taca 2013-06-11 14:55:54 +00:00
parent 63faf8b5d2
commit 81f3c7b27a
16 changed files with 179 additions and 215 deletions

View file

@ -1,13 +1,12 @@
# $NetBSD: Makefile,v 1.50 2013/02/03 16:04:04 taca Exp $
# $NetBSD: Makefile,v 1.51 2013/06/11 14:55:54 taca Exp $
DISTNAME= rubygems-1.8.25
DISTNAME= rubygems-2.0.3
CATEGORIES= misc ruby
MASTER_SITES= http://production.cf.rubygems.org/rubygems/ \
http://rubyforge.org/frs/download.php/75309/
MASTER_SITES= http://production.cf.rubygems.org/rubygems/
EXTRACT_SUFX= .tgz
MAINTAINER= taca@NetBSD.org
HOMEPAGE= http://www.rubygems.org/
HOMEPAGE= https://rubygems.org/
COMMENT= Ruby standard for publishing and managing third party libraries
LICENSE= gnu-gpl-v2 OR ruby-license

View file

@ -1,9 +1,8 @@
@comment $NetBSD: PLIST,v 1.21 2012/04/28 13:52:45 taca Exp $
@comment $NetBSD: PLIST,v 1.22 2013/06/11 14:55:54 taca Exp $
bin/gem${RUBY_VER}.new
${RUBY_VENDORLIB}/gauntlet_rubygems.rb
${RUBY_VENDORLIB}/rbconfig/datadir.rb
${RUBY_VENDORLIB}/rubygems.rb
${RUBY_VENDORLIB}/rubygems/builder.rb
${RUBY_VENDORLIB}/rubygems/available_set.rb
${RUBY_VENDORLIB}/rubygems/command.rb
${RUBY_VENDORLIB}/rubygems/command_manager.rb
${RUBY_VENDORLIB}/rubygems/commands/build_command.rb
@ -19,6 +18,7 @@ ${RUBY_VENDORLIB}/rubygems/commands/help_command.rb
${RUBY_VENDORLIB}/rubygems/commands/install_command.rb
${RUBY_VENDORLIB}/rubygems/commands/list_command.rb
${RUBY_VENDORLIB}/rubygems/commands/lock_command.rb
${RUBY_VENDORLIB}/rubygems/commands/mirror_command.rb
${RUBY_VENDORLIB}/rubygems/commands/outdated_command.rb
${RUBY_VENDORLIB}/rubygems/commands/owner_command.rb
${RUBY_VENDORLIB}/rubygems/commands/pristine_command.rb
@ -35,38 +35,40 @@ ${RUBY_VENDORLIB}/rubygems/commands/uninstall_command.rb
${RUBY_VENDORLIB}/rubygems/commands/unpack_command.rb
${RUBY_VENDORLIB}/rubygems/commands/update_command.rb
${RUBY_VENDORLIB}/rubygems/commands/which_command.rb
${RUBY_VENDORLIB}/rubygems/commands/yank_command.rb
${RUBY_VENDORLIB}/rubygems/compatibility.rb
${RUBY_VENDORLIB}/rubygems/config_file.rb
${RUBY_VENDORLIB}/rubygems/custom_require.rb
${RUBY_VENDORLIB}/rubygems/core_ext/kernel_gem.rb
${RUBY_VENDORLIB}/rubygems/core_ext/kernel_require.rb
${RUBY_VENDORLIB}/rubygems/defaults.rb
${RUBY_VENDORLIB}/rubygems/dependency.rb
${RUBY_VENDORLIB}/rubygems/dependency_installer.rb
${RUBY_VENDORLIB}/rubygems/dependency_list.rb
${RUBY_VENDORLIB}/rubygems/dependency_resolver.rb
${RUBY_VENDORLIB}/rubygems/deprecate.rb
${RUBY_VENDORLIB}/rubygems/doc_manager.rb
${RUBY_VENDORLIB}/rubygems/doctor.rb
${RUBY_VENDORLIB}/rubygems/errors.rb
${RUBY_VENDORLIB}/rubygems/exceptions.rb
${RUBY_VENDORLIB}/rubygems/ext.rb
${RUBY_VENDORLIB}/rubygems/ext/builder.rb
${RUBY_VENDORLIB}/rubygems/ext/cmake_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/format.rb
${RUBY_VENDORLIB}/rubygems/gem_openssl.rb
${RUBY_VENDORLIB}/rubygems/gem_path_searcher.rb
${RUBY_VENDORLIB}/rubygems/gem_runner.rb
${RUBY_VENDORLIB}/rubygems/gemcutter_utilities.rb
${RUBY_VENDORLIB}/rubygems/indexer.rb
${RUBY_VENDORLIB}/rubygems/install_message.rb
${RUBY_VENDORLIB}/rubygems/install_update_options.rb
${RUBY_VENDORLIB}/rubygems/installer.rb
${RUBY_VENDORLIB}/rubygems/installer_test_case.rb
${RUBY_VENDORLIB}/rubygems/local_remote_options.rb
${RUBY_VENDORLIB}/rubygems/mock_gem_ui.rb
${RUBY_VENDORLIB}/rubygems/old_format.rb
${RUBY_VENDORLIB}/rubygems/name_tuple.rb
${RUBY_VENDORLIB}/rubygems/package.rb
${RUBY_VENDORLIB}/rubygems/package/f_sync_dir.rb
${RUBY_VENDORLIB}/rubygems/package/digest_io.rb
${RUBY_VENDORLIB}/rubygems/package/old.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.rb
${RUBY_VENDORLIB}/rubygems/package/tar_reader/entry.rb
${RUBY_VENDORLIB}/rubygems/package/tar_test_case.rb
@ -76,15 +78,26 @@ ${RUBY_VENDORLIB}/rubygems/path_support.rb
${RUBY_VENDORLIB}/rubygems/platform.rb
${RUBY_VENDORLIB}/rubygems/psych_additions.rb
${RUBY_VENDORLIB}/rubygems/psych_tree.rb
${RUBY_VENDORLIB}/rubygems/rdoc.rb
${RUBY_VENDORLIB}/rubygems/remote_fetcher.rb
${RUBY_VENDORLIB}/rubygems/require_paths_builder.rb
${RUBY_VENDORLIB}/rubygems/request_set.rb
${RUBY_VENDORLIB}/rubygems/requirement.rb
${RUBY_VENDORLIB}/rubygems/security.rb
${RUBY_VENDORLIB}/rubygems/security/policies.rb
${RUBY_VENDORLIB}/rubygems/security/policy.rb
${RUBY_VENDORLIB}/rubygems/security/signer.rb
${RUBY_VENDORLIB}/rubygems/security/trust_dir.rb
${RUBY_VENDORLIB}/rubygems/server.rb
${RUBY_VENDORLIB}/rubygems/source_index.rb
${RUBY_VENDORLIB}/rubygems/source.rb
${RUBY_VENDORLIB}/rubygems/source_list.rb
${RUBY_VENDORLIB}/rubygems/source_local.rb
${RUBY_VENDORLIB}/rubygems/source_specific_file.rb
${RUBY_VENDORLIB}/rubygems/spec_fetcher.rb
${RUBY_VENDORLIB}/rubygems/specification.rb
${RUBY_VENDORLIB}/rubygems/ssl_certs/ca-bundle.pem
${RUBY_VENDORLIB}/rubygems/ssl_certs/AddTrustExternalCARoot.pem
${RUBY_VENDORLIB}/rubygems/ssl_certs/Entrust_net-Secure-Server-Certification-Authority.pem
${RUBY_VENDORLIB}/rubygems/ssl_certs/GeoTrust_Global_CA.pem
${RUBY_VENDORLIB}/rubygems/ssl_certs/VerisignClass3PublicPrimaryCertificationAuthority-G2.pem
${RUBY_VENDORLIB}/rubygems/syck_hack.rb
${RUBY_VENDORLIB}/rubygems/test_case.rb
${RUBY_VENDORLIB}/rubygems/test_utilities.rb
@ -95,4 +108,5 @@ ${RUBY_VENDORLIB}/rubygems/validator.rb
${RUBY_VENDORLIB}/rubygems/version.rb
${RUBY_VENDORLIB}/rubygems/version_option.rb
${RUBY_VENDORLIB}/ubygems.rb
@pkgdir lib/ruby/gems/1.9.3/doc
@pkgdir lib/ruby/gems/1.9.3/specifications
@pkgdir lib/ruby/gems/1.9.3/build_info

