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

root/tags/RELEASE_1_5_2/install.rb

Revision 982, 1.3 kB (checked in by nahi, 5 years ago)

install rubylibdir not sitelibdir under 1.8.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to author date id revision
Line 
1 #!/usr/bin/env ruby
2
3 require 'rbconfig'
4 require 'ftools'
5
6 include Config
7
8 RUBYLIBDIR = CONFIG["rubylibdir"]
9 RV = CONFIG["MAJOR"] + "." + CONFIG["MINOR"]
10 SITELIBDIR = CONFIG["sitedir"] + "/" +  RV
11 SRCPATH = File.join(File.dirname($0), 'lib')
12
13 def install(from, to)
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)
17   end
18 end
19
20 def install_dir(*path)
21   from_path = File.join(SRCPATH, *path)
22   unless FileTest.directory?(from_path)
23     raise RuntimeError.new("'#{ from_path }' not found.")
24   end
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
35   end
36 end
37
38 begin
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')
48
49   puts "install succeed!"
50
51 rescue
52   puts "install failed!"
53   puts $!
54
55 end
Note: See TracBrowser for help on using the browser.