-
Notifications
You must be signed in to change notification settings - Fork 0
/
instruby.rb
51 lines (47 loc) · 1.26 KB
/
instruby.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!./miniruby -I.
require "rbconfig.rb"
include Config
$:.unshift CONFIG["srcdir"]+"/lib"
require "ftools"
binsuffix = CONFIG["binsuffix"]
if ENV["prefix"]
prefix = ENV["prefix"]
else
prefix = CONFIG["prefix"]
end
ruby_install_name = CONFIG["ruby_install_name"]
bindir = CONFIG["bindir"]
libdir = CONFIG["libdir"] + "/" + ruby_install_name
archdir = libdir+"/"+CONFIG["arch"]
mandir = CONFIG["mandir"] + "/man1"
wdir = Dir.getwd
File.makedirs bindir, TRUE
File.install "ruby#{binsuffix}",
"#{bindir}/#{ruby_install_name}#{binsuffix}", 0755, TRUE
for dll in Dir['*.dll']
File.install dll, "#{bindir}/#{dll}", 0755, TRUE
end
File.makedirs "#{libdir}", TRUE
for lib in ["libruby.so", "libruby.so.LIB"]
if File.exist? lib
File.install lib, "#{libdir}", 0644, TRUE
end
end
File.makedirs libdir, TRUE
Dir.chdir "ext"
system "../miniruby#{binsuffix} extmk.rb install"
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
end
File.makedirs mandir, TRUE
File.install "ruby.1", "#{mandir}", 0644, TRUE
Dir.chdir wdir
File.install "config.h", "#{archdir}", 0644, TRUE
File.install "rbconfig.rb", "#{archdir}", 0644, TRUE
# vi:set sw=2: