Welcome to the "trac"-ing site of soap4r!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

Changeset 982

Show
Ignore:
Timestamp:
09/26/03 00:26:22 (5 years ago)
Author:
nahi
Message:

install rubylibdir not sitelibdir under 1.8.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/install.rb

    r971 r982  
    66include Config 
    77 
     8RUBYLIBDIR = CONFIG["rubylibdir"] 
    89RV = 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 
     10SITELIBDIR = CONFIG["sitedir"] + "/" +  RV  
     11SRCPATH = File.join(File.dirname($0), 'lib') 
    1512 
    1613def install(from, to) 
    17   toPath = File.catname(from, to) 
    18   unless FileTest.exist?(toPath) and File.compare(from, toPath) 
    19     File.install(from, toPath, 0644, true) 
     14  to_path = File.catname(from, to) 
     15  unless FileTest.exist?(to_path) and File.compare(from, to_path) 
     16    File.install(from, to_path, 0644, true) 
    2017  end 
    2118end 
    2219 
    23 def installDir(from, to) 
    24   unless FileTest.directory?(from) 
    25     raise RuntimeError.new("'#{ from }' not found.") 
     20def install_dir(*path) 
     21  from_path = File.join(SRCPATH, *path) 
     22  unless FileTest.directory?(from_path) 
     23    raise RuntimeError.new("'#{ from_path }' not found.") 
    2624  end 
    27   File.mkpath(to, true) 
    28   Dir[join(from, '*.rb')].each do |name| 
    29     install(name, to) 
     25  to_path_rubylib = File.join(RUBYLIBDIR, *path) 
     26  to_path_sitelib = File.join(SITELIBDIR, *path) 
     27  Dir[File.join(from_path, '*.rb')].each do |name| 
     28    basename = File.basename(name) 
     29    if File.exist?(File.join(to_path_rubylib, basename)) 
     30      install(name, to_path_rubylib) 
     31    else 
     32      File.mkpath(to_path_sitelib, true) 
     33      install(name, to_path_sitelib) 
     34    end 
    3035  end 
    3136end 
    3237 
    3338begin 
    34   installDir( 
    35     join(SRCPATH, 'lib', 'soap'), 
    36     join(DSTPATH, 'soap')) 
    37   installDir( 
    38     join(SRCPATH, 'lib', 'soap', 'rpc'), 
    39     join(DSTPATH, 'soap', 'rpc')) 
    40   installDir( 
    41     join(SRCPATH, 'lib', 'soap', 'mapping'), 
    42     join(DSTPATH, 'soap', 'mapping')) 
    43   installDir( 
    44     join(SRCPATH, 'lib', 'soap', 'encodingstyle'), 
    45     join(DSTPATH, 'soap', 'encodingstyle')) 
    46   installDir( 
    47     join(SRCPATH, 'lib', 'wsdl'), 
    48     join(DSTPATH, 'wsdl')) 
    49   installDir( 
    50     join(SRCPATH, 'lib', 'wsdl', 'xmlSchema'), 
    51     join(DSTPATH, 'wsdl', 'xmlSchema')) 
    52   installDir( 
    53     join(SRCPATH, 'lib', 'wsdl', 'soap'), 
    54     join(DSTPATH, 'wsdl', 'soap')) 
    55   installDir( 
    56     join(SRCPATH, 'lib', 'xsd'), 
    57     join(DSTPATH, 'xsd')) 
    58   installDir( 
    59     join(SRCPATH, 'lib', 'xsd', 'xmlparser'), 
    60     join(DSTPATH, 'xsd', 'xmlparser')) 
     39  install_dir('soap') 
     40  install_dir('soap', 'rpc') 
     41  install_dir('soap', 'mapping') 
     42  install_dir('soap', 'encodingstyle') 
     43  install_dir('wsdl') 
     44  install_dir('wsdl', 'xmlSchema') 
     45  install_dir('wsdl', 'soap') 
     46  install_dir('xsd') 
     47  install_dir('xsd', 'xmlparser') 
    6148 
    6249  puts "install succeed!"