[packages/ruby/new-paths: 1/7] fixing load paths to be sane like in perl; patches originally from fedora

glen glen at pld-linux.org
Thu Mar 21 09:23:16 CET 2013


commit d78ec589d68f68176140ee484f4507aad77c1686
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Thu Mar 21 01:41:10 2013 +0200

    fixing load paths to be sane like in perl; patches originally from fedora

 arch-specific-dir.patch          | 132 ++++++++++++++++++
 disable-versioned-paths.patch    | 149 +++++++++++++++++++++
 ruby.spec                        | 280 ++++++++++++++++++++++++---------------
 site-and-vendor-arch-flags.patch | 188 ++++++++++++++++++++++++++
 4 files changed, 642 insertions(+), 107 deletions(-)
---
diff --git a/ruby.spec b/ruby.spec
index c4e5b2a..8733a12 100644
--- a/ruby.spec
+++ b/ruby.spec
@@ -10,6 +10,7 @@
 %bcond_without	emacs		# skip building package with ruby-mode for emacs
 %bcond_without	tk		# skip building package with Tk bindings
 %bcond_without	batteries	# Don't include rubygems, json or rake
+%bcond_without	verpath	# LOAD_PATH with version number
 %bcond_with	bootstrap	# build bootstrap version
 
 %define		ruby_ver	1.9
@@ -28,11 +29,11 @@ Summary(pt_BR.UTF-8):	Linguagem de script orientada a objeto
 Summary(zh_CN.UTF-8):	ruby - 一种快速高效的面向对象脚本编程语言
 Name:		ruby
 Version:	%{basever}.%{patchlevel}
-Release:	1
+Release:	0.1
 Epoch:		1
 License:	The Ruby License
 Group:		Development/Languages
-Source0:	ftp://ftp.ruby-lang.org/pub/ruby/%{name}-%{basever}-p%{patchlevel}.tar.bz2
+Source0:	ftp://ftp.ruby-lang.org/pub/ruby/%{ruby_ver}/%{name}-%{basever}-p%{patchlevel}.tar.bz2
 # Source0-md5:	a810d64e2255179d2f334eb61fb8519c
 Source1:	http://www.ruby-doc.org/download/%{name}-doc-bundle.tar.gz
 # Source1-md5:	ad1af0043be98ba1a4f6d0185df63876
@@ -48,6 +49,12 @@ Source6:	%{name}-mode-init.el
 Patch0:		%{name}-lib64.patch
 Patch1:		%{name}-ffs.patch
 Patch2:		fix-bison-invocation.patch
+# http://redmine.ruby-lang.org/issues/5231
+Patch3:		disable-versioned-paths.patch
+# TODO: Should be submitted upstream?
+Patch4:		arch-specific-dir.patch
+# http://redmine.ruby-lang.org/issues/5281
+Patch5:		site-and-vendor-arch-flags.patch
 URL:		http://www.ruby-lang.org/
 BuildRequires:	autoconf >= 2.60
 BuildRequires:	automake
@@ -75,10 +82,10 @@ Obsoletes:	ruby-fastthread
 %if %{with batteries}
 Provides:	json = %{json_ver}
 Provides:	rake = %{rake_ver}
-Provides:	rubygems = %{rubygems_ver}
 Provides:	ruby-json = %{json_ver}
 Provides:	ruby-rake = %{rake_ver}
 Provides:	ruby-rubygems = %{rubygems_ver}
+Provides:	rubygems = %{rubygems_ver}
 Obsoletes:	ruby-json
 Obsoletes:	ruby-rake
 Obsoletes:	ruby-rubygems
@@ -87,6 +94,47 @@ Conflicts:	ruby-activesupport < 2.3.11-2
 Conflicts:	ruby-activesupport2 < 2.3.11-2
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
+%define	verpath	%{?with_verpath:/%{ruby_version}}
+
+%define	gemdir			%{_datadir}/%{name}/gems
+%define	gem_dir			%{_datadir}/%{name}/gems/%{ruby_version}
+%define	gems2dir		%{_datadir}/%{name}/gems/%{ruby_version}/gems
+
+# The RubyGems library has to stay out of Ruby directory three, since the
+# RubyGems should be share by all Ruby implementations.
+%define	rubygems_dir	%{_datadir}/rubygems
+# legacy: /usr/lib64/ruby/gems/1.9/
+
+%define	ruby_libdir		%{_datadir}/%{name}%{verpath}
+#%define	ruby_libarchdir	%{_libdir}/%{name}%{verpath}
+%define	ruby_libarchdir	%{_libdir}/%{name}
+
+# This is the local lib/arch and should not be used for packaging.
+%define	ruby_sitedir		site_ruby
+%define	ruby_sitelibdir		%{_prefix}/local/share/%{name}/%{ruby_sitedir}%{verpath}
+%define	ruby_sitearchdir	%{_prefix}/local/%{_lib}/%{name}/%{ruby_sitedir}%{verpath}
+
+# This is the general location for libs/archs compatible with all
+# or most of the Ruby versions available in the PLD repositories.
+%define	ruby_vendordir		vendor_ruby
+%define	ruby_vendorlibdir	%{_datadir}/%{name}/%{ruby_vendordir}%{verpath}
+%define	ruby_vendorarchdir	%{_libdir}/%{name}/%{ruby_vendordir}%{verpath}
+
+# TODO: drop legacy loadpaths after all ruby modules rebuilt in Th
+%define	legacy_libdir			%{_libdir}/%{name}/%{ruby_version}
+%define	legacy_archdir			%{_libdir}/%{name}/%{ruby_version}/%{_arch}-linux
+%define	legacy_sitedir			%{_libdir}/%{name}/%{ruby_sitedir}
+%define	legacy_sitelibdir		%{_libdir}/%{name}/%{ruby_sitedir}/%{ruby_version}
+%define	legacy_sitearchdir		%{_libdir}/%{name}/%{ruby_sitedir}/%{ruby_version}/%{_arch}-linux
+%define	legacy_vendordir		%{_libdir}/%{name}/%{ruby_vendordir}
+%define	legacy_vendorlibdir		%{_libdir}/%{name}/%{ruby_vendordir}/%{ruby_version}
+%define	legacy_vendorarchdir	%{_libdir}/%{name}/%{ruby_vendordir}/%{ruby_version}/%{_arch}-linux
+
+%define	legacy_siteloadpath		%{legacy_sitelibdir}:%{legacy_sitearchdir}:%{legacy_sitedir}
+%define	legacy_vendorloadpath	%{legacy_vendorlibdir}:%{legacy_vendorarchdir}:%{legacy_vendordir}
+%define	legacy_loadpath			%{legacy_libdir}:%{legacy_archdir}
+%define	legacy_loadpaths		%{legacy_siteloadpath}:%{legacy_vendorloadpath}:%{legacy_loadpath}
+
 # bleh, some nasty (gcc or ruby) bug still not fixed
 # (SEGV or "unexpected break" on miniruby run during build)
 %define		specflags_ia64	-O0
