Merge branch 'private-ruby-2.1' into master

Conflicts:
	.gitignore
	ruby.spec
	rubygems-2.0.0-Do-not-modify-global-Specification.dirs-during-insta.patch
	rubygems-2.0.0-Fixes-for-empty-ruby-version.patch
	sources
This commit is contained in:
Vít Ondruch 2014-04-08 08:40:52 +02:00
commit 5ef051104a
17 changed files with 477 additions and 1018 deletions

View File

@ -11,6 +11,15 @@ module Gem
end
private :previous_but_one_dir_to
##
# Tries to detect, if arguments and environment variables suggest that
# 'gem install' is executed from rpmbuild.
def rpmbuild?
(ARGV.include?('--install-dir') || ARGV.include?('-i')) && ENV['RPM_PACKAGE_NAME']
end
private :rpmbuild?
##
# Default gems locations allowed on FHS system (/usr, /usr/share).
# The locations are derived from directories specified during build
@ -78,8 +87,26 @@ module Gem
end
def default_ext_dir_for base_dir
dirs = Gem.default_dirs.detect {|location, paths| paths[:gem_dir] == base_dir}
dirs && File.join(dirs.last[:ext_dir], RbConfig::CONFIG['RUBY_INSTALL_NAME'])
dir = if rpmbuild?
build_dir = base_dir.chomp Gem.default_dirs[:system][:gem_dir]
if build_dir != base_dir
File.join build_dir, Gem.default_dirs[:system][:ext_dir]
end
else
dirs = Gem.default_dirs.detect {|location, paths| paths[:gem_dir] == base_dir}
dirs && dirs.last[:ext_dir]
end
dir && File.join(dir, RbConfig::CONFIG['RUBY_INSTALL_NAME'])
end
# This method should be available since RubyGems 2.2 until RubyGems 3.0.
# https://github.com/rubygems/rubygems/issues/749
if method_defined? :install_extension_in_lib
remove_method :install_extension_in_lib
def install_extension_in_lib
false
end
end
end
end

View File

@ -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 @@ Subject: [PATCH] Verbose mkmf.
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
@@ -1828,7 +1828,7 @@ SRC
SHELL = /bin/sh
# V=0 quiet, V=1 verbose. other values don't work.
@ -21,5 +21,5 @@ index 4b6c52e..67a15ee 100644
Q = $(Q1:0=@)
ECHO1 = $(V:1=@#{CONFIG['NULLCMD']})
--
1.8.1.2
1.8.3.1

View File

@ -1,5 +1,14 @@
From 2db9ad4a090d0c82e30afa44c623e3c5c99f7a37 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] Fix WEBrick tests.
---
test/runner.rb | 2 ++
1 file changed, 2 insertions(+)
diff --git a/test/runner.rb b/test/runner.rb
index 49844c7..8e59a85 100644
index 94beb44..db4dfe9 100644
--- a/test/runner.rb
+++ b/test/runner.rb
@@ -2,6 +2,8 @@ require 'rbconfig'
@ -11,3 +20,6 @@ index 49844c7..8e59a85 100644
src_testdir = File.dirname(File.realpath(__FILE__))
$LOAD_PATH << src_testdir
module Gem
--
1.8.3.1

View File

@ -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

View File