View file

@ -1,19 +1,16 @@
$NetBSD: distinfo,v 1.39 2013/02/03 16:04:04 taca Exp $
$NetBSD: distinfo,v 1.40 2013/06/11 14:55:54 taca Exp $
SHA1 (rubygems-1.8.25.tgz) = c62f8d110204ea65595604c98003b4c5a8e705b1
RMD160 (rubygems-1.8.25.tgz) = 205d24c3796102e178dbfa81d5ed4f3cd3fac890
Size (rubygems-1.8.25.tgz) = 380540 bytes
SHA1 (patch-aa) = 6f58690757271a230ead260a3429732067256567
SHA1 (patch-ab) = d2917ec23a41293049bdf901c809423126a6161d
SHA1 (patch-ac) = 7814fd204106f67e04ee9d278666b9ba30da3478
SHA1 (patch-ad) = 79c1a0750925862598545a992380ef7dfd8803a1
SHA1 (patch-af) = 4a138fb8c91189e4b39a12882a05f066100f08c4
SHA1 (patch-ag) = fe209f86dd68bfb8de7084b7a64e22a4dd6240f9
SHA1 (patch-ah) = cc3fc04696ea66670625d107872bb7c2e19b6114
SHA1 (rubygems-2.0.3.tgz) = 51b2d002874a30ae729bcc48a3a0c5983ffb508b
RMD160 (rubygems-2.0.3.tgz) = e2abad996a2380ba5f764a55304c3e416b715080
Size (rubygems-2.0.3.tgz) = 334203 bytes
SHA1 (patch-aa) = 02958c28dc9da54bf6d9f854335aa8d8e071497b
SHA1 (patch-ab) = 916311c3b957c173356fbd89e22dcc11f4966703
SHA1 (patch-ac) = 1a59a5d2fc090dfcf6d3bd3b9c133f0ce4a1feee
SHA1 (patch-ad) = de5b5a08035c2da3e8b08bcc5295d3998f13a854
SHA1 (patch-af) = d96d5dafd830b0c94bf6c191a3274701ebc6d564
SHA1 (patch-ag) = 5b94252ea03eba04849770bc141dfc58de932389
SHA1 (patch-ah) = 7552374df9c34fc4fabe4b5340dd7e84491aa949
SHA1 (patch-aj) = 3b77a675470ea3702b9870843d2bb39bb6a83f3e
SHA1 (patch-al) = beeff0531ff4bd23c0796b1e28805ae6fe2202b0
SHA1 (patch-am) = 374b16a77a3471958e0fcf7a60633658f9e9d559
SHA1 (patch-an) = a4de56fc44a4c7556486268344d44640538db108
SHA1 (patch-ao) = f2b6566e01eff03302a01e407a16120397ec5b50
SHA1 (patch-ap) = eaf2bf2fc7cc71139df7ce2677c3ec9fa95d1081
SHA1 (patch-test_rubygems_test__gem.rb) = 8bad451e8054fe954c13d28e542509b8adae2764
SHA1 (patch-am) = 90658b73df4382eab1d6f2d1b21fdcac6ed85891
SHA1 (patch-ao) = 4a8be3bdab5e465814b626d17a5f2811fbfc808c
SHA1 (patch-test_rubygems_test__gem.rb) = 65b03305af606e72d9bb41a54fce6877240cf383

