summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillermo Gomez S. (Gomix) <guillermo.gomez@gmail.com>2012-01-06 13:25:09 -0430
committerGuillermo Gomez S. (Gomix) <guillermo.gomez@gmail.com>2012-01-06 13:25:09 -0430
commita1e2bbe446b2baad531bf5c3e4770d9c8c9a1bae (patch)
treed2b10a98af8a8fa08b2f186bf60e2505b3054ec9
parentd7c7d48c17d8f3d02c0d120fc6bca9acb633ccc6 (diff)
downloadrubygem-kgio-a1e2bbe446b2baad531bf5c3e4770d9c8c9a1bae.tar.gz
rubygem-kgio-a1e2bbe446b2baad531bf5c3e4770d9c8c9a1bae.tar.xz
rubygem-kgio-a1e2bbe446b2baad531bf5c3e4770d9c8c9a1bae.zip
Initial package for rubygem-kgio
-rw-r--r--.gitignore1
-rw-r--r--no_ruby_strace_test_autopush.patch10
-rw-r--r--rubygem-kgio.spec126
-rw-r--r--sources1
4 files changed, 138 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..2591bf8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/kgio-2.7.0.gem
diff --git a/no_ruby_strace_test_autopush.patch b/no_ruby_strace_test_autopush.patch
new file mode 100644
index 0000000..a813002
--- /dev/null
+++ b/no_ruby_strace_test_autopush.patch
@@ -0,0 +1,10 @@
+--- test_autopush.rb.orig 2011-12-31 15:07:45.024640402 -0430
++++ test_autopush.rb 2011-12-31 15:07:54.080372110 -0430
+@@ -1,6 +1,6 @@
+ require 'tempfile'
+ require 'test/unit'
+-RUBY_PLATFORM =~ /linux/ and require 'strace'
++#RUBY_PLATFORM =~ /linux/ and require 'strace'
+ $-w = true
+ require 'kgio'
+
diff --git a/rubygem-kgio.spec b/rubygem-kgio.spec
new file mode 100644
index 0000000..f2fc4bd
--- /dev/null
+++ b/rubygem-kgio.spec
@@ -0,0 +1,126 @@
+%global gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
+%global gemname kgio
+%global rubyabi 1.8
+%global geminstdir %{gemdir}/gems/%{gemname}-%{version}
+%{!?ruby_sitearch: %global ruby_sitearch %(ruby -rrbconfig -e 'puts Config::CONFIG["sitearchdir"]')}
+
+Summary: Kinder, gentler I/O for Ruby
+Name: rubygem-%{gemname}
+Version: 2.7.0
+Release: 3%{?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/%{gemname}-%{version}.gem
+# Simple patch file to fix automated test file
+Source1: no_ruby_strace_test_autopush.patch
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+Requires: ruby
+Requires: ruby(abi) = %{rubyabi}
+Requires: ruby(rubygems)
+BuildRequires: ruby
+BuildRequires: ruby(abi) = %{rubyabi}
+BuildRequires: ruby(rubygems)
+BuildRequires: ruby-devel
+Provides: rubygem(%{gemname}) = %{version}
+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}
+
+%description doc
+Documentation for %{name}
+
+%prep
+%setup -q -c -T
+
+%build
+mkdir -p .%{gemdir}
+export CONFIGURE_ARGS="--with-cflags='%{optflags}'"
+gem install --local --install-dir .%{gemdir} \
+ -V \
+ --force %{SOURCE0}
+
+# Adjusting minor permissions
+chmod a+r .%{geminstdir}/ChangeLog
+chmod a+r .%{geminstdir}/NEWS
+
+%install
+rm -rf %{buildroot}
+mkdir -p %{buildroot}%{gemdir}
+cp -a .%{gemdir}/* \
+ %{buildroot}%{gemdir}/
+patch %{buildroot}%{geminstdir}/test/test_autopush.rb %{SOURCE1}
+
+# Remove the binary extension sources and build leftovers.
+rm -f %{buildroot}%{geminstdir}/.document
+rm -f %{buildroot}%{geminstdir}/.gitignore
+rm -f %{buildroot}%{geminstdir}/.manifest
+rm -f %{buildroot}%{geminstdir}/.wrongdoc.yml
+rm -f %{buildroot}%{geminstdir}/pkg.mk
+rm -f %{buildroot}%{geminstdir}/setup.rb
+rm -f %{buildroot}/%{geminstdir}/kgio.gemspec
+rm -f %{buildroot}/%{geminstdir}/GNUmakefile
+rm -f %{buildroot}/%{geminstdir}/GIT-VERSION-FILE
+rm -f %{buildroot}/%{geminstdir}/GIT-VERSION-GEN
+rm -rf %{buildroot}%{geminstdir}/.yardoc
+rm -rf %{buildroot}%{geminstdir}/ext
+
+install -d -m0755 %{buildroot}%{ruby_sitearch}
+mv %{buildroot}%{geminstdir}/lib/kgio_ext.so %{buildroot}%{ruby_sitearch}
+
+%check
+# Patch test_autopush.rb
+cd %{buildroot}%{geminstdir}
+RUBYOPT="-Ilib -I%{buildroot}%{ruby_sitearch} -Itest" testrb test/test_*
+
+%clean
+rm -rf %{buildroot}
+
+%files doc
+%doc %{gemdir}/doc/%{gemname}-%{version}
+%doc %{geminstdir}/TODO
+%doc %{geminstdir}/LATEST
+%doc %{geminstdir}/Rakefile
+%doc %{geminstdir}/ISSUES
+%doc %{geminstdir}/HACKING
+%doc %{geminstdir}/test
+
+%files
+%{ruby_sitearch}/kgio_ext.so
+%dir %{geminstdir}
+%dir %{geminstdir}/lib
+%doc %{geminstdir}/LICENSE
+%doc %{geminstdir}/COPYING
+%doc %{geminstdir}/README
+%doc %{geminstdir}/NEWS
+%doc %{geminstdir}/ChangeLog
+%{gemdir}/cache/%{gemname}-%{version}.gem
+%{gemdir}/specifications/%{gemname}-%{version}.gemspec
+%{geminstdir}/lib/kgio.rb
+
+%changelog
+* Sun Jan 1 2012 Guillermo Gómez <guillermo.gomez@gmail.com> - 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 <guillermo.gomez@gmail.com> - 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 <guillermo.gomez@gmail.com> - 2.7.0-1
+- Initial package
diff --git a/sources b/sources
index e69de29..4207548 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+a75bcff4cc3fab89baf9c3b4d3aaddcb kgio-2.7.0.gem