1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/build/autoconf/install-sh Mon Jul 02 23:37:12 2012 -0700
1.3 @@ -0,0 +1,119 @@
1.4 +#!/bin/sh
1.5 +
1.6 +#
1.7 +# install - install a program, script, or datafile
1.8 +# This comes from X11R5; it is not part of GNU.
1.9 +#
1.10 +# $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $
1.11 +#
1.12 +# This script is compatible with the BSD install script, but was written
1.13 +# from scratch.
1.14 +#
1.15 +
1.16 +
1.17 +# set DOITPROG to echo to test this script
1.18 +
1.19 +# Don't use :- since 4.3BSD and earlier shells don't like it.
1.20 +doit="${DOITPROG-}"
1.21 +
1.22 +
1.23 +# put in absolute paths if you don't have them in your path; or use env. vars.
1.24 +
1.25 +mvprog="${MVPROG-mv}"
1.26 +cpprog="${CPPROG-cp}"
1.27 +chmodprog="${CHMODPROG-chmod}"
1.28 +chownprog="${CHOWNPROG-chown}"
1.29 +chgrpprog="${CHGRPPROG-chgrp}"
1.30 +stripprog="${STRIPPROG-strip}"
1.31 +rmprog="${RMPROG-rm}"
1.32 +
1.33 +instcmd="$mvprog"
1.34 +chmodcmd=""
1.35 +chowncmd=""
1.36 +chgrpcmd=""
1.37 +stripcmd=""
1.38 +rmcmd="$rmprog -f"
1.39 +mvcmd="$mvprog"
1.40 +src=""
1.41 +dst=""
1.42 +
1.43 +while [ x"$1" != x ]; do
1.44 + case $1 in
1.45 + -c) instcmd="$cpprog"
1.46 + shift
1.47 + continue;;
1.48 +
1.49 + -m) chmodcmd="$chmodprog $2"
1.50 + shift
1.51 + shift
1.52 + continue;;
1.53 +
1.54 + -o) chowncmd="$chownprog $2"
1.55 + shift
1.56 + shift
1.57 + continue;;
1.58 +
1.59 + -g) chgrpcmd="$chgrpprog $2"
1.60 + shift
1.61 + shift
1.62 + continue;;
1.63 +
1.64 + -s) stripcmd="$stripprog"
1.65 + shift
1.66 + continue;;
1.67 +
1.68 + *) if [ x"$src" = x ]
1.69 + then
1.70 + src=$1
1.71 + else
1.72 + dst=$1
1.73 + fi
1.74 + shift
1.75 + continue;;
1.76 + esac
1.77 +done
1.78 +
1.79 +if [ x"$src" = x ]
1.80 +then
1.81 + echo "install: no input file specified"
1.82 + exit 1
1.83 +fi
1.84 +
1.85 +if [ x"$dst" = x ]
1.86 +then
1.87 + echo "install: no destination specified"
1.88 + exit 1
1.89 +fi
1.90 +
1.91 +
1.92 +# If destination is a directory, append the input filename; if your system
1.93 +# does not like double slashes in filenames, you may need to add some logic
1.94 +
1.95 +if [ -d $dst ]
1.96 +then
1.97 + dst="$dst"/`basename $src`
1.98 +fi
1.99 +
1.100 +# Make a temp file name in the proper directory.
1.101 +
1.102 +dstdir=`dirname $dst`
1.103 +dsttmp=$dstdir/#inst.$$#
1.104 +
1.105 +# Move or copy the file name to the temp name
1.106 +
1.107 +$doit $instcmd $src $dsttmp
1.108 +
1.109 +# and set any options; do chmod last to preserve setuid bits
1.110 +
1.111 +if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; fi
1.112 +if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; fi
1.113 +if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; fi
1.114 +if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; fi
1.115 +
1.116 +# Now rename the file to the real destination.
1.117 +
1.118 +$doit $rmcmd $dst
1.119 +$doit $mvcmd $dsttmp $dst
1.120 +
1.121 +
1.122 +exit 0