View file

@ -1,12 +1,12 @@
$NetBSD: patch-aa,v 1.12 2012/04/22 08:11:54 taca Exp $
$NetBSD: patch-aa,v 1.13 2013/06/11 14:55:54 taca Exp $
* Relax to allow some attribute could be nil.
* Complete "http://" to homepage attribute if it isn't begin with it.
* Accpet date with Time, but ignore time part.
--- lib/rubygems/specification.rb.orig 2012-04-13 22:21:48.000000000 +0000
--- lib/rubygems/specification.rb.orig 2013-02-12 20:04:55.000000000 +0000
+++ lib/rubygems/specification.rb
@@ -118,6 +118,12 @@ class Gem::Specification
@@ -164,6 +164,12 @@ class Gem::Specification
@@default_value[k].nil?
}
@ -19,16 +19,7 @@ $NetBSD: patch-aa,v 1.12 2012/04/22 08:11:54 taca Exp $
######################################################################
# :section: Required gemspec attributes
@@ -1000,7 +1006,7 @@ class Gem::Specification
# way to do it.
@date = case date
when String then
- if /\A(\d{4})-(\d{2})-(\d{2})\Z/ =~ date then
+ if /\A(\d{4})-(\d{2})-(\d{2})/ =~ date then
Time.utc($1.to_i, $2.to_i, $3.to_i)
# Workaround for where the date format output from psych isn't
@@ -1987,7 +1993,24 @@ class Gem::Specification
@@ -2317,7 +2323,24 @@ class Gem::Specification
normalize
nil_attributes = self.class.non_nil_attributes.find_all do |name|
@ -54,13 +45,14 @@ $NetBSD: patch-aa,v 1.12 2012/04/22 08:11:54 taca Exp $
end
unless nil_attributes.empty? then
@@ -2090,10 +2113,15 @@ class Gem::Specification
@@ -2455,10 +2478,15 @@ class Gem::Specification
raise Gem::InvalidSpecificationException, "#{lazy} is not a summary"
end
- if homepage and not homepage.empty? and
- homepage !~ /\A[a-z][a-z\d+.-]*:/i then
- raise Gem::InvalidSpecificationException,
- "\"#{homepage}\" is not a URI"
+ if homepage and not homepage.empty?
+ if @homepage =~ /\A[a-z][a-z\d+.-]*/i and
+ @homepage !~ /\A[a-z][a-z\d+.-]*:/i
@ -68,7 +60,7 @@ $NetBSD: patch-aa,v 1.12 2012/04/22 08:11:54 taca Exp $
+ end
+ if homepage !~ /\A[a-z][a-z\d+.-]*:/i then
+ raise Gem::InvalidSpecificationException,
"\"#{homepage}\" is not a URI"
+ "\"#{homepage}\" is not a URI"
+ end
end

