aboutsummaryrefslogtreecommitdiff
path: root/shells/shell-include/files/patch-install
blob: bece2ab9d0e70c654ef7242af8cd2fe0a8dafa21 (plain) (blame)
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
--- install.orig	2009-11-08 21:53:11 UTC
+++ install
@@ -36,12 +36,12 @@ manInstall(){
     #$3 = VERSION
     
     #makes the man dir if it does not exist
-    if /bin/[ ! -d "$1/man" ]; then
-	/bin/mkdir "$1/man"
-	/bin/chmod 755 "$1/man"
+    if /bin/[ ! -d "${DESTDIR}$1/man" ]; then
+	/bin/mkdir "${DESTDIR}$1/man"
+	/bin/chmod 755 "${DESTDIR}$1/man"
     fi    
     
-    manInstallTMPfile=/tmp/`shortRandom``shortRandom``shortRandom`$$`shortRandom`
+    manInstallTMPfile=_tmpfile
     /usr/bin/touch $manInstallTMPfile
     /bin/chmod go-rwx $manInstallTMPfile
 
@@ -72,9 +72,9 @@ manInstall(){
 
 
 	#makes the man section dir if it does not exist
-        if /bin/[ ! -d $1/man/man$manInstallMANsection ]; then
-	    /bin/mkdir "$1/man/man$manInstallMANsection"
-	    /bin/chmod 755 "$1/man/man$manInstallMANsection"
+        if /bin/[ ! -d ${DESTDIR}$1/man/man$manInstallMANsection ]; then
+	    /bin/mkdir "${DESTDIR}$1/man/man$manInstallMANsection"
+	    /bin/chmod 755 "${DESTDIR}$1/man/man$manInstallMANsection"
 	fi
 
 	#echo $line
@@ -82,7 +82,7 @@ manInstall(){
 	#echo $MANsection
 	#echo $MANcenter
     
-	manInstallMANfile=`echo $1/man/man$manInstallMANsection/$manInstallMANname.$manInstallMANsection.gz | sed 's/\/\//\//g'`
+	manInstallMANfile=`echo ${DESTDIR}$1/man/man$manInstallMANsection/$manInstallMANname.$manInstallMANsection.gz | sed 's/\/\//\//g'`
     
         /usr/local/bin/pod2man --section="$manInstallMANsection" --release="$3" --name="$manInstallMANname" --center="$manInstallMANcenter" "$manInstallLine" | /usr/bin/gzip > "$manInstallMANfile"
 
@@ -97,17 +97,17 @@ manInstall(){
 binInstall(){
     #$1 = prefix
 
-    if /bin/[ ! -d "$1/bin" ]; then
-	/bin/mkdir "$1/bin"
-        if /bin/[ ! -d $1/bin ]; then
-	    echo "$1/bin does not a dir or does not exist and could not be created"
+    if /bin/[ ! -d "${DESTDIR}$1/bin" ]; then
+	/bin/mkdir "${DESTDIR}$1/bin"
+        if /bin/[ ! -d ${DESTDIR}$1/bin ]; then
+	    echo "${DESTDIR}$1/bin does not a dir or does not exist and could not be created"
 	    exit 1;
 	fi
-	/bin/chmod u+rwx "$1/bin"
+	/bin/chmod u+rwx "${DESTDIR}$1/bin"
 
     fi
 
-    binInstallTMPfile=/tmp/`shortRandom``shortRandom``shortRandom`$$`shortRandom`
+    binInstallTMPfile=_tmpfile
     /usr/bin/touch $binInstallTMPfile
     /bin/chmod go-rwx $binInstallTMPfile
 
@@ -119,9 +119,9 @@ binInstall(){
     while /bin/[ $binInstallCL -le $binInstallNOL ]; do
 	binInstallLine=`getline $binInstallTMPfile $binInstallCL`
     
-	/bin/cat "./bin/$binInstallLine" | /usr/bin/sed "s/%%PREFIX%%/"`echo $1 | sed 's/\\//\\\\\//g'`"/g" > "$1/bin/$binInstallLine"
+	/bin/cat "./bin/$binInstallLine" | /usr/bin/sed "s/%%PREFIX%%/"`echo $1 | sed 's/\\//\\\\\//g'`"/g" > "${DESTDIR}$1/bin/$binInstallLine"
 
-	/bin/chmod 755 "$1/bin/$binInstallLine"
+	/bin/chmod 755 "${DESTDIR}$1/bin/$binInstallLine"
     
 	binInstallCL=`/bin/expr $binInstallCL + 1`
     done
@@ -132,7 +132,7 @@ binInstall(){
 includeInstall(){
     #$1 = prefix
 
-    includeInstallTMPfile=/tmp/`shortRandom``shortRandom``shortRandom`$$`shortRandom`
+    includeInstallTMPfile=_tmpfile
     /usr/bin/touch $includeInstallTMPfile
     /bin/chmod go-rwx $includeInstallTMPfile
 
@@ -145,13 +145,13 @@ includeInstall(){
 	includeInstallLine=`getline $includeInstallTMPfile $includeInstallCL`
     
 	if /bin/[ -d $includeInstallLine ]; then
-	    if /bin/[ ! -d "$1/$includeInstallLine" ]; then
-		mkdir "$1/$includeInstallLine"
-		chmod 755 "$1/$includeInstallLine"
+	    if /bin/[ ! -d "${DESTDIR}$1/$includeInstallLine" ]; then
+		mkdir "${DESTDIR}$1/$includeInstallLine"
+		chmod 755 "${DESTDIR}$1/$includeInstallLine"
 	    fi
 	else
-	    cat "$includeInstallLine" | /usr/bin/sed "s/%%PREFIX%%/"`echo $1 | sed 's/\\//\\\\\//g'`"/g" > "$1/$includeInstallLine"
-	    /bin/chmod 644 "$1/$includeInstallLine"
+	    cat "$includeInstallLine" | /usr/bin/sed "s/%%PREFIX%%/"`echo $1 | sed 's/\\//\\\\\//g'`"/g" > "${DESTDIR}$1/$includeInstallLine"
+	    /bin/chmod 644 "${DESTDIR}$1/$includeInstallLine"
 	fi
     
 	includeInstallCL=`/bin/expr $includeInstallCL + 1`