summaryrefslogtreecommitdiff
path: root/devel/freebase/files/patch-freebase_bin_install.rb
diff options
context:
space:
mode:
Diffstat (limited to 'devel/freebase/files/patch-freebase_bin_install.rb')
-rw-r--r--devel/freebase/files/patch-freebase_bin_install.rb58
1 files changed, 58 insertions, 0 deletions
diff --git a/devel/freebase/files/patch-freebase_bin_install.rb b/devel/freebase/files/patch-freebase_bin_install.rb
new file mode 100644
index 000000000000..e2cf68b0eaf0
--- /dev/null
+++ b/devel/freebase/files/patch-freebase_bin_install.rb
@@ -0,0 +1,58 @@
+--- bin/install.rb.orig Mon Mar 24 07:10:57 2003
++++ bin/install.rb Thu Oct 13 12:05:17 2005
+@@ -1,21 +1,39 @@
+ require 'rbconfig'
+ require 'find'
+ require 'ftools'
++require 'getoptlong'
++
++def usage( exit_code = 1 )
++ printf "Usage: #{ARGV[0]} [--path <PATH>]\n"
++ exit( exit_code )
++end
+
+ Dir.chdir ".." if Dir.pwd =~ /bin.?$/
+
++opts = GetoptLong.new( ["--prefix", "-p", GetoptLong::REQUIRED_ARGUMENT ] )
++$my_prefix = nil
++opts.each { |opt, arg|
++ case opt
++ when "--prefix"
++ $my_prefix = arg
++ else
++ usage()
++ end
++}
++
++def prefixize( str )
++ $my_prefix ?
++ str.gsub( Regexp::compile( "^#{Regexp::escape($prefix)}" ), $my_prefix ) :
++ str
++end
++
+ include Config
+
+-$srcdir = CONFIG["srcdir"]
++$prefix = CONFIG["prefix"]
+ $version = CONFIG["MAJOR"]+"."+CONFIG["MINOR"]
+-$libdir = File.join(CONFIG["libdir"], "ruby", $version)
+-$archdir = File.join($libdir, CONFIG["arch"])
+-$site_libdir = $:.find {|x| x =~ /site_ruby$/}
+-if !$site_libdir
+- $site_libdir = File.join($libdir, "site_ruby")
+-elsif $site_libdir !~ Regexp.quote($version)
+- $site_libdir = File.join($site_libdir, $version)
+-end
++$libdir = prefixize( CONFIG["rubylibdir"] )
++$archdir = prefixize( CONFIG["archdir"] )
++$site_libdir = prefixize( CONFIG["sitelibdir"] )
+
+ def install_rb(srcdir = nil)
+ libdir = "lib"
+@@ -39,4 +57,4 @@
+ end
+ end
+
+-install_rb
+\ No newline at end of file
++install_rb