Index: SOURCES/ruby-1.9.3-custom-rubygems-location.patch
===================================================================
--- SOURCES/ruby-1.9.3-custom-rubygems-location.patch	(revision 893675)
+++ SOURCES/ruby-1.9.3-custom-rubygems-location.patch	(working copy)
@@ -1,84 +0,0 @@
-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
-
Index: SOURCES/ruby-1.9.3-mkmf-verbose.patch
===================================================================
--- SOURCES/ruby-1.9.3-mkmf-verbose.patch	(revision 893675)
+++ SOURCES/ruby-1.9.3-mkmf-verbose.patch	(working copy)
@@ -1,4 +1,4 @@
-From ec16398159a161fc77436b4855d489f193b2515b Mon Sep 17 00:00:00 2001
+From 28cc0749d6729aa2444661ee7b411e183fe220b0 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
 Date: Mon, 19 Nov 2012 15:14:51 +0100
 Subject: [PATCH] Verbose mkmf.
@@ -8,10 +8,10 @@
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/lib/mkmf.rb b/lib/mkmf.rb
-index 4b6c52e..67a15ee 100644
+index 682eb46..e6b1445 100644
 --- a/lib/mkmf.rb
 +++ b/lib/mkmf.rb
-@@ -1777,7 +1777,7 @@ SRC
+@@ -1859,7 +1859,7 @@ SRC
  SHELL = /bin/sh
  
  # V=0 quiet, V=1 verbose.  other values don't work.
