[rubygem-rack-mount] Rebuild for https://fedoraproject.org/wiki/Features/Ruby_2.0.0

Vít Ondruch vondruch at fedoraproject.org
Tue Apr 9 08:22:20 UTC 2013


commit 0fe3d51cfa23b8a3202b81e1dfa63ea1f45d3ce9
Author: Vít Ondruch <vondruch at redhat.com>
Date:   Tue Apr 9 09:30:40 2013 +0200

    Rebuild for https://fedoraproject.org/wiki/Features/Ruby_2.0.0

 ...-mount-0.7.1-Fix-Ruby-2.0.0-compatibility.patch |   26 +++++++++++++++
 rubygem-rack-mount.spec                            |   34 ++++++++++----------
 2 files changed, 43 insertions(+), 17 deletions(-)
---
diff --git a/rubygem-rack-mount-0.7.1-Fix-Ruby-2.0.0-compatibility.patch b/rubygem-rack-mount-0.7.1-Fix-Ruby-2.0.0-compatibility.patch
new file mode 100644
index 0000000..8ec9ee5
--- /dev/null
+++ b/rubygem-rack-mount-0.7.1-Fix-Ruby-2.0.0-compatibility.patch
@@ -0,0 +1,26 @@
+From 42e7ae47c2dac2d98272ac99239e40bd59398891 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <v.ondruch at tiscali.cz>
+Date: Tue, 9 Apr 2013 11:12:02 +0300
+Subject: [PATCH] Fix Ruby 2.0.0 compatibility
+
+#respond_to? now exclude protected methods.
+---
+ lib/rack/mount/multimap.rb | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/rack/mount/multimap.rb b/lib/rack/mount/multimap.rb
+index 6b773e2..b88630b 100644
+--- a/lib/rack/mount/multimap.rb
++++ b/lib/rack/mount/multimap.rb
+@@ -125,7 +125,7 @@ def update_container(key)
+       end
+ 
+       def iterate_over_container(container)
+-        if container.respond_to?(:each_container_with_default)
++        if container.respond_to?(:each_container_with_default, true)
+           container.each_container_with_default do |value|
+             yield value
+           end
+-- 
+1.8.1.5
+
diff --git a/rubygem-rack-mount.spec b/rubygem-rack-mount.spec
index 6bdbf4f..7728035 100644
--- a/rubygem-rack-mount.spec
+++ b/rubygem-rack-mount.spec
@@ -1,11 +1,9 @@
 %global gem_name rack-mount
 
-%global testdir %{_tmppath}/%{gem_name}-%{version}
-
 Summary: Stackable dynamic tree based Rack router
 Name: rubygem-%{gem_name}
 Version: 0.7.1
-Release: 7%{?dist}
+Release: 8%{?dist}
 Group: Development/Languages
 License: MIT
 URL: http://github.com/josh/%{gem_name}
@@ -15,7 +13,9 @@ Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem
 Source1: %{gem_name}-tests.tgz
 # Add dependency on unbundeld regin.
 Patch1: rack-mount-add-regin-deps.patch
-Requires: ruby(abi) = 1.9.1
+# https://github.com/josh/rack-mount/pull/41
+Patch2: rubygem-rack-mount-0.7.1-Fix-Ruby-2.0.0-compatibility.patch
+Requires: ruby(release)
 Requires: ruby(rubygems)
 Requires: rubygem(rack) >= 1.1.0
 Requires: rubygem(regin)
@@ -46,14 +46,18 @@ Documentation for %{name}
 
 %prep
 %setup -q -c -T
-mkdir -p .%{gem_dir}
-gem install --local --install-dir .%{gem_dir} \
-            --force %{SOURCE0}
+%gem_install -n %{SOURCE0}
+
+rm -rf .%{gem_libdir}/rack/mount/vendor
 
 pushd .%{gem_dir}
 %patch1 -p0
 popd
 
+pushd .%{gem_instdir}
+%patch2 -p1
+popd
+
 %build
 
 %install
@@ -61,20 +65,14 @@ mkdir -p %{buildroot}%{gem_dir}
 cp -a .%{gem_dir}/* \
         %{buildroot}%{gem_dir}/
 
-rm -rf %{buildroot}%{gem_libdir}/rack/mount/vendor
-
 %check
-rm -rf %{testdir}
-mkdir %{testdir}
-tar xzvf %{SOURCE1} -C %{testdir}
-pushd %{testdir}
-testrb -I%{buildroot}%{gem_libdir} -I./test test/test_*
+pushd .%{gem_instdir}
+tar xzvf %{SOURCE1}
+testrb -Ilib:test test/test_*
 popd
-rm -rf %{testdir}
 
 
 %files
-%defattr(-, root, root, -)
 %dir %{gem_instdir}
 %{gem_libdir}
 %doc %{gem_instdir}/LICENSE
@@ -83,10 +81,12 @@ rm -rf %{testdir}
 %{gem_spec}
 
 %files doc
-%defattr(-, root, root, -)
 %doc %{gem_docdir}
 
 %changelog
+* Tue Apr 09 2013 Vít Ondruch <vondruch at redhat.com> - 0.7.1-8
+- Rebuild for https://fedoraproject.org/wiki/Features/Ruby_2.0.0
+
 * Thu Feb 14 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.7.1-7
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
 


More information about the scm-commits mailing list