summarylogtreecommitdiffstats
path: root/make_install.patch
blob: b79ceb956b13d7110ed4ee3658e040c93e48a61b (plain)
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
--- Makefile_raw	2017-04-03 22:32:08.000000000 +0200
+++ Makefile	2017-04-11 09:10:58.900793485 +0200
@@ -171,7 +171,7 @@
 	./therion --print-init-file > therion.ini
 
 install: all
-	tclsh makeinstall.tcl $(THPLATFORM)
+	tclsh makeinstall.tcl $(THPLATFORM) $(DESTDIR)
 
 minor-release:
 	perl makerelease.pl
--- makeinstall.tcl_raw	2017-04-03 22:32:08.000000000 +0200
+++ makeinstall.tcl	2017-04-11 09:15:00.960791964 +0200
@@ -2,6 +2,7 @@
 set instdir /usr/local
 if {$argc > 0} {
   set platform [lindex $argv 0]
+  set instdir [lindex $argv 1]
 } else {
   if {[string equal $tcl_platform(platform) windows]} {
     set platform WIN32
@@ -10,6 +11,8 @@
 
 proc copyfile {force src dst} {
   if {$force} {
+	set dirname [file dirname $dst]
+	file mkdir $dirname
     if {[catch { 
       file copy -force -- $src $dst
     }]} {
@@ -50,9 +53,9 @@
   copyfile 0 xtherion/xtherion.ini /etc/xtherion.ini
   file attributes /etc/xtherion.ini -permissions 0644
 } else {
-  copyfile 1 therion $instdir/bin/therion
-  copyfile 1 xtherion/xtherion $instdir/bin/xtherion
-  copyfile 1 loch/loch $instdir/bin/loch
+  copyfile 1 therion $instdir/usr/bin/therion
+  copyfile 1 xtherion/xtherion $instdir/usr/bin/xtherion
+  copyfile 1 loch/loch $instdir/usr/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