85 lines
2.8 KiB
RPMSpec
85 lines
2.8 KiB
RPMSpec
%global gem_name nio4r
|
|
%global libev_version 4.24
|
|
Name: rubygem-%{gem_name}
|
|
Version: 2.3.1
|
|
Release: 1
|
|
Summary: New IO for Ruby
|
|
License: MIT and (BSD or GPLv2+)
|
|
URL: https://github.com/socketry/nio4r
|
|
Source0: https://rubygems.org/gems/nio4r-%{version}.gem
|
|
BuildRequires: ruby(release) rubygems-devel ruby-devel rubygem(rspec) gcc
|
|
Provides: bundled(libev) = %{libev_version}
|
|
%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}
|
|
Requires: %{name} = %{version}-%{release}
|
|
BuildArch: noarch
|
|
%description doc
|
|
Documentation for %{name}.
|
|
|
|
%prep
|
|
%setup -q -n %{gem_name}-%{version}
|
|
|
|
%build
|
|
gem build ../%{gem_name}-%{version}.gemspec
|
|
%global optflags %{?optflags} -fno-strict-aliasing
|
|
%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}/
|
|
rm -rf %{buildroot}%{gem_instdir}/ext/
|
|
|
|
%check
|
|
pushd .%{gem_instdir}
|
|
EV_VERSION_MAJOR=$(grep EV_VERSION_MAJOR ext/libev/ev.h | cut -d ' ' -f3)
|
|
EV_VERSION_MINOR=$(grep EV_VERSION_MINOR ext/libev/ev.h | cut -d ' ' -f3)
|
|
[ "${EV_VERSION_MAJOR}.${EV_VERSION_MINOR}" = '%{libev_version}' ]
|
|
sed -i '/require "coveralls"/ s/^/#/' spec/spec_helper.rb
|
|
sed -i '/Coveralls.wear!/ s/^/#/' spec/spec_helper.rb
|
|
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
|
|
sed -i '/TIMEOUT_PRECISION/ s/0.1/0.5/' spec/nio/selector_spec.rb
|
|
sed -i '/^ it "wakes up if signaled to from another thread" do$/,/^ end$/ s/0.1/0.5/' \
|
|
spec/nio/selector_spec.rb
|
|
sed -i '/"selects readable when the other end closes"/a\
|
|
skip' spec/support/selectable_examples.rb
|
|
rspec -I$(dirs +1)%{gem_extdir_mri} spec
|
|
popd
|
|
|
|
%files
|
|
%dir %{gem_instdir}
|
|
%{gem_extdir_mri}
|
|
%exclude %{gem_instdir}/.*
|
|
%license %{gem_instdir}/LICENSE.txt
|
|
%exclude %{gem_instdir}/appveyor.yml
|
|
%{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 Aug 12 2020 yanan li <liyanan032@huawei.com> - 2.3.1-1
|
|
- Package init
|