Blame rubygem-nio4r.spec

101f50e
# Generated from nio4r-1.2.1.gem by gem2rpm -*- rpm-spec -*-
101f50e
%global gem_name nio4r
101f50e
101f50e
Name: rubygem-%{gem_name}
64e8a0f
Version: 2.0.0
64e8a0f
Release: 1%{?dist}
101f50e
Summary: New IO for Ruby
101f50e
Group: Development/Languages
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)
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
64e8a0f
Provides: bundled(libev) = 4.23
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
Group: Documentation
101f50e
Requires: %{name} = %{version}-%{release}
101f50e
BuildArch: noarch
101f50e
101f50e
%description doc
101f50e
Documentation for %{name}.
101f50e
101f50e
%prep
101f50e
gem unpack %{SOURCE0}
101f50e
101f50e
%setup -q -D -T -n  %{gem_name}-%{version}
101f50e
101f50e
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
101f50e
101f50e
%build
101f50e
# Create the gem as gem install only works on a gem file
101f50e
gem build %{gem_name}.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}
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
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
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
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