Blob Blame History Raw
# Generated from nio4r-1.2.1.gem by gem2rpm -*- rpm-spec -*-
%global gem_name nio4r

Name: rubygem-%{gem_name}
Version: 2.0.0
Release: 1%{?dist}
Summary: New IO for Ruby
Group: Development/Languages
# The entire source code is MIT, bundled libev is BSD or GPLv2+
License: MIT and (BSD or GPLv2+)
URL: https://github.com/socketry/nio4r
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
BuildRequires: ruby(release)
BuildRequires: rubygems-devel
BuildRequires: ruby-devel
BuildRequires: rubygem(rspec)

# As bundled libev ev.c is modified from original one,
# we have to use the bundled libev instead of separating it and
# using system libev.
# See below commits.
# Release the GIL when libev polls
# https://github.com/socketry/nio4r/commit/6801433
# A more productive message re: GVL
# https://github.com/socketry/nio4r/commit/fba5c68
Provides: bundled(libev) = 4.23

%description
Cross-platform asynchronous I/O primitives for scalable network clients and
servers. Inspired by the Java NIO API, but simplified for ease-of-use.


%package doc
Summary: Documentation for %{name}
Group: Documentation
Requires: %{name} = %{version}-%{release}
BuildArch: noarch

%description doc
Documentation for %{name}.

%prep
gem unpack %{SOURCE0}

%setup -q -D -T -n  %{gem_name}-%{version}

gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec

%build
# Create the gem as gem install only works on a gem file
gem build %{gem_name}.gemspec

# Update %%optflags used in %%gem_install to avoid strict-aliasing warnings.
# https://github.com/socketry/nio4r/pull/130
# http://pkgs.fedoraproject.org/cgit/rpms/rubygems.git/tree/macros.rubygems
%global optflags %{?optflags} -fno-strict-aliasing

# %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir
# by default, so that we can move it into the buildroot in %%install
%gem_install

%install
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
        %{buildroot}%{gem_dir}/

mkdir -p %{buildroot}%{gem_extdir_mri}
cp -a .%{gem_extdir_mri}/{gem.build_complete,*.so} %{buildroot}%{gem_extdir_mri}/

# Prevent dangling symlink in -debuginfo (rhbz#878863).
rm -rf %{buildroot}%{gem_instdir}/ext/

# Run the test suite
%check
pushd .%{gem_instdir}
# Ignore code coverage and bundler.
sed -i '/require "coveralls"/ s/^/#/' spec/spec_helper.rb
sed -i '/Coveralls.wear!/ s/^/#/' spec/spec_helper.rb

# Ignore rspec-retry.
# https://github.com/socketry/nio4r/commit/e718068
sed -i '/require "rspec\/retry"/ s/^/#/' spec/spec_helper.rb
sed -i '/config.verbose_retry/ s/^/#/' spec/spec_helper.rb
sed -i '/config.display_try_failure_messages/ s/^/#/' spec/spec_helper.rb
sed -i 's/, retry: [0-9]\+//' spec/nio/selectables/tcp_socket_spec.rb
sed -i 's/, retry: [0-9]\+//' spec/support/selectable_examples.rb

# Load nio4r_ext.so.
rspec -I$(dirs +1)%{gem_extdir_mri} spec
popd

%files
%dir %{gem_instdir}
%{gem_extdir_mri}
%exclude %{gem_instdir}/.*
%license %{gem_instdir}/LICENSE.txt
%{gem_libdir}
%exclude %{gem_cache}
%{gem_spec}

%files doc
%doc %{gem_docdir}
%{gem_instdir}/Gemfile
%doc %{gem_instdir}/README.md
%doc %{gem_instdir}/CHANGES.md
%{gem_instdir}/logo.png
%{gem_instdir}/tasks
%{gem_instdir}/Guardfile
%{gem_instdir}/Rakefile
%{gem_instdir}/examples
%{gem_instdir}/nio4r.gemspec
%{gem_instdir}/spec

%changelog
* Wed Mar 22 2017 Jun Aruga <jaruga@redhat.com> - 2.0.0-1
- Update to nio4r 2.0.0.

* Tue Feb 21 2017 Jun Aruga <jaruga@redhat.com> - 1.2.1-5
- Add flag to avoid warnings from strict-aliasing optimization.

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Thu Jan 12 2017 Vít Ondruch <vondruch@redhat.com> - 1.2.1-3
- Rebuilt for https://fedoraproject.org/wiki/Changes/Ruby_2.4

* Thu Jun 30 2016 Jun Aruga <jaruga@redhat.com> - 1.2.1-2
- Swap the description and summary

* Tue Jun 28 2016 Jun Aruga <jaruga@redhat.com> - 1.2.1-1
- Initial package