[rubygem-snmp: 5/5] Fix %%check error with Rakefile

Michael Stahnke stahnma at fedoraproject.org
Sun Jan 8 21:34:48 UTC 2012


commit 840bc330b95cf8eafe12388ece7dcad5cfc0e79f
Author: Michael Stahnke <stahnma at puppetlabs.com>
Date:   Sun Jan 8 09:09:12 2012 -0600

    Fix %%check error with Rakefile

 rubygem-snmp.spec |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/rubygem-snmp.spec b/rubygem-snmp.spec
index ba49a2d..bc5d3c3 100644
--- a/rubygem-snmp.spec
+++ b/rubygem-snmp.spec
@@ -5,7 +5,7 @@
 Summary: A Ruby implementation of SNMP (the Simple Network Management Protocol)
 Name: rubygem-%{gemname}
 Version: 1.1.0
-Release: 1%{?dist}
+Release: 2%{?dist}
 Group: Development/Languages
 License: GPLv2 or Ruby
 URL: http://snmplib.rubyforge.org
@@ -14,7 +14,7 @@ Patch0: rakefile.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Requires: rubygems
 Requires: ruby(abi) = 1.8
-BuildRequires: rubygems 
+BuildRequires: rubygems
 BuildRequires: ruby-devel
 # Following needed only for test/check
 BuildRequires: rubygem(rake), rubygem(test-spec)
@@ -38,7 +38,7 @@ pushd $(pwd)/%{gemdir}/gems/snmp-%{version}/
 patch -p1 < %{PATCH0}
 popd
 
-# Adding proper name spacing to test directory, otherwise 
+# Adding proper name spacing to test directory, otherwise
 # tests have issues between class Integer and SNMP::Integer
 sed -i 's/Integer/SNMP::Integer/g' ./%{geminstdir}/test/*.rb
 
@@ -48,13 +48,18 @@ sed -i 's/Integer/SNMP::Integer/g' ./%{geminstdir}/test/*.rb
 rm -rf %{buildroot}
 mkdir -p %{buildroot}%{gemdir}
 cp -a .%{gemdir}/* %{buildroot}%{gemdir}/
+# Rakefile requires the gemspec be in the gemdir for operation (and not have
+# verion in the name)
+cp -p %{buildroot}%{gemdir}/specifications/%{gemname}-%{version}.gemspec \
+      %{buildroot}%{gemdir}/gems/%{gemname}-%{version}/%{gemname}.gemspec
+
 
 %clean
 rm -rf %{buildroot}
 
 %check
 pushd %{buildroot}%{geminstdir}
-rake test
+  rake test
 popd
 
 %files
@@ -69,8 +74,13 @@ popd
 %doc %{geminstdir}/README.rdoc
 %{gemdir}/cache/%{gemname}-%{version}.gem
 %{gemdir}/specifications/%{gemname}-%{version}.gemspec
+%{geminstdir}/snmp.gemspec
+
 
 %changelog
+* Sun Jan 08 2012 <stahnma at fedoraproject.org> - 1.1.0-2
+- Ensure %%check can run properly
+
 * Sun Jan 08 2012 <stahnma at fedoraproject.org> - 1.1.0-1
 - Fix FTBFS bug  715639
 


More information about the scm-commits mailing list