| 1 |
#!/usr/bin/env ruby |
|---|
| 2 |
|
|---|
| 3 |
require 'rbconfig' |
|---|
| 4 |
require 'ftools' |
|---|
| 5 |
|
|---|
| 6 |
include Config |
|---|
| 7 |
|
|---|
| 8 |
RV = CONFIG["MAJOR"] + "." + CONFIG["MINOR"] |
|---|
| 9 |
DSTPATH = CONFIG["sitedir"] + "/" + RV |
|---|
| 10 |
SRCPATH = File.dirname( $0 ) |
|---|
| 11 |
|
|---|
| 12 |
def join( *arg ) |
|---|
| 13 |
File.join( *arg ) |
|---|
| 14 |
end |
|---|
| 15 |
|
|---|
| 16 |
require join( SRCPATH, '_installedFiles' ) |
|---|
| 17 |
$installed = InstalledFiles.new( SRCPATH ) |
|---|
| 18 |
|
|---|
| 19 |
def install( from, to ) |
|---|
| 20 |
toPath = File.catname( from, to ) |
|---|
| 21 |
unless FileTest.exist?( toPath ) and File.compare( from, toPath ) |
|---|
| 22 |
File.install( from, toPath, 0644, true ) |
|---|
| 23 |
$installed << InstalledFile.new( toPath ) |
|---|
| 24 |
end |
|---|
| 25 |
end |
|---|
| 26 |
|
|---|
| 27 |
def installDir( from, to ) |
|---|
| 28 |
unless FileTest.directory?( from ) |
|---|
| 29 |
raise RuntimeError.new( "'#{ from }' not found." ) |
|---|
| 30 |
end |
|---|
| 31 |
File.mkpath( to, true ) |
|---|
| 32 |
Dir[ join( from, '*.rb' ) ].each do | name | |
|---|
| 33 |
install( name, to ) |
|---|
| 34 |
end |
|---|
| 35 |
end |
|---|
| 36 |
|
|---|
| 37 |
begin |
|---|
| 38 |
installDir( join( SRCPATH, 'lib', 'soap' ), join( DSTPATH, 'soap' )) |
|---|
| 39 |
installDir( join( SRCPATH, 'lib', 'wsdl' ), join( DSTPATH, 'wsdl' )) |
|---|
| 40 |
installDir( join( SRCPATH, 'lib', 'wsdl', 'xmlSchema' ), |
|---|
| 41 |
join( DSTPATH, 'wsdl', 'xmlSchema' )) |
|---|
| 42 |
installDir( join( SRCPATH, 'lib', 'wsdl', 'soap' ), |
|---|
| 43 |
join( DSTPATH, 'wsdl', 'soap' )) |
|---|
| 44 |
installDir( join( SRCPATH, "redist" ), DSTPATH ) |
|---|
| 45 |
installDir( join( SRCPATH, 'redist', 'soap' ), join( DSTPATH, 'soap' )) |
|---|
| 46 |
|
|---|
| 47 |
$installed.dump( SRCPATH ) |
|---|
| 48 |
|
|---|
| 49 |
puts "install succeed!" |
|---|
| 50 |
|
|---|
| 51 |
rescue |
|---|
| 52 |
puts "install failed!" |
|---|
| 53 |
puts $! |
|---|
| 54 |
|
|---|
| 55 |
end |
|---|