View file

@ -1,53 +1,53 @@
$NetBSD: patch-ab,v 1.14 2011/11/08 15:26:12 taca Exp $
$NetBSD: patch-ab,v 1.15 2013/06/11 14:55:54 taca Exp $
Add install_root option for pkgsrc's rubygems support.
--- lib/rubygems/dependency_installer.rb.orig 2011-08-26 00:30:44.000000000 +0000
--- lib/rubygems/dependency_installer.rb.orig 2013-02-20 00:27:36.000000000 +0000
+++ lib/rubygems/dependency_installer.rb
@@ -38,6 +38,7 @@ class Gem::DependencyInstaller
@@ -50,6 +50,7 @@ class Gem::DependencyInstaller
# :format_executable:: See Gem::Installer#initialize.
# :ignore_dependencies:: Don't install any dependencies.
# :install_dir:: See Gem::Installer#install.
+ # :install_root: See Gem::Installer#install.
+ # :install_root:: See Gem::Installer#install.
# :prerelease:: Allow prerelease versions. See #install.
# :security_policy:: See Gem::Installer::new and Gem::Security.
# :user_install:: See Gem::Installer.new
@@ -45,11 +46,14 @@ class Gem::DependencyInstaller
@@ -57,13 +58,14 @@ class Gem::DependencyInstaller
# :build_args:: See Gem::Installer::new
def initialize(options = {})
- @install_dir = options[:install_dir] || Gem.dir
-
if options[:install_dir] then
- @gem_home = options[:install_dir]
+ if options[:install_root].nil? or options[:install_root] == "" then
+ @gem_home = options[:install_root].dup
+ else
+ @gem_home = options[:install_dir].dup
+ end
Gem::Specification.dirs = @gem_home
Gem.ensure_gem_subdirectories @gem_home
- options[:install_dir] = @gem_home # FIX: because we suck and reuse below
+ @install_dir = options[:install_dir]
# HACK shouldn't change the global settings, needed for -i behavior
# maybe move to the install command? See also github #442
Gem::Specification.dirs = @install_dir
Gem.ensure_gem_subdirectories @install_dir
+ else
+ @install_dir = Gem.dir
end
options = DEFAULT_OPTIONS.merge options
@@ -69,7 +73,12 @@ class Gem::DependencyInstaller
@@ -91,7 +93,12 @@ class Gem::DependencyInstaller
@installed_gems = []
@toplevel_specs = nil
@install_dir = options[:install_dir] || Gem.dir
- @cache_dir = options[:cache_dir] || @install_dir
+ @install_root = options[:install_root]
+ @install_root = options[:install_root] || ""
+ install_dir = @install_dir
+ unless @install_root.nil? or @install_root == ""
+ install_dir = File.join(@install_root, @install_dir)
+ if not @install_root.empty?
+ install_dir = File.join(@install_root, install_dir)
+ end
+ @cache_dir = options[:cache_dir] || install_dir
# Set with any errors that SpecFetcher finds while search through
# gemspecs for a dep
@@ -290,6 +299,7 @@ class Gem::DependencyInstaller
@@ -353,6 +360,7 @@ class Gem::DependencyInstaller
:format_executable => @format_executable,
:ignore_dependencies => @ignore_dependencies,
:install_dir => @install_dir,
+ :install_root => @install_root,
:security_policy => @security_policy,
:user_install => @user_install,
:wrappers => @wrappers
:wrappers => @wrappers,

