2000-08-31 23:31:05 -04:00
|
|
|
#!./miniruby
|
1999-01-19 23:59:39 -05:00
|
|
|
|
2000-08-31 23:31:05 -04:00
|
|
|
load "./rbconfig.rb"
|
1998-01-16 07:19:09 -05:00
|
|
|
include Config
|
|
|
|
|
2000-12-18 04:46:21 -05:00
|
|
|
File.umask(0)
|
1999-01-19 23:59:39 -05:00
|
|
|
destdir = ARGV[0] || ''
|
|
|
|
|
1998-01-16 07:19:09 -05:00
|
|
|
$:.unshift CONFIG["srcdir"]+"/lib"
|
|
|
|
require "ftools"
|
1999-08-13 01:45:20 -04:00
|
|
|
require "find"
|
1998-01-16 07:19:09 -05:00
|
|
|
|
1999-08-13 01:45:20 -04:00
|
|
|
exeext = CONFIG["EXEEXT"]
|
1998-01-16 07:19:09 -05:00
|
|
|
if ENV["prefix"]
|
|
|
|
prefix = ENV["prefix"]
|
|
|
|
else
|
|
|
|
prefix = CONFIG["prefix"]
|
|
|
|
end
|
2000-02-17 02:11:22 -05:00
|
|
|
|
1998-01-16 07:19:09 -05:00
|
|
|
ruby_install_name = CONFIG["ruby_install_name"]
|
2000-02-17 02:11:22 -05:00
|
|
|
version = "/"+CONFIG["MAJOR"]+"."+CONFIG["MINOR"]
|
2000-03-13 02:18:45 -05:00
|
|
|
arch = "/"+CONFIG["arch"]
|
2000-02-17 02:11:22 -05:00
|
|
|
|
1999-08-13 01:45:20 -04:00
|
|
|
bindir = destdir+CONFIG["bindir"]
|
|
|
|
libdir = destdir+CONFIG["libdir"]
|
2000-03-13 02:18:45 -05:00
|
|
|
rubylibdir = destdir+CONFIG["prefix"]+"/lib/ruby"+version
|
|
|
|
archlibdir = rubylibdir+arch
|
2000-04-12 01:06:23 -04:00
|
|
|
sitelibdir = destdir+CONFIG["sitedir"]+version
|
2000-03-13 02:18:45 -05:00
|
|
|
sitearchlibdir = sitelibdir+arch
|
1999-08-13 01:45:20 -04:00
|
|
|
mandir = destdir+CONFIG["mandir"] + "/man1"
|
1999-01-19 23:59:39 -05:00
|
|
|
wdir = Dir.getwd
|
1998-01-16 07:19:09 -05:00
|
|
|
|
1999-08-13 01:45:20 -04:00
|
|
|
File.makedirs bindir, true
|
|
|
|
File.install ruby_install_name+exeext,
|
|
|
|
"#{bindir}/#{ruby_install_name}#{exeext}", 0755, true
|
2000-09-04 00:43:26 -04:00
|
|
|
rubyw = ruby_install_name.sub(/ruby/, '\&w')+exeext
|
|
|
|
if File.exist? rubyw
|
|
|
|
File.install rubyw, "#{bindir}/#{rubyw}", 0755, true
|
|
|
|
end
|
1999-01-19 23:59:39 -05:00
|
|
|
for dll in Dir['*.dll']
|
1999-08-13 01:45:20 -04:00
|
|
|
File.install dll, "#{bindir}/#{dll}", 0755, true
|
1999-01-19 23:59:39 -05:00
|
|
|
end
|
1999-08-13 01:45:20 -04:00
|
|
|
File.makedirs libdir, true
|
2000-07-25 10:46:46 -04:00
|
|
|
if CONFIG["LIBRUBY"] != CONFIG["LIBRUBY_A"]
|
|
|
|
for lib in [CONFIG["LIBRUBY"]]
|
|
|
|
if File.exist? lib
|
|
|
|
File.install lib, libdir, 0555, true
|
|
|
|
end
|
1999-01-19 23:59:39 -05:00
|
|
|
end
|
|
|
|
end
|
1999-08-13 01:45:20 -04:00
|
|
|
Dir.chdir libdir
|
|
|
|
if File.exist? CONFIG["LIBRUBY_SO"]
|
|
|
|
for link in CONFIG["LIBRUBY_ALIASES"].split
|
|
|
|
if File.exist? link
|
|
|
|
File.delete link
|
|
|
|
end
|
|
|
|
File.symlink CONFIG["LIBRUBY_SO"], link
|
|
|
|
print "link #{CONFIG['LIBRUBY_SO']} -> #{link}\n"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
Dir.chdir wdir
|
2000-03-13 02:18:45 -05:00
|
|
|
File.makedirs rubylibdir, true
|
2000-02-17 02:11:22 -05:00
|
|
|
File.makedirs archlibdir, true
|
|
|
|
File.makedirs sitelibdir, true
|
2000-03-09 04:04:36 -05:00
|
|
|
File.makedirs sitearchlibdir, true
|
1999-08-13 01:45:20 -04:00
|
|
|
|
|
|
|
if RUBY_PLATFORM =~ /-aix/
|
2000-02-17 02:11:22 -05:00
|
|
|
File.install "ruby.imp", archlibdir, 0644, true
|
1999-08-13 01:45:20 -04:00
|
|
|
end
|
|
|
|
|
1998-01-16 07:19:09 -05:00
|
|
|
Dir.chdir "ext"
|
2000-05-21 05:25:58 -04:00
|
|
|
if defined? CROSS_COMPILING
|
|
|
|
system "#{CONFIG['MINIRUBY']} extmk.rb install #{destdir}"
|
|
|
|
else
|
|
|
|
system "../miniruby#{exeext} extmk.rb install #{destdir}"
|
|
|
|
end
|
1998-01-16 07:19:09 -05:00
|
|
|
Dir.chdir CONFIG["srcdir"]
|
1999-08-13 01:45:20 -04:00
|
|
|
|
2000-07-14 00:34:43 -04:00
|
|
|
File.install "sample/irb.rb", "#{bindir}/irb", 0755, true
|
|
|
|
|
1999-08-13 01:45:20 -04:00
|
|
|
Find.find("lib") do |f|
|
|
|
|
next unless /\.rb$/ =~ f
|
2000-03-13 02:18:45 -05:00
|
|
|
dir = rubylibdir+"/"+File.dirname(f[4..-1])
|
1999-08-13 01:45:20 -04:00
|
|
|
File.makedirs dir, true unless File.directory? dir
|
|
|
|
File.install f, dir, 0644, true
|
1999-01-19 23:59:39 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
for f in Dir["*.h"]
|
2000-02-17 02:11:22 -05:00
|
|
|
File.install f, archlibdir, 0644, true
|
1999-08-13 01:45:20 -04:00
|
|
|
end
|
2000-05-21 08:23:51 -04:00
|
|
|
if RUBY_PLATFORM =~ /mswin32|mingw/
|
2000-02-17 02:11:22 -05:00
|
|
|
File.makedirs archlibdir + "/win32", true
|
|
|
|
File.install "win32/win32.h", archlibdir + "/win32", 0644, true
|
1998-01-16 07:19:09 -05:00
|
|
|
end
|
2000-02-17 02:11:22 -05:00
|
|
|
File.install wdir+'/'+CONFIG['LIBRUBY_A'], archlibdir, 0644, true
|
1999-01-19 23:59:39 -05:00
|
|
|
|
1999-08-13 01:45:20 -04:00
|
|
|
File.makedirs mandir, true
|
2000-09-01 05:18:11 -04:00
|
|
|
File.install "ruby.1", mandir+"/"+ruby_install_name+".1", 0644, true
|
1999-01-19 23:59:39 -05:00
|
|
|
Dir.chdir wdir
|
2000-02-17 02:11:22 -05:00
|
|
|
File.install "config.h", archlibdir, 0644, true
|
|
|
|
File.install "rbconfig.rb", archlibdir, 0644, true
|
1998-01-16 07:19:09 -05:00
|
|
|
# vi:set sw=2:
|