Newer
Older
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
require 'ftools'
require 'net/ftp'
# Arguments passed to config stage of setup
config_args = [
"--make-prog=nmake",
"--",
"--with-fox-include=c:\\src\\fox-1.6.4\\include",
"--with-fox-lib=c:\\src\\fox-1.6.4\\lib",
"--with-fxscintilla-include=c:\\src\\fxscintilla-1.63-fox1.6\\include",
"--with-fxscintilla-lib=c:\\src\\fxscintilla-1.63-fox1.6\\lib"
]
# Inno Setup command-line compiler
ISCC = "C:\\Progra~1\\InnoSe~1\\ISCC.exe"
def untar(fxruby_version)
tarfile = "../ftp/FXRuby-#{fxruby_version}.tar.gz"
dirname1 = "FXRuby-#{fxruby_version}"
dirname2 = "FXRuby-#{fxruby_version}-ruby#{VERSION}"
if File.exists? dirname1
system("rm", "-r", dirname1)
end
if File.exists? dirname2
system("rm", "-r", dirname2)
end
system("tar", "xzf", tarfile)
puts "File.mv(#{dirname1}, #{dirname2})"
File.mv(dirname1, dirname2)
end
def copy_installer_script(fxruby_version)
iss_filename = nil
case VERSION
when /1.6/
iss_filename = "FXRuby-ruby1.6-i586-mswin32.iss"
when /1.8.2/
iss_filename = "FXRuby-ruby1.8.2-i386-msvcrt.iss"
when /1.8.4/
iss_filename = "FXRuby-ruby1.8.4-i386-msvcrt.iss"
end
dir = "FXRuby-#{fxruby_version}-ruby#{VERSION}"
[iss_filename, dir]
end
def do_config(args)
ruby = "C:\\ruby-#{VERSION}\\bin\\ruby.exe"
system(ruby, "install.rb", "config", *args)
end
def do_setup
ruby = "C:\\ruby-#{VERSION}\\bin\\ruby.exe"
system(ruby, "install.rb", "setup")
end
def do_inno_setup(scriptname)
system(ISCC, scriptname)
end
def do_upload(fxruby_version)
file = nil
case VERSION
when /1.6.8/
file = "FXRuby-#{fxruby_version}-ruby168.exe"
when /1.8.2/
file = "FXRuby-#{fxruby_version}-ruby182.exe"
when /1.8.4/
file = "FXRuby-#{fxruby_version}-ruby184.exe"
end
ftp = Net::FTP.open('upload.sourceforge.net', 'ftp', 'lyle@rubyforge.org')
ftp.putbinaryfile(file, "/incoming/" + file)
ftp.close
end
if __FILE__ == $0
fxruby_version = "<%= FXRUBY_VERSION %>"
untar(fxruby_version)
iss_filename, dir = copy_installer_script(fxruby_version)
Dir.chdir(dir)
do_config(config_args)
do_setup
do_inno_setup(iss_filename)
# do_upload(fxruby_version)
end