View file

@ -1,10 +1,10 @@
$NetBSD: patch-ac,v 1.7 2011/11/08 15:26:12 taca Exp $
$NetBSD: patch-ac,v 1.8 2013/06/11 14:55:54 taca Exp $
Add install_root option for pkgsrc's rubygems support.
--- lib/rubygems/install_update_options.rb.orig 2011-08-26 00:30:44.000000000 +0000
--- lib/rubygems/install_update_options.rb.orig 2013-02-12 20:04:55.000000000 +0000
+++ lib/rubygems/install_update_options.rb
@@ -32,6 +32,12 @@ module Gem::InstallUpdateOptions
@@ -33,6 +33,12 @@ module Gem::InstallUpdateOptions
value
end

View file

@ -1,49 +1,41 @@
$NetBSD: patch-ad,v 1.10 2011/11/08 15:26:12 taca Exp $
$NetBSD: patch-ad,v 1.11 2013/06/11 14:55:54 taca Exp $
* Add install_root option for pkgsrc's rubygems support.
--- lib/rubygems/installer.rb.orig 2011-08-26 00:30:44.000000000 +0000
--- lib/rubygems/installer.rb.orig 2013-02-21 21:50:03.000000000 +0000
+++ lib/rubygems/installer.rb
@@ -85,6 +85,9 @@ class Gem::Installer
# for a signed-gems-only policy.
@@ -89,6 +89,9 @@ class Gem::Installer
# foo_exec18.
# :ignore_dependencies:: Don't raise if a dependency is missing.
# :install_dir:: The directory to install the gem into.
+ # :install_root:: The directory to use as a buildroot for "destdir"-style
+ # installation. All paths during installation are relative
+ # to the buildroot.
# :format_executable:: Format the executable the same as the ruby executable.
# If your ruby is ruby18, foo_exec will be installed as
# foo_exec18.
@@ -283,7 +286,11 @@ class Gem::Installer
# If the user has asked for the gem to be installed in a directory that is
# the system gem directory, then use the system bin directory, else create
# (or use) a new bin dir under the gem_home.
- bindir = @bin_dir || Gem.bindir(gem_home)
+ bindir = @bin_dir || (Gem.bindir @gem_home, @install_root)
+
+ unless @install_root.nil? or @install_root == ""
+ bindir = File.join(@install_root, bindir)
+ end
Dir.mkdir bindir unless File.exist? bindir
raise Gem::FilePermissionError.new(bindir) unless File.writable? bindir
@@ -416,6 +423,7 @@ class Gem::Installer
:exec_format => false,
# :security_policy:: Use the specified security policy. See Gem::Security
# :user_install:: Indicate that the gem should be unpacked into the users
# personal gem directory.
@@ -538,7 +541,8 @@ class Gem::Installer
:env_shebang => false,
:force => false,
:install_dir => Gem.dir,
- :only_install_dir => false
+ :only_install_dir => false,
+ :install_root => nil,
}.merge options
@env_shebang = options[:env_shebang]
@@ -427,6 +435,11 @@ class Gem::Installer
@wrappers = options[:wrappers]
@bin_dir = options[:bin_dir]
@development = options[:development]
@@ -553,8 +557,13 @@ class Gem::Installer
# If the user has asked for the gem to be installed in a directory that is
# the system gem directory, then use the system bin directory, else create
# (or use) a new bin dir under the gem_home.
- @bin_dir = options[:bin_dir] || Gem.bindir(gem_home)
+ install_root = options[:install_root]
+ @bin_dir = options[:bin_dir] || Gem.bindir(gem_home, install_root)
@development = options[:development]
+ unless install_root.nil? or install_root == ""
+ @install_root = File.expand_path install_root
+ @gem_home = File.join(@install_root, @gem_home)
+ end
raise "NOTE: Installer option :source_index is dead" if
options[:source_index]
@build_args = options[:build_args] || Gem::Command.build_args
end

