[rubygems] Make test suite green.

Vít Ondruch vondruch at fedoraproject.org
Thu Jan 26 13:55:13 UTC 2012


commit e84f6392f0c4fb9b73b4bca73025ba4041e7485f
Author: Vít Ondruch <vondruch at redhat.com>
Date:   Thu Jan 26 14:55:05 2012 +0100

    Make test suite green.

 rubygems.spec |   80 ++++++++++++++++++++++++++++----------------------------
 1 files changed, 40 insertions(+), 40 deletions(-)
---
diff --git a/rubygems.spec b/rubygems.spec
index b14ad68..66038b7 100644
--- a/rubygems.spec
+++ b/rubygems.spec
@@ -1,10 +1,15 @@
 # Upstream git:
 # https://github.com/rubygems/rubygems.git
 #
-%global	gem_dir		%{_datadir}/gems
-%global	rubygems_dir	%{_datadir}/%{name}
 
-%global	repoid		75711
+# The RubyGems library has to stay out of Ruby directory three, since the
+# RubyGems should be share by all Ruby implementations.
+%global rubygems_dir %{_datadir}/rubygems
+
+# Specify custom RubyGems root and other related macros.
+%global gem_dir %{_datadir}/gems
+# TODO: Should we create arch specific rubygems-filesystem?
+%global gem_extdir %{_exec_prefix}/lib{,64}/gems
 
 # Executing testsuite (enabling %%check section) will cause dependency loop.
 # To avoid dependency loop when necessary, please set the following value to 0
@@ -13,13 +18,16 @@
 Summary:	The Ruby standard for packaging ruby libraries
 Name:		rubygems
 Version:	1.8.15
-Release:	1%{?dist}
+Release:	2%{?dist}
 Group:		Development/Libraries
 License:	Ruby or MIT
 
-URL:		http://rubyforge.org/projects/rubygems/
-Source0:	http://rubyforge.org/frs/download.php/%{repoid}/rubygems-%{version}.tgz
+URL:		https://rubygems.org/
+Source0:	http://production.cf.rubygems.org/rubygems/%{name}-%{version}.tgz
+
 # Sources from the works by Vít Ondruch <vondruch at redhat.com>
+# Please keep Source100 and Patch{105,109} in sync with ruby.spec
+
 Source100:	operating_system.rb
 
 # Kill patch0 for ruby 1.9.x
@@ -45,24 +53,20 @@ Patch109:	rubygems-1.8.11-binary-extensions.patch
 
 
 Requires:	ruby(abi) = 1.9.1
-Requires:	ruby >= 1.9.1
-Requires:	rubygem(rdoc)
-Requires:	rubygem(io-console)
-BuildRequires:	ruby
+Requires:	rubygem(rdoc) >= 3.9.4
+Requires:	rubygem(io-console) >= 0.3
+BuildRequires:	ruby(abi) = 1.9.1
 %if %{enable_check}
 # For mkmf.rb
 BuildRequires:	ruby-devel
-BuildRequires:	rubygem(hoe)
 BuildRequires:	rubygem(minitest)
 BuildRequires:	rubygem(rake)
-BuildRequires:	rubygem(rdoc)
-BuildRequires:	rubygem(io-console)
+BuildRequires:	rubygem(rdoc) >= 3.9.4
+BuildRequires:	rubygem(io-console) >= 0.3
 %endif
 BuildArch:	noarch
 Provides:	ruby(rubygems) = %{version}-%{release}
-# Workaround
-Provides:	ruby(rubygems) = 1.8.11
-Provides:	gems = %{version}-%{release}
+Provides:   gem = %{version}-%{release}
 
 %description
 RubyGems is the Ruby standard for publishing and managing third party
@@ -95,41 +99,33 @@ for f in `find lib -name \*.rb` ; do
   head -1 $f | grep -q '^#!/usr/bin/env ruby' && sed -i -e '1d' $f
 done
 
-# Cleanups
-rm -rf rubygems-update-%{version}/
-
 %build
 # Nothing
 
 %install
 GEM_HOME=%{buildroot}/%{gem_dir} \
-    ruby setup.rb --prefix=/ \
-        --no-rdoc --no-ri \
+    ruby setup.rb --rdoc --prefix=/ \
         --destdir=%{buildroot}/%{rubygems_dir}/
 
 mkdir -p %{buildroot}/%{_bindir}
 mv %{buildroot}/%{rubygems_dir}/bin/gem %{buildroot}/%{_bindir}/gem
 rm -rf %{buildroot}/%{rubygems_dir}/bin
-mv %{buildroot}/%{rubygems_dir}/lib/* %{buildroot}/%{rubygems_dir}/.
-
-# FIXME!!
-mkdir -p $RPM_BUILD_ROOT%{gem_dir}/{cache,gems,specifications,doc}
 
+mv %{buildroot}/%{rubygems_dir}/lib/* %{buildroot}/%{rubygems_dir}/.
 # No longer needed
-rmdir $RPM_BUILD_ROOT%{rubygems_dir}/lib
-
-# Create the following
-mkdir -p $RPM_BUILD_ROOT%{_exec_prefix}/lib{,64}/gems{,/exts}
+rmdir %{buildroot}%{rubygems_dir}/lib
 
 # Install custom operating_system.rb.
 mkdir -p %{buildroot}%{rubygems_dir}/rubygems/defaults
 install -cpm 0644 %{SOURCE100} %{buildroot}%{rubygems_dir}/rubygems/defaults/
-# Also
-mkdir -p ./lib/rubygems/defaults
-install -cpm 644 %{SOURCE100} ./lib/rubygems/defaults/
 
-# create macros.rubygems
+# Create gem folders.
+mkdir -p %{buildroot}%{gem_dir}/{cache,gems,specifications,doc}
+mkdir -p %{buildroot}%{gem_extdir}/exts
+
+# Create macros.rubygems file for rubygems-devel
 mkdir -p %{buildroot}%{_sysconfdir}/rpm
+
 cat >> %{buildroot}%{_sysconfdir}/rpm/macros.rubygems << \EOF
 # The RubyGems root folder.
 %%gem_dir %{gem_dir}
@@ -145,17 +141,18 @@ EOF
 
 %if %{enable_check}
 %check
-# Don't use isolate
-sed -i.tmp -e '\@isolate at d' Rakefile
-# Some tests fail, need checking
-rake test || :
-mv Rakefile.tmp Rakefile
+# Create an empty operating_system.rb, so that the system's one doesn't get used,
+# otherwise the test suite fails.
+mkdir -p lib/rubygems/defaults
+touch lib/rubygems/defaults/operating_system.rb
+
+# It is necessary to specify the paths using RUBYOPT to let the test suite pass."
+GEM_PATH=%{gem_dir} RUBYOPT="-Itest -I/usr/lib64/gems/exts/io-console-0.3/lib/ -I./lib/" \
+	testrb test
 %endif
 
 %files
-%defattr(-, root, root, -)
 %doc README* 
-#%%doc ChangeLog
 %doc History.txt
 %doc MIT.txt LICENSE.txt
 %dir %{gem_dir}
@@ -181,6 +178,9 @@ mv Rakefile.tmp Rakefile
 %config(noreplace)  %{_sysconfdir}/rpm/macros.rubygems
 
 %changelog
+* Thu Jan 26 2012 Vít Ondruch <vondruch at redhat.com> - 1.8.15-2
+- Make test suite green.
+
 * Thu Jan 26 2012 Mamoru Tasaka <mtasaka at fedoraproject.org> - 1.8.15-1
 - 1.8.15
 


More information about the scm-commits mailing list