e942936
%global gem_name pcaprub
e942936
56b87ba
# Some test won't work without root permissions.
56b87ba
%global enable_network_tests 0
56b87ba
e942936
Name: rubygem-%{gem_name}
e942936
Version: 0.12.4
c862dbc
Release: 9%{?dist}
e942936
Summary: libpcap bindings for ruby
8aef797
License: LGPLv2
e942936
URL: https://github.com/pcaprub/pcaprub
e942936
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
e942936
BuildRequires: ruby(release)
e942936
BuildRequires: rubygems-devel
e942936
BuildRequires: ruby-devel
e942936
BuildRequires: libpcap-devel
56b87ba
BuildRequires: rubygem(test-unit)
e942936
e942936
%description
e942936
libpcap bindings for ruby with Ruby1.8, Ruby1.9, Ruby 2.x.
e942936
e942936
e942936
%package doc
e942936
Summary: Documentation for %{name}
e942936
Requires: %{name} = %{version}-%{release}
e942936
BuildArch: noarch
e942936
e942936
%description doc
e942936
Documentation for %{name}.
e942936
e942936
%prep
e942936
gem unpack %{SOURCE0}
e942936
e942936
%setup -q -D -T -n  %{gem_name}-%{version}
e942936
e942936
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
e942936
e942936
%build
e942936
# Create the gem as gem install only works on a gem file
e942936
gem build %{gem_name}.gemspec
e942936
e942936
# %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir
e942936
# by default, so that we can move it into the buildroot in %%install
e942936
%gem_install
e942936
e942936
%install
e942936
mkdir -p %{buildroot}%{gem_dir}
e942936
cp -a .%{gem_dir}/* \
e942936
        %{buildroot}%{gem_dir}/
e942936
e942936
mkdir -p %{buildroot}%{gem_extdir_mri}
e942936
cp -a .%{gem_extdir_mri}/{gem.build_complete,*.so} %{buildroot}%{gem_extdir_mri}/
e942936
8aef797
# Prevent dangling symlink in -debuginfo (rhbz#878863).
8aef797
rm -rf %{buildroot}%{gem_instdir}/ext/
e942936
e942936
e942936
# Run the test suite
e942936
%check
e942936
pushd .%{gem_instdir}
56b87ba
# Get rid of Bundler.
56b87ba
sed -i '/bundler\/setup/ s/^/#/' test/test_helper.rb
56b87ba
56b87ba
# We don't care about code coverage.
56b87ba
sed -i '/[Cc]overalls/ s/^/#/' test/test_helper.rb
56b87ba
56b87ba
# Lets go just with recent test-unit, it should be enough to run the test
56b87ba
# suite.
56b87ba
sed -i '/minitest/ s/^/#/' test/test_helper.rb
56b87ba
56b87ba
%if ! 0%{?enable_network_tests}
56b87ba
sed -i '/open_live/i\\n    omit "Requires root permissions."\n' test/test_pcaprub_unit.rb
56b87ba
sed -i '/o.activate/i\\n    omit "Cannot activate interface."\n' test/test_pcaprub_unit.rb
56b87ba
%endif
e942936
56b87ba
ruby -I$(dirs +1)%{gem_extdir_mri} -e 'Dir.glob "./test/**/test_*.rb", &method(:require)'
e942936
popd
e942936
e942936
%files
e942936
%dir %{gem_instdir}
e942936
%{gem_extdir_mri}
56b87ba
%exclude %{gem_instdir}/.*
e942936
%license %{gem_instdir}/LICENSE
e942936
%{gem_libdir}
e942936
%exclude %{gem_cache}
e942936
%{gem_spec}
e942936
e942936
%files doc
e942936
%doc %{gem_docdir}
e942936
%doc %{gem_instdir}/FAQ.rdoc
e942936
%{gem_instdir}/Gemfile
e942936
%doc %{gem_instdir}/README.rdoc
e942936
%{gem_instdir}/Rakefile
e942936
%doc %{gem_instdir}/USAGE.rdoc
e942936
%{gem_instdir}/examples
e942936
%{gem_instdir}/test
e942936
e942936
%changelog
c862dbc
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.4-9
c862dbc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
c862dbc
279e479
* Sat Jan 20 2018 Björn Esser <besser82@fedoraproject.org> - 0.12.4-8
279e479
- Rebuilt for switch to libxcrypt
279e479
6aea12e
* Thu Jan 04 2018 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0.12.4-7
d9006de
- F-28: rebuild for ruby25
d9006de
2df2aac
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.4-5
2df2aac
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
2df2aac
6424606
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.4-4
6424606
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
6424606
56b87ba
* Thu Apr 06 2017 Vít Ondruch <vondruch@redhat.com> - 0.12.4-3
56b87ba
- Enable parts of the test suite (rhbz#1371845)
56b87ba
- Fix FTBFS in Rawhide and rebuild against Ruby 2.4 (rhbz#1424354).
a9902eb
74a2f95
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.4-2
74a2f95
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
74a2f95
e942936
* Mon Jun 20 2016 Germano Massullo <germano.massullo@gmail.com> - 0.12.4-1
e942936
- Initial package