Revision | ddf0d749bc1147f7625404efa5f106df7694e368 (tree) |
---|---|
Time | 2009-03-31 01:15:08 |
Author | soutaro <soutaro@f836...> |
Commiter | soutaro |
setup.rb updated to current version (svn)
git-svn-id: http://dev.ikejima.org/src/svn/pragger/trunk@400 f8368ae4-1e99-dc11-9799-0018f35ab5fa
@@ -1,7 +1,7 @@ | ||
1 | 1 | # |
2 | 2 | # setup.rb |
3 | 3 | # |
4 | -# Copyright (c) 2000-2005 Minero Aoki | |
4 | +# Copyright (c) 2000-2006 Minero Aoki | |
5 | 5 | # |
6 | 6 | # This program is free software. |
7 | 7 | # You can distribute/modify this program under the terms of |
@@ -296,13 +296,14 @@ class ConfigTable | ||
296 | 296 | ALIASES.each do |ali, name| |
297 | 297 | @table[ali] = @table[name] |
298 | 298 | end |
299 | - @items.freeze | |
300 | - @table.freeze | |
301 | - @options_re = /\A--(#{@table.keys.join('|')})(?:=(.*))?\z/ | |
299 | + end | |
300 | + | |
301 | + def options_re | |
302 | + /\A--(#{@table.keys.join('|')})(?:=(.*))?\z/ | |
302 | 303 | end |
303 | 304 | |
304 | 305 | def parse_opt(opt) |
305 | - m = @options_re.match(opt) or setup_rb_error "config: unknown option #{opt}" | |
306 | + m = options_re().match(opt) or setup_rb_error "config: unknown option #{opt}" | |
306 | 307 | m.to_a[1,2] |
307 | 308 | end |
308 | 309 |
@@ -751,7 +752,7 @@ end | ||
751 | 752 | class ToplevelInstaller |
752 | 753 | |
753 | 754 | Version = '3.4.1' |
754 | - Copyright = 'Copyright (c) 2000-2005 Minero Aoki' | |
755 | + Copyright = 'Copyright (c) 2000-2006 Minero Aoki' | |
755 | 756 | |
756 | 757 | TASKS = [ |
757 | 758 | [ 'all', 'do config, setup, then install' ], |
@@ -1343,7 +1344,11 @@ class Installer | ||
1343 | 1344 | end |
1344 | 1345 | |
1345 | 1346 | def install_dir_bin(rel) |
1346 | - install_files targetfiles(), "#{config('bindir')}/#{rel}", 0755 | |
1347 | + install_files targetfiles(), "#{config('bindir')}/#{rel}", 0755, strip_ext? | |
1348 | + end | |
1349 | + | |
1350 | + def strip_ext? | |
1351 | + /mswin|mingw/ !~ RUBY_PLATFORM | |
1347 | 1352 | end |
1348 | 1353 | |
1349 | 1354 | def install_dir_lib(rel) |
@@ -1371,10 +1376,15 @@ class Installer | ||
1371 | 1376 | install_files targetfiles(), "#{config('mandir')}/#{rel}", 0644 |
1372 | 1377 | end |
1373 | 1378 | |
1374 | - def install_files(list, dest, mode) | |
1379 | + def install_files(list, dest, mode, stripext = false) | |
1375 | 1380 | mkdir_p dest, @config.install_prefix |
1376 | 1381 | list.each do |fname| |
1377 | - install fname, dest, mode, @config.install_prefix | |
1382 | + if stripext | |
1383 | + install fname, "#{dest}/#{File.basename(fname, '.*')}", | |
1384 | + mode, @config.install_prefix | |
1385 | + else | |
1386 | + install fname, dest, mode, @config.install_prefix | |
1387 | + end | |
1378 | 1388 | end |
1379 | 1389 | end |
1380 | 1390 |
@@ -1418,7 +1428,7 @@ class Installer | ||
1418 | 1428 | |
1419 | 1429 | def hookfiles |
1420 | 1430 | %w( pre-%s post-%s pre-%s.rb post-%s.rb ).map {|fmt| |
1421 | - %w( config setup install clean ).map {|t| sprintf(fmt, t) } | |
1431 | + %w( config setup install clean distclean ).map {|t| sprintf(fmt, t) } | |
1422 | 1432 | }.flatten |
1423 | 1433 | end |
1424 | 1434 |
@@ -1556,6 +1566,7 @@ class Installer | ||
1556 | 1566 | path = [ "#{curr_srcdir()}/#{id}", |
1557 | 1567 | "#{curr_srcdir()}/#{id}.rb" ].detect {|cand| File.file?(cand) } |
1558 | 1568 | return unless path |
1569 | + $stderr.puts "invoking hook script #{path}" if verbose? | |
1559 | 1570 | begin |
1560 | 1571 | instance_eval File.read(path), path, 1 |
1561 | 1572 | rescue |