View file

@ -1,10 +1,10 @@
$NetBSD: patch-af,v 1.6 2011/11/08 15:26:12 taca Exp $
$NetBSD: patch-af,v 1.7 2013/06/11 14:55:54 taca Exp $
Add install_root option for pkgsrc's rubygems support.
--- lib/rubygems/commands/uninstall_command.rb.orig 2011-08-27 00:43:50.000000000 +0000
--- lib/rubygems/commands/uninstall_command.rb.orig 2013-02-12 20:04:54.000000000 +0000
+++ lib/rubygems/commands/uninstall_command.rb
@@ -21,6 +21,11 @@ class Gem::Commands::UninstallCommand <
@@ -22,6 +22,11 @@ class Gem::Commands::UninstallCommand <
options[:all] = value
end

View file

@ -1,19 +1,31 @@
$NetBSD: patch-ag,v 1.9 2011/08/12 15:50:44 taca Exp $
$NetBSD: patch-ag,v 1.10 2013/06/11 14:55:54 taca Exp $
Add install_root option for pkgsrc's rubygems support.
--- lib/rubygems/uninstaller.rb.orig 2011-05-26 04:01:53.000000000 +0000
--- lib/rubygems/uninstaller.rb.orig 2013-02-12 20:04:55.000000000 +0000
+++ lib/rubygems/uninstaller.rb
@@ -51,6 +51,12 @@ class Gem::Uninstaller
@@ -51,6 +51,11 @@ class Gem::Uninstaller
@force_ignore = options[:ignore]
@bin_dir = options[:bin_dir]
@format_executable = options[:format_executable]
+ install_root = options[:install_root]
+ unless install_root.nil? or install_root == ""
+ @install_root = File.expand_path install_root
+ @gem_home = File.join(@install_root, @gem_home)
+ end
# Indicate if development dependencies should be checked when
# uninstalling. (default: false)
@@ -199,7 +204,11 @@ class Gem::Uninstaller
end
if remove then
- bin_dir = @bin_dir || Gem.bindir(spec.base_dir)
+ bin_dir = @bin_dir || (Gem.bindir @gem_home, @install_root)
+
# only add user directory if install_dir is not set
@user_install = false
@user_install = options[:user_install] unless options[:install_dir]
+ unless @install_root.nil? or @install_root == ""
+ bindir = File.join(@install_root, bindir)
+ end
raise Gem::FilePermissionError, bin_dir unless File.writable? bin_dir

View file

