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