Fri Sep 10 03:48:40 2010 UTC ()
* 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.


(taca)
diff -r0 -r1.1 pkgsrc/misc/rubygems/ALTERNATIVES
diff -r1.31 -r1.32 pkgsrc/misc/rubygems/Makefile
diff -r1.13 -r1.14 pkgsrc/misc/rubygems/PLIST
diff -r1.24 -r1.25 pkgsrc/misc/rubygems/distinfo
diff -r1.7 -r1.8 pkgsrc/misc/rubygems/patches/patch-aa
diff -r1.10 -r1.11 pkgsrc/misc/rubygems/patches/patch-ab
diff -r1.4 -r1.5 pkgsrc/misc/rubygems/patches/patch-ac
diff -r1.4 -r1.5 pkgsrc/misc/rubygems/patches/patch-aj
diff -r1.5 -r1.6 pkgsrc/misc/rubygems/patches/patch-ad
diff -r1.5 -r1.6 pkgsrc/misc/rubygems/patches/patch-ah
diff -r1.3 -r1.4 pkgsrc/misc/rubygems/patches/patch-af
diff -r1.3 -r1.4 pkgsrc/misc/rubygems/patches/patch-ak
diff -r1.6 -r1.7 pkgsrc/misc/rubygems/patches/patch-ag
diff -r0 -r1.1 pkgsrc/misc/rubygems/patches/patch-al
diff -r0 -r1.1 pkgsrc/misc/rubygems/patches/patch-am
diff -r0 -r1.1 pkgsrc/misc/rubygems/patches/patch-an
diff -r0 -r1.1 pkgsrc/misc/rubygems/patches/patch-ao
diff -r0 -r1.1 pkgsrc/misc/rubygems/patches/patch-ap

File Added: pkgsrc/misc/rubygems/Attic/ALTERNATIVES
bin/gem @PREFIX@/bin/gem@RUBY_VER@

cvs diff -r1.31 -r1.32 pkgsrc/misc/rubygems/Attic/Makefile (expand / switch to context diff)
--- pkgsrc/misc/rubygems/Attic/Makefile 2010/09/07 17:20:26 1.31
+++ pkgsrc/misc/rubygems/Attic/Makefile 2010/09/10 03:48:40 1.32
@@ -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 @@
 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_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 @@
 	  ${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 @@
 	cd ${WRKSRC} && ${SETENV} ${INSTALL_ENV} ${MAKE_ENV} \
 		${RUBY} setup.rb ${INSTALL_TARGET}
 
+.include "../../lang/ruby/modules.mk"
 .include "../../mk/bsd.pkg.mk"

cvs diff -r1.13 -r1.14 pkgsrc/misc/rubygems/Attic/PLIST (expand / switch to context diff)
--- pkgsrc/misc/rubygems/Attic/PLIST 2009/07/24 06:38:53 1.13
+++ pkgsrc/misc/rubygems/Attic/PLIST 2010/09/10 03:48:40 1.14
@@ -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/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/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/validator.rb
 ${RUBY_VENDORLIB}/rubygems/version.rb
 ${RUBY_VENDORLIB}/rubygems/version_option.rb
-${RUBY_VENDORLIB}/rubygems.rb
 ${RUBY_VENDORLIB}/ubygems.rb

cvs diff -r1.24 -r1.25 pkgsrc/misc/rubygems/Attic/distinfo (expand / switch to context diff)
--- pkgsrc/misc/rubygems/Attic/distinfo 2010/01/27 13:21:58 1.24
+++ pkgsrc/misc/rubygems/Attic/distinfo 2010/09/10 03:48:40 1.25
@@ -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-aa) = fc267424284e9e020c9b4643330f429b1b934512
-SHA1 (patch-ab) = b38026920e31ae7782df6bbd7d7285d18dcf6ece
+SHA1 (patch-ab) = b4c9df1c829ba5d2159f43e999a2b696ceaea96d
-SHA1 (patch-ac) = 30ff76c661575d9c51051bb207363f3d2d8b5283
+SHA1 (patch-ac) = de613df5f7b17e3a9fe5cbc4febe6bebe479dff8
-SHA1 (patch-ad) = 9e6b11f5edae0656a59d623f4dae05ca7ecbdfaf
+SHA1 (patch-ad) = 3bc027ca7a020edc158e01a71d4d3b55a994e2d0
-SHA1 (patch-af) = a89a1e21fa6389359653c21ed5eac02d84114b51
+SHA1 (patch-af) = f8ba8859790d55bfadee6aadff97eda8218b5811
-SHA1 (patch-ag) = 2892adb1fdfeac0d50b7ffea8b1f802094195ba3
+SHA1 (patch-ag) = c5bfa929fe235f13577a7430d270d90129e55e57
-SHA1 (patch-ah) = 015aaccf066333d057997404f43b126e648ff379
+SHA1 (patch-ah) = d7564cce46999d2d82b1290abddc863dea2498ab
-SHA1 (patch-aj) = fa2192319a01e7a9dc50e497de5d3d52ab9f5768
+SHA1 (patch-aj) = 5950f31e8e0c533663816bd8b8a592548f8b452b
-SHA1 (patch-ak) = 999b52ab6f61dd1c81608d08418b9bb34bdc8aa6
+SHA1 (patch-ak) = aa1aceba13e9b4c7d90ba28061fac5a502a5efbe
+SHA1 (patch-al) = d0e26e23501274749831ff4bd9f4f8ff8bc774ab
+SHA1 (patch-am) = 0d77f1d03ef372b1de337e332b4d669857bc4d98
+SHA1 (patch-an) = 233524d9fc5522942989006d87afae13c46b818d
+SHA1 (patch-ao) = b1d713a0cd10cae91657440cb97c4043a00d2ff8
+SHA1 (patch-ap) = c70cd7cf263ef53fc4fde1fd9b499563dab1325b