@ -1,360 +0,0 @@
diff -urN ruby-2.0.0-p0/tool/config.guess ruby-2.0.0-p0-aarch64/tool/config.guess
--- ruby-2.0.0-p0/tool/config.guess 2012-01-29 07:50:18.000000000 -0600
+++ ruby-2.0.0-p0-aarch64/tool/config.guess 2013-03-08 07:15:49.233030866 -0600
@@ -2,9 +2,9 @@
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-# 2011 Free Software Foundation, Inc.
+# 2011, 2012 Free Software Foundation, Inc.
-timestamp='2011-11-11'
+timestamp='2012-09-25'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -17,9 +17,7 @@
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -57,8 +55,8 @@
Originally written by Per Bothner.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
-Software Foundation, Inc.
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -145,7 +143,7 @@
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or
- # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
# switched to ELF, *-*-netbsd* would select the old
# object file format. This provides both forward
@@ -202,6 +200,10 @@
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
exit ;;
+ *:Bitrig:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
+ exit ;;
*:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
@@ -304,7 +306,7 @@
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit ;;
- arm:riscos:*:*|arm:RISCOS:*:*)
+ arm*:riscos:*:*|arm*:RISCOS:*:*)
echo arm-unknown-riscos
exit ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
@@ -803,6 +805,9 @@
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
exit ;;
+ *:MINGW64*:*)
+ echo ${UNAME_MACHINE}-pc-mingw64
+ exit ;;
*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
@@ -863,6 +868,13 @@
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit ;;
+ aarch64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ aarch64_be:Linux:*:*)
+ UNAME_MACHINE=aarch64_be
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
EV5) UNAME_MACHINE=alphaev5 ;;
@@ -897,16 +909,16 @@
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
cris:Linux:*:*)
- echo cris-axis-linux-gnu
+ echo ${UNAME_MACHINE}-axis-linux-gnu
exit ;;
crisv32:Linux:*:*)
- echo crisv32-axis-linux-gnu
+ echo ${UNAME_MACHINE}-axis-linux-gnu
exit ;;
frv:Linux:*:*)
- echo frv-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
hexagon:Linux:*:*)
- echo hexagon-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
i*86:Linux:*:*)
LIBC=gnu
@@ -948,7 +960,7 @@
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
or32:Linux:*:*)
- echo or32-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
padre:Linux:*:*)
echo sparc-unknown-linux-gnu
@@ -989,7 +1001,7 @@
echo ${UNAME_MACHINE}-dec-linux-gnu
exit ;;
x86_64:Linux:*:*)
- echo x86_64-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
xtensa*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
@@ -1196,6 +1208,9 @@
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
echo i586-pc-haiku
exit ;;
+ x86_64:Haiku:*:*)
+ echo x86_64-unknown-haiku
+ exit ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
exit ;;
@@ -1251,7 +1266,7 @@
NEO-?:NONSTOP_KERNEL:*:*)
echo neo-tandem-nsk${UNAME_RELEASE}
exit ;;
- NSE-?:NONSTOP_KERNEL:*:*)
+ NSE-*:NONSTOP_KERNEL:*:*)
echo nse-tandem-nsk${UNAME_RELEASE}
exit ;;
NSR-?:NONSTOP_KERNEL:*:*)
@@ -1320,11 +1335,11 @@
i*86:AROS:*:*)
echo ${UNAME_MACHINE}-pc-aros
exit ;;
+ x86_64:VMkernel:*:*)
+ echo ${UNAME_MACHINE}-unknown-esx
+ exit ;;
esac
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
eval $set_cc_for_build
cat >$dummy.c <<EOF
#ifdef _SEQUENT_
diff -urN ruby-2.0.0-p0/tool/config.sub ruby-2.0.0-p0-aarch64/tool/config.sub
--- ruby-2.0.0-p0/tool/config.sub 2012-01-29 07:50:18.000000000 -0600
+++ ruby-2.0.0-p0-aarch64/tool/config.sub 2013-03-08 07:15:49.328019902 -0600
@@ -2,9 +2,9 @@
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-# 2011 Free Software Foundation, Inc.
+# 2011, 2012 Free Software Foundation, Inc.
-timestamp='2011-11-11'
+timestamp='2012-10-10'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@@ -21,9 +21,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -76,8 +74,8 @@
GNU config.sub ($timestamp)
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
-Software Foundation, Inc.
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -125,13 +123,17 @@
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
- linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
knetbsd*-gnu* | netbsd*-gnu* | \
kopensolaris*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
+ android-linux)
+ os=-linux-android
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+ ;;
*)
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
if [ $basic_machine != $1 ]
@@ -154,7 +156,7 @@
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis | -knuth | -cray | -microblaze)
+ -apple | -axis | -knuth | -cray | -microblaze*)
os=
basic_machine=$1
;;
@@ -223,6 +225,12 @@
-isc*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
+ -lynx*178)
+ os=-lynxos178
+ ;;
+ -lynx*5)
+ os=-lynxos5
+ ;;
-lynx*)
os=-lynxos
;;
@@ -247,6 +255,7 @@
# Some are omitted here because they have special meanings below.
1750a | 580 \
| a29k \
+ | aarch64 | aarch64_be \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
@@ -264,7 +273,7 @@
| le32 | le64 \
| lm32 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | mcore | mep | metag \
+ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
@@ -319,8 +328,7 @@
c6x)
basic_machine=tic6x-unknown
;;
- m6811 | m68hc11 | m6812 | m68hc12 | picochip)
- # Motorola 68HC11/12.
+ m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
basic_machine=$basic_machine-unknown
os=-none
;;
@@ -333,7 +341,10 @@
strongarm | thumb | xscale)
basic_machine=arm-unknown
;;
-
+ xgate)
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
xscaleeb)
basic_machine=armeb-unknown
;;
@@ -356,6 +367,7 @@
# Recognize the basic CPU types with company name.
580-* \
| a29k-* \
+ | aarch64-* | aarch64_be-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
@@ -377,7 +389,8 @@
| lm32-* \
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+ | microblaze-* | microblazeel-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
@@ -719,7 +732,6 @@
i370-ibm* | ibm*)
basic_machine=i370-ibm
;;
-# I'm not sure what "Sysv32" means. Should this be sysv3.2?
i*86v32)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv32
@@ -777,9 +789,13 @@
basic_machine=ns32k-utek
os=-sysv
;;
- microblaze)
+ microblaze*)
basic_machine=microblaze-xilinx
;;
+ mingw64)
+ basic_machine=x86_64-pc
+ os=-mingw64
+ ;;
mingw32)
basic_machine=i386-pc
os=-mingw32
@@ -1341,15 +1357,15 @@
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
- | -openbsd* | -solidbsd* \
+ | -bitrig* | -openbsd* | -solidbsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* | -cegcc* \
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -linux-android* \
- | -linux-newlib* | -linux-uclibc* \
+ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+ | -linux-newlib* | -linux-musl* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
@@ -1532,6 +1548,9 @@
c4x-* | tic4x-*)
os=-coff
;;
+ hexagon-*)
+ os=-elf
+ ;;
tic54x-*)
os=-coff
;;
@@ -1559,9 +1578,6 @@
;;
m68000-sun)
os=-sunos3
- # This also exists in the configure program, but was not the
- # default.
- # os=-sunos4
;;
m68*-cisco)
os=-aout

View File

