3
# install - install a program, script, or datafile
4
# This comes from X11R5; it is not part of GNU.
6
# $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $
8
# This script is compatible with the BSD install script, but was written
13
# set DOITPROG to echo to test this script
18
# put in absolute paths if you don't have them in your path; or use env. vars.
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}"
37
while [ x"$1" != x ]; do
43
-m) chmodcmd="$chmodprog $2"
48
-o) chowncmd="$chownprog $2"
53
-g) chgrpcmd="$chgrpprog $2"
58
-s) stripcmd="$stripprog"
75
echo "install: no input file specified"
81
echo "install: no destination specified"
86
# if destination is a directory, append the input filename; if your system
87
# does not like double slashes in filenames, you may need to add some logic
91
dst="$dst"/`basename $src`
95
# get rid of the old one and mode the new one in
98
$doit $instcmd $src $dst
101
# and set any options; do chmod last to preserve setuid bits
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