Blame rubygem-nio4r.spec

101f50e
# Generated from nio4r-1.2.1.gem by gem2rpm -*- rpm-spec -*-
101f50e
%global gem_name nio4r
101f50e
d3cc932
%global libev_version 4.24
d3cc932
101f50e
Name: rubygem-%{gem_name}
30a7875
Version: 2.2.0
4260961
Release: 3%{?dist}
101f50e
Summary: New IO for Ruby
101f50e
# The entire source code is MIT, bundled libev is BSD or GPLv2+
101f50e
License: MIT and (BSD or GPLv2+)
64e8a0f
URL: https://github.com/socketry/nio4r
101f50e
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
101f50e
BuildRequires: ruby(release)
101f50e
BuildRequires: rubygems-devel
101f50e
BuildRequires: ruby-devel
101f50e
BuildRequires: rubygem(rspec)
30a7875
# Compiler is required for build of gem binary extension.
30a7875
# https://fedoraproject.org/wiki/Packaging:C_and_C++#BuildRequires_and_Requires
30a7875
BuildRequires: gcc
101f50e
101f50e
# As bundled libev ev.c is modified from original one,
101f50e
# we have to use the bundled libev instead of separating it and
101f50e
# using system libev.
101f50e
# See below commits.
101f50e
# Release the GIL when libev polls
64e8a0f
# https://github.com/socketry/nio4r/commit/6801433
101f50e
# A more productive message re: GVL
64e8a0f
# https://github.com/socketry/nio4r/commit/fba5c68
d3cc932
Provides: bundled(libev) = %{libev_version}
101f50e
101f50e
%description
64e8a0f
Cross-platform asynchronous I/O primitives for scalable network clients and
64e8a0f
servers. Inspired by the Java NIO API, but simplified for ease-of-use.
101f50e
101f50e
101f50e
%package doc
101f50e
Summary: Documentation for %{name}
101f50e
Requires: %{name} = %{version}-%{release}
101f50e
BuildArch: noarch
101f50e
101f50e
%description doc
101f50e
Documentation for %{name}.
101f50e
101f50e
%prep
30a7875
%setup -q -n  %{gem_name}-%{version}
101f50e
101f50e
%build
101f50e
# Create the gem as gem install only works on a gem file
30a7875
gem build ../%{gem_name}-%{version}.gemspec
101f50e
c89770f
# Update %%optflags used in %%gem_install to avoid strict-aliasing warnings.
c89770f
# https://github.com/socketry/nio4r/pull/130
c89770f
# http://pkgs.fedoraproject.org/cgit/rpms/rubygems.git/tree/macros.rubygems
c89770f
%global optflags %{?optflags} -fno-strict-aliasing
c89770f
101f50e
# %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir
101f50e
# by default, so that we can move it into the buildroot in %%install
101f50e
%gem_install
101f50e
101f50e
%install
101f50e
mkdir -p %{buildroot}%{gem_dir}
101f50e
cp -a .%{gem_dir}/* \
101f50e
        %{buildroot}%{gem_dir}/
101f50e
101f50e
mkdir -p %{buildroot}%{gem_extdir_mri}
101f50e
cp -a .%{gem_extdir_mri}/{gem.build_complete,*.so} %{buildroot}%{gem_extdir_mri}/
101f50e
101f50e
# Prevent dangling symlink in -debuginfo (rhbz#878863).
101f50e
rm -rf %{buildroot}%{gem_instdir}/ext/
101f50e
101f50e
# Run the test suite
101f50e
%check
101f50e
pushd .%{gem_instdir}
d3cc932
# Check libev version correctness.
d3cc932
EV_VERSION_MAJOR=$(grep EV_VERSION_MAJOR ext/libev/ev.h | cut -d ' ' -f3)
d3cc932
EV_VERSION_MINOR=$(grep EV_VERSION_MINOR ext/libev/ev.h | cut -d ' ' -f3)
d3cc932
[ "${EV_VERSION_MAJOR}.${EV_VERSION_MINOR}" = '%{libev_version}' ]
d3cc932
101f50e
# Ignore code coverage and bundler.
101f50e
sed -i '/require "coveralls"/ s/^/#/' spec/spec_helper.rb
101f50e
sed -i '/Coveralls.wear!/ s/^/#/' spec/spec_helper.rb
64e8a0f
64e8a0f
# Ignore rspec-retry.
64e8a0f
# https://github.com/socketry/nio4r/commit/e718068
64e8a0f
sed -i '/require "rspec\/retry"/ s/^/#/' spec/spec_helper.rb
64e8a0f
sed -i '/config.verbose_retry/ s/^/#/' spec/spec_helper.rb
64e8a0f
sed -i '/config.display_try_failure_messages/ s/^/#/' spec/spec_helper.rb
64e8a0f
sed -i 's/, retry: [0-9]\+//' spec/nio/selectables/tcp_socket_spec.rb
64e8a0f
sed -i 's/, retry: [0-9]\+//' spec/support/selectable_examples.rb
64e8a0f
9b27c42
# NIO::Selector is slow at i686 environment.
9b27c42
sed -i '/TIMEOUT_PRECISION/ s/0.1/0.5/' spec/nio/selector_spec.rb
9b27c42
sed -i '/^    it "wakes up if signaled to from another thread" do$/,/^    end$/ s/0.1/0.5/' \
9b27c42
  spec/nio/selector_spec.rb
9b27c42
101f50e
# Load nio4r_ext.so.
101f50e
rspec -I$(dirs +1)%{gem_extdir_mri} spec
101f50e
popd
101f50e
101f50e
%files
101f50e
%dir %{gem_instdir}
101f50e
%{gem_extdir_mri}
101f50e
%exclude %{gem_instdir}/.*
101f50e
%license %{gem_instdir}/LICENSE.txt
30a7875
%exclude %{gem_instdir}/appveyor.yml
101f50e
%{gem_libdir}
101f50e
%exclude %{gem_cache}
101f50e
%{gem_spec}
101f50e
101f50e
%files doc
101f50e
%doc %{gem_docdir}
101f50e
%{gem_instdir}/Gemfile
101f50e
%doc %{gem_instdir}/README.md
101f50e
%doc %{gem_instdir}/CHANGES.md
101f50e
%{gem_instdir}/logo.png
101f50e
%{gem_instdir}/tasks
64e8a0f
%{gem_instdir}/Guardfile
101f50e
%{gem_instdir}/Rakefile
101f50e
%{gem_instdir}/examples
101f50e
%{gem_instdir}/nio4r.gemspec
101f50e
%{gem_instdir}/spec
101f50e
101f50e
%changelog
4260961
* Sat Jan 20 2018 Björn Esser <besser82@fedoraproject.org> - 2.2.0-3
4260961
- Rebuilt for switch to libxcrypt
4260961
35a1929
* Thu Jan 04 2018 Mamoru TASAKA <mtasaka@fedoraproject.org> - 2.2.0-2
35a1929
- F-28: rebuild for ruby25
35a1929
30a7875
* Thu Jan 04 2018 Vít Ondruch <vondruch@redhat.com> - 2.2.0-1
30a7875
- Update to nio4r 2.2.0.
30a7875
7f30a4c
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.0-4
7f30a4c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
7f30a4c
84d48c4
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.0-3
84d48c4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
84d48c4
d3cc932
* Wed May 31 2017 Jun Aruga <jaruga@redhat.com> - 2.1.0-2
d3cc932
- Add check of libev version correctness.
d3cc932
9b27c42
* Mon May 29 2017 Jun Aruga <jaruga@redhat.com> - 2.1.0-1
9b27c42
- Update to nio4r 2.1.0.
9b27c42
64e8a0f
* Wed Mar 22 2017 Jun Aruga <jaruga@redhat.com> - 2.0.0-1
64e8a0f
- Update to nio4r 2.0.0.
64e8a0f
c89770f
* Tue Feb 21 2017 Jun Aruga <jaruga@redhat.com> - 1.2.1-5
c89770f
- Add flag to avoid warnings from strict-aliasing optimization.
c89770f
ed4eb4e
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.1-4
ed4eb4e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
ed4eb4e
39e9a00
* Thu Jan 12 2017 Vít Ondruch <vondruch@redhat.com> - 1.2.1-3
39e9a00
- Rebuilt for https://fedoraproject.org/wiki/Changes/Ruby_2.4
39e9a00
101f50e
* Thu Jun 30 2016 Jun Aruga <jaruga@redhat.com> - 1.2.1-2
101f50e
- Swap the description and summary
101f50e
101f50e
* Tue Jun 28 2016 Jun Aruga <jaruga@redhat.com> - 1.2.1-1
101f50e
- Initial package