@ -1,28 +0,0 @@
From fb9fcc8b01d968c62577756cbfd00f20a10b5cbf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
Date: Tue, 9 Jul 2013 12:32:49 +0200
Subject: [PATCH] Make stable Gem::Specification.files in default .gemspecs
Although the .gemspec files for default gems are same in function, the
different order of their "s.files" makes them different therefore
possibly conflicting in multilib scenario.
---
tool/rbinstall.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb
index 1063fac..fb2fcee 100755
--- a/tool/rbinstall.rb
+++ b/tool/rbinstall.rb
@@ -592,7 +592,7 @@ module RbInstall
end
def collect
- ruby_libraries + built_libraries
+ (ruby_libraries + built_libraries).sort
end
private
--
1.8.3.1

View File

@ -1,70 +0,0 @@
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"
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

View File

@ -1,33 +1,44 @@
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 | 1 +
common.mk | 2 +-
configure.in | 7 +++++++
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/Makefile.in b/Makefile.in
index a93a1e6..fb30c19 100644
index 7e8ed82..7916993 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -108,6 +108,7 @@ XRUBY_RUBYLIBDIR = @XRUBY_RUBYLIBDIR@
@@ -114,6 +114,7 @@ XRUBY_RUBYLIBDIR = @XRUBY_RUBYLIBDIR@
XRUBY_RUBYHDRDIR = @XRUBY_RUBYHDRDIR@
DEFAULT_PRELUDES = $(@USE_RUBYGEMS@_GEM_PRELUDE)
DEFAULT_PRELUDES = $(GEM_PRELUDE)
+OPTIONAL_PRELUDES = @OPTIONAL_PRELUDES@
#### End of system configuration section. ####
diff --git a/common.mk b/common.mk
index e5069e5..ca5e3f9 100644
index 5cfbc3d..3f0a82e 100644
--- a/common.mk
+++ b/common.mk
@@ -107,7 +107,7 @@ ALLOBJS = $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(DMYEXT)
@@ -109,7 +109,7 @@ ALLOBJS = $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(DMYEXT)
GOLFOBJS = goruby.$(OBJEXT) golf_prelude.$(OBJEXT)
-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
YES_GEM_PRELUDE = $(GEM_PRELUDE)
NO_GEM_PRELUDE =
PRELUDES = prelude.c miniprelude.c
GOLFPRELUDES = golf_prelude.c
diff --git a/configure.in b/configure.in
index 7977aaf..1ef42cd 100644
index 0e371e2..d4f1dcb 100644
--- a/configure.in
+++ b/configure.in
@@ -3494,6 +3494,13 @@ AC_SUBST(rubyarchhdrdir)dnl
@@ -3841,6 +3841,13 @@ AC_SUBST(rubyarchhdrdir)dnl
AC_SUBST(sitearchhdrdir)dnl
AC_SUBST(vendorarchhdrdir)dnl
@ -41,3 +52,6 @@ index 7977aaf..1ef42cd 100644
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

View File

@ -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
@@ -3071,6 +3071,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

View File

@ -0,0 +1,113 @@
From 763c6571697b0bd551a8a0c27d538d00f161a9f3 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 ++++++++++++
2 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/configure.in b/configure.in
index 88d24ee..4a300b9 100644
--- a/configure.in
+++ b/configure.in
@@ -3645,8 +3645,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,
@@ -3676,6 +3676,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 */'])
@@ -3692,30 +3691,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
--
1.8.4.2

View File