cvs diff -r1.7 -r1.8 pkgsrc/misc/rubygems/patches/Attic/patch-aa (expand / switch to context diff)
--- pkgsrc/misc/rubygems/patches/Attic/patch-aa 2009/06/12 23:02:57 1.7
+++ pkgsrc/misc/rubygems/patches/Attic/patch-aa 2010/09/10 03:48:40 1.8
@@ -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

cvs diff -r1.10 -r1.11 pkgsrc/misc/rubygems/patches/Attic/patch-ab (expand / switch to context diff)
--- pkgsrc/misc/rubygems/patches/Attic/patch-ab 2009/06/10 21:44:31 1.10
+++ pkgsrc/misc/rubygems/patches/Attic/patch-ab 2010/09/10 03:48:40 1.11
@@ -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

cvs diff -r1.4 -r1.5 pkgsrc/misc/rubygems/patches/Attic/patch-ac (expand / switch to context diff)
--- pkgsrc/misc/rubygems/patches/Attic/patch-ac 2009/06/10 21:44:31 1.4
+++ pkgsrc/misc/rubygems/patches/Attic/patch-ac 2010/09/10 03:48:40 1.5
@@ -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

cvs diff -r1.4 -r1.5 pkgsrc/misc/rubygems/patches/Attic/patch-aj (expand / switch to context diff)
--- pkgsrc/misc/rubygems/patches/Attic/patch-aj 2009/06/10 21:44:31 1.4
+++ pkgsrc/misc/rubygems/patches/Attic/patch-aj 2010/09/10 03:48:40 1.5
@@ -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

cvs diff -r1.5 -r1.6 pkgsrc/misc/rubygems/patches/Attic/patch-ad (expand / switch to context diff)
--- pkgsrc/misc/rubygems/patches/Attic/patch-ad 2009/06/10 21:44:31 1.5
+++ pkgsrc/misc/rubygems/patches/Attic/patch-ad 2010/09/10 03:48:40 1.6
@@ -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

cvs diff -r1.5 -r1.6 pkgsrc/misc/rubygems/patches/Attic/patch-ah (expand / switch to context diff)
--- pkgsrc/misc/rubygems/patches/Attic/patch-ah 2009/06/10 21:44:31 1.5
+++ pkgsrc/misc/rubygems/patches/Attic/patch-ah 2010/09/10 03:48:40 1.6
@@ -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 @@
  
      $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
+ 

cvs diff -r1.3 -r1.4 pkgsrc/misc/rubygems/patches/Attic/patch-af (expand / switch to context diff)
--- pkgsrc/misc/rubygems/patches/Attic/patch-af 2009/06/10 21:44:31 1.3
+++ pkgsrc/misc/rubygems/patches/Attic/patch-af 2010/09/10 03:48:40 1.4
@@ -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

cvs diff -r1.3 -r1.4 pkgsrc/misc/rubygems/patches/Attic/patch-ak (expand / switch to context diff)
--- pkgsrc/misc/rubygems/patches/Attic/patch-ak 2009/04/07 07:35:44 1.3
+++ pkgsrc/misc/rubygems/patches/Attic/patch-ak 2010/09/10 03:48:40 1.4
@@ -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
  

cvs diff -r1.6 -r1.7 pkgsrc/misc/rubygems/patches/Attic/patch-ag (expand / switch to context diff)
--- pkgsrc/misc/rubygems/patches/Attic/patch-ag 2010/01/27 13:21:58 1.6
+++ pkgsrc/misc/rubygems/patches/Attic/patch-ag 2010/09/10 03:48:40 1.7
@@ -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 @@
 +      @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
+     # 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?
  
-@@ -125,6 +131,11 @@ class Gem::Uninstaller
- 
      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)

File Added: pkgsrc/misc/rubygems/patches/Attic/patch-al
$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

File Added: pkgsrc/misc/rubygems/patches/Attic/patch-am
$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
 

File Added: pkgsrc/misc/rubygems/patches/Attic/patch-an
$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."

File Added: pkgsrc/misc/rubygems/patches/Attic/patch-ao
$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'
 

File Added: pkgsrc/misc/rubygems/patches/Attic/patch-ap
$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,
     }