3 if test -f config.sh; then TOP=.;
4 elif test -f ../config.sh; then TOP=..;
5 elif test -f ../../config.sh; then TOP=../..;
6 elif test -f ../../../config.sh; then TOP=../../..;
7 elif test -f ../../../../config.sh; then TOP=../../../..;
9 echo "Can't find config.sh."; exit 1
15 */*) cd `expr X$0 : 'X\(.*\)/'` ;;
17 echo "Extracting install (with variable substitutions)"
18 $spitshell >install <<!GROK!THIS!
20 # @(#) Installing script accepting bsd-style arguments
22 # $Id: install.SH,v 3.0.1.1 1993/08/19 06:42:10 ram Exp $
24 # Copyright (c) 1991-1993, Raphael Manfredi
26 # You may redistribute only under the terms of the Artistic Licence,
27 # as specified in the README file that comes with the distribution.
28 # You may reuse parts of this distribution only within the terms of
29 # that same Artistic Licence; a copy of which may be found at the root
30 # of the source tree for dist 3.0.
32 # $Log: install.SH,v $
33 # Revision 3.0.1.1 1993/08/19 06:42:10 ram
34 # patch1: leading config.sh searching was not aborting properly
36 # Revision 3.0 1993/08/18 12:04:08 ram
37 # Baseline for dist 3.0 netwide release.
48 $spitshell >>install <<'!NO!SUBS!'
63 if $test ! -d "$name"; then
64 create="$name $create";
65 name=`echo $name | $sed -e "s|^[^/]*$||"`;
66 name=`echo $name | $sed -e "s|\(.*\)/.*|\1|"`;
71 for file in $create; do
72 mkdir $file && $test $verbose &&
73 echo "install: created directory $file" >&2;
104 -d) newdir="$newdir$2 "
112 *) if $test x$src = x
124 # if -d option is used, we have to create the path given
125 if $test ! x$newdir = x
133 exit 0 # -d is the only action
138 echo "install: no input file specified" >&2
144 echo "install: no destination specified" >&2
148 srcbase=`basename $src`
149 dstbase=`basename $dst`
151 # If the destination is a directory, the target name is srcbase...
152 if $test -d $dst; then
155 dst="`echo $dst | sed 's,^\(.*\)/.*$,\1,'`"
156 if $test ! -d $dst; then
162 # If the src has a directory, extract the dir name...
163 if $test "$src" != "$srcbase" -a "$src" != "./$srcbase"; then
164 src="`echo $src | sed 's,^\(.*\)/.*$,\1,'`"
169 # dst is the destination directory and dstbase the base name.
170 # srcbase is the base name of source and src the source dir.
172 srcpth=`(cd $src; pwd)`/$srcbase
173 destpth=`(cd $dst; pwd)`/$dstbase
174 if $test x$srcpth = x$destpth; then
176 echo "install: destination and source are identical"
184 if $test -f $dst/$dstbase; then
185 $rm -f $dst/$dstbase && $test $verbose &&
186 echo "install: $dst/$dstbase removed"
188 if $test -f $dst/$dstbase; then
189 $mv $dst/$dstbase $dst/OLD$dstbase && $test $verbose &&
190 echo "install: $dst/$dstbase renamed as OLD$dstbase"
193 cp $srcbase $dst/$dstbase && $test $verbose &&
194 echo "install: $srcbase installed as $dst/$dstbase"
196 if $test ! x$dostrip = x; then
197 strip $dst/$dstbase 2>/dev/null && $test $verbose &&
198 echo "install: stripped $dst/$dstbase"
201 if $test ! x$uid = x; then
202 $chown $uid $dst/$dstbase
204 if $test ! x$gid = x; then
205 $chgrp $gid $dst/$dstbase
207 if $test ! x$mode = x
209 $chmod $mode $dst/$dstbase