@ -1,4 +1,4 @@
From 796aa193a0e01f3035361f045ac66486d71f608a Mon Sep 17 00:00:00 2001
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.
@ -8,12 +8,12 @@ Subject: [PATCH] Always use i386.
1 file changed, 2 insertions(+)
diff --git a/configure.in b/configure.in
index 418b0cb..d26fe5b 100644
index 553d4d0..03a4152 100644
--- a/configure.in
+++ b/configure.in
@@ -3419,6 +3419,8 @@ AC_SUBST(vendorarchdir)dnl
configure_args=$ac_configure_args
AC_SUBST(configure_args)dnl
@@ -3757,6 +3757,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/`
+
@ -21,5 +21,5 @@ index 418b0cb..d26fe5b 100644
arch="universal-${target_os}"
AC_CACHE_CHECK(whether __ARCHITECTURE__ is available, rb_cv_architecture_available,
--
1.8.1
1.8.3.1

View File

@ -1,46 +1,73 @@
From b5e9dc3683cb085aa57e7b12c35a4f21b2cc1482 Mon Sep 17 00:00:00 2001
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 | 8 ++++++++
tool/rbinstall.rb | 9 +++++++++
version.c | 4 ++++
3 files changed, 21 insertions(+)
configure.in | 5 +++++
loadpath.c | 4 ++++
template/verconf.h.in | 3 +++
tool/rbinstall.rb | 9 +++++++++
4 files changed, 21 insertions(+)
diff --git a/configure.in b/configure.in
index 1627d12..e064b2b 100644
index 03a4152..0e371e2 100644
--- a/configure.in
+++ b/configure.in
@@ -3349,6 +3349,13 @@ AC_ARG_WITH(vendorarchdir,
@@ -3731,6 +3731,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 "$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
if test "${LOAD_RELATIVE+set}"; then
AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE)
RUBY_EXEC_PREFIX=''
@@ -3754,6 +3754,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
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.in b/template/verconf.h.in
index 79c003e..34f2382 100644
--- a/template/verconf.h.in
+++ b/template/verconf.h.in
@@ -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 92e54c6..c72dfb6 100755
index b47b6e1..0b99408 100755
--- a/tool/rbinstall.rb
+++ b/tool/rbinstall.rb
@@ -313,6 +313,7 @@ sitelibdir = CONFIG["sitelibdir"]
@@ -324,6 +324,7 @@ sitelibdir = CONFIG["sitelibdir"]
sitearchlibdir = CONFIG["sitearchdir"]
vendorlibdir = CONFIG["vendorlibdir"]
vendorarchlibdir = CONFIG["vendorarchdir"]
@ -48,7 +75,7 @@ index 92e54c6..c72dfb6 100755
mandir = CONFIG["mandir", true]
docdir = CONFIG["docdir", true]
configure_args = Shellwords.shellwords(CONFIG["configure_args"])
@@ -500,7 +501,15 @@ end
@@ -512,7 +513,15 @@ end
install?(:local, :comm, :lib) do
prepare "library scripts", rubylibdir
noinst = %w[README* *.txt *.rdoc *.gemspec]
@ -64,21 +91,6 @@ index 92e54c6..c72dfb6 100755
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
1.8.3.1

183
ruby.spec
View File

@ -1,19 +1,17 @@
%global major_version 2
%global minor_version 0
%global teeny_version 0
%global patch_level 353
%global minor_version 1
%global teeny_version 1
%global patch_level 76
%global major_minor_version %{major_version}.%{minor_version}
%global ruby_version %{major_minor_version}.%{teeny_version}
%global ruby_version_patch_level %{major_minor_version}.%{teeny_version}.%{patch_level}
%global ruby_release %{ruby_version}
# Specify the named version. It has precedense to revision.
#%%global milestone preview2
# Keep the revision enabled for pre-releases from SVN.
#%%global revision 39387
#%%global revision 44362
%global ruby_archive %{name}-%{ruby_version}
@ -22,29 +20,33 @@
%global development_release %{?milestone}%{?!milestone:%{?revision:r%{revision}}}
%global ruby_archive %{ruby_archive}-%{?milestone}%{?!milestone:%{?revision:r%{revision}}}
%else
%global ruby_archive %{ruby_archive}-p%{patch_level}
# Ruby will be using semver versioning scheme since Ruby 2.1.0. However, it is
# unclear ATM what name will be used when next bugfix version is released.
# http://bugs.ruby-lang.org/issues/8835
#%%global ruby_archive %{ruby_archive}-p%{patch_level}
%endif
%global release 18
%{!?release_string:%global release_string %{?development_release:0.}%{release}%{?development_release:.%{development_release}}%{?dist}}
%global rubygems_version 2.0.14
%global rubygems_version 2.2.2
# 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
%global rake_version 0.9.6
# TODO: The IRB has strange versioning. Keep the Ruby's versioning ATM.
# http://redmine.ruby-lang.org/issues/5313
%global irb_version %{ruby_version_patch_level}
%global rdoc_version 4.0.0
%global bigdecimal_version 1.2.0
%global irb_version %{ruby_version}
%global bigdecimal_version 1.2.4
%global io_console_version 0.4.2
%global json_version 1.7.7
%global minitest_version 4.3.2
%global psych_version 2.0.0
%global json_version 1.8.1
%global minitest_version 4.7.5
%global psych_version 2.0.3
%global rake_version 10.1.0
%global rdoc_version 4.1.0
# Might not be needed in the future, if we are lucky enough.
# https://bugzilla.redhat.com/show_bug.cgi?id=888262
@ -60,7 +62,7 @@
Summary: An interpreter of object-oriented scripting language
Name: ruby
Version: %{ruby_version_patch_level}
Version: %{ruby_version}
Release: %{release_string}
Group: Development/Languages
# Public Domain for example for: include/ruby/st.h, strftime.c, ...
@ -79,6 +81,10 @@ Source6: abrt_prelude.rb
# https://fedorahosted.org/fpc/ticket/312
# https://bugzilla.redhat.com/show_bug.cgi?id=977941
Source7: config.h
# RPM dependency generators.
Source8: rubygems.attr
Source9: rubygems.req
Source10: rubygems.prov
# Include the constants defined in macros files.
@ -113,51 +119,26 @@ source_macros(rpm.expand("%{SOURCE5}"))
}
# http://bugs.ruby-lang.org/issues/7807
Patch0: ruby-2.0.0-Prevent-duplicated-paths-when-empty-version-string-i.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.
Patch3: ruby-1.9.3-always-use-i386.patch
Patch3: ruby-2.1.0-always-use-i386.patch
# Fixes random WEBRick test failures.
# https://bugs.ruby-lang.org/issues/6573.
Patch5: ruby-1.9.3.p195-fix-webrick-tests.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
Patch8: 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
# Adds aarch64 support.
# http://bugs.ruby-lang.org/issues/8331
# https://bugzilla.redhat.com/show_bug.cgi?id=926463
# Please note that this is the BZ patch, it might be good idea to update it
# with its upstream version when available.
Patch16: ruby-2.0.0-p195-aarch64.patch
# Adds support for '--with-prelude' configuration option. This allows to built
# in support for ABRT.
# http://bugs.ruby-lang.org/issues/8566
Patch17: ruby-2.1.0-Allow-to-specify-additional-preludes-by-configuratio.patch
# Fixes issues with DESTDIR.
# https://bugs.ruby-lang.org/issues/8115
Patch18: ruby-2.0.0-p247-Revert-mkmf.rb-prefix-install_dirs-only-with-DESTDIR.patch
# Fixes multilib conlicts of .gemspec files.
# https://bugs.ruby-lang.org/issues/8623
Patch19: ruby-2.0.0-p247-Make-stable-Gem-Specification.files-in-default-.gems.patch
# Backport regenerated certificates for IMAP tests.
# http://bugs.ruby-lang.org/issues/9341
Patch20: ruby-2.1.1-fix-test-failures-due-to-expired-certs.patch
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
Requires: ruby(rubygems) >= %{rubygems_version}
@ -169,7 +150,6 @@ Requires: rubygem(bigdecimal) >= %{bigdecimal_version}
BuildRequires: autoconf
BuildRequires: gdbm-devel
BuildRequires: ncurses-devel
BuildRequires: libdb-devel
BuildRequires: libffi-devel
BuildRequires: openssl-devel
@ -179,6 +159,9 @@ BuildRequires: tk-devel
# Needed to pass test_set_program_name(TestRubyOptions)
BuildRequires: procps
BuildRequires: %{_bindir}/dtrace
# RubyGems test suite optional dependencies.
BuildRequires: %{_bindir}/git
BuildRequires: %{_bindir}/cmake
# This package provides %%{_bindir}/ruby-mri therefore it is marked by this
# virtual provide. It can be installed as dependency of rubypick.
@ -262,7 +245,7 @@ specified in standard Ruby syntax.
Summary: The Interactive Ruby
Version: %{irb_version}
Group: Development/Libraries
Requires: %{name}-libs = %{ruby_version_patch_level}
Requires: %{name}-libs = %{ruby_version}
Provides: irb = %{version}-%{release}
Provides: ruby(irb) = %{version}-%{release}
BuildArch: noarch
@ -284,8 +267,6 @@ Requires: rubygem(json) >= %{json_version}
Provides: rdoc = %{version}-%{release}
Provides: ri = %{version}-%{release}
Provides: rubygem(rdoc) = %{version}-%{release}
Obsoletes: ruby-rdoc < %{version}
Obsoletes: ruby-ri < %{version}
BuildArch: noarch
%description -n rubygem-rdoc
@ -402,8 +383,8 @@ serialize and de-serialize most Ruby objects to and from the YAML format.
%package tcltk
Summary: Tcl/Tk interface for scripting language Ruby
Group: Development/Languages
Requires: %{name}-libs%{?_isa} = %{ruby_version_patch_level}
Provides: ruby(tcltk) = %{ruby_version_patch_level}-%{release}
Requires: %{name}-libs%{?_isa} = %{ruby_version}
Provides: ruby(tcltk) = %{ruby_version}-%{release}
%description tcltk
Tcl/Tk interface for the object-oriented scripting language Ruby.
@ -412,18 +393,12 @@ Tcl/Tk interface for the object-oriented scripting language Ruby.
%setup -q -n %{ruby_archive}
%patch0 -p1
%patch1 -p1
%patch3 -p1
%patch5 -p1
%patch8 -p1
%patch9 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
# Provide an example of usage of the tapset:
cp -a %{SOURCE3} .
@ -438,6 +413,7 @@ autoconf
%configure \
--with-rubylibprefix='%{ruby_libdir}' \
--with-archlibdir='%{_libdir}' \
--with-rubyarchprefix='%{ruby_libarchdir}' \
--with-sitedir='%{ruby_sitelibdir}' \
--with-sitearchdir='%{ruby_sitearchdir}' \
@ -455,8 +431,6 @@ autoconf
--enable-multiarch \
--with-prelude=./abrt_prelude.rb \
# Q= makes the build output more verbose and allows to check Fedora
# compiler options.
make %{?_smp_mflags} COPY="cp -p" Q=
@ -479,11 +453,17 @@ sed -i 's/Version: \${ruby_version}/Version: %{ruby_version}/' %{buildroot}%{_li
# Move macros file insto proper place and replace the %%{name} macro, since it
# would be wrongly evaluated during build of other packages.
mkdir -p %{buildroot}%{_sysconfdir}/rpm
install -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/rpm/macros.ruby
sed -i "s/%%{name}/%{name}/" %{buildroot}%{_sysconfdir}/rpm/macros.ruby
install -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/rpm/macros.rubygems
sed -i "s/%%{name}/%{name}/" %{buildroot}%{_sysconfdir}/rpm/macros.rubygems
mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d
install -m 644 %{SOURCE4} %{buildroot}%{_rpmconfigdir}/macros.d/macros.ruby
sed -i "s/%%{name}/%{name}/" %{buildroot}%{_rpmconfigdir}/macros.d/macros.ruby
install -m 644 %{SOURCE5} %{buildroot}%{_rpmconfigdir}/macros.d/macros.rubygems
sed -i "s/%%{name}/%{name}/" %{buildroot}%{_rpmconfigdir}/macros.d/macros.rubygems
# Install dependency generators.
mkdir -p %{buildroot}%{_rpmconfigdir}/fileattrs
install -m 644 %{SOURCE8} %{buildroot}%{_rpmconfigdir}/fileattrs
install -m 755 %{SOURCE9} %{buildroot}%{_rpmconfigdir}
install -m 755 %{SOURCE10} %{buildroot}%{_rpmconfigdir}
# Install custom operating_system.rb.
mkdir -p %{buildroot}%{rubygems_dir}/rubygems/defaults
@ -509,25 +489,25 @@ mv %{buildroot}%{ruby_libdir}/rdoc* %{buildroot}%{gem_dir}/gems/rdoc-%{rdoc_vers
mv %{buildroot}%{gem_dir}/specifications/default/rdoc-%{rdoc_version}.gemspec %{buildroot}%{gem_dir}/specifications
mkdir -p %{buildroot}%{gem_dir}/gems/bigdecimal-%{bigdecimal_version}/lib
mkdir -p %{buildroot}%{_libdir}/gems/%{name}/bigdecimal-%{bigdecimal_version}/lib
mkdir -p %{buildroot}%{_libdir}/gems/%{name}/bigdecimal-%{bigdecimal_version}
mv %{buildroot}%{ruby_libdir}/bigdecimal %{buildroot}%{gem_dir}/gems/bigdecimal-%{bigdecimal_version}/lib
mv %{buildroot}%{ruby_libarchdir}/bigdecimal.so %{buildroot}%{_libdir}/gems/%{name}/bigdecimal-%{bigdecimal_version}/lib
mv %{buildroot}%{ruby_libarchdir}/bigdecimal.so %{buildroot}%{_libdir}/gems/%{name}/bigdecimal-%{bigdecimal_version}
mv %{buildroot}%{gem_dir}/specifications/default/bigdecimal-%{bigdecimal_version}.gemspec %{buildroot}%{gem_dir}/specifications
ln -s %{gem_dir}/gems/bigdecimal-%{bigdecimal_version}/lib/bigdecimal %{buildroot}%{ruby_libdir}/bigdecimal
ln -s %{_libdir}/gems/%{name}/bigdecimal-%{bigdecimal_version}/lib/bigdecimal.so %{buildroot}%{ruby_libarchdir}/bigdecimal.so
ln -s %{_libdir}/gems/%{name}/bigdecimal-%{bigdecimal_version}/bigdecimal.so %{buildroot}%{ruby_libarchdir}/bigdecimal.so
mkdir -p %{buildroot}%{gem_dir}/gems/io-console-%{io_console_version}/lib
mkdir -p %{buildroot}%{_libdir}/gems/%{name}/io-console-%{io_console_version}/lib/io
mkdir -p %{buildroot}%{_libdir}/gems/%{name}/io-console-%{io_console_version}/io
mv %{buildroot}%{ruby_libdir}/io %{buildroot}%{gem_dir}/gems/io-console-%{io_console_version}/lib
mv %{buildroot}%{ruby_libarchdir}/io/console.so %{buildroot}%{_libdir}/gems/%{name}/io-console-%{io_console_version}/lib/io
mv %{buildroot}%{ruby_libarchdir}/io/console.so %{buildroot}%{_libdir}/gems/%{name}/io-console-%{io_console_version}/io
mv %{buildroot}%{gem_dir}/specifications/default/io-console-%{io_console_version}.gemspec %{buildroot}%{gem_dir}/specifications
ln -s %{gem_dir}/gems/io-console-%{io_console_version}/lib/io %{buildroot}%{ruby_libdir}/io
ln -s %{_libdir}/gems/%{name}/io-console-%{io_console_version}/lib/io/console.so %{buildroot}%{ruby_libarchdir}/io/console.so
ln -s %{_libdir}/gems/%{name}/io-console-%{io_console_version}/io/console.so %{buildroot}%{ruby_libarchdir}/io/console.so
mkdir -p %{buildroot}%{gem_dir}/gems/json-%{json_version}/lib
mkdir -p %{buildroot}%{_libdir}/gems/%{name}/json-%{json_version}/lib
mkdir -p %{buildroot}%{_libdir}/gems/%{name}/json-%{json_version}
mv %{buildroot}%{ruby_libdir}/json* %{buildroot}%{gem_dir}/gems/json-%{json_version}/lib
mv %{buildroot}%{ruby_libarchdir}/json/ %{buildroot}%{_libdir}/gems/%{name}/json-%{json_version}/lib/
mv %{buildroot}%{ruby_libarchdir}/json/ %{buildroot}%{_libdir}/gems/%{name}/json-%{json_version}/
mv %{buildroot}%{gem_dir}/specifications/default/json-%{json_version}.gemspec %{buildroot}%{gem_dir}/specifications
mkdir -p %{buildroot}%{gem_dir}/gems/minitest-%{minitest_version}/lib
@ -535,9 +515,9 @@ mv %{buildroot}%{ruby_libdir}/minitest %{buildroot}%{gem_dir}/gems/minitest-%{mi
mv %{buildroot}%{gem_dir}/specifications/default/minitest-%{minitest_version}.gemspec %{buildroot}%{gem_dir}/specifications
mkdir -p %{buildroot}%{gem_dir}/gems/psych-%{psych_version}/lib
mkdir -p %{buildroot}%{_libdir}/gems/%{name}/psych-%{psych_version}/lib
mkdir -p %{buildroot}%{_libdir}/gems/%{name}/psych-%{psych_version}
mv %{buildroot}%{ruby_libdir}/psych* %{buildroot}%{gem_dir}/gems/psych-%{psych_version}/lib
mv %{buildroot}%{ruby_libarchdir}/psych.so %{buildroot}%{_libdir}/gems/%{name}/psych-%{psych_version}/lib/
mv %{buildroot}%{ruby_libarchdir}/psych.so %{buildroot}%{_libdir}/gems/%{name}/psych-%{psych_version}/
mv %{buildroot}%{gem_dir}/specifications/default/psych-%{psych_version}.gemspec %{buildroot}%{gem_dir}/specifications
# The links should replace directory, which RPM cannot handle and it is causing
# issues during upgrade from F18 to F19. As a workaround the links are placed
@ -545,7 +525,7 @@ mv %{buildroot}%{gem_dir}/specifications/default/psych-%{psych_version}.gemspec
# https://bugzilla.redhat.com/show_bug.cgi?id=988490
ln -s %{gem_dir}/gems/psych-%{psych_version}/lib/psych %{buildroot}%{ruby_vendorlibdir}/psych
ln -s %{gem_dir}/gems/psych-%{psych_version}/lib/psych.rb %{buildroot}%{ruby_vendorlibdir}/psych.rb
ln -s %{_libdir}/gems/%{name}/psych-%{psych_version}/lib/psych.so %{buildroot}%{ruby_vendorarchdir}/psych.so
ln -s %{_libdir}/gems/%{name}/psych-%{psych_version}/psych.so %{buildroot}%{ruby_vendorarchdir}/psych.so
# Adjust the gemspec files so that the gems will load properly
sed -i '/^end$/ i\
@ -590,6 +570,18 @@ DISABLE_TESTS="-x test_dl2.rb $DISABLE_TESTS"
# the test suite).
touch abrt.rb
# TestSignal#test_hup_me hangs up the test suite.
# http://bugs.ruby-lang.org/issues/8997
sed -i '/def test_hup_me/,/end if Process.respond_to/ s/^/#/' test/ruby/test_signal.rb
# Fix "Could not find 'minitest'" error.
# http://bugs.ruby-lang.org/issues/9259
sed -i "/^ gem 'minitest', '~> 4.0'/ s/^/#/" lib/rubygems/test_case.rb
# Segmentation fault.
# https://bugs.ruby-lang.org/issues/9198
sed -i '/^ def test_machine_stackoverflow/,/^ end/ s/^/#/' test/ruby/test_exception.rb
# Allow MD5 in OpenSSL.
# https://bugs.ruby-lang.org/issues/9154
OPENSSL_ENABLE_MD5_VERIFY=1 make check TESTS="-v $DISABLE_TESTS"
@ -619,7 +611,7 @@ OPENSSL_ENABLE_MD5_VERIFY=1 make check TESTS="-v $DISABLE_TESTS"
%doc README.EXT
%lang(ja) %doc README.EXT.ja
%{_sysconfdir}/rpm/macros.ruby
%{_rpmconfigdir}/macros.d/macros.ruby
%{_includedir}/*
%{_libdir}/libruby.so
@ -682,7 +674,6 @@ OPENSSL_ENABLE_MD5_VERIFY=1 make check TESTS="-v $DISABLE_TESTS"
%dir %{ruby_libarchdir}
%{ruby_libarchdir}/continuation.so
%{ruby_libarchdir}/coverage.so
%{ruby_libarchdir}/curses.so
%{ruby_libarchdir}/date_core.so
%{ruby_libarchdir}/dbm.so
%dir %{ruby_libarchdir}/digest
@ -769,6 +760,7 @@ OPENSSL_ENABLE_MD5_VERIFY=1 make check TESTS="-v $DISABLE_TESTS"
%dir %{ruby_libarchdir}/racc
%{ruby_libarchdir}/racc/cparse.so
%{ruby_libarchdir}/rbconfig.rb
%{ruby_libarchdir}/rbconfig/sizeof.so
%{ruby_libarchdir}/readline.so
%{ruby_libarchdir}/ripper.so
%{ruby_libarchdir}/sdbm.so
@ -777,6 +769,7 @@ OPENSSL_ENABLE_MD5_VERIFY=1 make check TESTS="-v $DISABLE_TESTS"
%{ruby_libarchdir}/strscan.so
%{ruby_libarchdir}/syslog.so
%exclude %{ruby_libarchdir}/tcltklib.so
%{ruby_libarchdir}/thread.so
%exclude %{ruby_libarchdir}/tkutil.so
%{ruby_libarchdir}/zlib.so
@ -815,7 +808,10 @@ OPENSSL_ENABLE_MD5_VERIFY=1 make check TESTS="-v $DISABLE_TESTS"
%exclude %{gem_dir}/specifications/default/test-unit-*.gemspec
%files -n rubygems-devel
%{_sysconfdir}/rpm/macros.rubygems
%{_rpmconfigdir}/macros.d/macros.rubygems
%{_rpmconfigdir}/fileattrs/rubygems.attr
%{_rpmconfigdir}/rubygems.req
%{_rpmconfigdir}/rubygems.prov
%files -n rubygem-rake
%{_bindir}/rake
@ -885,18 +881,27 @@ OPENSSL_ENABLE_MD5_VERIFY=1 make check TESTS="-v $DISABLE_TESTS"
%{ruby_libdir}/tkextlib
%changelog
* Mon Feb 10 2014 Josef Stribny <jstribny@redhat.com> - 2.0.0.353-18
* Wed Mar 05 2014 Vít Ondruch <vondruch@redhat.com> - 2.1.1-18
- Update to Ruby 2.1.1.
* Mon Mar 03 2014 Vít Ondruch <vondruch@redhat.com> - 2.1.0-19
- Add RPM dependency generators for RubyGems.
* Mon Feb 10 2014 Josef Stribny <jstribny@redhat.com> - 2.1.0-19
- Don't link cert.pem explicitely
* Wed Jan 15 2014 Vít Ondruch <vondruch@redhat.com> - 2.0.0.353-17
- Fix RubyGems version (rhbz#1036708).
- Fix FTBFS due to expired certificate for IMAP test case.
* Wed Jan 15 2014 Vít Ondruch <vondruch@redhat.com> - 2.1.0-18
- Don't generate documentation on unexpected places.
- Detect if rubygems are running under rpmbuild and install gem binary
extensions into appropriate place.
- Add support for ppc64le arch (rhbz#1053263).
- Re-enable some test cases, which are passing now with Kernel 3.12.8+.
- Backport fix for floating point issues on i686.
* Mon Nov 25 2013 Vít Ondruch <vondruch@redhat.com> - 2.0.0.353-16
- Update to Ruby 2.0.0-p353.
* Thu Jan 02 2014 Vít Ondruch <vondruch@redhat.com> - 2.1.0-17
- Upgrade to Ruby 2.1.0.
- Move RPM macros into /usr/lib/rpm/macros.d directory.
- Allow MD5 in OpenSSL for tests.
- Fix heap overflow in floating point parsing (CVE-2013-4164).
* Tue Jul 30 2013 Vít Ondruch <vondruch@redhat.com> - 2.0.0.247-15
- Move Psych symlinks to vendor dir, to prevent F18 -> F19 upgrade issues

View File

@ -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

3
rubygems.attr Normal file
View File

@ -0,0 +1,3 @@
%__rubygems_requires %{_rpmconfigdir}/rubygems.req
%__rubygems_provides %{_rpmconfigdir}/rubygems.prov
%__rubygems_path ^%{gem_spec}$

36
rubygems.prov Normal file
View File

@ -0,0 +1,36 @@
#!/usr/bin/ruby
require 'rubygems/package'
module RubyGemsProv
module Helpers
# If there is some prelease version files, such as rc1 (i.e. non-numeric
# field), prepend this field by tilde instead of dot.
def self.normalize_prerelease(version)
if version.prerelease?
prerelease = version.version.sub /^#{version.release}\./, ''
"#{version.release}-0.1.#{prerelease}"
else
"#{version.release}-1"
end
end
end
# Reports all functionality gem provides.
def self.provides
while filename = gets
filename.strip!
begin
specification = Gem::Specification.load filename
puts "rubygem(#{specification.name}) = #{Helpers::normalize_prerelease(specification.version)}"
rescue => e
# Ignore all errors.
end
end
end
end
if __FILE__ == $0
RubyGemsProv::provides
end

81
rubygems.req Normal file
View File

@ -0,0 +1,81 @@
#!/usr/bin/ruby
require 'rubygems/package'
module RubyGemsReq
module Helpers
# Expands '~>' and '!=' gem requirements.
def self.expand_requirement(requirements)
requirements.inject([]) do |output, r|
output.concat case r.first
when '~>'
expand_pessimistic_requirement(r)
when '!='
expand_not_equal_requirement(r)
else
[r]
end
end
end
# Expands the pessimistic version operator '~>' into equivalent '>=' and
# '<' pair.
def self.expand_pessimistic_requirement(requirement)
next_version = Gem::Version.create(requirement.last).bump
return ['>=', requirement.last], ['<', next_version]
end
# Expands the not equal version operator '!=' into equivalent '<' and
# '>' pair.
def self.expand_not_equal_requirement(requirement)
return ['<', requirement.last], ['>', requirement.last]
end
# Converts Gem::Requirement into array of requirements strings compatible
# with RPM .spec file.
def self.requirement_versions_to_rpm(requirement)
self.expand_requirement(requirement.requirements).map do |op, version|
version == Gem::Version.new(0) ? "" : "#{op} #{version}"
end
end
end
# Report RubyGems dependency, versioned if required.
def self.rubygems_dependency(specification)
Helpers::requirement_versions_to_rpm(specification.required_rubygems_version).each do |requirement|
dependency_string = "ruby(rubygems)"
dependency_string += " #{specification.required_rubygems_version}" if requirement && requirement.length > 0
puts dependency_string
end
end
# Report all gem dependencies including their version.
def self.gem_depenencies(specification)
specification.runtime_dependencies.each do |dependency|
Helpers::requirement_versions_to_rpm(dependency.requirement).each do |requirement|
dependency_string = "rubygem(#{dependency.name})"
dependency_string += " #{requirement}" if requirement && requirement.length > 0
puts dependency_string
end
end
end
# Reports all requirements specified by all provided .gemspec files.
def self.requires
while filename = gets
filename.strip!
begin
specification = Gem::Specification.load filename
rubygems_dependency(specification)
gem_depenencies(specification)
rescue => e
# Ignore all errors.
end
end
end
end
if __FILE__ == $0
RubyGemsReq::requires
end