File: makeinstall.tcl

package info (click to toggle)
therion 5.3.9-4
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 16,956 kB
  • sloc: ansic: 127,467; cpp: 89,790; tcl: 24,110; perl: 2,051; makefile: 1,003; asm: 201; python: 54; sh: 4
file content (45 lines) | stat: -rw-r--r-- 1,431 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
set platform LINUX
set instdir /usr/local
if {$argc > 0} {
  set platform [lindex $argv 0]
} else {
  if {[string equal $tcl_platform(platform) windows]} {
    set platform WIN32
  }
}

proc copyfile {force src dst} {
  if {$force} {
    if {[catch { 
      file copy -force -- $src $dst
    }]} {
      puts stderr "installation error: could not write $dst"
    }
  } else {
    if {![file exists $dst]} {
      copyfile 1 $src $dst
    }
  }
}

if {[string equal $platform WIN32]} {
  copyfile 1 therion.exe "c:/Program files/Therion/therion.exe"
  copyfile 1 xtherion/xtherion.tcl "c:/Program files/Therion/xtherion.tcl"
  copyfile 1 loch/loch.exe "c:/Program files/Therion/loch.exe"
} elseif {[string equal $platform MACOSX]} {
  copyfile 1 therion /usr/bin/therion
  copyfile 1 xtherion/xtherion /usr/bin/xtherion
  copyfile 1 loch/loch /usr/bin/loch
  copyfile 1 therion.ini /etc/therion.ini.new
  copyfile 1 xtherion/xtherion.ini /etc/xtherion.ini.new
  copyfile 0 therion.ini /etc/therion.ini
  copyfile 0 xtherion/xtherion.ini /etc/xtherion.ini
} else {
  copyfile 1 therion $instdir/bin/therion
  copyfile 1 xtherion/xtherion $instdir/bin/xtherion
  copyfile 1 loch/loch $instdir/bin/loch
  copyfile 1 therion.ini $instdir/etc/therion.ini.new
  copyfile 1 xtherion/xtherion.ini $instdir/etc/xtherion.ini.new
  copyfile 0 therion.ini $instdir/etc/therion.ini
  copyfile 0 xtherion/xtherion.ini $instdir/etc/xtherion.ini
}