File: install

package info (click to toggle)
clig 1.9.11.1-3
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 640 kB
  • ctags: 114
  • sloc: tcl: 1,909; sh: 556; ansic: 497; makefile: 130
file content (73 lines) | stat: -rwxr-xr-x 1,935 bytes parent folder | download | duplicates (2)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/sh
# \
exec tclsh "$0" "$@"
########################################################################

## This should typically be called via `make install', but you can of
## course run it by hand if you supply all necessary parameters as
## obvious from the makefile.

########################################################################
## trivial command line parser, understands BLA=blubs and sets
## env(BLA) to blubs.
foreach assign $argv {
  if {[regexp {([^=]+)=(.*)} $assign dummy key value]} {
    set env($key) $value
  }
}
########################################################################

##
## Create destination directories
##
file mkdir $env(BINDIR)
file mkdir  $env(MAN1DIR)
file mkdir p $env(MANnDIR)
foreach dir {c tcl tcllib} {
  file mkdir [file join $env(LIBDIR) $dir]
}
file mkdir $env(DOCDIR)

##
## copy all files to their destination
##

# the executables
foreach exe {clig cligUsage} {
  set dst [file join $env(BINDIR) $exe]
  file copy -force $exe.fixed $dst
  file attributes $dst -permissions 0755
}

# pkgIndex
file copy -force pkgIndex.tcl [file join $env(LIBDIR)]

# files sourced by the executable
eval file copy -force [glob tcl/*.tcl] tcl/cmdline.cli \
    [file join $env(LIBDIR) tcl]

# C-language template files
eval file copy -force [glob c/*.c c/*.man] [file join $env(LIBDIR) c]

# the tcl-package ::clig
eval file copy -force [glob tcllib/*.tcl] [file join $env(LIBDIR) tcllib]

# the manual
foreach t {1 n} {
  set suffix $env(M${t}SUFFIX)
  set files $env(M${t}FILES)
  set dir $env(MAN${t}DIR)
  foreach f $files {
    set dst [file join $dir [file root [file tail $f]]].$suffix
    file copy -force $f $dst
  }
}

# doc and examples
file copy -force CHANGES ANNOUNCE index.html README WISHLIST \
    COPYING-2.0 LICENSE example \
    $env(DOCDIR)
########################################################################
## Local Variables: ##
## mode:tcl ##
## End: ##