From 6478728b6fa73688f14785935dee16cf8d0ceab7 Mon Sep 17 00:00:00 2001 From: Ken Dreyer Date: Thu, 21 Feb 2013 16:39:06 -0700 Subject: Initial package, created with gem2rpm 0.8.1 --- .gitignore | 1 + rubygem-unicorn.spec | 197 ++++++++++++++++++++++++ sources | 1 + unicorn-4.5.0-teeinput-namespace-conflict.patch | 110 +++++++++++++ 4 files changed, 309 insertions(+) create mode 100644 .gitignore create mode 100644 rubygem-unicorn.spec create mode 100644 sources create mode 100644 unicorn-4.5.0-teeinput-namespace-conflict.patch diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f179e43 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/unicorn-4.3.1.gem diff --git a/rubygem-unicorn.spec b/rubygem-unicorn.spec new file mode 100644 index 0000000..4755499 --- /dev/null +++ b/rubygem-unicorn.spec @@ -0,0 +1,197 @@ +# Generated from unicorn-4.3.1.gem by gem2rpm -*- rpm-spec -*- +%global gem_name unicorn +%if 0%{?el6} +%global rubyabi 1.8 +%else +%global rubyabi 1.9.1 +%endif + +Summary: Rack HTTP server for fast clients and Unix +Name: rubygem-%{gem_name} +Version: 4.3.1 +Release: 1%{?dist} +Group: Development/Languages +License: GPLv2 or GPLv3 or Ruby +URL: http://unicorn.bogomips.org/ +Source0: %{gem_name}-%{version}.gem +Patch0: unicorn-4.5.0-teeinput-namespace-conflict.patch +Requires: ruby(abi) = %{rubyabi} +Requires: ruby(rubygems) +Requires: rubygem(rack) +Requires: rubygem(kgio) => 2.6 +Requires: rubygem(kgio) < 3 +Requires: rubygem(raindrops) => 0.7 +Requires: rubygem(raindrops) < 1 +BuildRequires: ruby(abi) = %{rubyabi} +%if 0%{?el6} +BuildRequires: ruby(rubygems) +%else +BuildRequires: rubygems-devel +%endif +BuildRequires: ruby-devel +BuildRequires: rubygem(rack) +BuildRequires: rubygem(kgio) => 2.6 +BuildRequires: rubygem(kgio) < 3 +BuildRequires: rubygem(raindrops) => 0.7 +BuildRequires: rubygem(raindrops) < 1 +BuildRequires: rubygem(minitest) +BuildRequires: rubygem(rails) +Provides: rubygem(%{gem_name}) = %{version} + +# macros for RHEL6 compatibility: +%{!?gem_dir: %global gem_dir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)} +%{!?gem_instdir: %global gem_instdir %{gem_dir}/gems/%{gem_name}-%{version}} +%{!?gem_libdir: %global gem_libdir %{gem_instdir}/lib} +%{!?gem_cache: %global gem_cache %{gem_dir}/cache/%{gem_name}-%{version}.gem} +%{!?gem_spec: %global gem_spec %{gem_dir}/specifications/%{gem_name}-%{version}.gemspec} +%{!?gem_docdir: %global gem_docdir %{gem_dir}/doc/%{gem_name}-%{version}} +%{!?gem_extdir: %global gem_extdir %{_libdir}/gems/exts/%{gem_name}-%{version}} +%{!?ruby_sitearch: %global ruby_sitearch %(ruby -rrbconfig -e 'puts Config::CONFIG["sitearchdir"]')} + +%description +Unicorn is an HTTP server for Rack applications designed to only serve +fast clients on low-latency, high-bandwidth connections and take +advantage of features in Unix/Unix-like kernels. Slow clients should +only be served by placing a reverse proxy capable of fully buffering +both the the request and response in between Unicorn and slow clients. + + +%package doc +Summary: Documentation for %{name} +Group: Documentation +Requires: %{name} = %{version}-%{release} +BuildArch: noarch + +%description doc +Documentation for %{name} + +%prep +%setup -q -c -T +mkdir -p .%{gem_dir} +export CONFIGURE_ARGS="--with-cflags='%{optflags}'" +gem install --local --install-dir .%{gem_dir} \ + --bindir .%{_bindir} \ + -V \ + --force %{SOURCE0} + +pushd .%{gem_instdir} +%patch0 -p1 +popd + +# Fix wrong shebang +sed -i -e '/^#!\//, 1d' .%{gem_instdir}/bin/unicorn +sed -i -e '/^#!\//, 1d' .%{gem_instdir}/bin/unicorn_rails +sed -i -e '1i#!/usr/bin/ruby' .%{gem_instdir}/bin/unicorn +sed -i -e '1i#!/usr/bin/ruby' .%{gem_instdir}/bin/unicorn_rails + +# Require rubygems when running tests +sed -i "2irequire 'rubygems'" .%{gem_instdir}/test/test_helper.rb + +# Clean up development-only files +rm -f .%{gem_instdir}/.CHANGELOG.old +rm -f .%{gem_instdir}/.document +rm -f .%{gem_instdir}/.gitignore +rm -f .%{gem_instdir}/.mailmap +rm -f .%{gem_instdir}/.manifest +rm -f .%{gem_instdir}/.wrongdoc.yml +rm -f .%{gem_instdir}/local.mk.sample +rm -f .%{gem_instdir}/GIT-VERSION-FILE +rm -f .%{gem_instdir}/GIT-VERSION-GEN +rm -f .%{gem_instdir}/GNUmakefile +rm -f .%{gem_instdir}/setup.rb +find .%{gem_instdir} -name .gitignore -exec rm {} + +find .%{gem_instdir} -name .gitkeep -exec rm {} + +# Remove extra gemspec file +rm -rf .%{gem_instdir}/%{gem_name}.gemspec + +# Remove broken test +rm -rf .%{gem_instdir}/test/rails + +%build + +%install +mkdir -p %{buildroot}%{gem_dir} +cp -a .%{gem_dir}/* \ + %{buildroot}%{gem_dir}/ + +%if 0%{?el6} +# gem_extdir doesn't really work on EL 6 +mkdir -p %{buildroot}%{ruby_sitearch} +# move the extension to ruby_sitearch +mv %{buildroot}%{gem_libdir}/unicorn_http.so %{buildroot}%{ruby_sitearch} +%else +mkdir -p %{buildroot}%{gem_extdir}/lib +# move the extension to gem_extdir +mv %{buildroot}%{gem_libdir}/unicorn_http.so %{buildroot}%{gem_extdir}/lib/ +%endif + +mkdir -p %{buildroot}%{_bindir} +cp -a .%{_bindir}/* \ + %{buildroot}%{_bindir}/ + +find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x + +# Install man pages in the proper location +mkdir -p %{buildroot}%{_mandir} +mv %{buildroot}/%{gem_instdir}/man/* %{buildroot}%{_mandir}/ + +# Remove the binary extension sources and build leftovers. +rm -rf %{buildroot}%{gem_instdir}/ext + +%check +pushd .%{gem_instdir} + # Tests don't work if run as a suite. Must run individually. + %if 0%{?el6} + # Tests fail on EL 6 or Rails 2.3 + %else + ruby -Ilib -e "Dir.glob('./test/**/test_*.rb').each {|t| require t}" + %endif +popd + +%files +%dir %{gem_instdir} +%doc %{gem_instdir}/COPYING +%doc %{gem_instdir}/LICENSE +%{_bindir}/unicorn +%{_bindir}/unicorn_rails +%doc %{_mandir}/man1/unicorn.1.gz +%doc %{_mandir}/man1/unicorn_rails.1.gz +%{gem_instdir}/bin +%{gem_libdir} +%if 0%{?el6} +%{ruby_sitearch}/unicorn_http.so +%else +%{gem_extdir} +%endif +%exclude %{gem_cache} +%{gem_spec} + +%files doc +%doc %{gem_docdir} +%doc %{gem_instdir}/FAQ +%doc %{gem_instdir}/README +%doc %{gem_instdir}/TUNING +%doc %{gem_instdir}/PHILOSOPHY +%doc %{gem_instdir}/HACKING +%doc %{gem_instdir}/DESIGN +%doc %{gem_instdir}/CONTRIBUTORS +%doc %{gem_instdir}/SIGNALS +%doc %{gem_instdir}/KNOWN_ISSUES +%doc %{gem_instdir}/TODO +%doc %{gem_instdir}/NEWS +%doc %{gem_instdir}/ChangeLog +%doc %{gem_instdir}/LATEST +%doc %{gem_instdir}/ISSUES +%doc %{gem_instdir}/Sandbox +%doc %{gem_instdir}/Links +%doc %{gem_instdir}/Application_Timeouts +%doc %{gem_instdir}/test +%doc %{gem_instdir}/t +%doc %{gem_instdir}/Documentation +%{gem_instdir}/examples +%{gem_instdir}/Rakefile +%{gem_instdir}/script + +%changelog +* Tue Feb 19 2013 ktdreyer@ktdreyer.com - 4.3.1-1 +- Initial package, created with gem2rpm 0.8.1 diff --git a/sources b/sources new file mode 100644 index 0000000..4e2979c --- /dev/null +++ b/sources @@ -0,0 +1 @@ +db2b20d1399e957cc1955e28c1eeec64 unicorn-4.3.1.gem diff --git a/unicorn-4.5.0-teeinput-namespace-conflict.patch b/unicorn-4.5.0-teeinput-namespace-conflict.patch new file mode 100644 index 0000000..e2fceea --- /dev/null +++ b/unicorn-4.5.0-teeinput-namespace-conflict.patch @@ -0,0 +1,110 @@ +--- a/test/unit/test_tee_input.rb 2012-12-27 16:58:26.363046370 -0500 ++++ b/test/unit/test_tee_input.rb 2012-12-27 16:57:47.608044611 -0500 +@@ -4,7 +4,7 @@ + require 'digest/sha1' + require 'unicorn' + +-class TeeInput < Unicorn::TeeInput ++class MyTeeInput < Unicorn::TeeInput + attr_accessor :tmp, :len + end + +@@ -31,7 +31,7 @@ + + def test_gets_long + r = init_request("hello", 5 + (4096 * 4 * 3) + "#$/foo#$/".size) +- ti = TeeInput.new(@rd, r) ++ ti = MyTeeInput.new(@rd, r) + status = line = nil + pid = fork { + @rd.close +@@ -52,7 +52,7 @@ + + def test_gets_short + r = init_request("hello", 5 + "#$/foo".size) +- ti = TeeInput.new(@rd, r) ++ ti = MyTeeInput.new(@rd, r) + status = line = nil + pid = fork { + @rd.close +@@ -71,7 +71,7 @@ + + def test_small_body + r = init_request('hello') +- ti = TeeInput.new(@rd, r) ++ ti = MyTeeInput.new(@rd, r) + assert_equal 0, @parser.content_length + assert @parser.body_eof? + assert_equal StringIO, ti.tmp.class +@@ -85,7 +85,7 @@ + + def test_read_with_buffer + r = init_request('hello') +- ti = TeeInput.new(@rd, r) ++ ti = MyTeeInput.new(@rd, r) + buf = '' + rv = ti.read(4, buf) + assert_equal 'hell', rv +@@ -100,7 +100,7 @@ + + def test_big_body + r = init_request('.' * Unicorn::Const::MAX_BODY << 'a') +- ti = TeeInput.new(@rd, r) ++ ti = MyTeeInput.new(@rd, r) + assert_equal 0, @parser.content_length + assert @parser.body_eof? + assert_kind_of File, ti.tmp +@@ -112,7 +112,7 @@ + a, b = 300, 3 + r = init_request('.' * b, 300) + assert_equal 300, @parser.content_length +- ti = TeeInput.new(@rd, r) ++ ti = MyTeeInput.new(@rd, r) + pid = fork { + @wr.write('.' * 197) + sleep 1 # still a *potential* race here that would make the test moot... +@@ -126,7 +126,7 @@ + + def test_big_body_multi + r = init_request('.', Unicorn::Const::MAX_BODY + 1) +- ti = TeeInput.new(@rd, r) ++ ti = MyTeeInput.new(@rd, r) + assert_equal Unicorn::Const::MAX_BODY, @parser.content_length + assert ! @parser.body_eof? + assert_kind_of File, ti.tmp +@@ -165,7 +165,7 @@ + @wr.write("0\r\n\r\n") + } + @wr.close +- ti = TeeInput.new(@rd, @parser) ++ ti = MyTeeInput.new(@rd, @parser) + assert_nil @parser.content_length + assert_nil ti.len + assert ! @parser.body_eof? +@@ -204,7 +204,7 @@ + end + @wr.write("0\r\n\r\n") + } +- ti = TeeInput.new(@rd, @parser) ++ ti = MyTeeInput.new(@rd, @parser) + assert_nil @parser.content_length + assert_nil ti.len + assert ! @parser.body_eof? +@@ -234,7 +234,7 @@ + @wr.write("Hello: World\r\n\r\n") + } + @wr.close +- ti = TeeInput.new(@rd, @parser) ++ ti = MyTeeInput.new(@rd, @parser) + assert_nil @parser.content_length + assert_nil ti.len + assert ! @parser.body_eof? +@@ -256,7 +256,7 @@ + assert_equal "", buf + + @wr.write("9\r\nabcde") +- ti = TeeInput.new(@rd, @parser) ++ ti = MyTeeInput.new(@rd, @parser) + assert_nil @parser.content_length + assert_equal "abcde", ti.read(9) + assert ! @parser.body_eof? -- cgit