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

Changeset 1781

Show
Ignore:
Timestamp:
05/17/07 13:25:00 (2 years ago)
Author:
nahi
Message:
  • let install.rb support --prefix option. Config::CONFIGprefix? is used when --prefix is not given. closes #255.
Files:

Legend:

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

    r1557 r1781  
    11#!/usr/bin/env ruby 
    22 
     3require 'getoptlong' 
    34require 'rbconfig' 
    45require 'ftools' 
    56 
     7OptSet = [ 
     8  ['--prefix','-p', GetoptLong::REQUIRED_ARGUMENT], 
     9] 
     10prefix = nil 
     11GetoptLong.new(*OptSet).each do |name, arg| 
     12  case name 
     13  when "--prefix" 
     14    prefix = arg 
     15  else 
     16    raise ArgumentError.new("Unknown type #{ arg }") 
     17  end 
     18end 
     19 
    620include Config 
     21RV = CONFIG["MAJOR"] + "." + CONFIG["MINOR"] 
     22ORG_PREFIX = CONFIG["prefix"] 
     23SRCPATH = File.join(File.dirname($0), 'lib') 
    724 
    825RUBYLIBDIR = CONFIG["rubylibdir"] 
    9 RV = CONFIG["MAJOR"] + "." + CONFIG["MINOR"] 
    1026SITELIBDIR = CONFIG["sitedir"] + "/" +  RV  
    11 SRCPATH = File.join(File.dirname($0), 'lib') 
     27 
     28if prefix 
     29  RUBYLIBDIR.sub!(/^#{Regexp.quote(ORG_PREFIX)}/, prefix) 
     30  SITELIBDIR.sub!(/^#{Regexp.quote(ORG_PREFIX)}/, prefix) 
     31end 
    1232 
    1333def install(from, to)