Remove building with NOCRYPTO option
[minix.git] / crypto / external / bsd / openssl / dist / util / install.sh
blobe1d0c982df50226f57ef0c0a0f73a58302b2a3a4
1 #!/bin/sh
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
9 # from scratch.
13 # set DOITPROG to echo to test this script
15 doit="${DOITPROG:-}"
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}"
28 instcmd="$mvprog"
29 chmodcmd=""
30 chowncmd=""
31 chgrpcmd=""
32 stripcmd=""
33 rmcmd="$rmprog -f"
34 src=""
35 dst=""
37 while [ x"$1" != x ]; do
38 case $1 in
39 -c) instcmd="$cpprog"
40 shift
41 continue;;
43 -m) chmodcmd="$chmodprog $2"
44 shift
45 shift
46 continue;;
48 -o) chowncmd="$chownprog $2"
49 shift
50 shift
51 continue;;
53 -g) chgrpcmd="$chgrpprog $2"
54 shift
55 shift
56 continue;;
58 -s) stripcmd="$stripprog"
59 shift
60 continue;;
62 *) if [ x"$src" = x ]
63 then
64 src=$1
65 else
66 dst=$1
68 shift
69 continue;;
70 esac
71 done
73 if [ x"$src" = x ]
74 then
75 echo "install: no input file specified"
76 exit 1
79 if [ x"$dst" = x ]
80 then
81 echo "install: no destination specified"
82 exit 1
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
89 if [ -d $dst ]
90 then
91 dst="$dst"/`basename $src`
95 # get rid of the old one and mode the new one in
97 $doit $rmcmd $dst
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
108 exit 0