@ -1,22 +1,32 @@
$NetBSD: patch-ah,v 1.10 2011/11/08 15:26:12 taca Exp $
$NetBSD: patch-ah,v 1.11 2013/06/11 14:55:54 taca Exp $
Add install_root option for pkgsrc's rubygems support.
--- lib/rubygems.rb.orig 2011-08-27 00:43:50.000000000 +0000
--- lib/rubygems.rb.orig 2013-02-21 22:01:26.000000000 +0000
+++ lib/rubygems.rb
@@ -327,7 +327,10 @@ module Gem
@@ -286,11 +286,17 @@ 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_dir = install_dir.sub(install_root, "")
+ end
# TODO: move to Gem::Dirs
return File.join install_dir, 'bin' unless
install_dir.to_s == Gem.default_dir.to_s
@@ -619,12 +622,12 @@ module Gem
- return File.join install_dir, 'bin' unless
- install_dir.to_s == Gem.default_dir.to_s
- Gem.default_bindir
+ if install_dir.to_s == Gem.default_dir.to_s
+ install_dir = Gem.default_bindir
+ else
+ install_dir = File.join install_dir, 'bin'
+ end
+ unless install_root.nil?
+ install_dir = File.join install_root, install_dir
+ end
+ install_dir
end
##
@@ -538,12 +544,12 @@ module Gem
##
# The index to insert activated gem paths into the $LOAD_PATH.
#
@ -29,9 +39,9 @@ Add install_root option for pkgsrc's rubygems support.
- index = $LOAD_PATH.index ConfigMap[:sitelibdir]
+ index = $LOAD_PATH.index ConfigMap[:vendorlibdir]
if QUICKLOADER_SUCKAGE then
$LOAD_PATH.each_with_index do |path, i|
@@ -799,6 +802,7 @@ module Gem
index
end
@@ -716,6 +722,7 @@ module Gem
prefix = File.dirname RUBYGEMS_DIR
if prefix != File.expand_path(ConfigMap[:sitelibdir]) and

View file

@ -1,15 +0,0 @@
$NetBSD: patch-al,v 1.2 2011/08/12 15:50:44 taca Exp $
Prevent access to HOME when --install-root is used.
--- lib/rubygems/commands/install_command.rb.orig 2011-05-18 23:36:37.000000000 +0000
+++ lib/rubygems/commands/install_command.rb
@@ -148,7 +148,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

View file

@ -1,19 +1,32 @@
$NetBSD: patch-am,v 1.3 2011/08/12 15:50:44 taca Exp $
$NetBSD: patch-am,v 1.4 2013/06/11 14:55:54 taca Exp $
Make sure to setup under DESTDIR.
--- lib/rubygems/commands/setup_command.rb.orig 2011-05-26 04:01:53.000000000 +0000
--- lib/rubygems/commands/setup_command.rb.orig 2013-02-12 20:04:54.000000000 +0000
+++ lib/rubygems/commands/setup_command.rb
@@ -110,7 +110,7 @@ By default, this RubyGems will install g
@@ -143,7 +143,7 @@ By default, this RubyGems will install g
uninstall_old_gemcutter
- install_rdoc
+ install_rdoc install_destdir
- documentation_success = install_rdoc
+ documentation_success = install_rdoc install_destdir
say
if @verbose then
@@ -221,16 +221,20 @@ TEXT
@@ -160,7 +160,11 @@ By default, this RubyGems will install g
release_notes = File.join Dir.pwd, 'History.txt'
release_notes = if File.exist? release_notes then
- history = File.read release_notes
+ if RUBY_VERSION != "1.8.7"
+ history = File.read release_notes, :encoding => 'utf-8'
+ else
+ history = File.read release_notes
+ end
history = history.sub(/^# coding:.*?^=/m, '')
text = history.split(HISTORY_HEADER)
@@ -295,11 +299,15 @@ TEXT
end
end
@ -27,12 +40,15 @@ Make sure to setup under DESTDIR.
+ FileUtils.mkdir_p gem_doc_dir unless File.exist?(gem_doc_dir)
+ end
+
if File.writable? gem_doc_dir and
begin
Gem.ensure_gem_subdirectories Gem.dir
rescue SystemCallError
@@ -310,7 +318,7 @@ TEXT
(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, 'doc', 'rubygems-[0-9]*')].each do |dir|
+ Dir[File.join(gem_doc_dir, 'rubygems-[0-9]*')].each do |dir|
rm_rf dir
end

