diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c220ff --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +SOURCES/puma-3.6.2-examples.tgz +SOURCES/puma-3.6.2-tests.tgz +SOURCES/puma-3.6.2.gem diff --git a/.rh-ror50-rubygem-puma.metadata b/.rh-ror50-rubygem-puma.metadata new file mode 100644 index 0000000..2f76e21 --- /dev/null +++ b/.rh-ror50-rubygem-puma.metadata @@ -0,0 +1,3 @@ +47d1d27a2ac0eef889b44cf1d7b03f168c217efd SOURCES/puma-3.6.2-examples.tgz +f5fcee771b9cd902b6b526bbb442b1189416dcad SOURCES/puma-3.6.2-tests.tgz +c70092fea4ca0b274898a6c849a8dd2b231889c6 SOURCES/puma-3.6.2.gem diff --git a/README.md b/README.md deleted file mode 100644 index 98f42b4..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/rubygem-puma-3.6.0-enable-log-for-tests.patch b/SOURCES/rubygem-puma-3.6.0-enable-log-for-tests.patch new file mode 100644 index 0000000..dbdd8e2 --- /dev/null +++ b/SOURCES/rubygem-puma-3.6.0-enable-log-for-tests.patch @@ -0,0 +1,29 @@ +From 9bc7514ef45e554c9600faaaeb9d7e34cf877dae Mon Sep 17 00:00:00 2001 +From: Hans de Graaff +Date: Sat, 20 Aug 2016 09:04:41 +0200 +Subject: [PATCH] Enable log_requests for integration tests + +These tests depend on log_requests being enabled, but this was turned +off by default in 03ed48ca903879f3b9a649f5df1cf9d6577ef3d2 +--- + test/shell/t1_conf.rb | 1 + + test/shell/t2_conf.rb | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/test/shell/t1_conf.rb b/test/shell/t1_conf.rb +index bde7167..cae5662 100644 +--- a/test/shell/t1_conf.rb ++++ b/test/shell/t1_conf.rb +@@ -1,2 +1,3 @@ ++log_requests + stdout_redirect "t1-stdout" + pidfile "t1-pid" +diff --git a/test/shell/t2_conf.rb b/test/shell/t2_conf.rb +index dab6032..47d58e7 100644 +--- a/test/shell/t2_conf.rb ++++ b/test/shell/t2_conf.rb +@@ -1,3 +1,4 @@ ++log_requests + stdout_redirect "t2-stdout" + pidfile "t2-pid" + bind "tcp://0.0.0.0:10103" diff --git a/SPECS/rubygem-puma.spec b/SPECS/rubygem-puma.spec new file mode 100644 index 0000000..4b1ddcf --- /dev/null +++ b/SPECS/rubygem-puma.spec @@ -0,0 +1,174 @@ +%{?scl:%scl_package rubygem-%{gem_name}} +%{!?scl:%global pkg_name %{name}} + +# Generated from puma-3.6.0.gem by gem2rpm -*- rpm-spec -*- +%global gem_name puma + +Name: %{?scl_prefix}rubygem-%{gem_name} +Version: 3.6.2 +Release: 2%{?dist} +Summary: A simple, fast, threaded, and highly concurrent HTTP 1.1 server +Group: Development/Languages +License: BSD +URL: http://puma.io +Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem +# The puma gem doesn't ship with the test suite. +# git clone https://github.com/puma/puma.git && cd puma +# git checkout v3.6.2 && tar czvf puma-3.6.2-tests.tgz test/ +Source1: %{gem_name}-%{version}-tests.tgz +# The puma gem doesn't ship with the examples used in test suite. +# tar czvf puma-3.6.2-examples.tgz examples/ +Source3: %{gem_name}-%{version}-examples.tgz +# Enable log_requests to pass integration tests +# https://github.com/puma/puma/commit/9bc7514 +Patch0: rubygem-puma-3.6.0-enable-log-for-tests.patch + +Requires: %{?scl_prefix_ruby}ruby(release) +Requires: %{?scl_prefix_ruby}ruby(rubygems) +BuildRequires: openssl-devel +BuildRequires: %{?scl_prefix_ruby}ruby(release) +BuildRequires: %{?scl_prefix_ruby}ruby(rubygems) +BuildRequires: %{?scl_prefix_ruby}ruby +BuildRequires: %{?scl_prefix_ruby}ruby-devel >= 1.8.7 +BuildRequires: %{?scl_prefix_ruby}rubygems-devel +BuildRequires: %{?scl_prefix}rubygem(rack) +BuildRequires: %{?scl_prefix_ruby}rubygem(test-unit) +BuildRequires: %{?scl_prefix_ruby}rubygem(minitest) +Provides: %{?scl_prefix}rubygem(%{gem_name}) = %{version} + +# Explicitly require runtime subpackage, as long as older scl-utils do not generate it +%{?scl:Requires: %{?scl_prefix}runtime} + +%description +A simple, fast, threaded, and highly concurrent HTTP 1.1 server for +Ruby/Rack applications. + +%package doc +Summary: Documentation for %{pkg_name} +Group: Documentation +Requires: %{?scl_prefix}%{pkg_name} = %{version}-%{release} +BuildArch: noarch + +%description doc +Documentation for %{pkg_name}. + +%prep +%{?scl:scl enable %{scl} - << \EOF} +set -e +gem unpack %{SOURCE0} + +%setup -q -D -T -n %{gem_name}-%{version} + +gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec +%{?scl:EOF} + +%build +%{?scl:scl enable %{scl} - << \EOF} +set -e +gem build %{gem_name}.gemspec + +%gem_install +%{?scl:EOF} + +%install +mkdir -p %{buildroot}%{gem_dir} +cp -a .%{gem_dir}/* \ + %{buildroot}%{gem_dir}/ + +mkdir -p %{buildroot}%{gem_extdir_mri}/puma +cp -a .%{gem_extdir_mri}/gem.build_complete %{buildroot}%{gem_extdir_mri}/ +cp -a .%{gem_extdir_mri}/puma/*.so %{buildroot}%{gem_extdir_mri}/puma + +# Prevent dangling symlink in -debuginfo (rhbz#878863). +rm -rf %{buildroot}%{gem_instdir}/ext/ + +mkdir -p %{buildroot}%{_bindir} +cp -pa .%{_bindir}/* \ + %{buildroot}%{_bindir}/ + +find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x + +# Run the test suite + +%check +pushd .%{gem_instdir} +tar xzf %{SOURCE1} +tar xzf %{SOURCE3} + +patch -p1 < %{PATCH0} + +# Skip failed tests on upstream. +# https://github.com/puma/puma/issues/1044 +sed -i '/^ def test_control_clustered$/,/^ end$/ s/^/#/' \ + test/test_cli.rb + +# Log stdout and stderr of the test to detect an error easily. +sed -i '/ruby / s| > /dev/null 2>&1||' test/shell/run.sh + +# Make binary exension available in Ruby load path. +# Enable verbose mode to check unstable tests easily. +export RUBYOPT="-Ilib:test:.:$(dirs +1 -l)%{gem_extdir_mri}" +%{?scl:scl enable %{scl} - << \EOF} +set -e +ruby \ + -r 'minitest/autorun' \ + -e 'Dir.glob "./test/**/test_*.rb", &method(:require)' \ + -- -v +%{?scl:EOF} + +# Integration test +pushd test/shell +# Make binary exension available in Ruby load path. +export RUBYOPT="-I$(dirs +2 -l)%{gem_extdir_mri}" +%{?scl:scl enable %{scl} - << \EOF} +sh -x run.sh +%{?scl:EOF} +popd + +popd + +%files +# There is no %%license macro on RHEL6. +# https://bugzilla.redhat.com/show_bug.cgi?id=1386246 +%{!?_licensedir:%global license %%doc} + +%dir %{gem_instdir} +%{_bindir}/puma +%{_bindir}/pumactl +%{gem_extdir_mri} +%license %{gem_instdir}/LICENSE +%{gem_instdir}/bin +%{gem_libdir} +%exclude %{gem_cache} +%{gem_spec} + +%files doc +%doc %{gem_docdir} +%doc %{gem_instdir}/DEPLOYMENT.md +%{gem_instdir}/Gemfile +%doc %{gem_instdir}/History.txt +%doc %{gem_instdir}/Manifest.txt +%doc %{gem_instdir}/README.md +%{gem_instdir}/Rakefile +%doc %{gem_instdir}/docs +%{gem_instdir}/puma.gemspec +%{gem_instdir}/tools + +%changelog +* Fri Feb 17 2017 Jun Aruga - 3.6.2-2 +- Remove README.Fedora, as the content is already mentioned in README.md + +* Wed Jan 18 2017 Jun Aruga - 3.6.2-1 +- Update to Puma 3.6.2. + +* Wed Sep 21 2016 Jun Aruga - 3.6.0-3 +- Skip test that needs internet. + +* Mon Sep 19 2016 Jun Aruga - 3.6.0-2 +- Add openssl-devel dependency to enable HTTPS support. +- Add regenerated parser logic. +- Improve Ruby load path to run test suite. +- Improve files section. + +* Thu Aug 11 2016 Jun Aruga - 3.6.0-1 +- Initial package