--- /dev/null
+From 28e8a4ad0146fef37b514bde9a27ba5b6f7c34c5 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
+Date: Tue, 2 Jul 2013 11:51:50 +0200
+Subject: [PATCH] Revert "mkmf.rb: prefix install_dirs only with DESTDIR"
+
+Fixes issues with DESTDIR.
+https://bugs.ruby-lang.org/issues/8115
+
+This reverts commit 7e1d5045943835ff906850e7b3bc71f985ae5f36.
+---
+ lib/mkmf.rb | 29 ++++++++++++++---------------
+ 1 file changed, 14 insertions(+), 15 deletions(-)
+
+diff --git a/lib/mkmf.rb b/lib/mkmf.rb
+index ee89198..cca487e 100644
+--- a/lib/mkmf.rb
++++ b/lib/mkmf.rb
+@@ -189,21 +189,21 @@ module MakeMakefile
+ ]
+ elsif $configure_args.has_key?('--vendor')
+ dirs = [
+- ['BINDIR', '$(DESTDIR)$(bindir)'],
+- ['RUBYCOMMONDIR', '$(DESTDIR)$(vendordir)$(target_prefix)'],
+- ['RUBYLIBDIR', '$(DESTDIR)$(vendorlibdir)$(target_prefix)'],
+- ['RUBYARCHDIR', '$(DESTDIR)$(vendorarchdir)$(target_prefix)'],
+- ['HDRDIR', '$(DESTDIR)$(rubyhdrdir)/ruby$(target_prefix)'],
+- ['ARCHHDRDIR', '$(DESTDIR)$(rubyhdrdir)/$(arch)/ruby$(target_prefix)'],
++ ['BINDIR', '$(bindir)'],
++ ['RUBYCOMMONDIR', '$(vendordir)$(target_prefix)'],
++ ['RUBYLIBDIR', '$(vendorlibdir)$(target_prefix)'],
++ ['RUBYARCHDIR', '$(vendorarchdir)$(target_prefix)'],
++ ['HDRDIR', '$(rubyhdrdir)/ruby$(target_prefix)'],
++ ['ARCHHDRDIR', '$(rubyhdrdir)/$(arch)/ruby$(target_prefix)'],
+ ]
+ else
+ dirs = [
+- ['BINDIR', '$(DESTDIR)$(bindir)'],
+- ['RUBYCOMMONDIR', '$(DESTDIR)$(sitedir)$(target_prefix)'],
+- ['RUBYLIBDIR', '$(DESTDIR)$(sitelibdir)$(target_prefix)'],
+- ['RUBYARCHDIR', '$(DESTDIR)$(sitearchdir)$(target_prefix)'],
+- ['HDRDIR', '$(DESTDIR)$(rubyhdrdir)/ruby$(target_prefix)'],
+- ['ARCHHDRDIR', '$(DESTDIR)$(rubyhdrdir)/$(arch)/ruby$(target_prefix)'],
++ ['BINDIR', '$(bindir)'],
++ ['RUBYCOMMONDIR', '$(sitedir)$(target_prefix)'],
++ ['RUBYLIBDIR', '$(sitelibdir)$(target_prefix)'],
++ ['RUBYARCHDIR', '$(sitearchdir)$(target_prefix)'],
++ ['HDRDIR', '$(rubyhdrdir)/ruby$(target_prefix)'],
++ ['ARCHHDRDIR', '$(rubyhdrdir)/$(arch)/ruby$(target_prefix)'],
+ ]
+ end
+ dirs << ['target_prefix', (target_prefix ? "/#{target_prefix}" : "")]
+@@ -1728,7 +1728,6 @@ SRC
+ end
+
+ def with_destdir(dir)
+- return dir unless $extmk
+ dir = dir.sub($dest_prefix_pattern, '')
+ /\A\$[\(\{]/ =~ dir ? dir : "$(DESTDIR)"+dir
+ end
+@@ -1787,8 +1786,8 @@ ECHO = $(ECHO1:0=@echo)
+ #### Start of system configuration section. ####
+ #{"top_srcdir = " + $top_srcdir.sub(%r"\A#{Regexp.quote($topdir)}/", "$(topdir)/") if $extmk}
+ srcdir = #{srcdir.gsub(/\$\((srcdir)\)|\$\{(srcdir)\}/) {mkintpath(CONFIG[$1||$2]).unspace}}
+-topdir = #{mkintpath(topdir = $extmk ? CONFIG["topdir"] : $topdir).unspace}
+-hdrdir = #{(hdrdir = CONFIG["hdrdir"]) == topdir ? "$(topdir)" : mkintpath(hdrdir).unspace}
++topdir = #{mkintpath($extmk ? CONFIG["topdir"] : $topdir).unspace}
++hdrdir = #{mkintpath(CONFIG["hdrdir"]).unspace}
+ arch_hdrdir = #{$arch_hdrdir.quote}
+ PATH_SEPARATOR = #{CONFIG['PATH_SEPARATOR']}
+ VPATH = #{vpath.join(CONFIG['PATH_SEPARATOR'])}
+--
+1.8.2.1
+
--- /dev/null
+From b5e9dc3683cb085aa57e7b12c35a4f21b2cc1482 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
+Date: Fri, 11 Nov 2011 13:14:45 +0100
+Subject: [PATCH] Allow to install RubyGems into custom location, outside of
+ Ruby tree.
+
+---
+ configure.in | 8 ++++++++
+ tool/rbinstall.rb | 9 +++++++++
+ version.c | 4 ++++
+ 3 files changed, 21 insertions(+)
+
+diff --git a/configure.in b/configure.in
+index 1627d12..e064b2b 100644
+--- a/configure.in
++++ b/configure.in
+@@ -3349,6 +3349,13 @@ AC_ARG_WITH(vendorarchdir,
+ [vendorarchdir=$withval],
+ [vendorarchdir=${multiarch+'${rubysitearchprefix}/vendor_ruby/${ruby_version}'}${multiarch-'${vendorlibdir}/${sitearch}'}])
+
++AC_ARG_WITH(rubygemsdir,
++ AS_HELP_STRING([--with-rubygemsdir=DIR], [custom rubygems directory]),
++ [rubygemsdir=$withval])
++if test "$rubygemsdir" != ""; then
++ AC_DEFINE_UNQUOTED(RUBYGEMS_DIR,"$rubygemsdir" !<verconf>!)
++fi
++
+ unexpand_shvar rubylibprefix exec_prefix libdir RUBY_BASE_NAME
+ unexpand_shvar rubyarchprefix exec_prefix libdir arch RUBY_BASE_NAME archlibdir rubylibprefix
+ unexpand_shvar rubysitearchprefix exec_prefix libdir sitearch arch RUBY_BASE_NAME archlibdir sitearchlibdir rubylibprefix
+@@ -3415,6 +3422,7 @@ AC_SUBST(sitearchdir)dnl
+ AC_SUBST(vendordir)dnl
+ AC_SUBST(vendorlibdir)dnl
+ AC_SUBST(vendorarchdir)dnl
++AC_SUBST(rubygemsdir)dnl
+
+ configure_args=$ac_configure_args
+ AC_SUBST(configure_args)dnl
+diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb
+index 92e54c6..c72dfb6 100755
+--- a/tool/rbinstall.rb
++++ b/tool/rbinstall.rb
+@@ -313,6 +313,7 @@ sitelibdir = CONFIG["sitelibdir"]
+ sitearchlibdir = CONFIG["sitearchdir"]
+ vendorlibdir = CONFIG["vendorlibdir"]
+ vendorarchlibdir = CONFIG["vendorarchdir"]
++rubygemsdir = CONFIG["rubygemsdir"]
+ mandir = CONFIG["mandir", true]
+ docdir = CONFIG["docdir", true]
+ configure_args = Shellwords.shellwords(CONFIG["configure_args"])
+@@ -500,7 +501,15 @@ end
+ install?(:local, :comm, :lib) do
+ prepare "library scripts", rubylibdir
+ noinst = %w[README* *.txt *.rdoc *.gemspec]
++ noinst += %w[*ubygems.rb rubygems/ datadir.rb] if rubygemsdir
+ install_recursive(File.join(srcdir, "lib"), rubylibdir, :no_install => noinst, :mode => $data_mode)
++ if rubygemsdir
++ noinst = %w[obsolete.rb]
++ install_recursive(File.join(srcdir, "lib", "rubygems"), File.join(rubygemsdir, "rubygems"), :mode => $data_mode)
++ install_recursive(File.join(srcdir, "lib", "rbconfig"), File.join(rubygemsdir, "rbconfig"), :no_install => noinst, :mode => $data_mode)
++ install(File.join(srcdir, "lib", "ubygems.rb"), File.join(rubygemsdir, "ubygems.rb"), :mode => $data_mode)
++ install(File.join(srcdir, "lib", "rubygems.rb"), File.join(rubygemsdir, "rubygems.rb"), :mode => $data_mode)
++ end
+ end
+
+ install?(:local, :arch, :lib) do
+diff --git a/version.c b/version.c
+index 54c4513..d76100b 100644
+--- a/version.c
++++ b/version.c
+@@ -99,6 +99,10 @@ const char ruby_initial_load_paths[] =
+ #endif
+ #endif
+
++#ifdef RUBYGEMS_DIR
++ RUBYGEMS_DIR "\0"
++#endif
++
+ RUBY_LIB "\0"
+ #ifdef RUBY_THINARCH
+ RUBY_ARCH_LIB_FOR(RUBY_THINARCH) "\0"
+--
+1.8.1.2
+
--- /dev/null
+From e943a89efd63dcfb80a0ab8d9a4db37f523f508e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
+Date: Fri, 8 Feb 2013 22:48:41 +0100
+Subject: [PATCH] Prevent duplicated paths when empty version string is
+ configured.
+
+---
+ configure.in | 3 +++
+ version.c | 10 ++++++++++
+ 2 files changed, 13 insertions(+)
+
+diff --git a/configure.in b/configure.in
+index 5850bbf..7604bb8 100644
+--- a/configure.in
++++ b/configure.in
+@@ -3367,6 +3367,9 @@ unexpand_shvar exec_prefix prefix
+ if test ${RUBY_LIB_VERSION_STYLE+set}; then
+ AC_DEFINE_UNQUOTED(RUBY_LIB_VERSION_STYLE, $RUBY_LIB_VERSION_STYLE !<verconf>!)
+ else
++ if test "x${ruby_version}" = 'x'; then
++ AC_DEFINE(RUBY_LIB_VERSION_BLANK, 1)
++ fi
+ AC_DEFINE_UNQUOTED(RUBY_LIB_VERSION, [$RUBY_LIB_VERSION] !<verconf>!)
+ fi
+ AC_DEFINE_UNQUOTED(RUBY_EXEC_PREFIX, ${RUBY_EXEC_PREFIX})
+diff --git a/version.c b/version.c
+index 282960d..54c4513 100644
+--- a/version.c
++++ b/version.c
+@@ -39,9 +39,15 @@
+ #define RUBY_VENDOR_LIB RUBY_LIB_PREFIX"/vendor_ruby"
+ #endif
+
++#ifdef RUBY_LIB_VERSION_BLANK
++#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
+ #ifndef RUBY_ARCH_LIB_FOR
+ #define RUBY_ARCH_LIB_FOR(arch) RUBY_LIB "/"arch
+ #endif
+@@ -77,8 +83,10 @@ const char ruby_initial_load_paths[] =
+ RUBY_SITE_ARCH_LIB_FOR(RUBY_THINARCH) "\0"
+ #endif
+ RUBY_SITE_ARCH_LIB_FOR(RUBY_SITEARCH) "\0"
++#ifndef RUBY_LIB_VERSION_BLANK
+ RUBY_SITE_LIB "\0"
+ #endif
++#endif
+
+ #ifndef NO_RUBY_VENDOR_LIB
+ RUBY_VENDOR_LIB2 "\0"
+@@ -86,8 +94,10 @@ const char ruby_initial_load_paths[] =
+ RUBY_VENDOR_ARCH_LIB_FOR(RUBY_THINARCH) "\0"
+ #endif
+ RUBY_VENDOR_ARCH_LIB_FOR(RUBY_SITEARCH) "\0"
++#ifndef RUBY_LIB_VERSION_BLANK
+ RUBY_VENDOR_LIB "\0"
+ #endif
++#endif
+
+ RUBY_LIB "\0"
+ #ifdef RUBY_THINARCH
+--
+1.8.1.2
+
--- /dev/null
+From c9b2eff36728266052ccfff54d3ac0a0624fd0f1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
+Date: Thu, 14 Feb 2013 11:50:41 +0100
+Subject: [PATCH] Use File.join insteado of manual path creation.
+
+This prevents issues, when File.join in #new_default_spec removes
+superfluous slashes while they are kept in expected paths. E.g. the test
+would fail if ruby configuration specifies --with-ruby-version=''.
+---
+ test/rubygems/test_gem_commands_contents_command.rb | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/test/rubygems/test_gem_commands_contents_command.rb b/test/rubygems/test_gem_commands_contents_command.rb
+index 60df53f..35c9631 100644
+--- a/test/rubygems/test_gem_commands_contents_command.rb
++++ b/test/rubygems/test_gem_commands_contents_command.rb
+@@ -140,10 +140,10 @@ lib/foo.rb
+ @cmd.execute
+ end
+
+- expected = %W[
+- #{Gem::ConfigMap[:bindir]}/default_command
+- #{Gem::ConfigMap[:rubylibdir]}/default/gem.rb
+- #{Gem::ConfigMap[:archdir]}/default_gem.so
++ expected = [
++ File.join(Gem::ConfigMap[:bindir], 'default_command'),
++ File.join(Gem::ConfigMap[:rubylibdir], 'default/gem.rb'),
++ File.join(Gem::ConfigMap[:archdir], 'default_gem.so')
+ ].sort.join "\n"
+
+ assert_equal expected, @ui.output.chomp
+--
+1.8.1.2
+
-diff -ur ruby-1.9.2-p0-o//configure.in ruby-1.9.2-p0/configure.in
---- ruby-1.9.2-p0-o//configure.in 2010-08-14 02:11:59.000000000 -0600
-+++ ruby-1.9.2-p0/configure.in 2010-09-16 17:16:23.000000000 -0600
-@@ -2222,7 +2222,7 @@
- RUBY_APPEND_OPTION(CFLAGS, -pipe)
- ],
- [human*], [
-- AC_LIBOBJ([x68.o])
-+ AC_LIBOBJ([x68])
- CFLAGS="$CFLAGS -fansi-only"
- XCFLAGS="$XCFLAGS -cc1-stack=262144 -cpp-stack=2694144"
- EXEEXT=.x
-Only in ruby-1.9.2-p0: configure.in.orig
-Only in ruby-1.9.2-p0: configure.in.rej
-Only in ruby-1.9.2-p0: configure.in.rej~
-Only in ruby-1.9.2-p0: configure.in~
-diff -ur ruby-1.9.2-p0-o//ext/tk/extconf.rb ruby-1.9.2-p0/ext/tk/extconf.rb
--- ruby-1.9.2-p0-o//ext/tk/extconf.rb 2010-08-08 09:01:15.000000000 -0600
+++ ruby-1.9.2-p0/ext/tk/extconf.rb 2010-09-16 17:17:25.000000000 -0600
@@ -1188,7 +1188,7 @@
paths = []
opt_paths.compact.each{|path| paths.concat(Dir.glob(path.strip.chomp('/'), File::FNM_CASEFOLD))}
defaults.compact.each{|path| paths.concat(Dir.glob(path.strip.chomp('/'), File::FNM_CASEFOLD))}
-Only in ruby-1.9.2-p0/ext/tk: extconf.rb.orig
-Only in ruby-1.9.2-p0/ext/tk: extconf.rb.rej
-Only in ruby-1.9.2-p0/ext/tk: extconf.rb.rej~
-Only in ruby-1.9.2-p0/ext/tk: extconf.rb~
# - replace ri with fastri
# - patch ri to search multiple indexes (one per package), so RPMs can install ri docs
# - fix inconsistencies with versioned vs not-versioned dirs (see dirname hacks in configure)
-# - custom-rubygems-location.patch
#
# Conditional build:
%bcond_without doc # skip (time-consuming) docs generating; intended for speed up test builds
%bcond_without default_ruby # use this Ruby as default system Ruby
%bcond_with bootstrap # build bootstrap version
-%define rel 1
-%define ruby_version 1.9
-%define basever 1.9.3
-%define patchlevel 545
+%define rel 0.2
+%define ruby_version 2.0
+%define basever 2.0.0
+%define patchlevel 353
%define ruby_suffix %{!?with_default_ruby:%{ruby_version}}
%define doc_version 1_9_3
-%define json_ver 1.5.5
-%define rake_ver 0.9.2.2
-%define rubygems_ver 1.8.23.2
-%define minitest_ver 2.5.1
-# when increasing rdoc_ver, please remove "11." prefix in rdoc package release
-%define rdoc_ver 3.9.5
+
+%define bigdecimal_ver 1.2.0
+%define io_console_ver 0.4.2
%define irb_ver 0.9.6
-%define bigdecimal_ver 1.1.0
-%define io_console_ver 0.3
+%define json_ver 1.7.7
+%define minitest_ver 4.3.2
+%define psych_ver 2.0.0
+%define rake_ver 0.9.6
+%define rdoc_ver 4.0.0
+%define rubygems_ver 2.0.14
+%define test_unit_ver 2.0.0.0
+
%define oname ruby
Summary: Ruby - interpreted scripting language
Summary(ja.UTF-8): オブジェクト指向言語Rubyインタプリタ
# Public Domain for example for: include/ruby/st.h, strftime.c, ...
License: (Ruby or BSD) and Public Domain
Group: Development/Languages
-Source0: ftp://ftp.ruby-lang.org/pub/ruby/1.9/%{oname}-%{basever}-p%{patchlevel}.tar.bz2
-# Source0-md5: 4743c1dc48491070bae8fc8b423bc1a7
+Source0: ftp://ftp.ruby-lang.org/pub/ruby/2.0/%{oname}-%{basever}-p%{patchlevel}.tar.bz2
+# Source0-md5: 20eb8f067d20f6b76b7e16cce2a85a55
Source1: http://www.ruby-doc.org/download/%{oname}-doc-bundle.tar.gz
# Source1-md5: ad1af0043be98ba1a4f6d0185df63876
Source2: http://www.ruby-doc.org/downloads/%{oname}_%{doc_version}_stdlib_rdocs.tgz
Patch1: %{oname}-ffs.patch
Patch2: fix-bison-invocation.patch
# http://redmine.ruby-lang.org/issues/5231
-Patch3: disable-versioned-paths.patch
+#Patch3: disable-versioned-paths.patch
# TODO: Should be submitted upstream?
-Patch4: arch-specific-dir.patch
+#Patch4: arch-specific-dir.patch
# http://redmine.ruby-lang.org/issues/5281
-Patch5: site-and-vendor-arch-flags.patch
+#Patch5: site-and-vendor-arch-flags.patch
# Make mkmf verbose by default
Patch6: mkmf-verbose.patch
Patch7: strip-ccache.patch
+Patch8: duplicated-paths.patch
+Patch9: DESTDIR.patch
+Patch10: empty-ruby-version.patch
+Patch11: rubygems-2.0.0-binary-extensions.patch
+Patch12: custom-rubygems-location.patch
URL: http://www.ruby-lang.org/
BuildRequires: autoconf >= 2.60
BuildRequires: automake
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define ruby_ridir %{_datadir}/ri/%{ruby_version}/system
-%define gem_dir %{_datadir}/%{oname}/gems/%{ruby_version}
+#%define gem_dir %{_datadir}/gems
+#%define gem_dir %{_datadir}/%{oname}/gems/%{ruby_version}
+%define gem_dir %{_datadir}/%{oname}/%{ruby_version}/gems
# location where rubygems is installed
%define rubygems_dir %{ruby_libdir}
%define ruby_archdir %{_libdir}/%{oname}/%{ruby_version}
+%define ruby_libarchdir %{_libdir}/%{oname}/%{ruby_version}
%define ruby_libdir %{_datadir}/%{oname}/%{ruby_version}
# This is the local lib/arch and should not be used for packaging.
Provides: ruby-minitest = %{minitest_ver}
Obsoletes: ruby-minitest <= 1.5.0
%endif
+# FIXME later
+Provides: ruby(abi) = %{ruby_version}
%description modules
Ruby standard modules and utilities:
Summary: A tool to generate HTML and command-line documentation for Ruby projects
Summary(pl.UTF-8): Narzędzie do generowania dokumentacji HTML i linii poleceń dla projektów w Rubym
Version: %{rdoc_ver}
-# remove "11." when rdoc_ver is increased
-Release: 11.%{basever}.%{patchlevel}.%{rel}
+Release: %{basever}.%{patchlevel}.%{rel}
Epoch: 0
License: GPL v2 and Ruby and MIT
Group: Development/Libraries
%patch0 -p1
%patch1 -p1
%patch2 -p1
-%patch3 -p1
-%patch4 -p1
-%patch5 -p1
+#%patch3 -p1
+#%patch4 -p1
+#%patch5 -p1
%patch6 -p1
%patch7 -p1
+%patch8 -p1
+%patch9 -p1
+%patch10 -p1
+%patch11 -p1
+%patch12 -p1
# must be regenerated with new bison
%{__rm} parse.{c,h}
%configure \
%{?with_bootstrap:--with-baseruby=%{oname}-1.8.7-p330/miniruby} \
--program-suffix=%{ruby_suffix} \
- --with-rubylibprefix=%(dirname %{ruby_libdir}) \
- --with-archdir=%{ruby_archdir} \
- --with-sitedir=%(dirname %{ruby_sitelibdir}) \
+ --with-rubygemsdir=%{rubygems_dir} \
+ --with-rubylibprefix=%{ruby_libdir} \
+ --with-rubyarchprefix=%{ruby_archdir} \
+ --with-sitedir=%{ruby_sitelibdir} \
--with-sitearchdir=%{ruby_sitearchdir} \
- --with-vendordir=%(dirname %{ruby_vendorlibdir}) \
+ --with-vendordir=%{ruby_vendorlibdir} \
--with-vendorarchdir=%{ruby_vendorarchdir} \
- --with-search-path="%{legacy_loadpaths}" \
+ --with-rubyhdrdir=%{_includedir}/%{oname}-%{ruby_version} \
+ --with-rubyarchhdrdir=%{_includedir}/%{oname}-%{ruby_version} \
+ --with-sitearchhdrdir='$(sitehdrdir)/$(arch)' \
+ --with-vendorarchhdrdir='$(vendorhdrdir)/$(arch)' \
--enable-shared \
--enable-pthread \
+ --enable-multiarch \
--disable-rubygems \
--disable-install-doc \
- --with-ruby-version=minor
+ --with-ruby-version=''
%{__make} -j1 main \
COPY="cp -p" Q= \
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{%{ruby_rdocdir},%{ruby_ridir}} \
- $RPM_BUILD_ROOT{%{ruby_vendorarchdir} \
+ $RPM_BUILD_ROOT%{ruby_vendorarchdir}
$RPM_BUILD_ROOT%{ruby_vendorlibdir}/net \
$RPM_BUILD_ROOT%{ruby_vendordir}/data \
- $RPM_BUILD_ROOT{%{legacy_archdir}/racc,%{legacy_sitelibdir},%{legacy_sitearchdir},%{legacy_vendorarchdir},%{legacy_libdir}/tasks} \
%{__make} install %{?with_doc:install-doc} \
DESTDIR=$RPM_BUILD_ROOT
%{__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} $RPM_BUILD_ROOT%{gem_dir}/specifications/{json,minitest,rake}-*.gemspec
+%{__rm} $RPM_BUILD_ROOT%{gem_dir}/specifications/default/{json,minitest,rake}-*.gemspec
%{?with_doc:%{__rm} -r $RPM_BUILD_ROOT%{_datadir}/ri/%{ruby_version}/system/JSON}
%endif
%if %{with doc}
# too much .ri
-%{__rm} $RPM_BUILD_ROOT%{ruby_ridir}/cache.ri
-%{__rm} $RPM_BUILD_ROOT%{ruby_ridir}/created.rid
+#%{__rm} $RPM_BUILD_ROOT%{ruby_ridir}/cache.ri
+#%{__rm} $RPM_BUILD_ROOT%{ruby_ridir}/created.rid
%endif
%clean
%files
%defattr(644,root,root,755)
-%doc NEWS LEGAL README README.EXT ChangeLog ToDo
+%doc NEWS LEGAL README README.EXT ChangeLog
%attr(755,root,root) %{_bindir}/ruby%{ruby_suffix}
%attr(755,root,root) %{_libdir}/libruby.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/libruby.so.%{ruby_version}
%dir %{ruby_libdir}
%dir %{ruby_archdir}
%dir %{ruby_vendordir}
-%dir %{ruby_vendordir}/data
+#%dir %{ruby_vendordir}/data
%dir %{ruby_vendorlibdir}
%dir %{ruby_vendorarchdir}
%dir %{_datadir}/ri/%{ruby_version}
%dir %{ruby_ridir}
-%dir %{ruby_rdocdir}
+#%dir %{ruby_rdocdir}
# common dirs for ruby vendor modules
-%dir %{ruby_vendorlibdir}/net
+#%dir %{ruby_vendorlibdir}/net
+%if 0
# legacy dirs. when everything rebuilt in Th not using these dirs. drop them
%dir %{legacy_archdir}
%dir %{legacy_sitedir}
%dir %{legacy_vendorarchdir}
%dir %{legacy_libdir}/tasks
%dir %{legacy_archdir}/racc
+%endif
%files devel
%defattr(644,root,root,755)
%dir %{gem_dir}/gems/rdoc-%{rdoc_ver}
%dir %{gem_dir}/gems/rdoc-%{rdoc_ver}/bin
%attr(755,root,root) %{gem_dir}/gems/rdoc-%{rdoc_ver}/bin/rdoc
-%{gem_dir}/specifications/rdoc-%{rdoc_ver}.gemspec
+%{gem_dir}/specifications/default/rdoc-%{rdoc_ver}.gemspec
%attr(755,root,root) %{gem_dir}/gems/rdoc-%{rdoc_ver}/bin/ri
%if %{with batteries}
%files rubygems
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/gem%{ruby_suffix}
+%dir %{rubygems_dir}
%{rubygems_dir}/rubygems
%{rubygems_dir}/rubygems.rb
%{rubygems_dir}/ubygems.rb
+%{rubygems_dir}/rbconfig
%files rake
%defattr(644,root,root,755)
%dir %{gem_dir}/gems/rake-%{rake_ver}
%dir %{gem_dir}/gems/rake-%{rake_ver}/bin
%attr(755,root,root) %{gem_dir}/gems/rake-%{rake_ver}/bin/rake
-%{gem_dir}/specifications/rake-%{rake_ver}.gemspec
+%{gem_dir}/specifications/default/rake-%{rake_ver}.gemspec
%files json
%defattr(644,root,root,755)
%dir %{ruby_archdir}/json
%dir %{ruby_archdir}/json/ext
%attr(755,root,root) %{ruby_archdir}/json/ext/*.so
-%{gem_dir}/specifications/json-%{json_ver}.gemspec
+%{gem_dir}/specifications/default/json-%{json_ver}.gemspec
%endif
%files modules
%{ruby_libdir}/ripper
%{ruby_libdir}/rss
%{ruby_libdir}/shell
-%{ruby_libdir}/syck
+#%{ruby_libdir}/syck
+%{ruby_libdir}/syslog
%{ruby_libdir}/test
%{ruby_libdir}/uri
%{ruby_libdir}/webrick
%{ruby_libdir}/tsort.rb
%{ruby_libdir}/[u-z]*.rb
%if %{with batteries}
-%exclude %{ruby_libdir}/rubygems.rb
-%exclude %{ruby_libdir}/ubygems.rb
+#%exclude %{ruby_libdir}/rubygems.rb
+#%exclude %{ruby_libdir}/ubygems.rb
%endif
%exclude %{ruby_libdir}/irb.rb
%exclude %{ruby_libdir}/mkmf.rb
%attr(755,root,root) %{ruby_archdir}/racc/*.so
%{ruby_archdir}/rbconfig.rb
-%{gem_dir}/specifications/bigdecimal-%{bigdecimal_ver}.gemspec
-%{gem_dir}/specifications/io-console-%{io_console_ver}.gemspec
+%{gem_dir}/specifications/default/bigdecimal-%{bigdecimal_ver}.gemspec
+%{gem_dir}/specifications/default/io-console-%{io_console_ver}.gemspec
%if %{with batteries}
# minitest
%{ruby_libdir}/minitest
-%{gem_dir}/specifications/minitest-%{minitest_ver}.gemspec
+%{gem_dir}/specifications/default/minitest-%{minitest_ver}.gemspec
%endif
+%{gem_dir}/specifications/default/psych-%{psych_ver}.gemspec
+
+# test-unit
+%{gem_dir}/specifications/default/test-unit-%{test_unit_ver}.gemspec
+%dir %{gem_dir}/gems/test-unit-%{test_unit_ver}
+%dir %{gem_dir}/gems/test-unit-%{test_unit_ver}/bin
+%attr(755,root,root) %{gem_dir}/gems/test-unit-%{test_unit_ver}/bin/testrb
+
# parents of gem_dir
-%dir %{_datadir}/%{oname}/gems
+#%dir %{_datadir}/%{oname}/gems
#%dir %{_datadir}/%{oname}/gems/%{ruby_version}
-%dir %{_datadir}/%{oname}/gems/%{ruby_version}/gems
+#%dir %{_datadir}/%{oname}/gems/%{ruby_version}/gems
+
+%dir %{_datadir}/%{oname}/%{ruby_version}/gems/gems
%dir %{gem_dir}
%dir %{gem_dir}/specifications
+%dir %{gem_dir}/specifications/default
%{_mandir}/man1/erb%{ruby_suffix}.1*
%{_mandir}/man1/ri%{ruby_suffix}.1*
%{_mandir}/man1/testrb%{ruby_suffix}.1*
--- /dev/null
+From ec90622235ae19b28a327cb50a10e0311e8f3d71 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
+Date: Thu, 3 Nov 2011 16:43:05 +0100
+Subject: [PATCH 1/8] Add dedicate extensions folder into $LOAD_PATH.
+
+---
+ lib/rubygems/specification.rb | 32 ++++++++++++++++++++++++++++++--
+ 1 file changed, 30 insertions(+), 2 deletions(-)
+
+diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb
+index cabdf8d..87b14d2 100644
+--- a/lib/rubygems/specification.rb
++++ b/lib/rubygems/specification.rb
+@@ -1256,6 +1256,12 @@ class Gem::Specification
+ File.join full_gem_path, path
+ end
+
++ unless extensions.empty?
++ paths += require_paths.map do |path|
++ File.join ext_dir, path
++ end
++ end
++
+ # gem directories must come after -I and ENV['RUBYLIB']
+ insert_index = Gem.load_path_insert_index
+
+@@ -1374,11 +1380,16 @@ class Gem::Specification
+
+ def contains_requirable_file? file
+ root = full_gem_path
++ ext = ext_dir
+ suffixes = Gem.suffixes
+
+ require_paths.any? do |lib|
+- base = "#{root}/#{lib}/#{file}"
+- suffixes.any? { |suf| File.file? "#{base}#{suf}" }
++ base = ["#{root}/#{lib}/#{file}"]
++ base << "#{ext}/#{lib}/#{file}" unless extensions.empty?
++
++ base.any? do |path|
++ suffixes.any? { |suf| File.file? "#{path}#{suf}" }
++ end
+ end
+ end
+
+@@ -1674,6 +1685,23 @@ class Gem::Specification
+ end
+
+ ##
++ # Returns the full path to this spec's ext directory.
++ # eg: /usr/local/lib/ruby/1.8/exts/mygem-1.0
++
++ def ext_dir
++ @gem_dir ||= File.expand_path File.join(exts_dir, full_name)
++ end
++
++ ##
++ # Returns the full path to the exts directory containing this spec's
++ # gem directory. eg: /usr/local/lib/ruby/1.8/exts
++
++ def exts_dir
++ # TODO: this logic seems terribly broken, but tests fail if just base_dir
++ @exts_dir ||= File.join(loaded_from && base_dir || Gem.dir, "exts")
++ end
++
++ ##
+ # Deprecated and ignored, defaults to true.
+ #
+ # Formerly used to indicate this gem was RDoc-capable.
+--
+1.8.1.2
+
+
+From e42819f32fc5d935f7e7189ec4be8bdab0a2cf3f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
+Date: Wed, 16 Nov 2011 13:26:48 +0100
+Subject: [PATCH 2/8] Use spec's ext dir for extension installation.
+
+---
+ lib/rubygems/installer.rb | 2 +-
+ lib/rubygems/specification.rb | 7 +++----
+ 2 files changed, 4 insertions(+), 5 deletions(-)
+
+diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb
+index 780a88b..854c177 100644
+--- a/lib/rubygems/installer.rb
++++ b/lib/rubygems/installer.rb
+@@ -646,7 +646,7 @@ TEXT
+ say "This could take a while..."
+ end
+
+- dest_path = File.join gem_dir, spec.require_paths.first
++ dest_path = spec.ext_dir
+ ran_rake = false # only run rake once
+
+ spec.extensions.each do |extension|
+diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb
+index 87b14d2..492ddbe 100644
+--- a/lib/rubygems/specification.rb
++++ b/lib/rubygems/specification.rb
+@@ -1689,16 +1689,15 @@ class Gem::Specification
+ # eg: /usr/local/lib/ruby/1.8/exts/mygem-1.0
+
+ def ext_dir
+- @gem_dir ||= File.expand_path File.join(exts_dir, full_name)
++ @ext_dir ||= File.join exts_dir, full_name, require_paths.first
+ end
+
+ ##
+ # Returns the full path to the exts directory containing this spec's
+- # gem directory. eg: /usr/local/lib/ruby/1.8/exts
++ # gem directory. eg: /usr/local/lib/ruby/1.8/gems
+
+ def exts_dir
+- # TODO: this logic seems terribly broken, but tests fail if just base_dir
+- @exts_dir ||= File.join(loaded_from && base_dir || Gem.dir, "exts")
++ @exts_dir ||= gems_dir
+ end
+
+ ##
+--
+1.8.1.2
+
+
+From 0e9dd0655111f7dda805233c79a3771459d9a66a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
+Date: Wed, 16 Nov 2011 14:52:16 +0100
+Subject: [PATCH 3/9] Simplify the extending of $LOAD_PATH for binary gems.
+
+---
+ lib/rubygems/specification.rb | 11 +++++------
+ 1 file changed, 5 insertions(+), 6 deletions(-)
+
+diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb
+index 492ddbe..c703827 100644
+--- a/lib/rubygems/specification.rb
++++ b/lib/rubygems/specification.rb
+@@ -1256,11 +1256,7 @@ class Gem::Specification
+ File.join full_gem_path, path
+ end
+
+- unless extensions.empty?
+- paths += require_paths.map do |path|
+- File.join ext_dir, path
+- end
+- end
++ paths << ext_dir unless extensions.empty? || paths.include?(ext_dir)
+
+ # gem directories must come after -I and ENV['RUBYLIB']
+ insert_index = Gem.load_path_insert_index
+@@ -1697,7 +1693,10 @@ class Gem::Specification
+ # gem directory. eg: /usr/local/lib/ruby/1.8/gems
+
+ def exts_dir
+- @exts_dir ||= gems_dir
++ @exts_dir ||= begin
++ dirs = Gem.default_dirs.detect {|location, paths| paths[:gem_dir] == base_dir}
++ dirs ? File.join(dirs.last[:ext_dir], 'exts') : gems_dir
++ end
+ end
+
+ ##
+--
+1.8.1.2
+
+
+From 9a8556c609e800d0dbd24af416d613f2e82f323c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
+Date: Fri, 9 Dec 2011 16:31:04 +0100
+Subject: [PATCH 4/8] Fix the binary extension search path construction.
+
+---
+ lib/rubygems/installer.rb | 2 +-
+ lib/rubygems/specification.rb | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb
+index 854c177..f1f2ad7 100644
+--- a/lib/rubygems/installer.rb
++++ b/lib/rubygems/installer.rb
+@@ -646,7 +646,7 @@ TEXT
+ say "This could take a while..."
+ end
+
+- dest_path = spec.ext_dir
++ dest_path = File.join spec.ext_dir, spec.require_paths.first
+ ran_rake = false # only run rake once
+
+ spec.extensions.each do |extension|
+diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb
+index c703827..fa9ea6e 100644
+--- a/lib/rubygems/specification.rb
++++ b/lib/rubygems/specification.rb
+@@ -1256,7 +1256,7 @@ class Gem::Specification
+ File.join full_gem_path, path
+ end
+
+- paths << ext_dir unless extensions.empty? || paths.include?(ext_dir)
++ paths << File.join(ext_dir, require_paths.first) unless extensions.empty? || (ext_dir == full_gem_path)
+
+ # gem directories must come after -I and ENV['RUBYLIB']
+ insert_index = Gem.load_path_insert_index
+@@ -1685,7 +1685,7 @@ class Gem::Specification
+ # eg: /usr/local/lib/ruby/1.8/exts/mygem-1.0
+
+ def ext_dir
+- @ext_dir ||= File.join exts_dir, full_name, require_paths.first
++ @ext_dir ||= File.join exts_dir, full_name
+ end
+
+ ##
+--
+1.8.1.2
+
+
+From 476c2f90cc6f5f490858f253a9b23eb19d53d2fc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
+Date: Tue, 13 Dec 2011 12:14:54 +0100
+Subject: [PATCH 5/8] Remove binary extensions during uninstall.
+
+---
+ lib/rubygems/uninstaller.rb | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/lib/rubygems/uninstaller.rb b/lib/rubygems/uninstaller.rb
+index d672b9d..5c31a0c 100644
+--- a/lib/rubygems/uninstaller.rb
++++ b/lib/rubygems/uninstaller.rb
+@@ -246,6 +246,7 @@ class Gem::Uninstaller
+ File.writable?(spec.base_dir)
+
+ FileUtils.rm_rf spec.full_gem_path
++ FileUtils.rm_rf spec.ext_dir
+
+ # TODO: should this be moved to spec?... I vote eww (also exists in docmgr)
+ old_platform_name = [spec.name,
+--
+1.8.1.2
+
+
+From 35dc17e86f701fe1be80d98ace79735c535fd570 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
+Date: Tue, 13 Dec 2011 14:27:14 +0100
+Subject: [PATCH 6/8] Avoid dependency on customized operating_system.rb.
+
+---
+ lib/rubygems/defaults.rb | 11 +++++++++++
+ lib/rubygems/specification.rb | 5 +----
+ 2 files changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/lib/rubygems/defaults.rb b/lib/rubygems/defaults.rb
+index ea84e5c..b221954 100644
+--- a/lib/rubygems/defaults.rb
++++ b/lib/rubygems/defaults.rb
+@@ -101,6 +101,17 @@ module Gem
+ end
+
+ ##
++ # Returns binary extensions dir for specified RubyGems base dir or nil
++ # if such directory cannot be determined.
++ #
++ # By default, the binary extensions are located side by side with their
++ # Ruby counterparts, therefore nil is returned
++
++ def self.default_ext_dir_for base_dir
++ nil
++ end
++
++ ##
+ # A wrapper around RUBY_ENGINE const that may not be defined
+
+ def self.ruby_engine
+diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb
+index fa9ea6e..2b10499 100644
+--- a/lib/rubygems/specification.rb
++++ b/lib/rubygems/specification.rb
+@@ -1693,10 +1693,7 @@ class Gem::Specification
+ # gem directory. eg: /usr/local/lib/ruby/1.8/gems
+
+ def exts_dir
+- @exts_dir ||= begin
+- dirs = Gem.default_dirs.detect {|location, paths| paths[:gem_dir] == base_dir}
+- dirs ? File.join(dirs.last[:ext_dir], 'exts') : gems_dir
+- end
++ @exts_dir ||= Gem.default_ext_dir_for(base_dir) || gems_dir
+ end
+
+ ##
+--
+1.8.1.2
+
+
+From 0937c0b0a3c2ed08ab5b0875f7f95e24157525c2 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
+Date: Thu, 7 Feb 2013 13:07:34 +0100
+Subject: [PATCH 7/8] Fix binary extensions installation when --install-dir is
+ specified.
+
+---
+ lib/rubygems/installer.rb | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb
+index f1f2ad7..e1577fc 100644
+--- a/lib/rubygems/installer.rb
++++ b/lib/rubygems/installer.rb
+@@ -646,7 +646,7 @@ TEXT
+ say "This could take a while..."
+ end
+
+- dest_path = File.join spec.ext_dir, spec.require_paths.first
++ dest_path = File.join(options[:install_dir] ? gem_dir : spec.ext_dir, spec.require_paths.first)
+ ran_rake = false # only run rake once
+
+ spec.extensions.each do |extension|
+--
+1.8.1.2
+
+
+From 062a11c59731f5875d5a8821a212c8a41cb84577 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
+Date: Fri, 15 Feb 2013 17:07:07 +0100
+Subject: [PATCH 8/8] Use correct option.
+
+---
+ lib/rubygems/installer.rb | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb
+index e1577fc..1492c68 100644
+--- a/lib/rubygems/installer.rb
++++ b/lib/rubygems/installer.rb
+@@ -646,7 +646,7 @@ TEXT
+ say "This could take a while..."
+ end
+
+- dest_path = File.join(options[:install_dir] ? gem_dir : spec.ext_dir, spec.require_paths.first)
++ dest_path = File.join(@install_dir ? gem_dir : spec.ext_dir, spec.require_paths.first)
+ ran_rake = false # only run rake once
+
+ spec.extensions.each do |extension|
+--
+1.8.1.2
+
strip ccache from CC and CXX from rbconfig.rb
---- ruby-1.9.3-p429/tool/mkconfig.rb~ 2013-06-27 19:03:54.455442002 +0300
-+++ ruby-1.9.3-p429/tool/mkconfig.rb 2013-06-27 19:03:25.464126000 +0300
-@@ -85,6 +85,7 @@
- when /^sitearchdir$/; sitearchdir_override = val; next
- when /^vendorarchdir$/; vendorarchdir_override = val; next
- when /^sitearch/; val = '$(arch)' if val.empty?
+--- ruby-2.0.0-p353/tool/mkconfig.rb~ 2013-03-24 17:42:06.000000000 +0200
++++ ruby-2.0.0-p353/tool/mkconfig.rb 2014-03-18 10:34:08.489251715 +0200
+@@ -77,6 +77,7 @@
+ when /^(?:MAJOR|MINOR|TEENY)$/; next
+ when /^RUBY_INSTALL_NAME$/; next if $install_name
+ when /^RUBY_SO_NAME$/; next if $so_name
+ when /^(CC|CXX)$/; val.sub!(/ccache /, '')
+ when /^arch$/; if val.empty? then val = arch else arch = val end
+ when /^sitearch$/; val = '$(arch)' if val.empty?
end
- case val
- when /^\$\(ac_\w+\)$/; next