View file

@ -1,27 +0,0 @@
$NetBSD: patch-an,v 1.3 2011/08/12 15:50:44 taca Exp $
Add install_root option for pkgsrc's rubygems support.
--- lib/rubygems/commands/unpack_command.rb.orig 2011-05-18 23:36:37.000000000 +0000
+++ lib/rubygems/commands/unpack_command.rb
@@ -14,6 +14,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
@@ -70,7 +74,8 @@ class Gem::Commands::UnpackCommand < Gem
basename = File.basename path, '.gem'
target_dir = File.expand_path basename, options[:target]
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}'"
end
end

View file

@ -1,12 +1,12 @@
$NetBSD: patch-ao,v 1.4 2012/04/22 08:11:54 taca Exp $
$NetBSD: patch-ao,v 1.5 2013/06/11 14:55:54 taca Exp $
Don't hard code config file's path for gem.
--- lib/rubygems/config_file.rb.orig 2012-03-22 21:25:48.000000000 +0000
--- lib/rubygems/config_file.rb.orig 2013-02-12 20:04:55.000000000 +0000
+++ lib/rubygems/config_file.rb
@@ -47,32 +47,7 @@ class Gem::ConfigFile
@@ -56,32 +56,7 @@ class Gem::ConfigFile
PLATFORM_DEFAULTS = {}
# :stopdoc:
- system_config_path =
- begin
@ -36,5 +36,5 @@ Don't hard code config file's path for gem.
- end
+ system_config_path = '@PKG_SYSCONFDIR@'
SYSTEM_WIDE_CONFIG_FILE = File.join system_config_path, 'gemrc'
# :startdoc:

View file

@ -1,24 +0,0 @@
$NetBSD: patch-ap,v 1.2 2011/08/12 15:50:44 taca Exp $
Prevent access to HOME when --install-root is used.
--- lib/rubygems/doc_manager.rb.orig 2011-05-18 23:36:37.000000000 +0000
+++ lib/rubygems/doc_manager.rb
@@ -60,7 +60,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
@@ -71,7 +71,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,
}

View file

@ -1,24 +1,22 @@
$NetBSD: patch-test_rubygems_test__gem.rb,v 1.2 2011/08/12 15:50:44 taca Exp $
$NetBSD: patch-test_rubygems_test__gem.rb,v 1.3 2013/06/11 14:55:54 taca Exp $
Use vendorlibdir.
--- test/rubygems/test_gem.rb.orig 2011-05-26 04:01:53.000000000 +0000
--- test/rubygems/test_gem.rb.orig 2013-02-12 20:20:45.000000000 +0000
+++ test/rubygems/test_gem.rb
@@ -806,13 +806,13 @@ class TestGem < Gem::TestCase
Gem::ConfigMap[:libdir] = orig_libdir
@@ -952,12 +952,12 @@ class TestGem < Gem::TestCase
end
- def test_self_prefix_sitelibdir
def test_self_prefix_sitelibdir
- orig_sitelibdir = Gem::ConfigMap[:sitelibdir]
- Gem::ConfigMap[:sitelibdir] = @@project_dir
+ def test_self_prefix_vendorlibdir
+ orig_vendorlibdir = Gem::ConfigMap[:vendorlibdir]
+ orig_sitelibdir = Gem::ConfigMap[:vendorlibdir]
+ Gem::ConfigMap[:vendorlibdir] = @@project_dir
assert_nil Gem.prefix
ensure
- Gem::ConfigMap[:sitelibdir] = orig_sitelibdir
+ Gem::ConfigMap[:vendorlibdir] = orig_vendorlibdir
+ Gem::ConfigMap[:vendorlibdir] = orig_sitelibdir
end
def test_self_refresh