Blame SPECS/rubygem-nio4r.spec

d4133d
%{?scl:%scl_package rubygem-%{gem_name}}
d4133d
%{!?scl:%global pkg_name %{name}}
d4133d
d4133d
# Generated from nio4r-1.2.1.gem by gem2rpm -*- rpm-spec -*-
d4133d
%global gem_name nio4r
d4133d
d4133d
Name: %{?scl_prefix}rubygem-%{gem_name}
d4133d
Version: 1.2.1
d4133d
Release: 3%{?dist}
d4133d
Summary: New IO for Ruby
d4133d
Group: Development/Languages
d4133d
# The entire source code is MIT, bundled libev is BSD or GPLv2+
d4133d
License: MIT and (BSD or GPLv2+)
d4133d
URL: https://github.com/celluloid/nio4r
d4133d
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
d4133d
d4133d
Requires: %{?scl_prefix_ruby}ruby(release)
d4133d
Requires: %{?scl_prefix_ruby}ruby(rubygems)
d4133d
BuildRequires: %{?scl_prefix_ruby}ruby(release)
d4133d
BuildRequires: %{?scl_prefix_ruby}ruby(rubygems)
d4133d
BuildRequires: %{?scl_prefix_ruby}ruby-devel
d4133d
BuildRequires: %{?scl_prefix_ruby}rubygems-devel
d4133d
BuildRequires: %{?scl_prefix}rubygem(rspec)
d4133d
Provides: %{?scl_prefix}rubygem(%{gem_name}) = %{version}
d4133d
d4133d
# Explicitly require runtime subpackage, as long as older scl-utils do not generate it
d4133d
%{?scl:Requires: %{?scl_prefix}runtime}
d4133d
d4133d
# As bundled libev ev.c is modified from original one,
d4133d
# we have to use the bundled libev instead of separating it and
d4133d
# using system libev.
d4133d
# See below commits.
d4133d
# Release the GIL when libev polls
d4133d
# https://github.com/celluloid/nio4r/commit/6801433
d4133d
# A more productive message re: GVL
d4133d
# https://github.com/celluloid/nio4r/commit/fba5c68
d4133d
Provides: %{?scl_prefix}bundled(libev) = 4.22
d4133d
d4133d
%description
d4133d
NIO provides a high performance selector API for monitoring IO objects
d4133d
d4133d
d4133d
%package doc
d4133d
Summary: Documentation for %{pkg_name}
d4133d
Group: Documentation
d4133d
Requires: %{?scl_prefix}%{pkg_name} = %{version}-%{release}
d4133d
BuildArch: noarch
d4133d
d4133d
%description doc
d4133d
Documentation for %{pkg_name}.
d4133d
d4133d
%prep
d4133d
%{?scl:scl enable %{scl} - << \EOF}
d4133d
set -e
d4133d
gem unpack %{SOURCE0}
d4133d
d4133d
%setup -q -D -T -n  %{gem_name}-%{version}
d4133d
d4133d
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
d4133d
%{?scl:EOF}
d4133d
d4133d
%build
d4133d
%{?scl:scl enable %{scl} - << \EOF}
d4133d
set -e
d4133d
# Create the gem as gem install only works on a gem file
d4133d
gem build %{gem_name}.gemspec
d4133d
d4133d
# Update %%optflags used in %%gem_install to avoid strict-aliasing warnings.
d4133d
# https://github.com/socketry/nio4r/pull/130
d4133d
%global optflags %{?optflags} -fno-strict-aliasing
d4133d
d4133d
# %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir
d4133d
# by default, so that we can move it into the buildroot in %%install
d4133d
%gem_install
d4133d
%{?scl:EOF}
d4133d
d4133d
%install
d4133d
d4133d
mkdir -p %{buildroot}%{gem_dir}
d4133d
cp -a .%{gem_dir}/* \
d4133d
        %{buildroot}%{gem_dir}/
d4133d
d4133d
mkdir -p %{buildroot}%{gem_extdir_mri}
d4133d
cp -a .%{gem_extdir_mri}/{gem.build_complete,*.so} %{buildroot}%{gem_extdir_mri}/
d4133d
d4133d
# Prevent dangling symlink in -debuginfo (rhbz#878863).
d4133d
rm -rf %{buildroot}%{gem_instdir}/ext/
d4133d
d4133d
# Remove useless shebang.
d4133d
# https://github.com/celluloid/nio4r/pull/86
d4133d
sed -i 's|^#!/usr/bin/env rake$||' %{buildroot}%{gem_instdir}/Rakefile
d4133d
d4133d
# Add executable bits to the file with shebang.
d4133d
# https://github.com/celluloid/nio4r/pull/85
d4133d
chmod 755 %{buildroot}%{gem_instdir}/examples/echo_server.rb
d4133d
d4133d
d4133d
# Run the test suite
d4133d
%check
d4133d
pushd .%{gem_instdir}
d4133d
# Ignore code coverage and bundler.
d4133d
sed -i '/require "coveralls"/ s/^/#/' spec/spec_helper.rb
d4133d
sed -i '/Coveralls.wear!/ s/^/#/' spec/spec_helper.rb
d4133d
sed -i '/require "bundler\/setup"/ s/^/#/' spec/spec_helper.rb
d4133d
# Load nio4r_ext.so.
d4133d
export RUBYOPT="-I$(dirs +1)%{gem_extdir_mri}"
d4133d
%{?scl:scl enable %{scl} - << \EOF}
d4133d
rspec spec
d4133d
%{?scl:EOF}
d4133d
popd
d4133d
d4133d
%files
d4133d
# There is no %%license macro on RHEL6.
d4133d
# https://bugzilla.redhat.com/show_bug.cgi?id=1386246
d4133d
%{!?_licensedir:%global license %%doc}
d4133d
d4133d
%dir %{gem_instdir}
d4133d
%{gem_extdir_mri}
d4133d
%exclude %{gem_instdir}/.*
d4133d
%license %{gem_instdir}/LICENSE.txt
d4133d
%{gem_libdir}
d4133d
%exclude %{gem_cache}
d4133d
%{gem_spec}
d4133d
d4133d
%files doc
d4133d
%doc %{gem_docdir}
d4133d
%{gem_instdir}/Gemfile
d4133d
%doc %{gem_instdir}/README.md
d4133d
%doc %{gem_instdir}/CHANGES.md
d4133d
%{gem_instdir}/logo.png
d4133d
%{gem_instdir}/tasks
d4133d
%{gem_instdir}/Rakefile
d4133d
%{gem_instdir}/examples
d4133d
%{gem_instdir}/nio4r.gemspec
d4133d
%{gem_instdir}/spec
d4133d
d4133d
%changelog
d4133d
* Wed Feb 22 2017 Jun Aruga <jaruga@redhat.com> - 1.2.1-3
d4133d
- Add flag to avoid warnings from strict-aliasing optimization.
d4133d
d4133d
* Thu Jun 30 2016 Jun Aruga <jaruga@redhat.com> - 1.2.1-2
d4133d
- Swap the description and summary
d4133d
d4133d
* Tue Jun 28 2016 Jun Aruga <jaruga@redhat.com> - 1.2.1-1
d4133d
- Initial package