File: install_rubysdl.rb

package info (click to toggle)
ruby-sdl 2.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,548 kB
  • sloc: cpp: 7,598; ansic: 4,498; ruby: 2,246; makefile: 110; sh: 102
file content (30 lines) | stat: -rw-r--r-- 759 bytes parent folder | download | duplicates (3)
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

require 'rbconfig'
require 'fileutils'
require 'optparse'

dlldir = nil
option = { :noop => false, :verbose => true }

ARGV.options do |opt|
  opt.on('--dlldir DIR'){|dir| dlldir = dir}
  opt.on('--no-harm'){ option[:noop] = true }
  opt.on('--quiet'){ option[:verbose] = false }

  opt.parse!
end

dlldir ||= Config::CONFIG["bindir"]
sitelibdir = Config::CONFIG["sitelibdir"]
sitearchdir = Config::CONFIG["sitearchdir"]


FileUtils.mkpath(dlldir, option) 
FileUtils.mkpath(sitelibdir, option)
FileUtils.mkpath(sitearchdir, option)

Dir.glob("dll/*.dll"){|fname| FileUtils.install(fname, dlldir, option)}
Dir.glob("ext/*.so"){|fname| FileUtils.install(fname, sitearchdir, option)}
Dir.glob("lib/*.rb"){|fname| FileUtils.install(fname, sitelibdir, option)}