1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15: doit="${DOITPROG:-}"
16:
17:
18:
19:
20: mvprog="${MVPROG:-mv}"
21: cpprog="${CPPROG:-cp}"
22: chmodprog="${CHMODPROG:-chmod}"
23: chownprog="${CHOWNPROG:-chown}"
24: chgrpprog="${CHGRPPROG:-chgrp}"
25: stripprog="${STRIPPROG:-strip}"
26: rmprog="${RMPROG:-rm}"
27:
28: instcmd="$mvprog"
29: chmodcmd=""
30: chowncmd=""
31: chgrpcmd=""
32: stripcmd=""
33: rmcmd="$rmprog -f"
34: src=""
35: dst=""
36:
37: while [ x"$1" != x ]; do
38: case $1 in
39: -c) instcmd="$cpprog"
40: shift
41: continue;;
42:
43: -m) chmodcmd="$chmodprog $2"
44: shift
45: shift
46: continue;;
47:
48: -o) chowncmd="$chownprog $2"
49: shift
50: shift
51: continue;;
52:
53: -g) chgrpcmd="$chgrpprog $2"
54: shift
55: shift
56: continue;;
57:
58: -s) stripcmd="$stripprog"
59: shift
60: continue;;
61:
62: *) if [ x"$src" = x ]
63: then
64: src=$1
65: else
66: dst=$1
67: fi
68: shift
69: continue;;
70: esac
71: done
72:
73: if [ x"$src" = x ]
74: then
75: echo "install: no input file specified"
76: exit 1
77: fi
78:
79: if [ x"$dst" = x ]
80: then
81: echo "install: no destination specified"
82: exit 1
83: fi
84:
85:
86:
87:
88:
89: if [ -d $dst ]
90: then
91: dst="$dst"/`basename $src`
92: fi
93:
94:
95:
96:
97: $doit $rmcmd $dst
98: $doit $instcmd $src $dst
99:
100:
101:
102:
103: if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; fi
104: if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; fi
105: if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; fi
106: if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; fi
107:
108: exit 0