reap 4.3.3 → 4.3.4
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +400 -8
- data/ProjectInfo +26 -26
- data/ProjectInfo.rb +88 -0
- data/bin/reap +1 -1
- data/bin/rubytest +1 -1
- data/data/reap/scaffold/standard/COPYING +403 -0
- data/data/reap/scaffold/{ChangeLog → standard/ChangeLog} +0 -0
- data/data/reap/scaffold/standard/INSTALL +14 -0
- data/data/reap/scaffold/{ProjectInfo → standard/ProjectInfo} +12 -12
- data/data/reap/scaffold/standard/README +3 -0
- data/data/reap/scaffold/standard/Rakefile +10 -0
- data/data/reap/scaffold/{INSTALL → standard/TODO} +0 -0
- data/data/reap/scaffold/subversion/trunk/COPYING +403 -0
- data/data/reap/scaffold/{README → subversion/trunk/ChangeLog} +0 -0
- data/data/reap/scaffold/subversion/trunk/INSTALL +14 -0
- data/data/reap/scaffold/subversion/trunk/ProjectInfo +78 -0
- data/data/reap/scaffold/subversion/trunk/README +3 -0
- data/data/reap/scaffold/subversion/trunk/Rakefile +10 -0
- data/data/reap/scaffold/{Todo → subversion/trunk/TODO} +0 -0
- data/data/reap/{setup-3.4.1/setup.rb → setup.rb} +181 -202
- data/{ChangeLog → doc/ChangeLog} +0 -0
- data/doc/doap.xml +27 -0
- data/doc/note/Rakefile.htm +69 -0
- data/{note/Rakefile → doc/note/aRakefile} +0 -0
- data/{note → doc/note}/composite_task.rb +0 -0
- data/{note → doc/note}/compositepublisher.rb +0 -0
- data/{note → doc/note}/ftptools.rb +0 -0
- data/{note → doc/note}/interface/interface.rb +0 -0
- data/{note → doc/note}/interface/rubyforge.rb +0 -0
- data/{note → doc/note}/license-each.rb +0 -0
- data/{note → doc/note}/package.rb.0 +0 -0
- data/{note → doc/note}/publisher.rb +0 -0
- data/{note → doc/note}/rubyforgepublisher.rb +0 -0
- data/{lib/reap/task → doc/note}/scaffold.rb +4 -3
- data/{lib/reap → doc/note}/setup.rb +7 -6
- data/{note → doc/note}/sshpublisher.rb +0 -0
- data/{note → doc/note}/suby-cvs.rb +0 -0
- data/{note → doc/note}/template.rb +0 -0
- data/lib/reap/bin/reap.rb +75 -51
- data/lib/reap/bin/{lint.rb → rubylint.rb} +0 -0
- data/lib/reap/projectinfo.rb +107 -50
- data/lib/reap/reap.rb +60 -0
- data/lib/reap/task.rb +46 -60
- data/lib/reap/task/doap.rb +67 -0
- data/lib/reap/task/info.rb +2 -2
- data/lib/reap/task/install.rb +29 -18
- data/lib/reap/task/package.rb +56 -56
- data/lib/reap/task/release.rb +34 -13
- data/package.rb +627 -0
- data/setup.rb +287 -272
- data/test/tc_reap.rb +1 -1
- metadata +64 -61
- data/ANN +0 -8
- data/data/reap/scaffold/COPYING +0 -11
- data/data/reap/scaffold/Rakefile +0 -146
- data/data/reap/scaffold/setup.rb +0 -1551
- data/data/reap/setup-3.4.1/COPYING +0 -515
- data/data/reap/setup-3.4.1/ChangeLog +0 -732
- data/data/reap/setup-3.4.1/Makefile +0 -56
- data/data/reap/setup-3.4.1/NEWS.en +0 -155
- data/data/reap/setup-3.4.1/NEWS.ja +0 -152
- data/data/reap/setup-3.4.1/README.en +0 -30
- data/data/reap/setup-3.4.1/README.ja +0 -34
- data/data/reap/setup-3.4.1/TODO +0 -14
- data/data/reap/setup-3.4.1/Template.README.en +0 -41
- data/data/reap/setup-3.4.1/Template.README.ja +0 -46
- data/data/reap/setup-3.4.1/Usage_en.txt +0 -231
- data/data/reap/setup-3.4.1/Usage_ja.txt +0 -250
- data/data/reap/setup-3.4.1/doc.en/hookapi.html +0 -91
- data/data/reap/setup-3.4.1/doc.en/index.html +0 -28
- data/data/reap/setup-3.4.1/doc.en/metaconfapi.html +0 -79
- data/data/reap/setup-3.4.1/doc.en/news.html +0 -189
- data/data/reap/setup-3.4.1/doc.en/usage.html +0 -297
- data/data/reap/setup-3.4.1/doc.ja/hookapi.html +0 -84
- data/data/reap/setup-3.4.1/doc.ja/index.html +0 -28
- data/data/reap/setup-3.4.1/doc.ja/metaconfapi.html +0 -80
- data/data/reap/setup-3.4.1/doc.ja/news.html +0 -186
- data/data/reap/setup-3.4.1/doc.ja/usage.html +0 -319
- data/data/reap/setup-3.4.1/sample/add-task.rb +0 -15
- data/data/reap/setup-3.4.1/test/test_installer.rb +0 -136
File without changes
|
@@ -0,0 +1,78 @@
|
|
1
|
+
--- %YAML:1.0
|
2
|
+
|
3
|
+
TITLE : &title Your App's Title
|
4
|
+
NAME : &pkg your_unix_name
|
5
|
+
SERIES : '0.0.1'
|
6
|
+
DATE : '2005-01-01'
|
7
|
+
STATUS : beta
|
8
|
+
|
9
|
+
AUTHOR : Your Name
|
10
|
+
EMAIL : youremail@address.com
|
11
|
+
HOMEPAGE : "http://your_package_name.rubyforge.org"
|
12
|
+
|
13
|
+
SUMMARY : One line summary
|
14
|
+
|
15
|
+
DESCRIPTION: >
|
16
|
+
Multline description
|
17
|
+
goes here.
|
18
|
+
|
19
|
+
RUBYFORGE:
|
20
|
+
PROJECT: your_projects_unix_name
|
21
|
+
USERNAME: your_rubyforge_username
|
22
|
+
|
23
|
+
|
24
|
+
#=================================================
|
25
|
+
# Unremark and use as needed. Often defaults
|
26
|
+
# are sufficiant and need not specify
|
27
|
+
# extra parameters.
|
28
|
+
#=================================================
|
29
|
+
|
30
|
+
PACKAGE:
|
31
|
+
DISTRIBUTE : [ gem, tar.bz2 ] # tgz zip deb
|
32
|
+
DEPENDENCIES : []
|
33
|
+
EXECUTABLES : []
|
34
|
+
DIR: pkg
|
35
|
+
INCLUDE:
|
36
|
+
- '**/*'
|
37
|
+
EXCLUDE:
|
38
|
+
- InstalledFiles
|
39
|
+
|
40
|
+
# PUBLISH:
|
41
|
+
# - HOST: rubyforge
|
42
|
+
# TYPE: web
|
43
|
+
# USERNAME: your_username
|
44
|
+
# DIR: www
|
45
|
+
|
46
|
+
# RDOC:
|
47
|
+
# TITLE: *title
|
48
|
+
# DIR: 'rdoc' # 'web/rdoc'
|
49
|
+
# TEMPLATE: html
|
50
|
+
# OPTIONS: ['--merge', '--all']
|
51
|
+
# MAIN: README
|
52
|
+
# INCLUDE:
|
53
|
+
# - '[A-Z]*'
|
54
|
+
# - 'lib/**/*.rb'
|
55
|
+
# - 'bin/**/*.rb'
|
56
|
+
# EXCLUDE: []
|
57
|
+
|
58
|
+
# ANNOUNCE:
|
59
|
+
# TO: ruby-talk@ruby-lang.org
|
60
|
+
# FROM: *email
|
61
|
+
# DOMAIN: your_domain.net
|
62
|
+
# SERVER: smtp.your_email_server.com
|
63
|
+
# PORT: 25
|
64
|
+
# ACCOUNT: email_account_name
|
65
|
+
# AUTHTYPE: login # login, cram_md5, plain
|
66
|
+
# SECTYPE: ssl # ~, ssl (tls not working yet)
|
67
|
+
# FILE: ANN # which file contains announcement
|
68
|
+
# SLOGAN: ALL YOUR BASE ARE BELONG TO RUBY!
|
69
|
+
# INFO:
|
70
|
+
# - http://your_homepage.org
|
71
|
+
# - http://other_links.com
|
72
|
+
|
73
|
+
# TEST:
|
74
|
+
# FILES:
|
75
|
+
# - 'test/**/tc*.rb'
|
76
|
+
# - 'test/**/test*.rb'
|
77
|
+
# - 'test/**/*test.rb'
|
78
|
+
# FIXTURE: []
|
File without changes
|
@@ -8,21 +8,50 @@
|
|
8
8
|
# the GNU LGPL, Lesser General Public License version 2.1.
|
9
9
|
#
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
11
|
+
#############################
|
12
|
+
# Forked from version 3.2.1 #
|
13
|
+
# #
|
14
|
+
# -trans #
|
15
|
+
#############################
|
16
|
+
|
17
|
+
# CHANGE No longer need to support 1.4.6 or 1.6 versions of Ruby.
|
18
|
+
|
19
|
+
# unless Enumerable.method_defined?(:map) # Ruby 1.4.6
|
20
|
+
# module Enumerable
|
21
|
+
# alias map collect
|
22
|
+
# end
|
23
|
+
# end
|
24
|
+
|
25
|
+
# unless File.respond_to?(:read) # Ruby 1.6
|
26
|
+
# def File.read(fname)
|
27
|
+
# open(fname) {|f|
|
28
|
+
# return f.read
|
29
|
+
# }
|
30
|
+
# end
|
31
|
+
# end
|
32
|
+
|
33
|
+
# This is hack!
|
34
|
+
# This is needed to install within an abitrary root dir.
|
35
|
+
# B/c setup.rb has become spegetti code, I was forced to do this hack.
|
36
|
+
# Setup.rb shuld be re-writ. I would use package.rb instead but
|
37
|
+
# it lacks hooks and extension compilation. But we'll keep
|
38
|
+
# an eye on that one for the future. -trans.
|
39
|
+
|
40
|
+
$setup_install_root = nil
|
41
|
+
ARGV.each{ |a|
|
42
|
+
if md = /--root=(.*)/.match( a )
|
43
|
+
$setup_install_root = md[1]
|
44
|
+
end
|
45
|
+
}
|
46
|
+
if $setup_install_root
|
47
|
+
ARGV.delete("--root=#{$setup_install_root}")
|
48
|
+
$setup_install_root = File.expand_path($setup_install_root)
|
49
|
+
puts "(root=#{$setup_install_root})"
|
15
50
|
end
|
16
51
|
|
17
|
-
|
18
|
-
def File.read(fname)
|
19
|
-
open(fname) {|f|
|
20
|
-
return f.read
|
21
|
-
}
|
22
|
-
end
|
23
|
-
end
|
52
|
+
# Windows?
|
24
53
|
|
25
|
-
unless Errno.const_defined?(:ENOTEMPTY)
|
54
|
+
unless Errno.const_defined?(:ENOTEMPTY)
|
26
55
|
module Errno
|
27
56
|
class ENOTEMPTY
|
28
57
|
# We do not raise this exception, implementation is not needed.
|
@@ -60,17 +89,11 @@ class ConfigTable
|
|
60
89
|
attr_accessor :install_prefix
|
61
90
|
attr_accessor :config_opt
|
62
91
|
|
63
|
-
|
92
|
+
def verbose=(x) @verbose = x end
|
93
|
+
def verbose?() @verbose end
|
64
94
|
|
65
|
-
def
|
66
|
-
|
67
|
-
end
|
68
|
-
|
69
|
-
attr_writer :no_harm
|
70
|
-
|
71
|
-
def no_harm?
|
72
|
-
@no_harm
|
73
|
-
end
|
95
|
+
def no_harm=(x) @no_harm = x end
|
96
|
+
def no_harm?() @no_harm end
|
74
97
|
|
75
98
|
def [](key)
|
76
99
|
lookup(key).resolve(self)
|
@@ -114,9 +137,7 @@ class ConfigTable
|
|
114
137
|
end
|
115
138
|
end
|
116
139
|
|
117
|
-
def savefile
|
118
|
-
'.config'
|
119
|
-
end
|
140
|
+
def savefile() '.config' end
|
120
141
|
|
121
142
|
def load_savefile
|
122
143
|
begin
|
@@ -139,124 +160,126 @@ class ConfigTable
|
|
139
160
|
end
|
140
161
|
|
141
162
|
def load_standard_entries
|
142
|
-
standard_entries(@rbconfig).each do |ent|
|
163
|
+
#standard_entries(@rbconfig).each do |ent|
|
164
|
+
standard_entries.each do |ent|
|
143
165
|
add ent
|
144
166
|
end
|
145
167
|
end
|
146
168
|
|
147
|
-
def standard_entries(rbconfig)
|
148
|
-
|
169
|
+
def standard_entries #(rbconfig)
|
170
|
+
rbconfig = @rbconfig
|
149
171
|
|
150
|
-
rubypath = File.join(
|
172
|
+
rubypath = File.join(rbconfig['bindir'], rbconfig['ruby_install_name'] + rbconfig['EXEEXT'])
|
151
173
|
|
152
|
-
major =
|
153
|
-
minor =
|
154
|
-
teeny =
|
174
|
+
major = rbconfig['MAJOR'].to_i
|
175
|
+
minor = rbconfig['MINOR'].to_i
|
176
|
+
teeny = rbconfig['TEENY'].to_i
|
155
177
|
version = "#{major}.#{minor}"
|
156
178
|
|
157
|
-
|
158
|
-
newpath_p = ((major >= 2) or
|
159
|
-
((major == 1) and
|
160
|
-
((minor >= 5) or
|
161
|
-
((minor == 4) and (teeny >= 4)))))
|
179
|
+
# CHANGE Do not need to support these old versions any more.
|
162
180
|
|
163
|
-
|
181
|
+
# # ruby ver. >= 1.4.4?
|
182
|
+
# newpath_p = ((major >= 2) or
|
183
|
+
# ((major == 1) and
|
184
|
+
# ((minor >= 5) or
|
185
|
+
# ((minor == 4) and (teeny >= 4)))))
|
186
|
+
|
187
|
+
#if c['rubylibdir']
|
164
188
|
# V > 1.6.3
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
189
|
+
|
190
|
+
root = '/'
|
191
|
+
prefix = rbconfig['prefix']
|
192
|
+
|
193
|
+
libruby = "#{prefix}/lib/ruby"
|
194
|
+
librubyver = rbconfig['rubylibdir']
|
195
|
+
librubyverarch = rbconfig['archdir']
|
196
|
+
siteruby = rbconfig['sitedir']
|
197
|
+
siterubyver = rbconfig['sitelibdir']
|
198
|
+
siterubyverarch = rbconfig['sitearchdir']
|
199
|
+
|
200
|
+
bindir = paramize(rbconfig['bindir'])
|
201
|
+
libdir = paramize(rbconfig['libdir'])
|
202
|
+
datadir = paramize(rbconfig['datadir'])
|
203
|
+
mandir = paramize(rbconfig['mandir'])
|
204
|
+
sysconfdir = paramize(rbconfig['sysconfdir'])
|
205
|
+
localstatedir = paramize(rbconfig['localstatedir'])
|
206
|
+
|
207
|
+
# elsif newpath_p
|
208
|
+
# # 1.4.4 <= V <= 1.6.3
|
209
|
+
# libruby = "#{c['prefix']}/lib/ruby"
|
210
|
+
# librubyver = "#{c['prefix']}/lib/ruby/#{version}"
|
211
|
+
# librubyverarch = "#{c['prefix']}/lib/ruby/#{version}/#{c['arch']}"
|
212
|
+
# siteruby = c['sitedir']
|
213
|
+
# siterubyver = "$siteruby/#{version}"
|
214
|
+
# siterubyverarch = "$siterubyver/#{c['arch']}"
|
215
|
+
# else
|
216
|
+
# # V < 1.4.4
|
217
|
+
# libruby = "#{c['prefix']}/lib/ruby"
|
218
|
+
# librubyver = "#{c['prefix']}/lib/ruby/#{version}"
|
219
|
+
# librubyverarch = "#{c['prefix']}/lib/ruby/#{version}/#{c['arch']}"
|
220
|
+
# siteruby = "#{c['prefix']}/lib/ruby/#{version}/site_ruby"
|
221
|
+
# siterubyver = siteruby
|
222
|
+
# siterubyverarch = "$siterubyver/#{c['arch']}"
|
223
|
+
# end
|
224
|
+
|
188
225
|
parameterize = lambda {|path|
|
189
|
-
path.sub(/\A#{Regexp.quote(
|
226
|
+
path.sub(/\A#{Regexp.quote(rbconfig['prefix'])}/, '$prefix')
|
190
227
|
}
|
191
228
|
|
192
|
-
if arg =
|
229
|
+
if arg = rbconfig['configure_args'].split.detect {|arg| /--with-make-prog=/ =~ arg }
|
193
230
|
makeprog = arg.sub(/'/, '').split(/=/, 2)[1]
|
194
231
|
else
|
195
232
|
makeprog = 'make'
|
196
233
|
end
|
197
234
|
|
235
|
+
installdir_lambda = lambda {|val, table|
|
236
|
+
case val
|
237
|
+
when 'std'
|
238
|
+
table['rbdir'] = '$librubyver'
|
239
|
+
table['sodir'] = '$librubyverarch'
|
240
|
+
when 'site'
|
241
|
+
table['rbdir'] = '$siterubyver'
|
242
|
+
table['sodir'] = '$siterubyverarch'
|
243
|
+
when 'home'
|
244
|
+
setup_rb_error '$HOME was not set' unless ENV['HOME']
|
245
|
+
table['prefix'] = ENV['HOME']
|
246
|
+
table['rbdir'] = '$libdir/ruby'
|
247
|
+
table['sodir'] = '$libdir/ruby'
|
248
|
+
end
|
249
|
+
}
|
250
|
+
|
198
251
|
[
|
199
|
-
ExecItem.new('installdirs', 'std/site/home',
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
PathItem.new('
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
'the directory for libraries'),
|
222
|
-
PathItem.new('datadir', 'path', parameterize.call(c['datadir']),
|
223
|
-
'the directory for shared data'),
|
224
|
-
PathItem.new('mandir', 'path', parameterize.call(c['mandir']),
|
225
|
-
'the directory for man pages'),
|
226
|
-
PathItem.new('sysconfdir', 'path', parameterize.call(c['sysconfdir']),
|
227
|
-
'the directory for system configuration files'),
|
228
|
-
PathItem.new('localstatedir', 'path', parameterize.call(c['localstatedir']),
|
229
|
-
'the directory for local state data'),
|
230
|
-
PathItem.new('libruby', 'path', libruby,
|
231
|
-
'the directory for ruby libraries'),
|
232
|
-
PathItem.new('librubyver', 'path', librubyver,
|
233
|
-
'the directory for standard ruby libraries'),
|
234
|
-
PathItem.new('librubyverarch', 'path', librubyverarch,
|
235
|
-
'the directory for standard ruby extensions'),
|
236
|
-
PathItem.new('siteruby', 'path', siteruby,
|
237
|
-
'the directory for version-independent aux ruby libraries'),
|
238
|
-
PathItem.new('siterubyver', 'path', siterubyver,
|
239
|
-
'the directory for aux ruby libraries'),
|
240
|
-
PathItem.new('siterubyverarch', 'path', siterubyverarch,
|
241
|
-
'the directory for aux ruby binaries'),
|
242
|
-
PathItem.new('rbdir', 'path', '$siterubyver',
|
243
|
-
'the directory for ruby scripts'),
|
244
|
-
PathItem.new('sodir', 'path', '$siterubyverarch',
|
245
|
-
'the directory for ruby extentions'),
|
246
|
-
PathItem.new('rubypath', 'path', rubypath,
|
247
|
-
'the path to set to #! line'),
|
248
|
-
ProgramItem.new('rubyprog', 'name', rubypath,
|
249
|
-
'the ruby program using for installation'),
|
250
|
-
ProgramItem.new('makeprog', 'name', makeprog,
|
251
|
-
'the make program to compile ruby extentions'),
|
252
|
-
SelectItem.new('shebang', 'all/ruby/never', 'ruby',
|
253
|
-
'shebang line (#!) editing mode'),
|
254
|
-
BoolItem.new('without-ext', 'yes/no', 'no',
|
255
|
-
'does not compile/install ruby extentions')
|
252
|
+
ExecItem.new('installdirs', 'std/site/home', 'install under libruby, site_ruby or $HOME respectively', &installdir_lambda),
|
253
|
+
PathItem.new('root', 'path', root, 'root destination directory'),
|
254
|
+
PathItem.new('prefix', 'path', prefix, 'path prefix of target environment'),
|
255
|
+
PathItem.new('bindir', 'path', bindir, 'the directory for commands'),
|
256
|
+
PathItem.new('libdir', 'path', libdir, 'the directory for libraries'),
|
257
|
+
PathItem.new('datadir', 'path', datadir, 'the directory for shared data'),
|
258
|
+
PathItem.new('mandir', 'path', mandir, 'the directory for man pages'),
|
259
|
+
PathItem.new('sysconfdir', 'path', sysconfdir, 'the directory for system configuration files'),
|
260
|
+
PathItem.new('localstatedir', 'path', localstatedir, 'the directory for local state data'),
|
261
|
+
PathItem.new('libruby', 'path', libruby, 'the directory for ruby libraries'),
|
262
|
+
PathItem.new('librubyver', 'path', librubyver, 'the directory for standard ruby libraries'),
|
263
|
+
PathItem.new('librubyverarch', 'path', librubyverarch, 'the directory for standard ruby extensions'),
|
264
|
+
PathItem.new('siteruby', 'path', siteruby, 'the directory for version-independent aux ruby libraries'),
|
265
|
+
PathItem.new('siterubyver', 'path', siterubyver, 'the directory for aux ruby libraries'),
|
266
|
+
PathItem.new('siterubyverarch', 'path', siterubyverarch, 'the directory for aux ruby binaries'),
|
267
|
+
PathItem.new('rbdir', 'path', '$siterubyver', 'the directory for ruby scripts'),
|
268
|
+
PathItem.new('sodir', 'path', '$siterubyverarch', 'the directory for ruby extentions'),
|
269
|
+
PathItem.new('rubypath', 'path', rubypath, 'the path to set to #! line'),
|
270
|
+
ProgramItem.new('rubyprog', 'name', rubypath, 'the ruby program using for installation'),
|
271
|
+
ProgramItem.new('makeprog', 'name', makeprog, 'the make program to compile ruby extentions'),
|
272
|
+
SelectItem.new('shebang', 'all/ruby/never', 'ruby', 'shebang line (#!) editing mode'),
|
273
|
+
BoolItem.new('without-ext', 'yes/no', 'no', 'does not compile/install ruby extentions')
|
256
274
|
]
|
257
275
|
end
|
258
276
|
private :standard_entries
|
259
277
|
|
278
|
+
def paramize( path )
|
279
|
+
path.sub(/\A#{Regexp.quote(@rbconfig['prefix'])}/, '$prefix')
|
280
|
+
end
|
281
|
+
private :paramize
|
282
|
+
|
260
283
|
def load_multipackage_entries
|
261
284
|
multipackage_entries().each do |ent|
|
262
285
|
add ent
|
@@ -265,10 +288,8 @@ class ConfigTable
|
|
265
288
|
|
266
289
|
def multipackage_entries
|
267
290
|
[
|
268
|
-
PackageSelectionItem.new('with',
|
269
|
-
|
270
|
-
PackageSelectionItem.new('without', 'name,name...', '', 'NONE',
|
271
|
-
'package names that you do not want to install')
|
291
|
+
PackageSelectionItem.new('with', 'name,name...', '', 'ALL', 'package names that you want to install'),
|
292
|
+
PackageSelectionItem.new('without', 'name,name...', '', 'NONE', 'package names that you do not want to install')
|
272
293
|
]
|
273
294
|
end
|
274
295
|
private :multipackage_entries
|
@@ -333,13 +354,8 @@ class ConfigTable
|
|
333
354
|
"--#{@name}=#{@template}"
|
334
355
|
end
|
335
356
|
|
336
|
-
def value?
|
337
|
-
|
338
|
-
end
|
339
|
-
|
340
|
-
def value
|
341
|
-
@value
|
342
|
-
end
|
357
|
+
def value? ; true ; end
|
358
|
+
def value ; @value ; end
|
343
359
|
|
344
360
|
def resolve(table)
|
345
361
|
@value.gsub(%r<\$([^/]+)>) { table[$1] }
|
@@ -358,9 +374,7 @@ class ConfigTable
|
|
358
374
|
end
|
359
375
|
|
360
376
|
class BoolItem < Item
|
361
|
-
def config_type
|
362
|
-
'bool'
|
363
|
-
end
|
377
|
+
def config_type() 'bool' end
|
364
378
|
|
365
379
|
def help_opt
|
366
380
|
"--#{@name}"
|
@@ -380,12 +394,9 @@ class ConfigTable
|
|
380
394
|
end
|
381
395
|
|
382
396
|
class PathItem < Item
|
383
|
-
def config_type
|
384
|
-
'path'
|
385
|
-
end
|
397
|
+
def config_type() 'path' end
|
386
398
|
|
387
399
|
private
|
388
|
-
|
389
400
|
def check(path)
|
390
401
|
setup_rb_error "config: --#{@name} requires argument" unless path
|
391
402
|
path[0,1] == '$' ? path : File.expand_path(path)
|
@@ -393,9 +404,7 @@ class ConfigTable
|
|
393
404
|
end
|
394
405
|
|
395
406
|
class ProgramItem < Item
|
396
|
-
def config_type
|
397
|
-
'program'
|
398
|
-
end
|
407
|
+
def config_type() 'program' end
|
399
408
|
end
|
400
409
|
|
401
410
|
class SelectItem < Item
|
@@ -404,12 +413,9 @@ class ConfigTable
|
|
404
413
|
@ok = selection.split('/')
|
405
414
|
end
|
406
415
|
|
407
|
-
def config_type
|
408
|
-
'select'
|
409
|
-
end
|
416
|
+
def config_type() 'select' end
|
410
417
|
|
411
418
|
private
|
412
|
-
|
413
419
|
def check(val)
|
414
420
|
unless @ok.include?(val.strip)
|
415
421
|
setup_rb_error "config: use --#{@name}=#{@template} (#{val})"
|
@@ -536,7 +542,9 @@ end # class ConfigTable
|
|
536
542
|
module FileOperations
|
537
543
|
|
538
544
|
def mkdir_p(dirname, prefix = nil)
|
539
|
-
dirname = prefix
|
545
|
+
dirname = File.join(prefix, File.expand_path(dirname)) if prefix
|
546
|
+
dirname = File.join( $setup_install_root, dirname ) if $setup_install_root
|
547
|
+
|
540
548
|
$stderr.puts "mkdir -p #{dirname}" if verbose?
|
541
549
|
return if no_harm?
|
542
550
|
|
@@ -620,11 +628,15 @@ module FileOperations
|
|
620
628
|
end
|
621
629
|
|
622
630
|
def install(from, dest, mode, prefix = nil)
|
631
|
+
|
632
|
+
realdest = prefix ? File.join(prefix, File.expand_path(dest)) : dest
|
633
|
+
realdest = File.join($setup_install_root, File.expand_path(realdest)) if $setup_install_root
|
634
|
+
|
623
635
|
$stderr.puts "install #{from} #{dest}" if verbose?
|
624
636
|
return if no_harm?
|
625
637
|
|
626
|
-
realdest = prefix ? prefix + File.expand_path(dest) : dest
|
627
638
|
realdest = File.join(realdest, File.basename(from)) if File.dir?(realdest)
|
639
|
+
|
628
640
|
str = File.binread(from)
|
629
641
|
if diff?(str, realdest)
|
630
642
|
verbose_off {
|
@@ -659,7 +671,7 @@ module FileOperations
|
|
659
671
|
def ruby(*args)
|
660
672
|
command config('rubyprog'), *args
|
661
673
|
end
|
662
|
-
|
674
|
+
|
663
675
|
def make(task = nil)
|
664
676
|
command(*[config('makeprog'), task].compact)
|
665
677
|
end
|
@@ -699,33 +711,14 @@ module HookScriptAPI
|
|
699
711
|
@config[key] = val
|
700
712
|
end
|
701
713
|
|
702
|
-
#
|
703
714
|
# srcdir/objdir (works only in the package directory)
|
704
|
-
#
|
705
|
-
|
706
|
-
def curr_srcdir
|
707
|
-
"#{srcdir_root()}/#{relpath()}"
|
708
|
-
end
|
709
|
-
|
710
|
-
def curr_objdir
|
711
|
-
"#{objdir_root()}/#{relpath()}"
|
712
|
-
end
|
713
|
-
|
714
|
-
def srcfile(path)
|
715
|
-
"#{curr_srcdir()}/#{path}"
|
716
|
-
end
|
717
715
|
|
718
|
-
def
|
719
|
-
|
720
|
-
end
|
721
|
-
|
722
|
-
def srcdirectory?(path)
|
723
|
-
|
724
|
-
end
|
725
|
-
|
726
|
-
def srcfile?(path)
|
727
|
-
File.file?(srcfile(path))
|
728
|
-
end
|
716
|
+
def curr_srcdir() "#{srcdir_root()}/#{relpath()}" end
|
717
|
+
def curr_objdir() "#{objdir_root()}/#{relpath()}" end
|
718
|
+
def srcfile(path) "#{curr_srcdir()}/#{path}" end
|
719
|
+
def srcexist?(path) File.exist?(srcfile(path)) end
|
720
|
+
def srcdirectory?(path) File.dir?(srcfile(path)) end
|
721
|
+
def srcfile?(path) File.file?(srcfile(path)) end
|
729
722
|
|
730
723
|
def srcentries(path = '.')
|
731
724
|
Dir.open("#{curr_srcdir()}/#{path}") {|d|
|
@@ -764,8 +757,8 @@ class ToplevelInstaller
|
|
764
757
|
[ 'distclean',"does `make distclean' for each extention" ]
|
765
758
|
]
|
766
759
|
|
767
|
-
def
|
768
|
-
config = ConfigTable.new(load_rbconfig
|
760
|
+
def self.invoke
|
761
|
+
config = ConfigTable.new(load_rbconfig)
|
769
762
|
config.load_standard_entries
|
770
763
|
config.load_multipackage_entries if multipackage?
|
771
764
|
config.fixup
|
@@ -773,11 +766,11 @@ class ToplevelInstaller
|
|
773
766
|
klass.new(File.dirname($0), config).invoke
|
774
767
|
end
|
775
768
|
|
776
|
-
def
|
769
|
+
def self.multipackage?
|
777
770
|
File.dir?(File.dirname($0) + '/packages')
|
778
771
|
end
|
779
772
|
|
780
|
-
def
|
773
|
+
def self.load_rbconfig
|
781
774
|
if arg = ARGV.detect {|arg| /\A--rbconfig=/ =~ arg }
|
782
775
|
ARGV.delete(arg)
|
783
776
|
load File.expand_path(arg.split(/=/, 2)[1])
|
@@ -788,6 +781,7 @@ class ToplevelInstaller
|
|
788
781
|
::Config::CONFIG
|
789
782
|
end
|
790
783
|
|
784
|
+
|
791
785
|
def initialize(ardir_root, config)
|
792
786
|
@ardir = File.expand_path(ardir_root)
|
793
787
|
@config = config
|
@@ -826,7 +820,7 @@ class ToplevelInstaller
|
|
826
820
|
__send__ "exec_#{task}"
|
827
821
|
end
|
828
822
|
end
|
829
|
-
|
823
|
+
|
830
824
|
def run_metaconfigs
|
831
825
|
@config.load_script "#{@ardir}/metaconfig"
|
832
826
|
end
|
@@ -839,17 +833,9 @@ class ToplevelInstaller
|
|
839
833
|
# Hook Script API bases
|
840
834
|
#
|
841
835
|
|
842
|
-
def srcdir_root
|
843
|
-
|
844
|
-
end
|
845
|
-
|
846
|
-
def objdir_root
|
847
|
-
'.'
|
848
|
-
end
|
849
|
-
|
850
|
-
def relpath
|
851
|
-
'.'
|
852
|
-
end
|
836
|
+
def srcdir_root() @ardir end
|
837
|
+
def objdir_root() '.' end
|
838
|
+
def relpath() '.' end
|
853
839
|
|
854
840
|
#
|
855
841
|
# Option Parsing
|
@@ -979,6 +965,7 @@ class ToplevelInstaller
|
|
979
965
|
out.puts
|
980
966
|
out.puts 'Options for INSTALL:'
|
981
967
|
out.printf fmt, '--no-harm', 'only display what to do if given', 'off'
|
968
|
+
out.printf fmt, '--root=path', 'install root directory (effects all paths)', '/'
|
982
969
|
out.printf fmt, '--prefix=path', 'install path prefix', ''
|
983
970
|
out.puts
|
984
971
|
end
|
@@ -1173,24 +1160,15 @@ class Installer
|
|
1173
1160
|
"#<#{self.class} #{File.basename(@srcdir)}>"
|
1174
1161
|
end
|
1175
1162
|
|
1176
|
-
def noop(rel)
|
1177
|
-
end
|
1163
|
+
def noop(rel) ; end
|
1178
1164
|
|
1179
1165
|
#
|
1180
1166
|
# Hook Script API base methods
|
1181
1167
|
#
|
1182
1168
|
|
1183
|
-
def srcdir_root
|
1184
|
-
|
1185
|
-
end
|
1186
|
-
|
1187
|
-
def objdir_root
|
1188
|
-
@objdir
|
1189
|
-
end
|
1190
|
-
|
1191
|
-
def relpath
|
1192
|
-
@currdir
|
1193
|
-
end
|
1169
|
+
def srcdir_root() @srcdir end
|
1170
|
+
def objdir_root() @objdir end
|
1171
|
+
def relpath() @currdir end
|
1194
1172
|
|
1195
1173
|
#
|
1196
1174
|
# Config Access
|
@@ -1373,6 +1351,7 @@ class Installer
|
|
1373
1351
|
|
1374
1352
|
def install_files(list, dest, mode)
|
1375
1353
|
mkdir_p dest, @config.install_prefix
|
1354
|
+
#mkdir_p dest, offset_dir
|
1376
1355
|
list.each do |fname|
|
1377
1356
|
install fname, dest, mode, @config.install_prefix
|
1378
1357
|
end
|