@@ -243,6 +291,9 @@ Tryb Ruby i debugger dla Emacsa.
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
 
 # must be regenerated with new bison
 %{__rm} parse.{c,h}
@@ -267,11 +318,22 @@ cd ..
 %{__autoconf}
 %configure \
 	%{?with_bootstrap:--with-baseruby=%{name}-1.8.7-p330/miniruby} \
+	--with-rubylibprefix=%{ruby_libdir} \
+	--with-archdir=%{ruby_libarchdir} \
+	--with-sitedir=%{ruby_sitelibdir} \
+	--with-sitearchdir=%{ruby_sitearchdir} \
+	--with-vendordir=%{ruby_vendorlibdir} \
+	--with-vendorarchdir=%{ruby_vendorarchdir} \
+	--with-rubygemsdir=%{rubygems_dir} \
+	--with-search-path=%{legacy_loadpaths} \
 	--enable-shared \
 	--enable-pthread \
+	%{!?with_verpath:--disable-versioned-paths} \
 	--with-ruby-version=minor
 
-%{__make} -j1 %{?with_bootstrap:BASERUBY="ruby-1.8.7-p330/miniruby -I./ruby-1.8.7-p330/lib"}
+%{__make} -j1 \
+	COPY="cp -p" Q= \
+	%{?with_bootstrap:BASERUBY="ruby-1.8.7-p330/miniruby -I./ruby-1.8.7-p330/lib"}
 
 %if %{with doc}
 %{__make} -j1 rdoc
@@ -280,20 +342,20 @@ cd ..
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{%{ruby_rdocdir},%{_examplesdir}/%{name}-%{version}} \
-	$RPM_BUILD_ROOT%{_libdir}/%{name}/%{ruby_ver}/tasks
+	$RPM_BUILD_ROOT%{ruby_libdir}/tasks
 
 %{__make} install \
 	DESTDIR=$RPM_BUILD_ROOT
 
 cp -Rf sample/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
-cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_mandir}/man1
-cp -a %{SOURCE5} $RPM_BUILD_ROOT%{_mandir}/man1
+cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_mandir}/man1
+cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_mandir}/man1
 
 %if %{without batteries}
 # packaged separately
