summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authortaca <taca>2010-09-10 03:48:40 +0000
committertaca <taca>2010-09-10 03:48:40 +0000
commitd4551e9e97c089b6f2b5c3255e0b75110adb833b (patch)
treef17c65de36621fc574638035a8ccfa9822391077 /misc
parent55e399db96d20f42fa24324025dd9b9fd7f09d09 (diff)
downloadpkgsrc-d4551e9e97c089b6f2b5c3255e0b75110adb833b.tar.gz
* take maintainer ship.
* Add LICENSE. * Adjust new ruby packages' framework. * Command name is gem${RUBY_VER} == gem18 now and add ALTERNATIVES. * Add comments to patches. * Overhalt --install_root option. * Avoid access HOME when --install_root is enabled. * honor PKG_SYSCONFDIR. Bump PKGREVISION.
Diffstat (limited to 'misc')
-rw-r--r--misc/rubygems/ALTERNATIVES1
-rw-r--r--misc/rubygems/Makefile18
-rw-r--r--misc/rubygems/PLIST12
-rw-r--r--misc/rubygems/distinfo25
-rw-r--r--misc/rubygems/patches/patch-aa4
-rw-r--r--misc/rubygems/patches/patch-ab4
-rw-r--r--misc/rubygems/patches/patch-ac8
-rw-r--r--misc/rubygems/patches/patch-ad4
-rw-r--r--misc/rubygems/patches/patch-af4
-rw-r--r--misc/rubygems/patches/patch-ag25
-rw-r--r--misc/rubygems/patches/patch-ah39
-rw-r--r--misc/rubygems/patches/patch-aj4
-rw-r--r--misc/rubygems/patches/patch-ak8
-rw-r--r--misc/rubygems/patches/patch-al15
-rw-r--r--misc/rubygems/patches/patch-am38
-rw-r--r--misc/rubygems/patches/patch-an27
-rw-r--r--misc/rubygems/patches/patch-ao34
-rw-r--r--misc/rubygems/patches/patch-ap24
18 files changed, 232 insertions, 62 deletions
diff --git a/misc/rubygems/ALTERNATIVES b/misc/rubygems/ALTERNATIVES
new file mode 100644
index 00000000000..a855e421a3f
--- /dev/null
+++ b/misc/rubygems/ALTERNATIVES
@@ -0,0 +1 @@
+bin/gem @PREFIX@/bin/gem@RUBY_VER@
diff --git a/misc/rubygems/Makefile b/misc/rubygems/Makefile
index 39c5e6ea64b..78fb4d18266 100644
--- a/misc/rubygems/Makefile
+++ b/misc/rubygems/Makefile
@@ -1,14 +1,15 @@
-# $NetBSD: Makefile,v 1.31 2010/09/07 17:20:26 taca Exp $
+# $NetBSD: Makefile,v 1.32 2010/09/10 03:48:40 taca Exp $
DISTNAME= rubygems-1.3.5
-PKGREVISION= 2
+PKGREVISION= 3
CATEGORIES= misc ruby
MASTER_SITES= http://rubyforge.org/frs/download.php/60718/
EXTRACT_SUFX= .tgz
-MAINTAINER= minskim@NetBSD.org
+MAINTAINER= taca@NetBSD.org
HOMEPAGE= http://www.rubygems.org/
COMMENT= Ruby standard for publishing and managing third party libraries
+LICENSE= gnu-gpl-v2 OR ruby-license
PKG_DESTDIR_SUPPORT= user-destdir
@@ -17,12 +18,12 @@ PKG_DESTDIR_SUPPORT= user-destdir
NO_CONFIGURE= yes
NO_BUILD= yes
RUBY_REQD= 1.8.7
+RUBY_VERSION= ${RUBY18_VERSION}
RUBY_VERSION_SUPPORTED= 18
REPLACE_RUBY_DIRS= bin
REPLACE_RUBY_PAT= [a-z]*
-GEM_HOME= ${PREFIX}/lib/ruby/gems/${RUBY_VER_DIR}
GEM_DOCDIR= ${GEM_HOME}/doc/${DISTNAME}
REQD_DIRS= ${GEM_HOME:H}
@@ -38,7 +39,6 @@ SUBST_FILES.conf= lib/rubygems/config_file.rb
SUBST_SED.conf= -e "s|@PKG_SYSCONFDIR@|${PKG_SYSCONFDIR}|g"
SUBST_MESSAGE.conf= Fixing configuration files.
-
# Generate a dynamic PLIST for the rubygems documentation directory.
GENERATE_PLIST+= \
${ECHO} "@comment The following lines are automatically generated." && \
@@ -46,17 +46,14 @@ GENERATE_PLIST+= \
${FIND} ${GEM_DOCDIR:S|${PREFIX}/||} \! -type d -print | \
${SORT};
-.include "../../lang/ruby/modules.mk"
-
# Force the Gem repository to be under ${DESTDIR}. This is harmless
# because this package depends on no other gems.
#
-INSTALL_ENV+= GEM_HOME=${DESTDIR}${GEM_HOME}
-INSTALL_ENV+= GEM_PATH=${DESTDIR}${GEM_HOME}
+INSTALL_ENV+= GEM_HOME=${DESTDIR}${PREFIX}/${GEM_HOME}
+INSTALL_ENV+= GEM_PATH=${DESTDIR}${PREFIX}/${GEM_HOME}
INSTALL_TARGET= install
INSTALL_TARGET+= --vendor
-INSTALL_TARGET+= --no-format-executable # "bin/gem", not "bin/gem18"
.if ${_USE_DESTDIR} != "no"
INSTALL_TARGET+= --destdir=${DESTDIR:Q}
.endif
@@ -68,4 +65,5 @@ do-install:
cd ${WRKSRC} && ${SETENV} ${INSTALL_ENV} ${MAKE_ENV} \
${RUBY} setup.rb ${INSTALL_TARGET}
+.include "../../lang/ruby/modules.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/misc/rubygems/PLIST b/misc/rubygems/PLIST
index 65324df7fff..a435482a459 100644
--- a/misc/rubygems/PLIST
+++ b/misc/rubygems/PLIST
@@ -1,7 +1,8 @@
-@comment $NetBSD: PLIST,v 1.13 2009/07/24 06:38:53 minskim Exp $
-bin/gem
+@comment $NetBSD: PLIST,v 1.14 2010/09/10 03:48:40 taca Exp $
+bin/gem${RUBY_VER}
${RUBY_VENDORLIB}/gauntlet_rubygems.rb
${RUBY_VENDORLIB}/rbconfig/datadir.rb
+${RUBY_VENDORLIB}/rubygems.rb
${RUBY_VENDORLIB}/rubygems/builder.rb
${RUBY_VENDORLIB}/rubygems/command.rb
${RUBY_VENDORLIB}/rubygems/command_manager.rb
@@ -45,11 +46,11 @@ ${RUBY_VENDORLIB}/rubygems/digest/sha1.rb
${RUBY_VENDORLIB}/rubygems/digest/sha2.rb
${RUBY_VENDORLIB}/rubygems/doc_manager.rb
${RUBY_VENDORLIB}/rubygems/exceptions.rb
+${RUBY_VENDORLIB}/rubygems/ext.rb
${RUBY_VENDORLIB}/rubygems/ext/builder.rb
${RUBY_VENDORLIB}/rubygems/ext/configure_builder.rb
${RUBY_VENDORLIB}/rubygems/ext/ext_conf_builder.rb
${RUBY_VENDORLIB}/rubygems/ext/rake_builder.rb
-${RUBY_VENDORLIB}/rubygems/ext.rb
${RUBY_VENDORLIB}/rubygems/format.rb
${RUBY_VENDORLIB}/rubygems/gem_openssl.rb
${RUBY_VENDORLIB}/rubygems/gem_path_searcher.rb
@@ -59,14 +60,14 @@ ${RUBY_VENDORLIB}/rubygems/install_update_options.rb
${RUBY_VENDORLIB}/rubygems/installer.rb
${RUBY_VENDORLIB}/rubygems/local_remote_options.rb
${RUBY_VENDORLIB}/rubygems/old_format.rb
+${RUBY_VENDORLIB}/rubygems/package.rb
${RUBY_VENDORLIB}/rubygems/package/f_sync_dir.rb
${RUBY_VENDORLIB}/rubygems/package/tar_header.rb
${RUBY_VENDORLIB}/rubygems/package/tar_input.rb
${RUBY_VENDORLIB}/rubygems/package/tar_output.rb
-${RUBY_VENDORLIB}/rubygems/package/tar_reader/entry.rb
${RUBY_VENDORLIB}/rubygems/package/tar_reader.rb
+${RUBY_VENDORLIB}/rubygems/package/tar_reader/entry.rb
${RUBY_VENDORLIB}/rubygems/package/tar_writer.rb
-${RUBY_VENDORLIB}/rubygems/package.rb
${RUBY_VENDORLIB}/rubygems/package_task.rb
${RUBY_VENDORLIB}/rubygems/platform.rb
${RUBY_VENDORLIB}/rubygems/remote_fetcher.rb
@@ -87,5 +88,4 @@ ${RUBY_VENDORLIB}/rubygems/user_interaction.rb
${RUBY_VENDORLIB}/rubygems/validator.rb
${RUBY_VENDORLIB}/rubygems/version.rb
${RUBY_VENDORLIB}/rubygems/version_option.rb
-${RUBY_VENDORLIB}/rubygems.rb
${RUBY_VENDORLIB}/ubygems.rb
diff --git a/misc/rubygems/distinfo b/misc/rubygems/distinfo
index 44e680e5b3b..d45339ab3b4 100644
--- a/misc/rubygems/distinfo
+++ b/misc/rubygems/distinfo
@@ -1,14 +1,19 @@
-$NetBSD: distinfo,v 1.24 2010/01/27 13:21:58 fhajny Exp $
+$NetBSD: distinfo,v 1.25 2010/09/10 03:48:40 taca Exp $
SHA1 (rubygems-1.3.5.tgz) = 8545f25d00c757a310b879a2580e56d6012fc981
RMD160 (rubygems-1.3.5.tgz) = 2d17f0de2d387bd2a034916cb79531110f3be196
Size (rubygems-1.3.5.tgz) = 278469 bytes
-SHA1 (patch-aa) = 4c5085a9a7cee24fe42ddbfc3524588838af4e16
-SHA1 (patch-ab) = b38026920e31ae7782df6bbd7d7285d18dcf6ece
-SHA1 (patch-ac) = 30ff76c661575d9c51051bb207363f3d2d8b5283
-SHA1 (patch-ad) = 9e6b11f5edae0656a59d623f4dae05ca7ecbdfaf
-SHA1 (patch-af) = a89a1e21fa6389359653c21ed5eac02d84114b51
-SHA1 (patch-ag) = 2892adb1fdfeac0d50b7ffea8b1f802094195ba3
-SHA1 (patch-ah) = 015aaccf066333d057997404f43b126e648ff379
-SHA1 (patch-aj) = fa2192319a01e7a9dc50e497de5d3d52ab9f5768
-SHA1 (patch-ak) = 999b52ab6f61dd1c81608d08418b9bb34bdc8aa6
+SHA1 (patch-aa) = fc267424284e9e020c9b4643330f429b1b934512
+SHA1 (patch-ab) = b4c9df1c829ba5d2159f43e999a2b696ceaea96d
+SHA1 (patch-ac) = de613df5f7b17e3a9fe5cbc4febe6bebe479dff8
+SHA1 (patch-ad) = 3bc027ca7a020edc158e01a71d4d3b55a994e2d0
+SHA1 (patch-af) = f8ba8859790d55bfadee6aadff97eda8218b5811
+SHA1 (patch-ag) = c5bfa929fe235f13577a7430d270d90129e55e57
+SHA1 (patch-ah) = d7564cce46999d2d82b1290abddc863dea2498ab
+SHA1 (patch-aj) = 5950f31e8e0c533663816bd8b8a592548f8b452b
+SHA1 (patch-ak) = aa1aceba13e9b4c7d90ba28061fac5a502a5efbe
+SHA1 (patch-al) = d0e26e23501274749831ff4bd9f4f8ff8bc774ab
+SHA1 (patch-am) = 0d77f1d03ef372b1de337e332b4d669857bc4d98
+SHA1 (patch-an) = 233524d9fc5522942989006d87afae13c46b818d
+SHA1 (patch-ao) = b1d713a0cd10cae91657440cb97c4043a00d2ff8
+SHA1 (patch-ap) = c70cd7cf263ef53fc4fde1fd9b499563dab1325b
diff --git a/misc/rubygems/patches/patch-aa b/misc/rubygems/patches/patch-aa
index da5d95bf51f..a79b646efe1 100644
--- a/misc/rubygems/patches/patch-aa
+++ b/misc/rubygems/patches/patch-aa
@@ -1,4 +1,6 @@
-$NetBSD: patch-aa,v 1.7 2009/06/12 23:02:57 minskim Exp $
+$NetBSD: patch-aa,v 1.8 2010/09/10 03:48:40 taca Exp $
+
+* Avoid access nil.
--- lib/rubygems/specification.rb.orig 2009-05-19 17:41:16.000000000 -0700
+++ lib/rubygems/specification.rb
diff --git a/misc/rubygems/patches/patch-ab b/misc/rubygems/patches/patch-ab
index ede66049c89..2fbe4eafc08 100644
--- a/misc/rubygems/patches/patch-ab
+++ b/misc/rubygems/patches/patch-ab
@@ -1,4 +1,6 @@
-$NetBSD: patch-ab,v 1.10 2009/06/10 21:44:31 minskim Exp $
+$NetBSD: patch-ab,v 1.11 2010/09/10 03:48:40 taca Exp $
+
+Add install_root option for pkgsrc's rubygems support.
--- lib/rubygems/dependency_installer.rb.orig 2009-03-04 17:07:04.000000000 -0800
+++ lib/rubygems/dependency_installer.rb
diff --git a/misc/rubygems/patches/patch-ac b/misc/rubygems/patches/patch-ac
index 4de08924d1c..bd270e4cd4e 100644
--- a/misc/rubygems/patches/patch-ac
+++ b/misc/rubygems/patches/patch-ac
@@ -1,12 +1,14 @@
-$NetBSD: patch-ac,v 1.4 2009/06/10 21:44:31 minskim Exp $
+$NetBSD: patch-ac,v 1.5 2010/09/10 03:48:40 taca Exp $
---- lib/rubygems/install_update_options.rb.orig 2009-03-13 16:01:10.000000000 -0700
+Add install_root option for pkgsrc's rubygems support.
+
+--- lib/rubygems/install_update_options.rb.orig 2009-06-22 22:54:36.000000000 +0000
+++ lib/rubygems/install_update_options.rb
@@ -34,6 +34,12 @@ module Gem::InstallUpdateOptions
options[:bin_dir] = File.expand_path(value)
end
-+ add_option(:"Install", '-B', '--install-root DIR',
++ add_option(:"Install/Update", '-B', '--install-root DIR',
+ 'Root directory for gem files on install') do |value, options|
+ options[:install_root] = File.expand_path(value)
+ Gem.ensure_gem_subdirectories File.join options[:install_root], Gem.dir
diff --git a/misc/rubygems/patches/patch-ad b/misc/rubygems/patches/patch-ad
index 973f24c7f4b..6da53d1749a 100644
--- a/misc/rubygems/patches/patch-ad
+++ b/misc/rubygems/patches/patch-ad
@@ -1,4 +1,6 @@
-$NetBSD: patch-ad,v 1.5 2009/06/10 21:44:31 minskim Exp $
+$NetBSD: patch-ad,v 1.6 2010/09/10 03:48:40 taca Exp $
+
+Add install_root option for pkgsrc's rubygems support.
--- lib/rubygems/installer.rb.orig 2009-03-31 21:06:19.000000000 -0700
+++ lib/rubygems/installer.rb
diff --git a/misc/rubygems/patches/patch-af b/misc/rubygems/patches/patch-af
index cbfee4da6c5..65057ddc416 100644
--- a/misc/rubygems/patches/patch-af
+++ b/misc/rubygems/patches/patch-af
@@ -1,4 +1,6 @@
-$NetBSD: patch-af,v 1.3 2009/06/10 21:44:31 minskim Exp $
+$NetBSD: patch-af,v 1.4 2010/09/10 03:48:40 taca Exp $
+
+Add install_root option for pkgsrc's rubygems support.
--- lib/rubygems/commands/uninstall_command.rb.orig 2009-03-13 16:16:55.000000000 -0700
+++ lib/rubygems/commands/uninstall_command.rb
diff --git a/misc/rubygems/patches/patch-ag b/misc/rubygems/patches/patch-ag
index c04139b7092..5594857c6e4 100644
--- a/misc/rubygems/patches/patch-ag
+++ b/misc/rubygems/patches/patch-ag
@@ -1,10 +1,12 @@
-$NetBSD: patch-ag,v 1.6 2010/01/27 13:21:58 fhajny Exp $
+$NetBSD: patch-ag,v 1.7 2010/09/10 03:48:40 taca Exp $
---- lib/rubygems/uninstaller.rb.orig 2009-05-15 11:32:23.000000000 -0700
+Add install_root option for pkgsrc's rubygems support.
+
+--- lib/rubygems/uninstaller.rb.orig 2009-06-22 22:54:36.000000000 +0000
+++ lib/rubygems/uninstaller.rb
-@@ -55,6 +55,12 @@ class Gem::Uninstaller
- @user_install = false
- @user_install = options[:user_install] unless options[:install_dir]
+@@ -51,6 +51,12 @@ class Gem::Uninstaller
+ @force_ignore = options[:ignore]
+ @bin_dir = options[:bin_dir]
+ install_root = options[:install_root]
+ unless install_root.nil? or install_root == ""
@@ -12,14 +14,15 @@ $NetBSD: patch-ag,v 1.6 2010/01/27 13:21:58 fhajny Exp $
+ @gem_home = File.join(@install_root, @gem_home)
+ end
+
- spec_dir = File.join @gem_home, 'specifications'
- @source_index = Gem::SourceIndex.from_gems_in spec_dir
-
-@@ -125,6 +131,11 @@ class Gem::Uninstaller
+ # only add user directory if install_dir is not set
+ @user_install = false
+ @user_install = options[:user_install] unless options[:install_dir]
+@@ -124,7 +130,11 @@ class Gem::Uninstaller
+ return if spec.nil?
unless spec.executables.empty? then
- bindir = @bin_dir ? @bin_dir : Gem.bindir(spec.installation_path)
-+ bindir = @bin_dir ? @bin_dir : Gem.bindir(spec.installation_path, @install_root)
+- bindir = @bin_dir ? @bin_dir : Gem.bindir(spec.installation_path)
++ bindir = @bin_dir ? @bin_dir : (Gem.bindir @gem_home, @install_root)
+
+ unless @install_root.nil? or @install_root == ""
+ bindir = File.join(@install_root, bindir)
diff --git a/misc/rubygems/patches/patch-ah b/misc/rubygems/patches/patch-ah
index 43205b9a63e..53eee21e4a7 100644
--- a/misc/rubygems/patches/patch-ah
+++ b/misc/rubygems/patches/patch-ah
@@ -1,23 +1,22 @@
-$NetBSD: patch-ah,v 1.5 2009/06/10 21:44:31 minskim Exp $
+$NetBSD: patch-ah,v 1.6 2010/09/10 03:48:40 taca Exp $
---- lib/rubygems.rb.orig 2009-05-21 14:44:06.000000000 -0700
+Add install_root option for pkgsrc's rubygems support.
+
+--- lib/rubygems.rb.orig 2009-07-21 23:46:08.000000000 +0000
+++ lib/rubygems.rb
-@@ -396,7 +396,13 @@ module Gem
+@@ -397,7 +397,10 @@ module Gem
##
# The path where gem executables are to be installed.
- def self.bindir(install_dir=Gem.dir)
+ def self.bindir(install_dir=Gem.dir, install_root=nil)
+ unless install_root.nil?
-+ install_root_path = Pathname.new install_root
-+ install_dir_path = Pathname.new install_dir
-+ install_dir_path = install_dir_path.relative_path_from install_root_path
-+ install_dir = install_dir_path.expand_path File::SEPARATOR
++ install_dir = install_dir.sub(install_root, "")
+ end
return File.join(install_dir, 'bin') unless
install_dir.to_s == Gem.default_dir
Gem.default_bindir
-@@ -637,12 +643,12 @@ module Gem
+@@ -638,12 +641,12 @@ module Gem
##
# The index to insert activated gem paths into the $LOAD_PATH.
#
@@ -32,13 +31,25 @@ $NetBSD: patch-ah,v 1.5 2009/06/10 21:44:31 minskim Exp $
$LOAD_PATH.each_with_index do |path, i|
if path.instance_variables.include?(:@gem_prelude_index) or
-@@ -750,7 +756,8 @@ module Gem
+@@ -749,14 +752,16 @@ module Gem
+ # The directory prefix this RubyGems was installed at.
+
def self.prefix
- prefix = File.dirname File.expand_path(__FILE__)
+- prefix = File.dirname File.expand_path(__FILE__)
++ dir = File.dirname File.expand_path(__FILE__)
++ prefix = File.dirname dir
- if File.dirname(prefix) == File.expand_path(ConfigMap[:sitelibdir]) or
-+ if File.dirname(prefix) == File.expand_path(ConfigMap[:vendorlibdir]) or
-+ File.dirname(prefix) == File.expand_path(ConfigMap[:sitelibdir]) or
- File.dirname(prefix) == File.expand_path(ConfigMap[:libdir]) or
- 'lib' != File.basename(prefix) then
+- File.dirname(prefix) == File.expand_path(ConfigMap[:libdir]) or
+- 'lib' != File.basename(prefix) then
++ if prefix == File.expand_path(ConfigMap[:sitelibdir]) or
++ prefix == File.expand_path(ConfigMap[:vendorlibdir]) or
++ prefix == File.expand_path(ConfigMap[:libdir]) or
++ 'lib' != File.basename(dir) then
nil
+ else
+- File.dirname prefix
++ prefix
+ end
+ end
+
diff --git a/misc/rubygems/patches/patch-aj b/misc/rubygems/patches/patch-aj
index 4ea55b0ee55..15685ad4320 100644
--- a/misc/rubygems/patches/patch-aj
+++ b/misc/rubygems/patches/patch-aj
@@ -1,4 +1,6 @@
-$NetBSD: patch-aj,v 1.4 2009/06/10 21:44:31 minskim Exp $
+$NetBSD: patch-aj,v 1.5 2010/09/10 03:48:40 taca Exp $
+
+Use vendordir instead of sitedir.
--- lib/rubygems/defaults.rb.orig 2009-05-20 16:30:35.000000000 -0700
+++ lib/rubygems/defaults.rb
diff --git a/misc/rubygems/patches/patch-ak b/misc/rubygems/patches/patch-ak
index aafcd055831..b59e71be76c 100644
--- a/misc/rubygems/patches/patch-ak
+++ b/misc/rubygems/patches/patch-ak
@@ -1,8 +1,10 @@
-$NetBSD: patch-ak,v 1.3 2009/04/07 07:35:44 minskim Exp $
+$NetBSD: patch-ak,v 1.4 2010/09/10 03:48:40 taca Exp $
---- test/test_gem.rb.orig 2008-10-09 15:42:25.000000000 -0700
+Use vendordir instead of sitedir.
+
+--- test/test_gem.rb.orig 2009-07-05 17:26:22.000000000 +0000
+++ test/test_gem.rb
-@@ -384,18 +384,18 @@ class TestGem < RubyGemTestCase
+@@ -425,18 +425,18 @@ class TestGem < RubyGemTestCase
Gem::ConfigMap[:libdir] = orig_libdir
end
diff --git a/misc/rubygems/patches/patch-al b/misc/rubygems/patches/patch-al
new file mode 100644
index 00000000000..842ec1fb373
--- /dev/null
+++ b/misc/rubygems/patches/patch-al
@@ -0,0 +1,15 @@
+$NetBSD: patch-al,v 1.1 2010/09/10 03:48:40 taca Exp $
+
+Prevent access to HOME when --install-root is used.
+
+--- lib/rubygems/commands/install_command.rb.orig 2009-06-22 22:54:36.000000000 +0000
++++ lib/rubygems/commands/install_command.rb
+@@ -144,7 +144,7 @@ to write the specification by hand. For
+ Gem::DocManager.new(gem, options[:rdoc_args]).generate_ri
+ end
+
+- Gem::DocManager.update_ri_cache
++ Gem::DocManager.update_ri_cache(options[:install_root])
+ end
+
+ if options[:generate_rdoc] then
diff --git a/misc/rubygems/patches/patch-am b/misc/rubygems/patches/patch-am
new file mode 100644
index 00000000000..2f9abc362cc
--- /dev/null
+++ b/misc/rubygems/patches/patch-am
@@ -0,0 +1,38 @@
+$NetBSD: patch-am,v 1.1 2010/09/10 03:48:40 taca Exp $
+
+Make sure to setup under DESTDIR.
+
+--- lib/rubygems/commands/setup_command.rb.orig 2009-06-26 00:43:45.000000000 +0000
++++ lib/rubygems/commands/setup_command.rb
+@@ -117,7 +117,7 @@ By default, this RubyGems will install g
+
+ say "RubyGems #{Gem::VERSION} installed"
+
+- install_rdoc
++ install_rdoc install_destdir
+
+ say
+ if @verbose then
+@@ -228,16 +228,20 @@ TEXT
+ end
+ end
+
+- def install_rdoc
++ def install_rdoc(install_destdir)
+ gem_doc_dir = File.join Gem.dir, 'doc'
+ rubygems_name = "rubygems-#{Gem::RubyGemsVersion}"
+ rubygems_doc_dir = File.join gem_doc_dir, rubygems_name
+
++ unless install_destdir.empty?
++ FileUtils.mkdir_p gem_doc_dir unless File.exist?(gem_doc_dir)
++ end
++
+ if File.writable? gem_doc_dir and
+ (not File.exist? rubygems_doc_dir or
+ File.writable? rubygems_doc_dir) then
+ say "Removing old RubyGems RDoc and ri" if @verbose
+- Dir[File.join(Gem.dir, 'doc', 'rubygems-[0-9]*')].each do |dir|
++ Dir[File.join(gem_doc_dir, 'rubygems-[0-9]*')].each do |dir|
+ rm_rf dir
+ end
+
diff --git a/misc/rubygems/patches/patch-an b/misc/rubygems/patches/patch-an
new file mode 100644
index 00000000000..dbd9311748c
--- /dev/null
+++ b/misc/rubygems/patches/patch-an
@@ -0,0 +1,27 @@
+$NetBSD: patch-an,v 1.1 2010/09/10 03:48:40 taca Exp $
+
+Add install_root option for pkgsrc's rubygems support.
+
+--- lib/rubygems/commands/unpack_command.rb.orig 2009-06-22 22:54:36.000000000 +0000
++++ lib/rubygems/commands/unpack_command.rb
+@@ -12,6 +12,10 @@ class Gem::Commands::UnpackCommand < Gem
+ :version => Gem::Requirement.default,
+ :target => Dir.pwd
+
++ add_option('--install-root DIR', 'Root directory for gem files on extract') do |value, options|
++ options[:install_root] = value
++ end
++
+ add_option('--target=DIR', 'target directory for unpacking') do |value, options|
+ options[:target] = value
+ end
+@@ -44,7 +48,8 @@ class Gem::Commands::UnpackCommand < Gem
+ basename = File.basename(path).sub(/\.gem$/, '')
+ target_dir = File.expand_path File.join(options[:target], basename)
+ FileUtils.mkdir_p target_dir
+- Gem::Installer.new(path, :unpack => true).unpack target_dir
++ Gem::Installer.new(path, :unpack => true,
++ :install_root => options[:install_root]).unpack target_dir
+ say "Unpacked gem: '#{target_dir}'"
+ else
+ alert_error "Gem '#{name}' not installed."
diff --git a/misc/rubygems/patches/patch-ao b/misc/rubygems/patches/patch-ao
new file mode 100644
index 00000000000..c41cc8dbba7
--- /dev/null
+++ b/misc/rubygems/patches/patch-ao
@@ -0,0 +1,34 @@
+$NetBSD: patch-ao,v 1.1 2010/09/10 03:48:40 taca Exp $
+
+Don't hard code config file's path for gem.
+
+--- lib/rubygems/config_file.rb.orig 2009-06-25 21:37:14.000000000 +0000
++++ lib/rubygems/config_file.rb
+@@ -29,26 +29,7 @@ class Gem::ConfigFile
+
+ PLATFORM_DEFAULTS = {}
+
+- system_config_path =
+- begin
+- require 'Win32API'
+-
+- CSIDL_COMMON_APPDATA = 0x0023
+- path = 0.chr * 260
+- if RUBY_VERSION > '1.9' then
+- SHGetFolderPath = Win32API.new 'shell32', 'SHGetFolderPath', 'PLPLP',
+- 'L', :stdcall
+- SHGetFolderPath.call nil, CSIDL_COMMON_APPDATA, nil, 1, path
+- else
+- SHGetFolderPath = Win32API.new 'shell32', 'SHGetFolderPath', 'LLLLP',
+- 'L'
+- SHGetFolderPath.call 0, CSIDL_COMMON_APPDATA, 0, 1, path
+- end
+-
+- path.strip
+- rescue LoadError
+- '/etc'
+- end
++ system_config_path = '@PKG_SYSCONFDIR@'
+
+ SYSTEM_WIDE_CONFIG_FILE = File.join system_config_path, 'gemrc'
+
diff --git a/misc/rubygems/patches/patch-ap b/misc/rubygems/patches/patch-ap
new file mode 100644
index 00000000000..f58994ff7ca
--- /dev/null
+++ b/misc/rubygems/patches/patch-ap
@@ -0,0 +1,24 @@
+$NetBSD: patch-ap,v 1.1 2010/09/10 03:48:40 taca Exp $
+
+Prevent access to HOME when --install-root is used.
+
+--- lib/rubygems/doc_manager.rb.orig 2009-06-22 22:54:36.000000000 +0000
++++ lib/rubygems/doc_manager.rb
+@@ -61,7 +61,7 @@ class Gem::DocManager
+ ##
+ # Updates the RI cache for RDoc 2 if it is installed
+
+- def self.update_ri_cache
++ def self.update_ri_cache(install_root = nil)
+ load_rdoc rescue return
+
+ return unless defined? RDoc::VERSION # RDoc 1 does not have VERSION
+@@ -72,7 +72,7 @@ class Gem::DocManager
+ :use_cache => true,
+ :use_system => true,
+ :use_site => true,
+- :use_home => true,
++ :use_home => (install_root == nil)? true: false,
+ :use_gems => true,
+ :formatter => RDoc::RI::Formatter,
+ }