Sha256: 7e9d24e19af03b0a8d94242b9e7f0ead9a7037ab38a6766fcfa48a7bcbffb2bb

Contents?: true

Size: 1.23 KB

Versions: 4

Compression:

Stored size: 1.23 KB

Contents

#!/usr/bin/env ratch

# install package to site_ruby

# This tool installs the package to site_ruby
# using Ruby's defualt configuration settings.
# If you want to change these you can can supply
# config settings for 'prefix' and/or 'sitedir'.

system_prefix = Config::CONFIG['prefix']
system_libdir = Config::CONFIG['sitelibdir']

config = config_load('install')

prefix = config['prefix'] || system_prefix
libdir = config['libdir']

unless libdir
  if (prefix == system_prefix) then
    libdir = system_libdir
  else
    libdir = File.join(prefix, system_libdir[system_prefix.size..-1])
  end
end

# TODO Probably should get files from manifest, if it exists.
# files = projectinfo.filelist
files = Dir.glob("{lib,ext,bin}/**/*").select{ |f| file?(f) }

lib_files  = files.grep(/^(lib|ext)/)
bin_files  = files.grep(/^bin/)

# Copy files to proper locations.

lib_files.each do |file|
  dest = File.dirname(file).sub('lib/', '')
  dest = File.join(libdir, dest)
  #dest.sub!(/(core|more)\//, '')  # SPECIAL FOR FACETS !!!!!
  mkdir_p dest unless dir?(dest)
  install file, dest, :mode => 0444
end

bin_files.each do |file|
  dest = File.dirname(file)
  dest = File.join(prefix, dest)
  mkdir_p dest unless dir?(dest)
  install file, dest, :mode => 0555
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ratch-0.2.1 data/ratch/rubyproject/install
ratch-0.2.2 dev/install.0
ratch-0.1 data/mint/ratch/install
ratch-0.3.0 work/scrap/install.0