summaryrefslogtreecommitdiff
path: root/instruby.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-01-20 04:59:39 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-01-20 04:59:39 +0000
commit62e648e148b3cb9f96dcce808c55c02b7ccb4486 (patch)
tree9708892ece92e860d81559ab55e6b1f9400d7ffc /instruby.rb
parentaeb049c573be4dc24dd20650f40e4777e0f698cf (diff)
ruby 1.3 cycle
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/RUBY@372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'instruby.rb')
-rw-r--r--instruby.rb54
1 files changed, 37 insertions, 17 deletions
diff --git a/instruby.rb b/instruby.rb
index 8fd7705..d489e0f 100644
--- a/instruby.rb
+++ b/instruby.rb
@@ -1,7 +1,10 @@
-#!./miniruby
+#!./miniruby -I.
+
require "rbconfig.rb"
include Config
+destdir = ARGV[0] || ''
+
$:.unshift CONFIG["srcdir"]+"/lib"
require "ftools"
@@ -12,26 +15,43 @@ else
prefix = CONFIG["prefix"]
end
ruby_install_name = CONFIG["ruby_install_name"]
-bindir = prefix + "/bin"
-libdir = prefix + "/lib/" + ruby_install_name
-archdir = libdir+"/"+CONFIG["arch"]
+bindir = CONFIG["bindir"]
+libdir = CONFIG["libdir"]
+pkglibdir = libdir + "/" + ruby_install_name
+archdir = pkglibdir + "/" + CONFIG["arch"]
mandir = CONFIG["mandir"] + "/man1"
+wdir = Dir.getwd
+File.makedirs "#{destdir}#{bindir}", true
File.install "ruby#{binsuffix}",
- "#{bindir}/#{ruby_install_name}#{binsuffix}", 0755, TRUE
-File.makedirs libdir, TRUE
+ "#{destdir}#{bindir}/#{ruby_install_name}#{binsuffix}", 0755, true
+for dll in Dir['*.dll']
+ File.install dll, "#{destdir}#{bindir}/#{dll}", 0755, true
+end
+File.makedirs "#{destdir}#{libdir}", true
+for lib in ["libruby.so", "libruby.so.LIB"]
+ if File.exist? lib
+ File.install lib, "#{destdir}#{libdir}", 0644, true
+ end
+end
+File.makedirs "#{destdir}#{pkglibdir}", true
+File.makedirs "#{destdir}#{archdir}", true
Dir.chdir "ext"
-system "../miniruby#{binsuffix} extmk.rb install"
+system "../miniruby#{binsuffix} extmk.rb install #{destdir}"
Dir.chdir CONFIG["srcdir"]
-IO.foreach 'MANIFEST' do |$_|
- $_.chop!
- if /^lib/
- File.install $_, libdir, 0644, TRUE
- elsif /^[a-z]+\.h$/
- File.install $_, archdir, 0644, TRUE
- end
- File.install "config.h", archdir, 0644, TRUE
+for f in Dir["lib/*.rb"]
+ File.install f, "#{destdir}#{pkglibdir}", 0644, true
+end
+
+File.makedirs(archdir,true)
+for f in Dir["*.h"]
+ File.install f, "#{destdir}#{archdir}", 0644, true
end
-File.install "rbconfig.rb", archdir, 0644, TRUE
-File.install "ruby.1", mandir, 0644, TRUE
+File.install "libruby.a", "#{destdir}#{archdir}", 0644, true
+
+File.makedirs "#{destdir}#{mandir}", true
+File.install "ruby.1", "#{destdir}#{mandir}", 0644, true
+Dir.chdir wdir
+File.install "config.h", "#{destdir}#{archdir}", 0644, true
+File.install "rbconfig.rb", "#{destdir}#{archdir}", 0644, true
# vi:set sw=2: