%global gem_name kgio Summary: Kinder, gentler I/O for Ruby Name: rubygem-%{gem_name} Version: 2.9.2 Release: 1%{?dist} Group: Development/Tools License: LGPLv2 or LGPLv3 # LICENSE file defines the licencing aspects of kgiox. # No license info in source files. URL: http://bogomips.org/kgio Source0: http://rubygems.org/downloads/%{gem_name}-%{version}.gem # Minitest 5 support, not yet submitted upstream Patch0: rubygem-kgio-2.9.2-minitest.patch # Skip tests that fail in mock Patch1: rubygem-kgio-2.9.2-skip-tests.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %if 0%{?fc19} || 0%{?fc20} || 0%{?el7} Requires: ruby(release) %endif %if 0%{?el5} || 0%{?el6} Requires: ruby(abi) = 1.8 %endif %if 0%{?fc19} || 0%{?fc20} || 0%{?el5} || 0%{?el6} || 0%{?el7} Requires: rubygem(rack) Requires: rubygem(raindrops) >= 0.7 Requires: rubygem(kgio) >= 2.6 %endif BuildRequires: ruby-devel BuildRequires: ruby-irb BuildRequires: rubygems-devel BuildRequires: rubygem(minitest) %if 0%{?fc19} || 0%{?fc20} || 0%{?el5} || 0%{?el6} || 0%{?el7} Provides: rubygem(%{gem_name}) = %{version} %endif ExcludeArch: ppc ppc64 %description kgio provides non-blocking I/O methods for Ruby without raising exceptions on EAGAIN and EINPROGRESS. It is intended for use with the Unicorn and Rainbows! Rack servers, but may be used by other applications (that run on Unix-like platforms). %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 # Adjusting minor permissions chmod a+r ChangeLog chmod a+r NEWS # Minitest 5 support # Not yet submitted upstream %patch0 -p1 # Skip tests that fail in mock %patch1 -p1 %build gem build %{gem_name}.gemspec %if 0%{?el6} mkdir -p .%{gem_dir} export CONFIGURE_ARGS="--with-cflags='%{optflags}' $CONFIGURE_ARGS" gem install \ -V \ --local \ --install-dir .%{gem_dir} \ --bindir .%{_bindir} \ --force \ --rdoc \ --backtrace \ %{gem_name}-%{version}.gem %else %gem_install %endif %install rm -rf %{buildroot} mkdir -p %{buildroot}%{gem_dir} mkdir -p %{buildroot}%{gem_extdir}/lib cp -a .%{gem_dir}/* %{buildroot}%{gem_dir}/ # Remove the binary extension sources and build leftovers. rm -f %{buildroot}%{gem_instdir}/.document rm -f %{buildroot}%{gem_instdir}/.gitignore rm -f %{buildroot}%{gem_instdir}/.manifest rm -f %{buildroot}%{gem_instdir}/.wrongdoc.yml rm -f %{buildroot}%{gem_instdir}/pkg.mk rm -f %{buildroot}%{gem_instdir}/setup.rb rm -f %{buildroot}/%{gem_instdir}/kgio.gemspec rm -f %{buildroot}/%{gem_instdir}/GNUmakefile rm -f %{buildroot}/%{gem_instdir}/GIT-VERSION-FILE rm -f %{buildroot}/%{gem_instdir}/GIT-VERSION-GEN rm -rf %{buildroot}%{gem_instdir}/.yardoc rm -rf %{buildroot}%{gem_instdir}/ext # If there are C extensions, mv them to the extdir. %if 0%{?el5} || 0%{?el6} || 0%{?el7} install -d -m0755 %{buildroot}%{gem_extdir} mv %{buildroot}%{gem_instdir}/lib/kgio_ext.so %{buildroot}%{gem_extdir}/lib/ %else mkdir -p %{buildroot}%{gem_extdir_mri} cp -pa .%{gem_extdir_mri}/* %{buildroot}%{gem_extdir_mri}/ %endif %check pushd .%{gem_instdir} %if 0%{?el6} # TODO: make tests work on EL6. %else make test %endif popd %clean rm -rf %{buildroot} %files doc %doc %{gem_dir}/doc/%{gem_name}-%{version} %doc %{gem_instdir}/TODO %doc %{gem_instdir}/LATEST %doc %{gem_instdir}/Rakefile %doc %{gem_instdir}/ISSUES %doc %{gem_instdir}/HACKING %doc %{gem_instdir}/test %files %if 0%{?fedora} >= 19 %{gem_extdir_mri} #%%{gem_extdir_mri} %%{_libdir}/gems/ruby/%%{gem_name}-%%{version} %endif %if 0%{?el5} || 0%{?el6} %{gem_extdir} #%%{gem_extdir} %%{_libdir}/gems/exts/%%{gem_name}-%%{version} %endif %dir %{gem_instdir}/lib %doc %{gem_instdir}/LICENSE %doc %{gem_instdir}/COPYING %doc %{gem_instdir}/README %doc %{gem_instdir}/NEWS %doc %{gem_instdir}/ChangeLog %{gem_cache} %{gem_spec} %{gem_instdir}/lib/kgio.rb %changelog * Tue May 13 2014 Ken Dreyer - 2.9.2-1 - Update version 2.9.2 (RHBZ #1006808) - Adjustments for https://fedoraproject.org/wiki/Changes/Ruby_2.1 - Simplify %%check to "make test" - Make -doc subpackage noarch * Sun Aug 04 2013 Fedora Release Engineering - 2.8.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild * Sat Mar 23 2013 Guillermo Gómez - 2.8.0-2 - Fixes for Ruby 2.0.0 packaging guidelines * Sun Feb 10 2013 Guillermo Gómez - 2.8.0-1 - Update version 2.8.0 * Sat Jul 21 2012 Fedora Release Engineering - 2.7.3-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild * Fri Mar 23 2012 Guillermo Gómez - 2.7.3-1 - Update version 2.7.3 * Sun Feb 12 2012 Guillermo Gómez - 2.7.0-5 - Proper use of new macros for Ruby 1.9 packaging - irb added as build require * Sat Jan 07 2012 Guillermo Gómez - 2.7.0-4 - Requires fixed for Ruby 1.9 * Sun Jan 01 2012 Guillermo Gómez - 2.7.0-3 - Path to kgio_ext.so at spec file check section fixed - Moved patching test file to install section - Unused macro removed from spec file * Sat Dec 31 2011 Guillermo Gómez - 2.7.0-2 - For now rdoc-generated files arch-dependent - defattr at the beginning of files remove - README, NEWS, ChangeLog location fixed - Test suite enabled during build time - kgio_ext.so placed under ruby_sitearch dir * Fri Dec 30 2011 Guillermo - 2.7.0-1 - Initial package