File: install.rb

package info (click to toggle)
libcsv-ruby 1.2.1-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 148 kB
  • ctags: 137
  • sloc: ruby: 1,847; makefile: 26
file content (32 lines) | stat: -rwxr-xr-x 518 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env ruby

require "rbconfig"
require "ftools"
include Config

DSTPATH = ENV['DESTDIR'] + CONFIG["rubylibdir"]
File.makedirs(DSTPATH)

def join( *arg )
  File.join( *arg )
end

def base( name )
  File.basename( name )
end

begin
  unless FileTest.directory?( "lib" )
    raise RuntimeError.new( "'lib' not found." )
  end

  Dir[ 'lib/*.rb' ].each do | name |
    File.install( name, join( DSTPATH, base( name )), 0644, true )
  end

  puts "install succeed!"

rescue 
  puts "install failed!"
  puts $!
end