@@ -21,5 +21,5 @@
  Q = $(Q1:0=@)
  ECHO1 = $(V:1=@#{CONFIG['NULLCMD']})
 -- 
-1.8.1.2
+1.8.3.1
 
Index: SOURCES/ruby-1.9.3.p195-fix-webrick-tests.patch
===================================================================
--- SOURCES/ruby-1.9.3.p195-fix-webrick-tests.patch	(revision 893675)
+++ SOURCES/ruby-1.9.3.p195-fix-webrick-tests.patch	(working copy)
@@ -1,13 +0,0 @@
-diff --git a/test/runner.rb b/test/runner.rb
-index 49844c7..8e59a85 100644
---- a/test/runner.rb
-+++ b/test/runner.rb
-@@ -2,6 +2,8 @@ require 'rbconfig'
- 
- require 'test/unit'
- 
-+require_relative 'ruby/envutil'
-+
- src_testdir = File.dirname(File.realpath(__FILE__))
- $LOAD_PATH << src_testdir
- module Gem
Index: SOURCES/ruby-2.0.0-CVE-2014-4975.patch
===================================================================
--- SOURCES/ruby-2.0.0-CVE-2014-4975.patch	(revision 893675)
+++ SOURCES/ruby-2.0.0-CVE-2014-4975.patch	(working copy)
@@ -1,43 +0,0 @@
-pack.c: fix buffer overrun
-
-* pack.c (encodes): fix buffer overrun by tail_lf.  Thanks to
-  Mamoru Tasaka and Tomas Hoger.  [ruby-core:63604] [Bug #10019]
-
---- ruby-2.0.0-p594/pack.c.orig	2012-10-19 09:13:32.000000000 -0400
-+++ ruby-2.0.0-p594/pack.c	2014-11-05 12:46:02.959341560 -0500
-@@ -1063,7 +1063,8 @@ static const char b64_table[] =
- static void
- encodes(VALUE str, const char *s, long len, int type, int tail_lf)
- {
--    char buff[4096];
-+    enum {buff_size = 4096, encoded_unit = 4};
-+    char buff[buff_size + 1];	/* +1 for tail_lf */
-     long i = 0;
-     const char *trans = type == 'u' ? uu_table : b64_table;
-     char padding;
-@@ -1076,7 +1077,7 @@ encodes(VALUE str, const char *s, long l
- 	padding = '=';
-     }
-     while (len >= 3) {
--        while (len >= 3 && sizeof(buff)-i >= 4) {
-+        while (len >= 3 && buff_size-i >= encoded_unit) {
-             buff[i++] = trans[077 & (*s >> 2)];
-             buff[i++] = trans[077 & (((*s << 4) & 060) | ((s[1] >> 4) & 017))];
-             buff[i++] = trans[077 & (((s[1] << 2) & 074) | ((s[2] >> 6) & 03))];
-@@ -1084,7 +1085,7 @@ encodes(VALUE str, const char *s, long l
-             s += 3;
-             len -= 3;
-         }
--        if (sizeof(buff)-i < 4) {
-+        if (buff_size-i < encoded_unit) {
-             rb_str_buf_cat(str, buff, i);
-             i = 0;
-         }
-@@ -1104,6 +1105,7 @@ encodes(VALUE str, const char *s, long l
-     }
-     if (tail_lf) buff[i++] = '\n';
-     rb_str_buf_cat(str, buff, i);
-+    if ((size_t)i > sizeof(buff)) rb_bug("encodes() buffer overrun");
- }
- 
- static const char hex_table[] = "0123456789ABCDEF";
Index: SOURCES/ruby-2.0.0-Prevent-duplicated-paths-when-empty-version-string-i.patch
===================================================================
--- SOURCES/ruby-2.0.0-Prevent-duplicated-paths-when-empty-version-string-i.patch	(revision 893675)
+++ SOURCES/ruby-2.0.0-Prevent-duplicated-paths-when-empty-version-string-i.patch	(working copy)
@@ -1,70 +0,0 @@
-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
-
Index: SOURCES/ruby-2.0.0-p451-Do-not-install-to-user-dir.patch
===================================================================
--- SOURCES/ruby-2.0.0-p451-Do-not-install-to-user-dir.patch	(revision 893675)
+++ SOURCES/ruby-2.0.0-p451-Do-not-install-to-user-dir.patch	(working copy)
@@ -1,11 +0,0 @@
---- ruby-2.0.0-p451/tool/rbinstall.rb~	2014-03-09 23:47:10.797069948 +0000
-+++ ruby-2.0.0-p451/tool/rbinstall.rb	2014-03-10 00:45:47.642333269 +0000
-@@ -712,7 +712,7 @@
- install?(:ext, :comm, :gem) do
-   $:.unshift(File.join(srcdir, "lib"))
-   require("rubygems.rb")
--  gem_dir = Gem.default_dir
-+  gem_dir = Gem.respond_to?(:default_dirs) ? Gem.default_dirs[:local][:gem_dir] : "/usr/share/ruby/gems"
-   # Gem.ensure_gem_subdirectories makes subdirectories group-writable.
-   directories = Gem::REPOSITORY_SUBDIRECTORIES
-   prepare "default gems", gem_dir, directories
Index: SOURCES/ruby-2.0.0-tk2.6.patch
===================================================================
--- SOURCES/ruby-2.0.0-tk2.6.patch	(revision 893675)
+++ SOURCES/ruby-2.0.0-tk2.6.patch	(working copy)
@@ -1,623 +0,0 @@
-diff -urN ruby-2.0.0-p576.orig/ext/tk/extconf.rb ruby-2.0.0-p576/ext/tk/extconf.rb
---- ruby-2.0.0-p576.orig/ext/tk/extconf.rb	2014-02-02 21:51:14.000000000 +0900
-+++ ruby-2.0.0-p576/ext/tk/extconf.rb	2014-10-19 19:47:49.196079162 +0900
-@@ -9,10 +9,10 @@
-   # %w[8.9 8.8 8.7 8.6 8.5 8.4 8.3 8.2 8.1 8.0 7.6 4.2]
-   # %w[8.7 8.6 8.5 8.4 8.3 8.2 8.1 8.0]
-   # %w[8.7 8.6 8.5 8.4 8.0] # to shorten search steps
--  %w[8.5 8.4] # At present, Tcl/Tk8.6 is not supported.
-+  %w[8.6 8.5 8.4]
- 
- TkLib_Config['unsupported_versions'] =
--  %w[8.8 8.7 8.6] # At present, Tcl/Tk8.6 is not supported.
-+  %w[8.8 8.7]
- 
- TkLib_Config['major_nums'] = '87'
- 
-diff -urN ruby-2.0.0-p576.orig/ext/tk/lib/tk/autoload.rb ruby-2.0.0-p576/ext/tk/lib/tk/autoload.rb
---- ruby-2.0.0-p576.orig/ext/tk/lib/tk/autoload.rb	2011-05-15 20:55:52.000000000 +0900
-+++ ruby-2.0.0-p576/ext/tk/lib/tk/autoload.rb	2014-10-19 19:47:49.196079162 +0900
-@@ -94,6 +94,8 @@
-   autoload :Y_Scrollable,     'tk/scrollable'
-   autoload :Scrollable,       'tk/scrollable'
- 
-+  autoload :Fontchooser,      'tk/fontchooser'
-+
-   autoload :Wm,               'tk/wm'
-   autoload :Wm_for_General,   'tk/wm'
- 
-diff -urN ruby-2.0.0-p576.orig/ext/tk/lib/tk/fontchooser.rb ruby-2.0.0-p576/ext/tk/lib/tk/fontchooser.rb
---- ruby-2.0.0-p576.orig/ext/tk/lib/tk/fontchooser.rb	2011-05-15 20:55:52.000000000 +0900
-+++ ruby-2.0.0-p576/ext/tk/lib/tk/fontchooser.rb	2014-10-19 19:47:49.197079290 +0900
-@@ -8,6 +8,10 @@
-   extend TkCore
- end
- 
-+module Tk
-+  Fontchooser = TkFont::Chooser
-+end
-+
- class << TkFont::Chooser
-   def method_missing(id, *args)
-     name = id.id2name
-diff -urN ruby-2.0.0-p576.orig/ext/tk/lib/tk/tk_mac.rb ruby-2.0.0-p576/ext/tk/lib/tk/tk_mac.rb
---- ruby-2.0.0-p576.orig/ext/tk/lib/tk/tk_mac.rb	1970-01-01 09:00:00.000000000 +0900
-+++ ruby-2.0.0-p576/ext/tk/lib/tk/tk_mac.rb	2014-10-19 19:47:49.197079290 +0900
-@@ -0,0 +1,158 @@
-+#
-+# tk/tk_mac.rb : Access Mac-Specific functionality on OS X from Tk
-+#                (supported by Tk8.6 or later)
-+#
-+#     ATTENTION !!
-+#         This is NOT TESTED. Because I have no test-environment.
-+#
-+require 'tk'
-+
-+module Tk
-+  module Mac
-+  end
-+end
-+
-+module Tk::Mac
-+  extend TkCore
-+
-+  # event handler callbacks
-+  def self.def_ShowPreferences(cmd=Proc.new)
-+    ip_eval("proc ::tk::mac::ShowPreferences {} { #{install_cmd(cmd)} }")
-+    nil
-+  end
-+
-+  def self.def_OpenApplication(cmd=Proc.new)
-+    ip_eval("proc ::tk::mac::OpenApplication {} { #{install_cmd(cmd)} }")
-+    nil
-+  end
-+
-+  def self.def_ReopenApplication(cmd=Proc.new)
-+    ip_eval("proc ::tk::mac::ReopenApplication {} { #{install_cmd(cmd)} }")
-+    nil
-+  end
-+
-+  def self.def_OpenDocument(cmd=Proc.new)
-+    ip_eval("proc ::tk::mac::OpenDocument {args} { eval #{install_cmd(cmd)} $args }")
-+    nil
-+  end
-+
-+  def self.def_PrintDocument(cmd=Proc.new)
-+    ip_eval("proc ::tk::mac::PrintDocument {args} { eval #{install_cmd(cmd)} $args }")
-+    nil
-+  end
-+
-+  def self.def_Quit(cmd=Proc.new)
-+    ip_eval("proc ::tk::mac::Quit {} { #{install_cmd(cmd)} }")
-+    nil
-+  end
-+
-+  def self.def_OnHide(cmd=Proc.new)
-+    ip_eval("proc ::tk::mac::OnHide {} { #{install_cmd(cmd)} }")
-+    nil
-+  end
-+
-+  def self.def_OnShow(cmd=Proc.new)
-+    ip_eval("proc ::tk::mac::OnShow {} { #{install_cmd(cmd)} }")
-+    nil
-+  end
-+
-+  def self.def_ShowHelp(cmd=Proc.new)
-+    ip_eval("proc ::tk::mac::ShowHelp {} { #{install_cmd(cmd)} }")
-+    nil
-+  end
-+
-+
-+  # additional dialogs
-+  def self.standardAboutPanel
-+    tk_call('::tk::mac::standardAboutPanel')
-+    nil
-+  end
-+
-+
-+  # system configuration
-+  def self.useCompatibilityMetrics(mode)
-+    tk_call('::tk::mac::useCompatibilityMetrics', mode)
-+    nil
-+  end
-+
-+  def self.CGAntialiasLimit(limit)
-+    tk_call('::tk::mac::CGAntialiasLimit', limit)
-+    nil
-+  end
-+
-+  def self.antialiasedtext(num)
-+    tk_call('::tk::mac::antialiasedtext', num)
-+    nil
-+  end
-+
-+  def self.useThemedToplevel(mode)
-+    tk_call('::tk::mac::useThemedToplevel', mode)
-+    nil
-+  end
-+
-+end
-+
-+class Tk::Mac::IconBitmap < TkImage
-+  TkCommandNames = ['::tk::mac::iconBitmap'].freeze
-+
-+  def self.new(width, height, keys)
-+    if keys.kind_of?(Hash)
-+      name = nil
-+      if keys.key?(:imagename)
-+        name = keys[:imagename]
-+      elsif keys.key?('imagename')
-+        name = keys['imagename']
-+      end
-+      if name
-+        if name.kind_of?(TkImage)
-+          obj = name
-+        else
-+          name = _get_eval_string(name)
-+          obj = nil
-+          Tk_IMGTBL.mutex.synchronize{
-+            obj = Tk_IMGTBL[name]
-+          }
-+        end
-+        if obj
-+          if !(keys[:without_creating] || keys['without_creating'])
-+            keys = _symbolkey2str(keys)
-+            keys.delete('imagename')
-+            keys.delete('without_creating')
-+            obj.instance_eval{
-+              tk_call_without_enc('::tk::mac::iconBitmap',
-+                                  @path, width, height, *hash_kv(keys, true))
-+            }
-+          end
-+          return obj
-+        end
-+      end
-+    end
-+    (obj = self.allocate).instance_eval{
-+      Tk_IMGTBL.mutex.synchronize{
-+        initialize(width, height, keys)
-+        Tk_IMGTBL[@path] = self
-+      }
-+    }
-+    obj
-+  end
-+
-+  def initialize(width, height, keys)
-+    @path = nil
-+    without_creating = false
-+    if keys.kind_of?(Hash)
-+      keys = _symbolkey2str(keys)
-+      @path = keys.delete('imagename')
-+      without_creating = keys.delete('without_creating')
-+    end
-+    unless @path
-+      Tk_Image_ID.mutex.synchronize{
-+        @path = Tk_Image_ID.join(TkCore::INTERP._ip_id_)
-+        Tk_Image_ID[1].succ!
-+      }
-+    end
-+    unless without_creating
-+      tk_call_without_enc('::tk::mac::iconBitmap',
-+                          @path, width, height, *hash_kv(keys, true))
-+    end
-+  end
-+end
-diff -urN ruby-2.0.0-p576.orig/ext/tk/lib/tk.rb ruby-2.0.0-p576/ext/tk/lib/tk.rb
---- ruby-2.0.0-p576.orig/ext/tk/lib/tk.rb	2011-05-27 08:36:33.000000000 +0900
-+++ ruby-2.0.0-p576/ext/tk/lib/tk.rb	2014-10-19 19:47:49.199079546 +0900
-@@ -1309,8 +1309,12 @@
-           end
- 
-           unless interp.deleted?
--            #Thread.current[:status].value = TclTkLib.mainloop(false)
--            Thread.current[:status].value = interp.mainloop(false)
-+            begin
-+              #Thread.current[:status].value = TclTkLib.mainloop(false)
-+              Thread.current[:status].value = interp.mainloop(false)
-+            rescue Exception=>e
-+              puts "ignore exception on interp: #{e.inspect}\n" if $DEBUG
-+            end
-           end
- 
-         ensure
-@@ -1569,7 +1573,15 @@
-   EOL
- =end
- 
--  at_exit{ INTERP.remove_tk_procs(TclTkLib::FINALIZE_PROC_NAME) }
-+  if !WITH_RUBY_VM || RUN_EVENTLOOP_ON_MAIN_THREAD ### check Ruby 1.9 !!!!!!!
-+    at_exit{ INTERP.remove_tk_procs(TclTkLib::FINALIZE_PROC_NAME) }
-+  else
-+    at_exit{
-+      Tk.root.destroy
-+      INTERP.remove_tk_procs(TclTkLib::FINALIZE_PROC_NAME)
-+      INTERP_THREAD.kill.join
-+    }
-+  end
- 
-   EventFlag = TclTkLib::EventFlag
- 
-@@ -5197,6 +5209,8 @@
-     TkWinfo.exist?(self)
-   end
- 
-+  alias subcommand tk_send
-+
-   def bind_class
-     @db_class || self.class()
-   end
-@@ -5742,7 +5756,7 @@
- #Tk.freeze
- 
- module Tk
--  RELEASE_DATE = '2010-06-03'.freeze
-+  RELEASE_DATE = '2014-10-19'.freeze
- 
-   autoload :AUTO_PATH,        'tk/variable'
-   autoload :TCL_PACKAGE_PATH, 'tk/variable'
-diff -urN ruby-2.0.0-p576.orig/ext/tk/lib/tkextlib/tcllib/validator.rb ruby-2.0.0-p576/ext/tk/lib/tkextlib/tcllib/validator.rb
---- ruby-2.0.0-p576.orig/ext/tk/lib/tkextlib/tcllib/validator.rb	1970-01-01 09:00:00.000000000 +0900
-+++ ruby-2.0.0-p576/ext/tk/lib/tkextlib/tcllib/validator.rb	2014-10-19 19:47:49.199079546 +0900
-@@ -0,0 +1,65 @@
-+#
-+#  tkextlib/tcllib/validator.rb
-+#                               by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
-+#
-+#   * Part of tcllib extension
-+#   * Provides a unified validation API
-+#
-+
-+require 'tk'
-+require 'tkextlib/tcllib.rb'
-+
-+# TkPackage.require('widget::validator', '0.1')
-+TkPackage.require('widget::validator')
-+
-+module Tk::Tcllib
-+  module Validator
-+    PACKAGE_NAME = 'widget::validator'.freeze
-+    def self.package_name
-+      PACKAGE_NAME
-+    end
-+
-+    def self.package_version
-+      begin
-+        TkPackage.require('widget::validator')
-+      rescue
-+        ''
-+      end
-+    end
-+  end
-+end
-+
-+module Tk::Tcllib::Validator
-+  extend TkCore
-+
-+  def self.attach(widget, color, cmd=Proc.new)
-+    tk_call_without_enc('::widget::validator', 'attach', widget, color, cmd)
-+    nil
-+  end
-+
-+  def self.detach(widget)
-+    tk_call_without_enc('::widget::validator', 'detach', widget)
-+    nil
-+  end
-+
-+  def self.validate(widget)
-+    tk_call_without_enc('::widget::validator', 'validate', widget)
-+    nil
-+  end
-+
-+  def attach_validator(color, cmd=Proc.new)
-+    tk_call_without_enc('::widget::validator', 'attach', @path, color, cmd)
-+    self
-+  end
-+
-+  def detach_validator(color, cmd=Proc.new)
-+    tk_call_without_enc('::widget::validator', 'detach', @path)
-+    self
-+  end
-+
-+  def invoke_validator(color, cmd=Proc.new)
-+    tk_call_without_enc('::widget::validator', 'validate', @path)
-+    self
-+  end
-+  alias validate_validator invoke_validator
-+end
-diff -urN ruby-2.0.0-p576.orig/ext/tk/lib/tkextlib/tile/treeview.rb ruby-2.0.0-p576/ext/tk/lib/tkextlib/tile/treeview.rb
---- ruby-2.0.0-p576.orig/ext/tk/lib/tkextlib/tile/treeview.rb	2009-10-02 19:45:39.000000000 +0900
-+++ ruby-2.0.0-p576/ext/tk/lib/tkextlib/tile/treeview.rb	2014-10-19 21:28:33.780314733 +0900
-@@ -986,6 +986,18 @@
-   end
-   alias added? tag_has?
- 
-+  def tag_has
-+    @t.tag_has(@id)
-+  end
-+
-+  def add(*items)
-+    @t.tag_add(@id, *items)
-+  end
-+
-+  def remove(*items)
-+    @t.tag_remove(@id, *items)
-+  end
-+
-   def bind(seq, *args)
-     if TkComm._callback_entry?(args[0]) || !block_given?
-       cmd = args.shift
-@@ -1299,6 +1311,24 @@
-     _bindinfo([@path, 'tag', 'bind', tag], context)
-   end
-   alias tagbindinfo tag_bindinfo
-+
-+  def tag_names
-+    tk_split_simplelist(tk_send('tag', 'names')).collect{|id|
-+      Tk::Tile::Treeview::Tag.id2obj(self, id)
-+    }
-+  end
-+
-+  def tag_add(tag, *items)
-+    fail ArgumentError, "no target items" if items.empty?
-+    tk_send('tag', 'add', tagid(tag), *(items.collect{|item| tagid(item)}))
-+    self
-+  end
-+
-+  def tag_remove(tag, *items)
-+    tk_send('tag', 'remove', tagid(tag), *(items.collect{|item| tagid(item)}))
-+    self
-+  end
-+
- end
- 
- #Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Treeview, :TkTreeview)
-diff -urN ruby-2.0.0-p576.orig/ext/tk/lib/tkextlib/tkimg/dted.rb ruby-2.0.0-p576/ext/tk/lib/tkextlib/tkimg/dted.rb
---- ruby-2.0.0-p576.orig/ext/tk/lib/tkextlib/tkimg/dted.rb	1970-01-01 09:00:00.000000000 +0900
-+++ ruby-2.0.0-p576/ext/tk/lib/tkextlib/tkimg/dted.rb	2014-10-19 19:47:49.216081708 +0900
-@@ -0,0 +1,33 @@
-+#
-+#  TkImg - format 'DTED'
-+#                               by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
-+#
-+require 'tk'
-+
-+# call setup script for general 'tkextlib' libraries
-+require 'tkextlib/setup.rb'
-+
-+# call setup script
-+require 'tkextlib/tkimg/setup.rb'
-+
-+# TkPackage.require('img::dted', '1.4')
-+TkPackage.require('img::dted')
-+
-+module Tk
-+  module Img
-+    module DTED
-+      PACKAGE_NAME = 'img::dted'.freeze
-+      def self.package_name
-+        PACKAGE_NAME
-+      end
-+
-+      def self.package_version
-+        begin
-+          TkPackage.require('img::dted')
-+        rescue
-+          ''
-+        end
-+      end
-+    end
-+  end
-+end
-diff -urN ruby-2.0.0-p576.orig/ext/tk/lib/tkextlib/tkimg/raw.rb ruby-2.0.0-p576/ext/tk/lib/tkextlib/tkimg/raw.rb
---- ruby-2.0.0-p576.orig/ext/tk/lib/tkextlib/tkimg/raw.rb	1970-01-01 09:00:00.000000000 +0900
-+++ ruby-2.0.0-p576/ext/tk/lib/tkextlib/tkimg/raw.rb	2014-10-19 19:47:49.216081708 +0900
-@@ -0,0 +1,33 @@
-+#
-+#  TkImg - format 'Raw Data'
-+#                               by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
-+#
-+require 'tk'
-+
-+# call setup script for general 'tkextlib' libraries
-+require 'tkextlib/setup.rb'
-+
-+# call setup script
-+require 'tkextlib/tkimg/setup.rb'
-+
-+# TkPackage.require('img::raw', '1.4')
-+TkPackage.require('img::raw')
-+
-+module Tk
-+  module Img
-+    module Raw
-+      PACKAGE_NAME = 'img::raw'.freeze
-+      def self.package_name
-+        PACKAGE_NAME
-+      end
-+
-+      def self.package_version
-+        begin
-+          TkPackage.require('img::raw')
-+        rescue
-+          ''
-+        end
-+      end
-+    end
-+  end
-+end
-diff -urN ruby-2.0.0-p576.orig/ext/tk/tcltklib.c ruby-2.0.0-p576/ext/tk/tcltklib.c
---- ruby-2.0.0-p576.orig/ext/tk/tcltklib.c	2014-01-20 01:28:53.000000000 +0900
-+++ ruby-2.0.0-p576/ext/tk/tcltklib.c	2014-10-19 20:35:59.648440798 +0900
-@@ -6033,7 +6033,12 @@
-     Tcl_CmdInfo info;
-     int ret;
- 
-+    DUMP1("call ip_rbNamespaceObjCmd");
-+    DUMP2("objc = %d", objc);
-+    DUMP2("objv[0] = '%s'", Tcl_GetString(objv[0]));
-+    DUMP2("objv[1] = '%s'", Tcl_GetString(objv[1]));
-     if (!Tcl_GetCommandInfo(interp, "__orig_namespace_command__", &(info))) {
-+        DUMP1("fail to get __orig_namespace_command__");
-         Tcl_ResetResult(interp);
-         Tcl_AppendResult(interp,
-                          "invalid command name \"namespace\"", (char*)NULL);
-@@ -6041,15 +6046,38 @@
-     }
- 
-     rbtk_eventloop_depth++;
--    /* DUMP2("namespace wrapper enter depth == %d", rbtk_eventloop_depth); */
-+    DUMP2("namespace wrapper enter depth == %d", rbtk_eventloop_depth);
- 
-     if (info.isNativeObjectProc) {
-+#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 6
-+        DUMP1("call a native-object-proc");
-         ret = (*(info.objProc))(info.objClientData, interp, objc, objv);
-+#else
-+        /* Tcl8.6 or later */
-+        int i;
-+        Tcl_Obj **cp_objv;
-+        char org_ns_cmd_name[] = "__orig_namespace_command__";
-+
-+        DUMP1("call a native-object-proc for tcl8.6 or later");
-+        cp_objv = RbTk_ALLOC_N(Tcl_Obj *, (objc + 1));
-+
-+        cp_objv[0] = Tcl_NewStringObj(org_ns_cmd_name, strlen(org_ns_cmd_name));
-+        for(i = 1; i < objc; i++) {
-+            cp_objv[i] = objv[i];
-+        }
-+        cp_objv[objc] = (Tcl_Obj *)NULL;
-+
-+        /* ret = Tcl_EvalObjv(interp, objc, cp_objv, TCL_EVAL_DIRECT); */
-+        ret = Tcl_EvalObjv(interp, objc, cp_objv, 0);
-+
-+        ckfree((char*)cp_objv);
-+#endif
-     } else {
-         /* string interface */
-         int i;
-         char **argv;
- 
-+        DUMP1("call with the string-interface");
-         /* argv = (char **)Tcl_Alloc(sizeof(char *) * (objc + 1)); */
-         argv = RbTk_ALLOC_N(char *, (objc + 1));
- #if 0 /* use Tcl_Preserve/Release */
-@@ -6077,9 +6105,10 @@
- #endif
-     }
- 
--    /* DUMP2("namespace wrapper exit depth == %d", rbtk_eventloop_depth); */
-+    DUMP2("namespace wrapper exit depth == %d", rbtk_eventloop_depth);
-     rbtk_eventloop_depth--;
- 
-+    DUMP1("end of ip_rbNamespaceObjCmd");
-     return ret;
- }
- #endif
-@@ -6089,6 +6118,8 @@
-     Tcl_Interp *interp;
- {
- #if TCL_MAJOR_VERSION >= 8
-+
-+#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 6
-     Tcl_CmdInfo orig_info;
- 
-     if (!Tcl_GetCommandInfo(interp, "namespace", &(orig_info))) {
-@@ -6105,6 +6136,11 @@
-                           orig_info.deleteProc);
-     }
- 
-+#else /* tcl8.6 or later */
-+    Tcl_GlobalEval(interp, "rename namespace __orig_namespace_command__");
-+
-+#endif
-+
-     Tcl_CreateObjCommand(interp, "namespace", ip_rbNamespaceObjCmd,
-                          (ClientData) 0, (Tcl_CmdDeleteProc *)NULL);
- #endif
-@@ -8487,15 +8523,28 @@
- #endif
- {
-     struct invoke_info *inf = (struct invoke_info *)arg;
-+
-+#if TCL_MAJOR_VERSION >= 8 && TCL_MINOR_VERSION < 6
-     int i, len;
--#if TCL_MAJOR_VERSION >= 8
-     int argc = inf->objc;
-     char **argv = (char **)NULL;
- #endif
- 
-+    DUMP1("call invoke_tcl_proc");
-+
-+#if TCL_MAJOR_VERSION > 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION >= 6)
-+
-+    /* eval */
-+    inf->ptr->return_value = Tcl_EvalObjv(inf->ptr->ip, inf->objc, inf->objv, TCL_EVAL_DIRECT);
-+    /* inf->ptr->return_value = Tcl_EvalObjv(inf->ptr->ip, inf->objc, inf->objv, 0); */
-+
-+#else /* Tcl/Tk 7.x, 8.0 -- 8.5 */
-+
-     /* memory allocation for arguments of this command */
--#if TCL_MAJOR_VERSION >= 8
-+#if TCL_MAJOR_VERSION == 8
-+    /* Tcl/Tk 8.0 -- 8.5 */
-     if (!inf->cmdinfo.isNativeObjectProc) {
-+        DUMP1("called proc is not a native-obj-proc");
-         /* string interface */
-         /* argv = (char **)ALLOC_N(char *, argc+1);*/ /* XXXXXXXXXX */
-         argv = RbTk_ALLOC_N(char *, (argc+1));
-@@ -8509,11 +8558,14 @@
-     }
- #endif
- 
-+    DUMP1("reset result of tcl-interp");
-     Tcl_ResetResult(inf->ptr->ip);
- 
-     /* Invoke the C procedure */
--#if TCL_MAJOR_VERSION >= 8
-+#if TCL_MAJOR_VERSION == 8
-+    /* Tcl/Tk 8.0 -- 8.5 */
-     if (inf->cmdinfo.isNativeObjectProc) {
-+        DUMP1("call tcl_proc as a native-obj-proc");
-         inf->ptr->return_value
-             = (*(inf->cmdinfo.objProc))(inf->cmdinfo.objClientData,
-                                         inf->ptr->ip, inf->objc, inf->objv);
-@@ -8521,7 +8573,9 @@
-     else
- #endif
-     {
--#if TCL_MAJOR_VERSION >= 8
-+#if TCL_MAJOR_VERSION == 8
-+        /* Tcl/Tk 8.0 -- 8.5 */
-+        DUMP1("call tcl_proc as not a native-obj-proc");
-         inf->ptr->return_value
-             = (*(inf->cmdinfo.proc))(inf->cmdinfo.clientData, inf->ptr->ip,
-                                      argc, (CONST84 char **)argv);
-@@ -8544,6 +8598,9 @@
- #endif
-     }
- 
-+#endif /* Tcl/Tk 8.6 or later || Tcl 7.x, 8.0 -- 8.5 */
-+
-+    DUMP1("end of invoke_tcl_proc");
-     return Qnil;
- }
- 
-@@ -8572,7 +8629,6 @@
- #if 1 /* wrap tcl-proc call */
-     struct invoke_info inf;
-     int status;
--    VALUE ret;
- #else
- #if TCL_MAJOR_VERSION >= 8
-     int argc = objc;
-@@ -8684,7 +8740,9 @@
- #endif
- 
-     /* invoke tcl-proc */
--    ret = rb_protect(invoke_tcl_proc, (VALUE)&inf, &status);
-+    DUMP1("invoke tcl-proc");
-+    rb_protect(invoke_tcl_proc, (VALUE)&inf, &status);
-+    DUMP2("status of tcl-proc, %d", status);
-     switch(status) {
-     case TAG_RAISE:
-         if (NIL_P(rb_errinfo())) {
Index: SOURCES/ruby-2.1.0-Allow-to-specify-additional-preludes-by-configuratio.patch
===================================================================
--- SOURCES/ruby-2.1.0-Allow-to-specify-additional-preludes-by-configuratio.patch	(revision 0)
+++ SOURCES/ruby-2.1.0-Allow-to-specify-additional-preludes-by-configuratio.patch	(working copy)
@@ -0,0 +1,58 @@
+From 996012f6abe0ce4d68a2de9f249935c6d5b467bc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
+Date: Fri, 4 Oct 2013 22:13:11 +0200
+Subject: [PATCH] Allow to specify addition preludes by configuration option.
+
+---
+ Makefile.in  | 2 ++
+ common.mk    | 2 +-
+ configure.in | 7 +++++++
+ 3 files changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 7e8ed82..7916993 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -114,6 +114,8 @@ XRUBY_LIBDIR = @XRUBY_LIBDIR@
+ XRUBY_RUBYLIBDIR = @XRUBY_RUBYLIBDIR@
+ XRUBY_RUBYHDRDIR = @XRUBY_RUBYHDRDIR@
+ 
++OPTIONAL_PRELUDES = @OPTIONAL_PRELUDES@
++
+ #### End of system configuration section. ####
+ 
+ MAJOR=	@MAJOR@
+diff --git a/common.mk b/common.mk
+index 5cfbc3d..3f0a82e 100644
+--- a/common.mk
++++ b/common.mk
+@@ -117,7 +117,7 @@ ALLOBJS       = $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(INITOBJS)
+ GOLFOBJS      = goruby.$(OBJEXT) golf_prelude.$(OBJEXT)
+ 
+ DEFAULT_PRELUDES = $(GEM_PRELUDE)
+-PRELUDE_SCRIPTS = $(srcdir)/prelude.rb $(srcdir)/enc/prelude.rb $(DEFAULT_PRELUDES)
++PRELUDE_SCRIPTS = $(srcdir)/prelude.rb $(srcdir)/enc/prelude.rb $(DEFAULT_PRELUDES) $(OPTIONAL_PRELUDES)
+ GEM_PRELUDE   = $(srcdir)/gem_prelude.rb
+ PRELUDES      = {$(srcdir)}prelude.c {$(srcdir)}miniprelude.c
+ GOLFPRELUDES  = {$(srcdir)}golf_prelude.c
+diff --git a/configure.in b/configure.in
+index 0e371e2..d4f1dcb 100644
+--- a/configure.in
++++ b/configure.in
+@@ -4169,6 +4169,13 @@ AC_SUBST(rubyarchhdrdir)dnl
+ AC_SUBST(sitearchhdrdir)dnl
+ AC_SUBST(vendorarchhdrdir)dnl
+ 
++AC_ARG_WITH(prelude,
++		AS_HELP_STRING([--with-prelude=FILE-LIST], [specify additional preludes separated by space]),
++		[prelude=$withval])
++if test "$prelude" != ""; then
++    AC_SUBST(OPTIONAL_PRELUDES, $prelude)
++fi
++
+ AC_ARG_WITH(mantype,
+ 	AS_HELP_STRING([--with-mantype=TYPE], [specify man page type; TYPE is one of man and doc]),
+ 		[
+-- 
+1.8.3.1
+

Property changes on: SOURCES/ruby-2.1.0-Allow-to-specify-additional-preludes-by-configuratio.patch
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: SOURCES/ruby-2.1.0-Enable-configuration-of-archlibdir.patch
===================================================================
--- SOURCES/ruby-2.1.0-Enable-configuration-of-archlibdir.patch	(revision 0)
+++ SOURCES/ruby-2.1.0-Enable-configuration-of-archlibdir.patch	(working copy)
@@ -0,0 +1,28 @@
+From 07c666ba5c3360dd6f43605a8ac7c85c99c1721f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
+Date: Tue, 1 Oct 2013 12:22:40 +0200
+Subject: [PATCH] Allow to configure libruby.so placement.
+
+---
+ configure.in | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/configure.in b/configure.in
+index 37d9a62..553d4d0 100644
+--- a/configure.in
++++ b/configure.in
+@@ -3385,6 +3385,11 @@ if test ${multiarch+set}; then
+ fi
+ 
+ archlibdir='${libdir}/${arch}'
++AC_ARG_WITH(archlibdir,
++	    AS_HELP_STRING([--with-archlibdir=DIR],
++			   [prefix for libruby [[LIBDIR/ARCH]]]),
++	    [archlibdir="$withval"])
++
+ sitearchlibdir='${libdir}/${sitearch}'
+ archincludedir='${includedir}/${arch}'
+ sitearchincludedir='${includedir}/${sitearch}'
+-- 
+1.8.3.1
+

Property changes on: SOURCES/ruby-2.1.0-Enable-configuration-of-archlibdir.patch
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: SOURCES/ruby-2.1.0-Prevent-duplicated-paths-when-empty-version-string-i.patch
===================================================================
--- SOURCES/ruby-2.1.0-Prevent-duplicated-paths-when-empty-version-string-i.patch	(revision 0)
+++ SOURCES/ruby-2.1.0-Prevent-duplicated-paths-when-empty-version-string-i.patch	(working copy)
@@ -0,0 +1,127 @@
+From e24d97c938c481450ed80ec83e5399595946c1ae 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     | 15 +++++++++------
+ loadpath.c       | 12 ++++++++++++
+ tool/mkconfig.rb |  2 +-
+ 3 files changed, 22 insertions(+), 7 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index 17ed3ed..5843651 100644
+--- a/configure.in
++++ b/configure.in
+@@ -3975,8 +3975,6 @@ AS_CASE(["$target_os"],
+     rubyw_install_name='$(RUBYW_INSTALL_NAME)'
+     ])
+ 
+-rubylibdir='${rubylibprefix}/${ruby_version}'
+-rubyarchdir=${multiarch+'${rubyarchprefix}/${ruby_version}'}${multiarch-'${rubylibdir}/${arch}'}
+ 
+ rubyarchprefix=${multiarch+'${archlibdir}/${RUBY_BASE_NAME}'}${multiarch-'${rubylibprefix}/${arch}'}
+ AC_ARG_WITH(rubyarchprefix,
+@@ -4006,6 +4004,7 @@ AC_ARG_WITH(ruby-version,
+             [ruby_version=full])
+ unset RUBY_LIB_VERSION
+ unset RUBY_LIB_VERSION_STYLE
++ruby_version_suffix=/'${ruby_version}'
+ AS_CASE(["$ruby_version"],
+   [full],  [RUBY_LIB_VERSION_STYLE='3	/* full */'],
+   [minor], [RUBY_LIB_VERSION_STYLE='2	/* minor */'])
+@@ -4022,30 +4021,34 @@ if test ${RUBY_LIB_VERSION_STYLE+set}; then
+     ruby_version="`$CPP -I. -I"${srcdir}" -I"${srcdir}/include" conftest.c | sed '/^ruby_version=/!d;s/ //g'`"
+     eval $ruby_version
+ elif test -z "${ruby_version}"; then
+-    AC_MSG_ERROR([No ruby version, No place for bundled libraries])
++    unset ruby_version_suffix
++    AC_DEFINE(RUBY_LIB_VERSION_BLANK, 1)
+ else
+     RUBY_LIB_VERSION="${ruby_version}"
+ fi
+ AC_SUBST(RUBY_LIB_VERSION_STYLE)
+ AC_SUBST(RUBY_LIB_VERSION)
+ 
++rubylibdir='${rubylibprefix}'${ruby_version_suffix}
++rubyarchdir=${multiarch+'${rubyarchprefix}'${ruby_version_suffix}}${multiarch-'${rubylibdir}/${arch}'}
++
+ AC_ARG_WITH(sitedir,
+ 	    AS_HELP_STRING([--with-sitedir=DIR], [site libraries in DIR [[RUBY_LIB_PREFIX/site_ruby]], "no" to disable site directory]),
+             [sitedir=$withval],
+             [sitedir='${rubylibprefix}/site_ruby'])
+-sitelibdir='${sitedir}/${ruby_version}'
++sitelibdir='${sitedir}'${ruby_version_suffix}
+ 
+ AC_ARG_WITH(sitearchdir,
+ 	    AS_HELP_STRING([--with-sitearchdir=DIR],
+ 			   [architecture dependent site libraries in DIR [[SITEDIR/SITEARCH]], "no" to disable site directory]),
+             [sitearchdir=$withval],
+-            [sitearchdir=${multiarch+'${rubysitearchprefix}/site_ruby/${ruby_version}'}${multiarch-'${sitelibdir}/${sitearch}'}])
++            [sitearchdir=${multiarch+'${rubysitearchprefix}/site_ruby'${ruby_version_suffix}}${multiarch-'${sitelibdir}/${sitearch}'}])
+ 
+ AC_ARG_WITH(vendordir,
+ 	    AS_HELP_STRING([--with-vendordir=DIR], [vendor libraries in DIR [[RUBY_LIB_PREFIX/vendor_ruby]], "no" to disable vendor directory]),
+             [vendordir=$withval],
+             [vendordir='${rubylibprefix}/vendor_ruby'])
+-vendorlibdir='${vendordir}/${ruby_version}'
++vendorlibdir='${vendordir}'${ruby_version_suffix}
+ 
+ AC_ARG_WITH(vendorarchdir,
+ 	    AS_HELP_STRING([--with-vendorarchdir=DIR],
+diff --git a/loadpath.c b/loadpath.c
+index 9160031..0d4d953 100644
+--- a/loadpath.c
++++ b/loadpath.c
+@@ -65,22 +65,34 @@ const char ruby_initial_load_paths[] =
+     RUBY_SEARCH_PATH "\0"
+ #endif
+ #ifndef NO_RUBY_SITE_LIB
++#ifdef RUBY_LIB_VERSION_BLANK
++    RUBY_SITE_LIB "\0"
++#else
+     RUBY_SITE_LIB2 "\0"
++#endif
+ #ifdef RUBY_THINARCH
+     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
++#ifdef RUBY_LIB_VERSION_BLANK
++    RUBY_VENDOR_LIB "\0"
++#else
+     RUBY_VENDOR_LIB2 "\0"
++#endif
+ #ifdef RUBY_THINARCH
+     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
+diff --git a/tool/mkconfig.rb b/tool/mkconfig.rb
+index 07076d4..35e6c3c 100755
+--- a/tool/mkconfig.rb
++++ b/tool/mkconfig.rb
+@@ -123,7 +123,7 @@ File.foreach "config.status" do |line|
+     val = val.gsub(/\$(?:\$|\{?(\w+)\}?)/) {$1 ? "$(#{$1})" : $&}.dump
+     case name
+     when /^prefix$/
+-      val = "(TOPDIR || DESTDIR + #{val})"
++      val = "(((TOPDIR && TOPDIR.empty?) ? nil : TOPDIR) || DESTDIR + #{val})"
+     when /^ARCH_FLAG$/
+       val = "arch_flag || #{val}" if universal
+     when /^UNIVERSAL_ARCHNAMES$/
+-- 
+1.9.0
+

Property changes on: SOURCES/ruby-2.1.0-Prevent-duplicated-paths-when-empty-version-string-i.patch
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: SOURCES/ruby-2.1.0-always-use-i386.patch
===================================================================
--- SOURCES/ruby-2.1.0-always-use-i386.patch	(revision 0)
+++ SOURCES/ruby-2.1.0-always-use-i386.patch	(working copy)
@@ -0,0 +1,25 @@
+From 2089cab72b38d6d5e7ba2b596e41014209acad30 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
+Date: Mon, 19 Nov 2012 14:37:28 +0100
+Subject: [PATCH] Always use i386.
+
+---
+ configure.in | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/configure.in b/configure.in
+index 553d4d0..03a4152 100644
+--- a/configure.in
++++ b/configure.in
+@@ -4087,6 +4087,8 @@ AC_SUBST(vendorarchdir)dnl
+ 
+ AC_SUBST(configure_args, "`echo "${ac_configure_args}" | sed 's/\\$/$$/g'`")dnl
+ 
++target_cpu=`echo $target_cpu | sed s/i.86/i386/`
++
+ if test "${universal_binary-no}" = yes ; then
+     arch="universal-${target_os}"
+     if test "${rb_cv_architecture_available}" = yes; then
+-- 
+1.8.3.1
+

Property changes on: SOURCES/ruby-2.1.0-always-use-i386.patch
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: SOURCES/ruby-2.1.0-custom-rubygems-location.patch
===================================================================
--- SOURCES/ruby-2.1.0-custom-rubygems-location.patch	(revision 0)
+++ SOURCES/ruby-2.1.0-custom-rubygems-location.patch	(working copy)
@@ -0,0 +1,96 @@
+From 94da59aafacc6a9efe829529eb51385588d6f149 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            | 5 +++++
+ loadpath.c              | 4 ++++
+ template/verconf.h.tmpl | 3 +++
+ tool/rbinstall.rb       | 9 +++++++++
+ 4 files changed, 21 insertions(+)
+
+diff --git a/configure.in b/configure.in
+index 03a4152..0e371e2 100644
+--- a/configure.in
++++ b/configure.in
+@@ -4061,6 +4061,10 @@ 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 "${LOAD_RELATIVE+set}"; then
+     AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE)
+     RUBY_EXEC_PREFIX=''
+@@ -4084,6 +4088,7 @@ AC_SUBST(sitearchdir)dnl
+ AC_SUBST(vendordir)dnl
+ AC_SUBST(vendorlibdir)dnl
+ AC_SUBST(vendorarchdir)dnl
++AC_SUBST(rubygemsdir)dnl
+ 
+ AC_SUBST(configure_args, "`echo "${ac_configure_args}" | sed 's/\\$/$$/g'`")dnl
+ 
+diff --git a/loadpath.c b/loadpath.c
+index 623dc9d..74c5d9e 100644
+--- a/loadpath.c
++++ b/loadpath.c
+@@ -94,6 +94,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"
+diff --git a/template/verconf.h.tmpl b/template/verconf.h.tmpl
+index 79c003e..34f2382 100644
+--- a/template/verconf.h.tmpl
++++ b/template/verconf.h.tmpl
+@@ -34,6 +34,9 @@
+ % if C["RUBY_SEARCH_PATH"]
+ #define RUBY_SEARCH_PATH		"${RUBY_SEARCH_PATH}"
+ % end
++% if C["rubygemsdir"]
++#define RUBYGEMS_DIR			"${rubygemsdir}"
++% end
+ %
+ % R = {}
+ % R["ruby_version"] = '"RUBY_LIB_VERSION"'
+diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb
+index b47b6e1..0b99408 100755
+--- a/tool/rbinstall.rb
++++ b/tool/rbinstall.rb
+@@ -317,6 +317,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"])
+@@ -505,7 +506,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, :comm, :hdr, :'comm-hdr') do
+-- 
+1.8.3.1
+

Property changes on: SOURCES/ruby-2.1.0-custom-rubygems-location.patch
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: SOURCES/ruby-2.3.0-Do-not-installt-user-dir.patch
===================================================================
--- SOURCES/ruby-2.3.0-Do-not-installt-user-dir.patch	(revision 0)
+++ SOURCES/ruby-2.3.0-Do-not-installt-user-dir.patch	(working copy)
@@ -0,0 +1,11 @@
+--- ruby-2.2.3/tool/rbinstall.rb.orig	2015-10-21 16:08:38.834317272 +0300
++++ ruby-2.2.3/tool/rbinstall.rb	2015-10-21 16:10:44.364295637 +0300
+@@ -665,7 +665,7 @@
+ install?(:ext, :comm, :gem) do
+   $:.unshift(File.join(srcdir, "lib"))
+   require("rubygems.rb")
+-  gem_dir = Gem.default_dir
++  gem_dir = Gem.respond_to?(:default_dirs) ? Gem.default_dirs[:local][:gem_dir] : "/usr/share/ruby/gems"
+   directories = Gem.ensure_gem_subdirectories(gem_dir, :mode => $dir_mode)
+   prepare "default gems", gem_dir, directories
+ 

Property changes on: SOURCES/ruby-2.3.0-Do-not-installt-user-dir.patch
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: SOURCES/ruby-2.3.0-Don-t-force-SSLv3-in-test-as-it-is-insecure-and-may-.patch
===================================================================
--- SOURCES/ruby-2.3.0-Don-t-force-SSLv3-in-test-as-it-is-insecure-and-may-.patch	(revision 0)
+++ SOURCES/ruby-2.3.0-Don-t-force-SSLv3-in-test-as-it-is-insecure-and-may-.patch	(working copy)
@@ -0,0 +1,25 @@
+From b9fa5fc9a14e6c889c9a0fa9c9386b2018f2314c Mon Sep 17 00:00:00 2001
+From: Jeremy Evans <code@jeremyevans.net>
+Date: Fri, 17 Jul 2015 11:25:09 -0600
+Subject: [PATCH 4/8] Don't force SSLv3 in test, as it is insecure and may not
+ be supported
+
+LibreSSL disables SSLv3 by default, and there's no reason this code
+should require SSLv3.
+
+diff --git test/openssl/test_ssl_session.rb test/openssl/test_ssl_session.rb
+index 0c384c7..d4713d9 100644
+--- test/openssl/test_ssl_session.rb
++++ test/openssl/test_ssl_session.rb
+@@ -355,7 +355,7 @@ __EOS__
+       3.times do
+         sock = TCPSocket.new("127.0.0.1", port)
+         begin
+-          ssl = OpenSSL::SSL::SSLSocket.new(sock, OpenSSL::SSL::SSLContext.new("SSLv3"))
++          ssl = OpenSSL::SSL::SSLSocket.new(sock, OpenSSL::SSL::SSLContext.new)
+           ssl.sync_close = true
+           ssl.session = last_client_session if last_client_session
+           ssl.connect
+-- 
+2.4.5
+

Property changes on: SOURCES/ruby-2.3.0-Don-t-force-SSLv3-in-test-as-it-is-insecure-and-may-.patch
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: SOURCES/ruby-2.3.0-Use-OP_NO_TICKET-when-testing-SSL-session-cache-call.patch
===================================================================
--- SOURCES/ruby-2.3.0-Use-OP_NO_TICKET-when-testing-SSL-session-cache-call.patch	(revision 0)
+++ SOURCES/ruby-2.3.0-Use-OP_NO_TICKET-when-testing-SSL-session-cache-call.patch	(working copy)
@@ -0,0 +1,23 @@
+From fb08c34eee2c883a01ab0dda2a2e34a290516a2a Mon Sep 17 00:00:00 2001
+From: Jeremy Evans <code@jeremyevans.net>
+Date: Fri, 17 Jul 2015 11:31:45 -0600
+Subject: [PATCH 5/8] Use OP_NO_TICKET when testing SSL session cache callbacks
+
+This fixes the test when using LibreSSL and possibly some
+configurations of OpenSSL.
+
+diff --git test/openssl/test_ssl_session.rb test/openssl/test_ssl_session.rb
+index d4713d9..58fa20b 100644
+--- test/openssl/test_ssl_session.rb
++++ test/openssl/test_ssl_session.rb
+@@ -316,6 +316,7 @@ __EOS__
+ 
+     ctx_proc = Proc.new { |ctx, ssl|
+       ctx.session_cache_mode = OpenSSL::SSL::SSLContext::SESSION_CACHE_SERVER
++      ctx.options = OpenSSL::SSL::OP_NO_TICKET
+       last_server_session = nil
+ 
+       # get_cb is called whenever a client proposed to resume a session but
+-- 
+2.4.5
+

Property changes on: SOURCES/ruby-2.3.0-Use-OP_NO_TICKET-when-testing-SSL-session-cache-call.patch
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: SOURCES/ruby-2.3.0-fix-test-ctx-client-session-cb.patch
===================================================================
--- SOURCES/ruby-2.3.0-fix-test-ctx-client-session-cb.patch	(revision 0)
+++ SOURCES/ruby-2.3.0-fix-test-ctx-client-session-cb.patch	(working copy)
@@ -0,0 +1,13 @@
+Index: test/openssl/test_ssl_session.rb
+===================================================================
+--- test/openssl/test_ssl_session.rb	(revision 49098)
++++ test/openssl/test_ssl_session.rb	(revision 49099)
+@@ -278,7 +278,7 @@
+ 
+   def test_ctx_client_session_cb
+     called = {}
+-    ctx = OpenSSL::SSL::SSLContext.new("SSLv3")
++    ctx = OpenSSL::SSL::SSLContext.new
+     ctx.session_cache_mode = OpenSSL::SSL::SSLContext::SESSION_CACHE_CLIENT
+ 
+     ctx.session_new_cb = lambda { |ary|

Property changes on: SOURCES/ruby-2.3.0-fix-test-ctx-client-session-cb.patch
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: SOURCES/rubygems-2.0.0-Do-not-modify-global-Specification.dirs-during-insta.patch
===================================================================
--- SOURCES/rubygems-2.0.0-Do-not-modify-global-Specification.dirs-during-insta.patch	(revision 893675)
+++ SOURCES/rubygems-2.0.0-Do-not-modify-global-Specification.dirs-during-insta.patch	(working copy)
@@ -1,151 +0,0 @@
-From b95b9942361104dc5b7fd08eb4970f893d8c1a54 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
-Date: Wed, 13 Feb 2013 13:12:30 +0100
-Subject: [PATCH 1/3] Remove duplicated check.
-
-The loaded specifications are rejected already in #gather_dependencies,
-so this condition cannot trigger.
----
- lib/rubygems/dependency_installer.rb | 3 ---
- 1 file changed, 3 deletions(-)
-
-diff --git a/lib/rubygems/dependency_installer.rb b/lib/rubygems/dependency_installer.rb
-index d811f62..dffa8df 100644
---- a/lib/rubygems/dependency_installer.rb
-+++ b/lib/rubygems/dependency_installer.rb
-@@ -330,9 +330,6 @@ class Gem::DependencyInstaller
- 
-     last = @gems_to_install.size - 1
-     @gems_to_install.each_with_index do |spec, index|
--      # REFACTOR more current spec set hardcoding, should be abstracted?
--      next if Gem::Specification.include?(spec) and index != last
--
-       # TODO: make this sorta_verbose so other users can benefit from it
-       say "Installing gem #{spec.full_name}" if Gem.configuration.really_verbose
- 
--- 
-1.8.1.2
-
-
-From 2fa9087b1986db6c7945c0f997fed2bfff5ce06a Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
-Date: Wed, 13 Feb 2013 15:47:47 +0100
-Subject: [PATCH 2/3] Do not modify global Specification.dirs during
- installation.
-
-While gems are installed into --install-dir just fine even without
-modifications of Specification.dirs, change in it makes inaccessible
-gems already present on the system.
----
- lib/rubygems/dependency_installer.rb | 15 ++++++---------
- 1 file changed, 6 insertions(+), 9 deletions(-)
-
-diff --git a/lib/rubygems/dependency_installer.rb b/lib/rubygems/dependency_installer.rb
-index dffa8df..841f26a 100644
---- a/lib/rubygems/dependency_installer.rb
-+++ b/lib/rubygems/dependency_installer.rb
-@@ -57,16 +57,14 @@ class Gem::DependencyInstaller
-   # :build_args:: See Gem::Installer::new
- 
-   def initialize(options = {})
--    @install_dir = options[:install_dir] || Gem.dir
- 
-     if options[:install_dir] then
--      # HACK shouldn't change the global settings, needed for -i behavior
--      # maybe move to the install command?  See also github #442
--      Gem::Specification.dirs = @install_dir
-+      Gem.ensure_gem_subdirectories options[:install_dir]
-     end
- 
-     options = DEFAULT_OPTIONS.merge options
- 
-+    @install_dir         = options[:install_dir]
-     @bin_dir             = options[:bin_dir]
-     @dev_shallow         = options[:dev_shallow]
-     @development         = options[:development]
-@@ -92,7 +89,7 @@ class Gem::DependencyInstaller
-     @installed_gems = []
-     @toplevel_specs = nil
- 
--    @cache_dir = options[:cache_dir] || @install_dir
-+    @cache_dir = options[:cache_dir] || @install_dir || Gem.dir
- 
-     # Set with any errors that SpecFetcher finds while search through
-     # gemspecs for a dep
-@@ -202,7 +199,7 @@ class Gem::DependencyInstaller
-     # that this isn't dependent only on the currently installed gems
-     dependency_list.specs.reject! { |spec|
-       not keep_names.include?(spec.full_name) and
--      Gem::Specification.include?(spec)
-+      (!@install_dir && Gem::Specification.include?(spec))
-     }
- 
-     unless dependency_list.ok? or @ignore_dependencies or @force then
-@@ -254,7 +251,7 @@ class Gem::DependencyInstaller
-           to_do.push t.spec
-         end
- 
--        results.remove_installed! dep
-+        results.remove_installed! dep unless @install_dir
- 
-         @available << results
-         results.inject_into_list dependency_list
-@@ -360,7 +357,7 @@ class Gem::DependencyInstaller
-                                 :force               => @force,
-                                 :format_executable   => @format_executable,
-                                 :ignore_dependencies => @ignore_dependencies,
--                                :install_dir         => @install_dir,
-+                                :install_dir         => (@install_dir || Gem.dir),
-                                 :security_policy     => @security_policy,
-                                 :user_install        => @user_install,
-                                 :wrappers            => @wrappers,
--- 
-1.8.1.2
-
-
-From d473204ce920702dd87257db49355929f31530d4 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
-Date: Fri, 15 Feb 2013 17:02:44 +0100
-Subject: [PATCH 3/3] Default to Gem.dir as late as possible.
-
----
- lib/rubygems/dependency_installer.rb | 2 +-
- lib/rubygems/installer.rb            | 4 ++--
- 2 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/lib/rubygems/dependency_installer.rb b/lib/rubygems/dependency_installer.rb
-index 841f26a..abcfa0f 100644
---- a/lib/rubygems/dependency_installer.rb
-+++ b/lib/rubygems/dependency_installer.rb
-@@ -357,7 +357,7 @@ class Gem::DependencyInstaller
-                                 :force               => @force,
-                                 :format_executable   => @format_executable,
-                                 :ignore_dependencies => @ignore_dependencies,
--                                :install_dir         => (@install_dir || Gem.dir),
-+                                :install_dir         => @install_dir,
-                                 :security_policy     => @security_policy,
-                                 :user_install        => @user_install,
-                                 :wrappers            => @wrappers,
-diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb
-index 780a88b..6543130 100644
---- a/lib/rubygems/installer.rb
-+++ b/lib/rubygems/installer.rb
-@@ -537,13 +537,13 @@ class Gem::Installer
-       :bin_dir      => nil,
-       :env_shebang  => false,
-       :force        => false,
--      :install_dir  => Gem.dir,
-       :only_install_dir => false
-     }.merge options
- 
-     @env_shebang         = options[:env_shebang]
-     @force               = options[:force]
--    @gem_home            = options[:install_dir]
-+    @install_dir         = options[:install_dir]
-+    @gem_home            = options[:install_dir] || Gem.dir
-     @ignore_dependencies = options[:ignore_dependencies]
-     @format_executable   = options[:format_executable]
-     @security_policy     = options[:security_policy]
--- 
-1.8.1.2
-
Index: SOURCES/rubygems-2.0.0-Fixes-for-empty-ruby-version.patch
===================================================================
--- SOURCES/rubygems-2.0.0-Fixes-for-empty-ruby-version.patch	(revision 893675)
+++ SOURCES/rubygems-2.0.0-Fixes-for-empty-ruby-version.patch	(working copy)
@@ -1,33 +0,0 @@
-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 1/2] 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
Index: SOURCES/rubygems-2.0.0-binary-extensions.patch
===================================================================
--- SOURCES/rubygems-2.0.0-binary-extensions.patch	(revision 893675)
+++ SOURCES/rubygems-2.0.0-binary-extensions.patch	(working copy)
@@ -1,344 +0,0 @@
-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
-
Index: SOURCES/rubygems.macros
===================================================================
--- SOURCES/rubygems.macros	(revision 0)
+++ SOURCES/rubygems.macros	(working copy)
@@ -0,0 +1,37 @@
+# The RubyGems root folder.
+%gem_dir %{_datadir}/gems
+%gem_archdir %{_libdir}/gems
+
+# Common gem locations and files.
+%gem_instdir %{gem_dir}/gems/%{gem_name}-%{version}
+%gem_extdir_mri %{gem_archdir}/%{name}/%{gem_name}-%{version}
+%gem_libdir %{gem_instdir}/lib
+%gem_cache %{gem_dir}/cache/%{gem_name}-%{version}.gem
+%gem_spec %{gem_dir}/specifications/%{gem_name}-%{version}.gemspec
+%gem_docdir %{gem_dir}/doc/%{gem_name}-%{version}
+
+# Install gem into appropriate directory.
+# -n<gem_file>      Overrides gem file name for installation.
+# -d<install_dir>   Set installation directory.
+%gem_install(d:n:) \
+mkdir -p %{-d*}%{!?-d:.%{gem_dir}} \
+\
+CONFIGURE_ARGS="--with-cflags='%{optflags}' $CONFIGURE_ARGS" \\\
+gem install \\\
+        -V \\\
+        --local \\\
+        --install-dir %{-d*}%{!?-d:.%{gem_dir}} \\\
+        --bindir .%{_bindir} \\\
+        --force \\\
+        --document=ri,rdoc \\\
+        %{-n*}%{!?-n:%{gem_name}-%{version}.gem} \
+%{nil}
+
+# For rubygems packages we want to filter out any provides caused by private
+# libs in %%{gem_archdir}.
+#
+# Note that this must be invoked in the spec file, preferably as
+# "%{?rubygems_default_filter}", before any %description block.
+%rubygems_default_filter %{expand: \
+%global __provides_exclude_from %{?__provides_exclude_from:%{__provides_exclude_from}|}^%{gem_extdir_mri}/.*\\\\.so$ \
+}
Index: SOURCES/sha1.lst
===================================================================
--- SOURCES/sha1.lst	(revision 893675)
+++ SOURCES/sha1.lst	(working copy)
@@ -1 +1 @@
-e724dd0e4a1e820a368be307aa0863a8ecf4b694  ruby-2.0.0-p645.tar.bz2
+cff5421e3a7f6dbe72009ef44164d4b9e6d1801f  ruby-2.2.3.tar.xz
Index: SPECS/ruby.spec
===================================================================
--- SPECS/ruby.spec	(revision 893675)
+++ SPECS/ruby.spec	(working copy)
@@ -1,9 +1,68 @@
-%define subver 2.0
-%define rubyapi 2.0.0
-%define rubyver 2.0.0
-%define patchversion p645
-%define rel 5
+# Taken from the fedora ruby-2.2.3 .spec. Thanks!
 
+%global major_version 2
+%global minor_version 2
+%global teeny_version 3
+%global major_minor_version %{major_version}.%{minor_version}
+
+%global ruby_version %{major_minor_version}.%{teeny_version}
+%global ruby_release %{ruby_version}
+
+# Specify the named version. It has precedense to revision.
+#%%global milestone rc1
+
+# Keep the revision enabled for pre-releases from SVN.
+#%%global revision 48936
+
+%global ruby_archive %{name}-%{ruby_version}
+
+# If revision and milestone are removed/commented out, the official release build is expected.
+%if 0%{?milestone:1}%{?revision:1} != 0
+%global development_release %{?milestone}%{?!milestone:%{?revision:r%{revision}}}
+%global ruby_archive %{ruby_archive}-%{?milestone}%{?!milestone:%{?revision:r%{revision}}}
+%endif
+
+
+%global release 1
+%{!?release_string:%global release_string %{?development_release:0.}%{release}%{?development_release:.%{development_release}}%{?dist}}
+
+%global rubygems_version 2.4.5.1
+
+# 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
+
+# TODO: The IRB has strange versioning. Keep the Ruby's versioning ATM.
+# http://redmine.ruby-lang.org/issues/5313
+%global irb_version %{ruby_version}
+
+%global bigdecimal_version 1.2.6
+%global io_console_version 0.4.3
+%global json_version 1.8.1
+%global minitest_version 5.4.3
+%global power_assert_version 0.2.2
+%global psych_version 2.0.8
+%global rake_version 10.4.2
+%global rdoc_version 4.2.0
+%global test_unit_version 3.0.8
+
+# Might not be needed in the future, if we are lucky enough.
+# https://bugzilla.redhat.com/show_bug.cgi?id=888262
+%global tapset_root %{_datadir}/systemtap
+%global tapset_dir %{tapset_root}/tapset
+%global tapset_libdir %(echo %{_libdir} | sed 's/64//')*
+
+%global _normalized_cpu %(echo %{_target_cpu} | sed 's/^ppc/powerpc/;s/i.86/i386/;s/sparcv./sparc/')
+
+%global with_rubypick 1
+
+# Additional defines by Mageia.
+
+%define subver %{major_minor_version}
+%define rubyapi %{ruby_version}
+%define rubyver %{ruby_version}
+%define rel %{release}
+
 %define libname %mklibname ruby %{subver}
 
 %define ruby_libdir %{_datadir}/%{name}
@@ -20,9 +79,7 @@
 
 # The RubyGems library has to stay out of Ruby directory tree, since the
 # RubyGems should be shared by all Ruby implementations.
-%define rubygems_dir %{_datadir}/rubygems
 %define gems_dir %{_datadir}/ruby/gems
-%define rubygems_version 2.0.2
 
 %define bootstrap 0
 %define build_gems 0
@@ -29,7 +86,7 @@
 
 Summary:	Object Oriented Script Language
 Name:		ruby
-Version:	%{rubyver}.%{patchversion}
+Version:	%{rubyver}
 Release: 	%mkrel %rel
 License:	Ruby or BSD
 Group:		Development/Ruby
@@ -38,7 +95,7 @@
 BuildRequires:	doxygen
 BuildRequires:	ncurses-devel
 BuildRequires:	readline-devel
-BuildRequires:	tcl-devel 
+BuildRequires:	tcl-devel
 BuildRequires:	tk-devel
 BuildRequires:	db-devel
 BuildRequires:  gdbm-devel >= 1.8.3
@@ -55,15 +112,16 @@
 # explicit file provides (since such requires are automatically added by find-requires)
 Provides: /usr/bin/ruby
 Provides: ruby(abi) = %rubyapi
-Source0:	http://ftp.ruby-lang.org/pub/ruby/%{subver}/ruby-%{rubyver}-%{patchversion}.tar.bz2
+Source0:	http://ftp.ruby-lang.org/pub/ruby/%{subver}/ruby-%{rubyver}.tar.xz
 Source1:	operating_system.rb
 Source3:	ruby.macros
+Source4:	rubygems.macros
 # From FC:
 # RPM dependency generators.
 Source8: rubygems.attr
 Source9: rubygems.req
 Source10: rubygems.prov
-URL:		http://www.ruby-lang.org/
+URL:		http://ruby-lang.org/
 %if !%bootstrap
 Requires:	rubygems >= %{rubygems_version}
 BuildRequires:	ruby
@@ -71,36 +129,34 @@
 
 # == FEDORA PATCHES BEGINS ==
 # http://bugs.ruby-lang.org/issues/7807
-Patch0: ruby-2.0.0-Prevent-duplicated-paths-when-empty-version-string-i.patch
-# Fixes random WEBRick test failures.
-# https://bugs.ruby-lang.org/issues/6573.
-Patch5: ruby-1.9.3.p195-fix-webrick-tests.patch
+Patch0: ruby-2.1.0-Prevent-duplicated-paths-when-empty-version-string-i.patch
+# Allows to override libruby.so placement. Hopefully we will be able to return
+# to plain --with-rubyarchprefix.
+# http://bugs.ruby-lang.org/issues/8973
+Patch1: ruby-2.1.0-Enable-configuration-of-archlibdir.patch
+# Force multiarch directories for i.86 to be always named i386. This solves
+# some differencies in build between Fedora and RHEL.
+Patch2: ruby-2.1.0-always-use-i386.patch
 # Allows to install RubyGems into custom directory, outside of Ruby's tree.
-# http://redmine.ruby-lang.org/issues/5617
-Patch8: ruby-1.9.3-custom-rubygems-location.patch
-# Add support for installing binary extensions according to FHS.
-# https://github.com/rubygems/rubygems/issues/210
-# Note that 8th patch might be resolved by
-# https://bugs.ruby-lang.org/issues/7897
-Patch9: rubygems-2.0.0-binary-extensions.patch
+# http://bugs.ruby-lang.org/issues/5617
+Patch4: ruby-2.1.0-custom-rubygems-location.patch
 # Make mkmf verbose by default
-Patch12: ruby-1.9.3-mkmf-verbose.patch
-# This slightly changes behavior of "gem install --install-dir" behavior.
-# Without this patch, Specifications.dirs is modified and gems installed on
-# the system cannot be required anymore. This causes later issues when RDoc
-# documentation should be generated, since json gem is sudenly not accessible.
-# https://github.com/rubygems/rubygems/pull/452
-Patch13: rubygems-2.0.0-Do-not-modify-global-Specification.dirs-during-insta.patch
-# This prevents issues, when ruby configuration specifies --with-ruby-version=''.
-# https://github.com/rubygems/rubygems/pull/455
-Patch14: rubygems-2.0.0-Fixes-for-empty-ruby-version.patch
+Patch5: ruby-1.9.3-mkmf-verbose.patch
+# Adds support for '--with-prelude' configuration option. This allows to built
+# in support for ABRT.
+# http://bugs.ruby-lang.org/issues/8566
+Patch6: ruby-2.1.0-Allow-to-specify-additional-preludes-by-configuratio.patch
+# Don't use SSLv3 for tests.
+# https://bugs.ruby-lang.org/issues/10046
+Patch9: ruby-2.3.0-fix-test-ctx-client-session-cb.patch
+Patch10: ruby-2.3.0-Don-t-force-SSLv3-in-test-as-it-is-insecure-and-may-.patch
+Patch11: ruby-2.3.0-Use-OP_NO_TICKET-when-testing-SSL-session-cache-call.patch
 # == FEDORA PATCHES ENDS ==
 # operating_system.rb sets default_dir to user_dir for non root, this causes the build
 # to install gems into user dir
-Patch20: ruby-2.0.0-p451-Do-not-install-to-user-dir.patch
+Patch20: ruby-2.3.0-Do-not-installt-user-dir.patch
 
-Patch21: ruby-2.0.0-CVE-2014-4975.patch
-Patch22: ruby-2.0.0-tk2.6.patch
+# Patch22: ruby-2.0.0-tk2.6.patch
 
 %package	-n %{libname}
 Summary:	Libraries necessary to run Ruby
@@ -316,23 +372,34 @@
 The test/unit means that test/unit which was bundled with Ruby 1.8.
 
 %prep
-%setup -q -n ruby-%{rubyver}-%{patchversion}
-%apply_patches
+%setup -q -n ruby-%{rubyver}
 # When patching mkmf.rb the mkmf.rb.0010 gets installed
-rm lib/mkmf.rb.0*
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch9
+%patch10
+%patch11
+%patch20 -p1
+# #patch22 -p1
 
 %build
 autoconf
 CFLAGS=`echo %optflags | sed 's/-fomit-frame-pointer//'`
 %configure2_5x --enable-shared --disable-rpath --enable-pthread \
-	--with-rubylibprefix='%{ruby_libdir}' \
+        --enable-multiarch \
+        --with-rubylibprefix='%{ruby_libdir}' \
+        --with-archlibdir='%{_libdir}' \
         --with-rubyarchprefix='%{ruby_libarchdir}' \
-	--with-sitedir='%{ruby_sitelibdir}' \
-	--with-sitearchdir='%{ruby_sitearchdir}' \
-	--with-vendordir='%{ruby_vendorlibdir}' \
-	--with-vendorarchdir='%{ruby_vendorarchdir}' \
-	--with-rubyhdrdir='%{_includedir}' \
-        --with-rubyarchhdrdir='$(archincludedir)' \
+        --with-sitedir='%{ruby_sitelibdir}' \
+        --with-sitearchdir='%{ruby_sitearchdir}' \
+        --with-vendordir='%{ruby_vendorlibdir}' \
+        --with-vendorarchdir='%{ruby_vendorarchdir}' \
+        --with-rubyhdrdir='%{_includedir}' \
+        --with-rubyarchhdrdir='%{_includedir}' \
         --with-sitearchhdrdir='$(sitehdrdir)/$(arch)' \
         --with-vendorarchhdrdir='$(vendorhdrdir)/$(arch)' \
         --with-rubygemsdir='%{rubygems_dir}' \
@@ -354,9 +421,10 @@
 (add-to-list 'interpreter-mode-alist '("ruby" . ruby-mode))
 EOF
 
-# Install the rpm macros 
+# Install the rpm macros
 mkdir -p %buildroot%{_sysconfdir}/rpm/macros.d
 cp %{SOURCE3} %buildroot%{_sysconfdir}/rpm/macros.d
+cp %{SOURCE4} %buildroot%{_sysconfdir}/rpm/macros.d
 
 # Install dependency generators.
 mkdir -p %{buildroot}%{_rpmconfigdir}/fileattrs
@@ -488,6 +556,7 @@
 %{_datadir}/emacs/site-lisp/*
 %config(noreplace) %{_sysconfdir}/emacs/site-start.d/*
 %{_sysconfdir}/rpm/macros.d/%{name}.macros
+%{_sysconfdir}/rpm/macros.d/rubygems.macros
 %{_datadir}/ruby/site_ruby
 %{_libdir}/ruby/site_ruby
 %{_datadir}/ruby/vendor_ruby