-%{__rm} -r $RPM_BUILD_ROOT%{_libdir}/%{name}/%{ruby_ver}/{rubygems,rake,json,tasks}
-%{__rm} -r $RPM_BUILD_ROOT%{_libdir}/%{name}/%{ruby_ver}/*-linux*/json
-%{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/%{ruby_ver}/{rake,rubygems,json}.rb
+%{__rm} -r $RPM_BUILD_ROOT%{ruby_libdir}/{rubygems,rake,json,tasks}
+%{__rm} -r $RPM_BUILD_ROOT%{ruby_libarchdir}/json
+%{__rm} $RPM_BUILD_ROOT%{ruby_libdir}/{rake,rubygems,json}.rb
 %{__rm} $RPM_BUILD_ROOT%{_bindir}/{gem,rake}
 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/rake*
 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/ri/%{ruby_ver}/system/JSON
@@ -312,6 +374,10 @@ emacs --no-site-file -q -batch -l path.el -f batch-byte-compile $RPM_BUILD_ROOT%
 %{__rm} path.el*
 %endif
 
+# too much .ri
+rm -rf $RPM_BUILD_ROOT%{_datadir}/ri
+rm -rf $RPM_BUILD_ROOT%{_docdir}/ruby/html
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -332,18 +398,18 @@ rm -rf $RPM_BUILD_ROOT
 %if %{with batteries}
 %{_mandir}/man1/rake.1*
 %endif
-%dir %{_libdir}/%{name}
-%dir %{_libdir}/%{name}/%{ruby_ver}
-%dir %{_libdir}/%{name}/%{ruby_ver}/*-linux*
-%dir %{_libdir}/%{name}/site_ruby
-%dir %{_libdir}/%{name}/site_ruby/%{ruby_ver}
-%dir %{_libdir}/%{name}/site_ruby/%{ruby_ver}/*-linux*
-%dir %{_libdir}/%{name}/vendor_ruby
-%dir %{_libdir}/%{name}/vendor_ruby/%{ruby_ver}
-%dir %{_libdir}/%{name}/vendor_ruby/%{ruby_ver}/*-linux*
-%dir %{_datadir}/ri
-%dir %{_datadir}/ri/%{ruby_ver}
-%dir %{_datadir}/ri/%{ruby_ver}/system
+#%dir %{_libdir}/%{name}
+#%dir %{_libdir}/%{name}/%{ruby_ver}
+#%dir %{ruby_libarchdir}
+#%dir %{_libdir}/%{name}/site_ruby
+#%dir %{_libdir}/%{name}/site_ruby/%{ruby_ver}
+#%dir %{_libdir}/%{name}/site_ruby/%{ruby_ver}/*-linux*
+#%dir %{_libdir}/%{name}/vendor_ruby
+#%dir %{_libdir}/%{name}/vendor_ruby/%{ruby_ver}
+#%dir %{_libdir}/%{name}/vendor_ruby/%{ruby_ver}/*-linux*
+#%dir %{_datadir}/ri
+#%dir %{_datadir}/ri/%{ruby_ver}
+#%dir %{_datadir}/ri/%{ruby_ver}/system
 %dir %{ruby_rdocdir}
 
 %files devel
@@ -359,11 +425,11 @@ rm -rf $RPM_BUILD_ROOT
 %if %{with tk}
 %files tk
 %defattr(644,root,root,755)
-%{_libdir}/%{name}/%{ruby_ver}/tcltk.rb
-%{_libdir}/%{name}/%{ruby_ver}/tk*.rb
-%{_libdir}/%{name}/%{ruby_ver}/tk
-%{_libdir}/%{name}/%{ruby_ver}/tkextlib
-%attr(755,root,root) %{_libdir}/%{name}/%{ruby_ver}/*-linux*/t*.so
+%{ruby_libdir}/tcltk.rb
+%{ruby_libdir}/tk*.rb
+%{ruby_libdir}/tk
+%{ruby_libdir}/tkextlib
+%attr(755,root,root) %{ruby_libarchdir}/t*.so
 %endif
 
 %files modules
@@ -373,91 +439,91 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{_bindir}/rdoc
 %attr(755,root,root) %{_bindir}/ri
 %attr(755,root,root) %{_bindir}/testrb
-%{_libdir}/%{name}/%{ruby_ver}/bigdecimal
-%{_libdir}/%{name}/%{ruby_ver}/cgi
-%{_libdir}/%{name}/%{ruby_ver}/date
-%{_libdir}/%{name}/%{ruby_ver}/digest
-%{_libdir}/%{name}/%{ruby_ver}/dl
-%{_libdir}/%{name}/%{ruby_ver}/drb
-%{_libdir}/%{name}/%{ruby_ver}/fiddle
-%{_libdir}/%{name}/%{ruby_ver}/io
-%{_libdir}/%{name}/%{ruby_ver}/irb
-%{_libdir}/%{name}/%{ruby_ver}/matrix
-%{_libdir}/%{name}/%{ruby_ver}/minitest
-%{_libdir}/%{name}/%{ruby_ver}/net
-%{_libdir}/%{name}/%{ruby_ver}/openssl
-%{_libdir}/%{name}/%{ruby_ver}/optparse
+%{ruby_libdir}/bigdecimal
+%{ruby_libdir}/cgi
+%{ruby_libdir}/date
+%{ruby_libdir}/digest
+%{ruby_libdir}/dl
+%{ruby_libdir}/drb
+%{ruby_libdir}/fiddle
+%{ruby_libdir}/io
+%{ruby_libdir}/irb
+%{ruby_libdir}/matrix
+%{ruby_libdir}/minitest
+%{ruby_libdir}/net
+%{ruby_libdir}/openssl
+%{ruby_libdir}/optparse
 %if %{with batteries}
-%{_libdir}/%{name}/%{ruby_ver}/json
-%{_libdir}/%{name}/%{ruby_ver}/rake
-%{_libdir}/%{name}/%{ruby_ver}/rubygems
-%dir %{_libdir}/%{name}/%{ruby_ver}/tasks
+%{ruby_libdir}/json
+%{ruby_libdir}/rake
+%{ruby_libdir}/rubygems
+%dir %{ruby_libarchdir}/%{ruby_version}/tasks
 %endif
-%{_libdir}/%{name}/%{ruby_ver}/psych
-%{_libdir}/%{name}/%{ruby_ver}/racc
-%{_libdir}/%{name}/%{ruby_ver}/rbconfig
-%{_libdir}/%{name}/%{ruby_ver}/rdoc
-%{_libdir}/%{name}/%{ruby_ver}/rexml
-%{_libdir}/%{name}/%{ruby_ver}/rinda
-%{_libdir}/%{name}/%{ruby_ver}/ripper
-%{_libdir}/%{name}/%{ruby_ver}/rss
-%{_libdir}/%{name}/%{ruby_ver}/shell
-%{_libdir}/%{name}/%{ruby_ver}/syck
-%{_libdir}/%{name}/%{ruby_ver}/test
-%{_libdir}/%{name}/%{ruby_ver}/uri
-%{_libdir}/%{name}/%{ruby_ver}/webrick
-%{_libdir}/%{name}/%{ruby_ver}/xmlrpc
-%{_libdir}/%{name}/%{ruby_ver}/yaml
-%{_libdir}/%{name}/%{ruby_ver}/[A-Za-s]*.rb
-%{_libdir}/%{name}/%{ruby_ver}/tempfile.rb
-%{_libdir}/%{name}/%{ruby_ver}/thread.rb
-%{_libdir}/%{name}/%{ruby_ver}/thwait.rb
-%{_libdir}/%{name}/%{ruby_ver}/time.rb
-%{_libdir}/%{name}/%{ruby_ver}/timeout.rb
-%{_libdir}/%{name}/%{ruby_ver}/tmpdir.rb
-%{_libdir}/%{name}/%{ruby_ver}/tracer.rb
-%{_libdir}/%{name}/%{ruby_ver}/tsort.rb
-%{_libdir}/%{name}/%{ruby_ver}/[u-z]*.rb
-%attr(755,root,root) %{_libdir}/%{name}/%{ruby_ver}/*-linux*/[a-s]*.so
-%attr(755,root,root) %{_libdir}/%{name}/%{ruby_ver}/*-linux*/[u-z]*.so
-%dir %{_libdir}/%{name}/%{ruby_ver}/*-linux*/digest
-%attr(755,root,root) %{_libdir}/%{name}/%{ruby_ver}/*-linux*/digest/*.so
-%dir %{_libdir}/%{name}/%{ruby_ver}/*-linux*/dl
-%attr(755,root,root) %{_libdir}/%{name}/%{ruby_ver}/*-linux*/dl/callback.so
-%dir %{_libdir}/%{name}/%{ruby_ver}/*-linux*/enc
-%attr(755,root,root) %{_libdir}/%{name}/%{ruby_ver}/*-linux*/enc/*.so
-%dir %{_libdir}/%{name}/%{ruby_ver}/*-linux*/enc/trans
-%attr(755,root,root) %{_libdir}/%{name}/%{ruby_ver}/*-linux*/enc/trans/*.so
-%dir %{_libdir}/%{name}/%{ruby_ver}/*-linux*/io
-%attr(755,root,root) %{_libdir}/%{name}/%{ruby_ver}/*-linux*/io/*.so
+%{ruby_libdir}/psych
+%{ruby_libdir}/racc
+%{ruby_libdir}/rbconfig
+%{ruby_libdir}/rdoc
+%{ruby_libdir}/rexml
+%{ruby_libdir}/rinda
+%{ruby_libdir}/ripper
+%{ruby_libdir}/rss
+%{ruby_libdir}/shell
+%{ruby_libdir}/syck
+%{ruby_libdir}/test
+%{ruby_libdir}/uri
+%{ruby_libdir}/webrick
+%{ruby_libdir}/xmlrpc
+%{ruby_libdir}/yaml
+%{ruby_libdir}/[A-Za-s]*.rb
+%{ruby_libdir}/tempfile.rb
+%{ruby_libdir}/thread.rb
+%{ruby_libdir}/thwait.rb
+%{ruby_libdir}/time.rb
+%{ruby_libdir}/timeout.rb
+%{ruby_libdir}/tmpdir.rb
+%{ruby_libdir}/tracer.rb
+%{ruby_libdir}/tsort.rb
+%{ruby_libdir}/[u-z]*.rb
+%attr(755,root,root) %{ruby_libarchdir}/[a-s]*.so
+%attr(755,root,root) %{ruby_libarchdir}/[u-z]*.so
+%dir %{ruby_libarchdir}/digest
+%attr(755,root,root) %{ruby_libarchdir}/digest/*.so
+%dir %{ruby_libarchdir}/dl
+%attr(755,root,root) %{ruby_libarchdir}/dl/callback.so
+%dir %{ruby_libarchdir}/enc
+%attr(755,root,root) %{ruby_libarchdir}/enc/*.so
+%dir %{ruby_libarchdir}/enc/trans
+%attr(755,root,root) %{ruby_libarchdir}/enc/trans/*.so
+%dir %{ruby_libarchdir}/io
+%attr(755,root,root) %{ruby_libarchdir}/io/*.so
 %if %{with batteries}
-%dir %{_libdir}/%{name}/%{ruby_ver}/*-linux*/json
-%dir %{_libdir}/%{name}/%{ruby_ver}/*-linux*/json/ext
-%attr(755,root,root) %{_libdir}/%{name}/%{ruby_ver}/*-linux*/json/ext/*.so
+%dir %{ruby_libarchdir}/json
+%dir %{ruby_libarchdir}/json/ext
+%attr(755,root,root) %{ruby_libarchdir}/json/ext/*.so
 %endif
-%dir %{_libdir}/%{name}/%{ruby_ver}/*-linux*/mathn
-%attr(755,root,root) %{_libdir}/%{name}/%{ruby_ver}/*-linux*/mathn/*.so
-%dir %{_libdir}/%{name}/%{ruby_ver}/*-linux*/racc
-%attr(755,root,root) %{_libdir}/%{name}/%{ruby_ver}/*-linux*/racc/*.so
-%{_libdir}/%{name}/%{ruby_ver}/*-linux*/rbconfig.rb
-%dir %{_libdir}/%{name}/gems
-%dir %{_libdir}/%{name}/gems/%{ruby_ver}
-%dir %{_libdir}/%{name}/gems/%{ruby_ver}/gems
-%dir %{_libdir}/%{name}/gems/%{ruby_ver}/specifications
-%{_libdir}/%{name}/gems/%{ruby_ver}/specifications/io-console-*.gemspec
-%{_libdir}/%{name}/gems/%{ruby_ver}/specifications/bigdecimal-*.gemspec
+%dir %{ruby_libarchdir}/mathn
+%attr(755,root,root) %{ruby_libarchdir}/mathn/*.so
+%dir %{ruby_libarchdir}/racc
+%attr(755,root,root) %{ruby_libarchdir}/racc/*.so
+%{ruby_libarchdir}/rbconfig.rb
+#%dir %{ruby_libdir}/gems
+%dir %{gem_dir}
+%dir %{gemdir}
+%dir %{gem_dir}/specifications
+%{gem_dir}/specifications/io-console-*.gemspec
+%{gem_dir}/specifications/bigdecimal-*.gemspec
 %if %{with batteries}
-%dir %{_libdir}/%{name}/gems/%{ruby_ver}/gems/rake-%{rake_ver}
-%dir %{_libdir}/%{name}/gems/%{ruby_ver}/gems/rake-%{rake_ver}/bin
-%attr(755,root,root) %{_libdir}/%{name}/gems/%{ruby_ver}/gems/rake-%{rake_ver}/bin/rake
-%dir %{_libdir}/%{name}/gems/%{ruby_ver}/gems/rdoc-%{rdoc_ver}
-%dir %{_libdir}/%{name}/gems/%{ruby_ver}/gems/rdoc-%{rdoc_ver}/bin
-%attr(755,root,root) %{_libdir}/%{name}/gems/%{ruby_ver}/gems/rdoc-%{rdoc_ver}/bin/rdoc
-%attr(755,root,root) %{_libdir}/%{name}/gems/%{ruby_ver}/gems/rdoc-%{rdoc_ver}/bin/ri
-%{_libdir}/%{name}/gems/%{ruby_ver}/specifications/minitest-%{minitest_ver}.gemspec
-%{_libdir}/%{name}/gems/%{ruby_ver}/specifications/rake-%{rake_ver}.gemspec
-%{_libdir}/%{name}/gems/%{ruby_ver}/specifications/rdoc-%{rdoc_ver}.gemspec
-%{_libdir}/%{name}/gems/%{ruby_ver}/specifications/json-%{json_ver}.gemspec
+%dir %{gems2dir}/rake-%{rake_ver}
+%dir %{gems2dir}/rake-%{rake_ver}/bin
+%attr(755,root,root) %{gems2dir}/rake-%{rake_ver}/bin/rake
+%dir %{gems2dir}/rdoc-%{rdoc_ver}
+%dir %{gems2dir}/rdoc-%{rdoc_ver}/bin
+%attr(755,root,root) %{gems2dir}/rdoc-%{rdoc_ver}/bin/rdoc
+%attr(755,root,root) %{gems2dir}/rdoc-%{rdoc_ver}/bin/ri
+%{gem_dir}/specifications/minitest-%{minitest_ver}.gemspec
+%{gem_dir}/specifications/rake-%{rake_ver}.gemspec
+%{gem_dir}/specifications/rdoc-%{rdoc_ver}.gemspec
+%{gem_dir}/specifications/json-%{json_ver}.gemspec
 %endif
 %{_mandir}/man1/erb.1*
 %{_mandir}/man1/irb.1*
diff --git a/arch-specific-dir.patch b/arch-specific-dir.patch
new file mode 100644
index 0000000..8440ea7
--- /dev/null
+++ b/arch-specific-dir.patch
@@ -0,0 +1,132 @@
+From df4253a5b79b63f16f215f2c19f1b9666c4ca01e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch at redhat.com>
+Date: Thu, 8 Sep 2011 15:30:05 +0200
+Subject: [PATCH] Add configuration arch specific dir flag.
+
+---
+ Makefile.in      |    1 +
+ configure.in     |   20 ++++++++++++++++++++
+ tool/mkconfig.rb |    4 +++-
+ version.c        |    2 ++
+ 4 files changed, 26 insertions(+), 1 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index bcdaf5f..d61b2ee 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -31,6 +31,7 @@ libexecdir = @libexecdir@
+ datarootdir = @datarootdir@
+ datadir = @datadir@
+ arch = @arch@
++archdir = @archdir@
+ sitearch = @sitearch@
+ sitedir = @sitedir@
+ ruby_version = @ruby_version@
+diff --git a/configure.in b/configure.in
+index 83e5d76..e6dc38c 100644
+--- a/configure.in
++++ b/configure.in
+@@ -2793,6 +2793,15 @@ else
+     RUBY_LIB_VERSION="\"${ruby_version}\""
+ fi
+ 
++AC_ARG_WITH(archdir,
++	    AS_HELP_STRING([--with-archdir=DIR], [architecture specific ruby libraries [[LIBDIR/RUBY_BASE_NAME/ARCH]]]),
++            [archdir=$withval],
++            [archdir='${rubylibprefix}/${arch}'])
++dir="${archdir}"
++until ARCH_DIR=`eval echo \\"${dir}\\"`; test "x${dir}" = "x${ARCH_DIR}"; do
++    dir="${ARCH_DIR}"
++done
++
+ AC_ARG_WITH(sitedir,
+ 	    AS_HELP_STRING([--with-sitedir=DIR], [site libraries in DIR [[RUBY_LIB_PREFIX/site_ruby]]]),
+             [sitedir=$withval],
+@@ -2815,16 +2824,25 @@ if test "${LOAD_RELATIVE+set}"; then
+     AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE)
+     RUBY_EXEC_PREFIX=""
+     RUBY_LIB_PREFIX="`eval echo "$RUBY_LIB_PREFIX" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
++    RUBY_ARCH_LIB_PATH="`eval echo "$ARCH_DIR" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
+     RUBY_SITE_LIB_PATH="`eval echo "$SITE_DIR" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
+     RUBY_VENDOR_LIB_PATH="`eval echo "$VENDOR_DIR" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
+ else
+     RUBY_EXEC_PREFIX="`eval echo \\"$exec_prefix/\\" | sed 's|^NONE/|'"$prefix"'/|;s|/$||'`"
+     RUBY_LIB_PREFIX="`eval echo \\"$RUBY_LIB_PREFIX\\" | sed 's|^NONE/|'"$prefix"'/|'`"
++    RUBY_ARCH_LIB_PATH="`eval echo \\"$ARCH_DIR\\" | sed 's|^NONE/|'"$prefix"'/|'`"
+     RUBY_SITE_LIB_PATH="`eval echo \\"$SITE_DIR\\" | sed 's|^NONE/|'"$prefix"'/|'`"
+     RUBY_VENDOR_LIB_PATH="`eval echo \\"$VENDOR_DIR\\" | sed 's|^NONE/|'"$prefix"'/|'`"
+ fi
+ 
+ pat=`echo "$RUBY_LIB_PREFIX/" | tr -c '\012' .`'\(.*\)'
++AS_CASE(["$RUBY_ARCH_LIB_PATH"],
++  ["$RUBY_LIB_PREFIX/"*], [
++    RUBY_ARCH_LIB_PATH='RUBY_LIB_PREFIX"/'"`expr \"$RUBY_ARCH_LIB_PATH\" : \"$pat\"`"'"'
++    ],
++  [
++    RUBY_ARCH_LIB_PATH="\"${RUBY_ARCH_LIB_PATH}\""
++    ])
+ AS_CASE(["$RUBY_SITE_LIB_PATH"],
+   ["$RUBY_LIB_PREFIX/"*], [
+     RUBY_SITE_LIB_PATH='RUBY_LIB_PREFIX"/'"`expr \"$RUBY_SITE_LIB_PATH\" : \"$pat\"`"'"'
+@@ -2855,6 +2873,7 @@ else
+ fi
+ AC_DEFINE_UNQUOTED(RUBY_EXEC_PREFIX, "${RUBY_EXEC_PREFIX}")
+ AC_DEFINE_UNQUOTED(RUBY_LIB_PREFIX, ${RUBY_LIB_PREFIX})
++AC_DEFINE_UNQUOTED(RUBY_ARCHLIB, ${RUBY_ARCH_LIB_PATH})
+ if test "x$SITE_DIR" = xno; then
+     AC_DEFINE(NO_RUBY_SITE_LIB)
+ else
+@@ -2869,6 +2888,7 @@ fi
+ AC_SUBST(arch)dnl
+ AC_SUBST(sitearch)dnl
+ AC_SUBST(ruby_version)dnl
++AC_SUBST(archdir)dnl
+ AC_SUBST(sitedir)dnl
+ AC_SUBST(vendordir)dnl
+ 
+diff --git a/tool/mkconfig.rb b/tool/mkconfig.rb
+index b707c4b..9780ef2 100755
+--- a/tool/mkconfig.rb
++++ b/tool/mkconfig.rb
+@@ -43,6 +43,7 @@ v_others = []
+ continued_name = nil
+ continued_line = nil
+ path_version = "/$(ruby_version)"
++archdir_override = "$(vendorlibdir)/$(sitearch)"
+ File.foreach "config.status" do |line|
+   next if /^#/ =~ line
+   name = nil
+@@ -77,6 +78,7 @@ File.foreach "config.status" do |line|
+     when /^RUBY_INSTALL_NAME$/; next if $install_name
+     when /^RUBY_SO_NAME$/; next if $so_name
+     when /^arch$/; if val.empty? then val = arch else arch = val end
++    when /^archdir$/; archdir_override = val; next
+     when /^sitearch/; val = '$(arch)' if val.empty?
+     end
+     case val
+@@ -207,7 +209,7 @@ print(*v_fast)
+ print(*v_others)
+ print <<EOS
+   CONFIG["rubylibdir"] = "$(rubylibprefix)#{path_version}"
+-  CONFIG["archdir"] = "$(rubylibdir)/$(arch)"
++  CONFIG["archdir"] = "#{archdir_override}"
+ EOS
+ print <<EOS unless v_disabled["sitedir"]
+   CONFIG["sitelibdir"] = "$(sitedir)#{path_version}"
+diff --git a/version.c b/version.c
+index 59d4e5e..915a0a2 100644
+--- a/version.c
++++ b/version.c
+@@ -47,7 +47,9 @@
+ #define RUBY_SITE_LIB2              RUBY_SITE_LIB    "/"RUBY_LIB_VERSION
+ #define RUBY_VENDOR_LIB2            RUBY_VENDOR_LIB  "/"RUBY_LIB_VERSION
+ #endif
++#ifndef RUBY_ARCHLIB
+ #define RUBY_ARCHLIB                RUBY_LIB         "/"RUBY_ARCH
++#endif
+ #define RUBY_SITE_ARCHLIB           RUBY_SITE_LIB2   "/"RUBY_SITEARCH
+ #define RUBY_VENDOR_ARCHLIB         RUBY_VENDOR_LIB2 "/"RUBY_SITEARCH
+ #ifdef  RUBY_THINARCH
+-- 
+1.7.6.1
+
diff --git a/disable-versioned-paths.patch b/disable-versioned-paths.patch
new file mode 100644
index 0000000..1d0bfea
--- /dev/null
+++ b/disable-versioned-paths.patch
@@ -0,0 +1,149 @@
+From fa1a50ad10814f724b8713865dc222724cb955ab Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch at redhat.com>
+Date: Thu, 25 Aug 2011 14:33:51 +0200
+Subject: [PATCH] Allow to disable versioned paths.
+
+---
+ configure.in     |   11 +++++++++++
+ tool/mkconfig.rb |    9 ++++++---
+ version.c        |   10 ++++++++++
+ 3 files changed, 27 insertions(+), 3 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index e742e74..86cb68f 100644
+--- a/configure.in
++++ b/configure.in
+@@ -2963,6 +2963,17 @@ else
+ fi
+ AC_SUBST(USE_RUBYGEMS)
+ 
++AC_ARG_ENABLE(versioned-paths,
++	AS_HELP_STRING([--disable-versioned-paths], [disable paths with version number]),
++	[enable_versioned_paths="$enableval"], [enable_versioned_paths=yes])
++if test x"$enable_versioned_paths" = xno; then
++    AC_DEFINE(DISABLE_VERSIONED_PATHS, 1)
++    USE_VERSIONED_PATHS=NO
++else
++    USE_VERSIONED_PATHS=YES
++fi
++AC_SUBST(USE_VERSIONED_PATHS)
++
+ arch_hdrdir="${EXTOUT}/include/${arch}/ruby"
+ AS_MKDIR_P("${arch_hdrdir}")
+ config_h="${arch_hdrdir}/config.h"
+diff --git a/tool/mkconfig.rb b/tool/mkconfig.rb
+index a2221f0..47d8c8f 100755
+--- a/tool/mkconfig.rb
++++ b/tool/mkconfig.rb
+@@ -42,6 +42,7 @@ v_others = []
+ vars = {}
+ continued_name = nil
+ continued_line = nil
++path_version = "/$(ruby_version)"
+ File.foreach "config.status" do |line|
+   next if /^#/ =~ line
+   name = nil
+@@ -138,6 +139,8 @@ File.foreach "config.status" do |line|
+     case name
+     when "ruby_version"
+       version = val[/\A"(.*)"\z/, 1]
++    when /^USE_VERSIONED_PATHS$/
++      path_version = nil if /NO/ =~ val
+     end
+   end
+ #  break if /^CEOF/
+@@ -203,15 +206,15 @@ end
+ print(*v_fast)
+ print(*v_others)
+ print <<EOS
+-  CONFIG["rubylibdir"] = "$(rubylibprefix)/$(ruby_version)"
++  CONFIG["rubylibdir"] = "$(rubylibprefix)#{path_version}"
+   CONFIG["archdir"] = "$(rubylibdir)/$(arch)"
+ EOS
+ print <<EOS unless v_disabled["sitedir"]
+-  CONFIG["sitelibdir"] = "$(sitedir)/$(ruby_version)"
++  CONFIG["sitelibdir"] = "$(sitedir)#{path_version}"
+   CONFIG["sitearchdir"] = "$(sitelibdir)/$(sitearch)"
+ EOS
+ print <<EOS unless v_disabled["vendordir"]
+-  CONFIG["vendorlibdir"] = "$(vendordir)/$(ruby_version)"
++  CONFIG["vendorlibdir"] = "$(vendordir)#{path_version}"
+   CONFIG["vendorarchdir"] = "$(vendorlibdir)/$(sitearch)"
+ EOS
+ print <<EOS
+diff --git a/version.c b/version.c
+index 59d4e5e..641dc33 100644
+--- a/version.c
++++ b/version.c
+@@ -38,9 +38,15 @@
+ #define RUBY_VENDOR_LIB RUBY_LIB_PREFIX"/vendor_ruby"
+ #endif
+ 
++#ifdef DISABLE_VERSIONED_PATHS
++#define RUBY_LIB                    RUBY_LIB_PREFIX
++#define RUBY_SITE_LIB2              RUBY_SITE_LIB
++#define RUBY_VENDOR_LIB2            RUBY_VENDOR_LIB
++#else
+ #define RUBY_LIB                    RUBY_LIB_PREFIX  "/"RUBY_LIB_VERSION
+ #define RUBY_SITE_LIB2              RUBY_SITE_LIB    "/"RUBY_LIB_VERSION
+ #define RUBY_VENDOR_LIB2            RUBY_VENDOR_LIB  "/"RUBY_LIB_VERSION
++#endif
+ #define RUBY_ARCHLIB                RUBY_LIB         "/"RUBY_ARCH
+ #define RUBY_SITE_ARCHLIB           RUBY_SITE_LIB2   "/"RUBY_SITEARCH
+ #define RUBY_VENDOR_ARCHLIB         RUBY_VENDOR_LIB2 "/"RUBY_SITEARCH
+@@ -75,8 +81,10 @@ const char ruby_initial_load_paths[] =
+     RUBY_SITE_THIN_ARCHLIB "\0"
+ #endif
+     RUBY_SITE_ARCHLIB "\0"
++#ifndef DISABLE_VERSIONED_PATHS
+     RUBY_SITE_LIB "\0"
+ #endif
++#endif
+ 
+ #ifndef NO_RUBY_VENDOR_LIB
+     RUBY_VENDOR_LIB2 "\0"
+@@ -84,8 +92,10 @@ const char ruby_initial_load_paths[] =
+     RUBY_VENDOR_THIN_ARCHLIB "\0"
+ #endif
+     RUBY_VENDOR_ARCHLIB "\0"
++#ifndef DISABLE_VERSIONED_PATHS
+     RUBY_VENDOR_LIB "\0"
+ #endif
++#endif
+ 
+     RUBY_LIB "\0"
+ #ifdef RUBY_THIN_ARCHLIB
+-- 
+1.7.7.3
+diff --git a/lib/rdoc/ri/paths.rb b/lib/rdoc/ri/paths.rb
+index a3c65bf..0575730 100644
+--- a/lib/rdoc/ri/paths.rb
++++ b/lib/rdoc/ri/paths.rb
+@@ -11,9 +11,9 @@ module RDoc::RI::Paths
+   version = RbConfig::CONFIG['ruby_version']
+ 
+   base    = if RbConfig::CONFIG.key? 'ridir' then
+-              File.join RbConfig::CONFIG['ridir'], version
++              File.join [RbConfig::CONFIG['ridir'], RbConfig::CONFIG['USE_VERSIONED_PATHS'] == 'YES' ? version : nil].compact
+             else
+-              File.join RbConfig::CONFIG['datadir'], 'ri', version
++              File.join [RbConfig::CONFIG['datadir'], 'ri', RbConfig::CONFIG['USE_VERSIONED_PATHS'] == 'YES' ? version : nil].compact
+             end
+ 
+   SYSDIR  = File.join base, "system"
+diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb
+index cec8c9f..fed14d2 100755
+--- a/tool/rbinstall.rb
++++ b/tool/rbinstall.rb
+@@ -379,7 +379,7 @@ end
+ 
+ install?(:doc, :rdoc) do
+   if $rdocdir
+-    ridatadir = File.join(CONFIG['ridir'], CONFIG['ruby_version'], "system")
++    ridatadir = File.join([CONFIG['ridir'], RbConfig::CONFIG['USE_VERSIONED_PATHS'] == 'YES' ? RbConfig::CONFIG['ruby_version'] : nil, "system"].compact)
+     prepare "rdoc", ridatadir
+     install_recursive($rdocdir, ridatadir, :mode => $data_mode)
+   end
+-- 
+1.7.6
+
diff --git a/site-and-vendor-arch-flags.patch b/site-and-vendor-arch-flags.patch
new file mode 100644
index 0000000..1363063
--- /dev/null
+++ b/site-and-vendor-arch-flags.patch
@@ -0,0 +1,188 @@
+From b0a875862d14244ca41cd1e1e9090f87757aaeb9 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch at redhat.com>
+Date: Mon, 5 Sep 2011 13:10:47 +0200
+Subject: [PATCH] Added configuration flags for site and vendor architecture
+ specific directories.
+
+---
+ Makefile.in      |    3 +++
+ configure.in     |   40 ++++++++++++++++++++++++++++++++++++++++
+ tool/mkconfig.rb |    8 ++++++--
+ version.c        |    4 ++++
+ 4 files changed, 53 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index bcdaf5f..f57e4c4 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -34,6 +34,9 @@ datadir = @datadir@
+ archdir = @archdir@
+ sitearch = @sitearch@
+ sitedir = @sitedir@
++sitearchdir= @sitearchdir@
++vendordir = @vendordir@
++vendorarchdir = @vendorarchdir@
+ ruby_version = @ruby_version@
+ 
+ TESTUI = console
+diff --git a/configure.in b/configure.in
+index 83e5d76..31532bd 100644
+--- a/configure.in
++++ b/configure.in
+@@ -2811,6 +2811,15 @@ until SITE_DIR=`eval echo \\"${dir}\\"`; test "x${dir}" = "x${SITE_DIR}"; do
+     dir="${SITE_DIR}"
+ done
+ 
++AC_ARG_WITH(sitearchdir,
++	    AS_HELP_STRING([--with-sitearchdir=DIR], [site libraries in DIR [[RUBY_LIB_PREFIX/site_ruby]]]),
++            [sitearchdir=$withval],
++            [sitearchdir='${rubylibprefix}/site_ruby/${arch}'])
++dir="${sitearchdir}"
++until SITEARCH_DIR=`eval echo \\"${dir}\\"`; test "x${dir}" = "x${SITEARCH_DIR}"; do
++    dir="${SITEARCH_DIR}"
++done
++
+ AC_ARG_WITH(vendordir,
+ 	    AS_HELP_STRING([--with-vendordir=DIR], [vendor libraries in DIR [[RUBY_LIB_PREFIX/vendor_ruby]]]),
+             [vendordir=$withval],
+@@ -2820,19 +2829,32 @@ until VENDOR_DIR=`eval echo \\"${dir}\\"`; test "x${dir}" = "x${VENDOR_DIR}"; do
+     dir="${VENDOR_DIR}"
+ done
+ 
++AC_ARG_WITH(vendorarchdir,
++	    AS_HELP_STRING([--with-vendorarchdir=DIR], [vendor libraries in DIR [[RUBY_LIB_PREFIX/vendor_ruby]]]),
++            [vendorarchdir=$withval],
++            [vendorarchdir='${rubylibprefix}/vendor_ruby/${arch}'])
++dir="${vendorarchdir}"
++until VENDORARCH_DIR=`eval echo \\"${dir}\\"`; test "x${dir}" = "x${VENDORARCH_DIR}"; do
++    dir="${VENDORARCH_DIR}"
++done
++
+ if test "${LOAD_RELATIVE+set}"; then
+     AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE)
+     RUBY_EXEC_PREFIX=""
+     RUBY_LIB_PREFIX="`eval echo "$RUBY_LIB_PREFIX" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
+     RUBY_ARCH_LIB_PATH="`eval echo "$ARCH_DIR" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
+     RUBY_SITE_LIB_PATH="`eval echo "$SITE_DIR" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
++    RUBY_SITE_ARCHLIB_PATH="`eval echo "$SITEARCH_DIR" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
+     RUBY_VENDOR_LIB_PATH="`eval echo "$VENDOR_DIR" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
++    RUBY_VENDOR_ARCHLIB_PATH="`eval echo "$VENDORARCH_DIR" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
+ else
+     RUBY_EXEC_PREFIX="`eval echo \\"$exec_prefix/\\" | sed 's|^NONE/|'"$prefix"'/|;s|/$||'`"
+     RUBY_LIB_PREFIX="`eval echo \\"$RUBY_LIB_PREFIX\\" | sed 's|^NONE/|'"$prefix"'/|'`"
+     RUBY_ARCH_LIB_PATH="`eval echo \\"$ARCH_DIR\\" | sed 's|^NONE/|'"$prefix"'/|'`"
+     RUBY_SITE_LIB_PATH="`eval echo \\"$SITE_DIR\\" | sed 's|^NONE/|'"$prefix"'/|'`"
++    RUBY_SITE_ARCHLIB_PATH="`eval echo \\"$SITEARCH_DIR\\" | sed 's|^NONE/|'"$prefix"'/|'`"
+     RUBY_VENDOR_LIB_PATH="`eval echo \\"$VENDOR_DIR\\" | sed 's|^NONE/|'"$prefix"'/|'`"
++    RUBY_VENDOR_ARCHLIB_PATH="`eval echo \\"$VENDORARCH_DIR\\" | sed 's|^NONE/|'"$prefix"'/|'`"
+ fi
+ 
+ pat=`echo "$RUBY_LIB_PREFIX/" | tr -c '\012' .`'\(.*\)'
+@@ -2850,6 +2872,13 @@ AS_CASE(["$RUBY_SITE_LIB_PATH"],
+   [
+     RUBY_SITE_LIB_PATH="\"${RUBY_SITE_LIB_PATH}\""
+     ])
++AS_CASE(["$RUBY_SITE_ARCHLIB_PATH"],
++  ["$RUBY_LIB_PREFIX/"*], [
++    RUBY_SITE_ARCHLIB_PATH='RUBY_LIB_PREFIX"/'"`expr \"$RUBY_SITE_ARCHLIB_PATH\" : \"$pat\"`"'"'
++    ],
++  [
++    RUBY_SITE_ARCHLIB_PATH="\"${RUBY_SITE_ARCHLIB_PATH}\""
++    ])
+ AS_CASE(["$RUBY_VENDOR_LIB_PATH"],
+   ["$RUBY_LIB_PREFIX/"*], [
+     RUBY_VENDOR_LIB_PATH='RUBY_LIB_PREFIX"/'"`expr \"$RUBY_VENDOR_LIB_PATH\" : \"$pat\"`"'"'
+@@ -2857,6 +2886,13 @@ AS_CASE(["$RUBY_VENDOR_LIB_PATH"],
+   [
+     RUBY_VENDOR_LIB_PATH="\"${RUBY_VENDOR_LIB_PATH}\""
+     ])
++AS_CASE(["$RUBY_VENDOR_ARCHLIB_PATH"],
++  ["$RUBY_LIB_PREFIX/"*], [
++    RUBY_VENDOR_ARCHLIB_PATH='RUBY_LIB_PREFIX"/'"`expr \"$RUBY_VENDOR_ARCHLIB_PATH\" : \"$pat\"`"'"'
++    ],
++  [
++    RUBY_VENDOR_ARCHLIB_PATH="\"${RUBY_VENDOR_ARCHLIB_PATH}\""
++    ])
+ pat=`echo "$RUBY_EXEC_PREFIX/" | tr -c '\012' .`'\(.*\)'
+ AS_CASE(["$RUBY_LIB_PREFIX"],
+   ["$RUBY_EXEC_PREFIX/"*], [
+@@ -2878,19 +2914,23 @@ if test "x$SITE_DIR" = xno; then
+     AC_DEFINE(NO_RUBY_SITE_LIB)
+ else
+     AC_DEFINE_UNQUOTED(RUBY_SITE_LIB, ${RUBY_SITE_LIB_PATH})
++    AC_DEFINE_UNQUOTED(RUBY_SITE_ARCHLIB, ${RUBY_SITE_ARCHLIB_PATH})
+ fi
+ if test "x$VENDOR_DIR" = xno; then
+     AC_DEFINE(NO_RUBY_VENDOR_LIB)
+ else
+     AC_DEFINE_UNQUOTED(RUBY_VENDOR_LIB, ${RUBY_VENDOR_LIB_PATH})
++    AC_DEFINE_UNQUOTED(RUBY_VENDOR_ARCHLIB, ${RUBY_VENDOR_ARCHLIB_PATH})
+ fi
+ 
+ AC_SUBST(arch)dnl
+ AC_SUBST(sitearch)dnl
+ AC_SUBST(ruby_version)dnl
+ AC_SUBST(archdir)dnl
+ AC_SUBST(sitedir)dnl
++AC_SUBST(sitearchdir)dnl
+ AC_SUBST(vendordir)dnl
++AC_SUBST(vendorarchdir)dnl
+ 
+ configure_args=$ac_configure_args
+ AC_SUBST(configure_args)dnl
+diff --git a/tool/mkconfig.rb b/tool/mkconfig.rb
+index b707c4b..6230720 100755
+--- a/tool/mkconfig.rb
++++ b/tool/mkconfig.rb
+@@ -44,6 +44,8 @@ v_others = []
+ continued_line = nil
+ path_version = "/$(ruby_version)"
+ archdir_override = "$(vendorlibdir)/$(sitearch)"
++sitearchdir_override = "$(sitelibdir)/$(sitearch)"
++vendorarchdir_override = "$(vendorlibdir)/$(sitearch)"
+ File.foreach "config.status" do |line|
+   next if /^#/ =~ line
+   name = nil
+@@ -79,6 +81,8 @@ File.foreach "config.status" do |line|
+     when /^RUBY_SO_NAME$/; next if $so_name
+     when /^arch$/; if val.empty? then val = arch else arch = val end
+     when /^archdir$/; archdir_override = val; next
++    when /^sitearchdir$/; sitearchdir_override = val; next
++    when /^vendorarchdir$/; vendorarchdir_override = val; next
+     when /^sitearch/; val = '$(arch)' if val.empty?
+     end
+     case val
+@@ -213,11 +217,11 @@ print <<EOS
+ EOS
+ print <<EOS unless v_disabled["sitedir"]
+   CONFIG["sitelibdir"] = "$(sitedir)#{path_version}"
+-  CONFIG["sitearchdir"] = "$(sitelibdir)/$(sitearch)"
++  CONFIG["sitearchdir"] = "#{sitearchdir_override}"
+ EOS
+ print <<EOS unless v_disabled["vendordir"]
+   CONFIG["vendorlibdir"] = "$(vendordir)#{path_version}"
+-  CONFIG["vendorarchdir"] = "$(vendorlibdir)/$(sitearch)"
++  CONFIG["vendorarchdir"] = "#{vendorarchdir_override}"
+ EOS
+ print <<EOS
+   CONFIG["topdir"] = File.dirname(__FILE__)
+diff --git a/version.c b/version.c
+index 59d4e5e..2558aa0 100644
+--- a/version.c
++++ b/version.c
+@@ -50,8 +50,12 @@
+ #ifndef RUBY_ARCHLIB
+ #define RUBY_ARCHLIB                RUBY_LIB         "/"RUBY_ARCH
+ #endif
++#ifndef RUBY_SITE_ARCHLIB
+ #define RUBY_SITE_ARCHLIB           RUBY_SITE_LIB2   "/"RUBY_SITEARCH
++#endif
++#ifndef RUBY_VENDOR_ARCHLIB
+ #define RUBY_VENDOR_ARCHLIB         RUBY_VENDOR_LIB2 "/"RUBY_SITEARCH
++#endif
+ #ifdef  RUBY_THINARCH
+ #define RUBY_THIN_ARCHLIB           RUBY_LIB         "/"RUBY_THINARCH
+ #define RUBY_SITE_THIN_ARCHLIB      RUBY_SITE_LIB2   "/"RUBY_THINARCH
+-- 
+1.7.6.1
+
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ruby.git/commitdiff/bdde33096bd424e9b237a9e6931c61f0fedde65f



More information about the pld-cvs-commit mailing list