1 ?RCS: $Id: install.U 1 2006-08-24 12:32:52Z rmanfredi $
3 ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
5 ?RCS: You may redistribute only under the terms of the Artistic Licence,
6 ?RCS: as specified in the README file that comes with the distribution.
7 ?RCS: You may reuse parts of this distribution only within the terms of
8 ?RCS: that same Artistic Licence; a copy of which may be found at the root
9 ?RCS: of the source tree for dist 4.0.
11 ?RCS: $Log: install.U,v $
12 ?RCS: Revision 3.0.1.2 1995/09/25 09:16:37 ram
13 ?RCS: patch59: all possible install programs are now looked for
15 ?RCS: Revision 3.0.1.1 1995/01/11 15:30:41 ram
16 ?RCS: patch45: created
18 ?MAKE:install installdir: Loc Oldconfig Getfile cat test startsh rm +cc \
19 eunicefix package contains mkdir echo n c
20 ?MAKE: -pick add $@ %<
22 ?S: This variable contains the name of an install program that can accept
23 ?S: BSD-style arguments. It must correctly support -c, -s, and -m at least.
24 ?S: It is a fully qualified pathname when found. If you have a local
25 ?S: install.SH file at the root directory of your package, it is assumed to
26 ?S: be the default script emulating a BSD install and the variable will be
27 ?S: set to ./install. Otherwise, it is set to plain 'install', relying on
28 ?S: the user's PATH to perform miracles.
31 ?S: This variable contains the name of a program that can install nested
32 ?S: directories. Often set to 'mkdir -p', it can also be 'install -d' if
33 ?S: you have such a beast and lack the former. If you have an install.SH
34 ?S: file at the root directory of your package, it will be used in last
35 ?S: resort, setting the variable to './install -d'. Otherwise, it is set to
36 ?S: plain 'mkdir', and cross your fingers!
38 ?T:dir file tryit prog creatdir either
40 : locate a BSD compatible install program
42 echo "Looking for a BSD-compatible install program..." >&4
50 for file in ginstall installbsd scoinst install; do
51 if $test -f $dir/$file; then
52 tryit="$tryit $dir/$file"
63 if $cc -o try try.c >/dev/null 2>&1; then
65 strip try >/dev/null 2>&1
67 echo "(I can't seem to compile a trivial C program -- bypassing.)"
78 \$1 -c -m 764 try.ns d
79 \$1 -c -s -m 642 try.ns d/try
85 for prog in $tryit; do
86 $echo $n "Checking $prog... $c"
87 ./tryinst $prog >/dev/null 2>&1
89 if $test -d foo/bar; then
93 (ls -l d/try >try.ls; ls -l d/try.ns >tryno.ls) 2>/dev/null
94 if (cmp -s d/try try && cmp -s d/try.ns try.ns && \
95 $contains 'rwxrw-r--' tryno.ls && \
96 $contains 'rw-r---w-' try.ls) >/dev/null 2>&1
99 echo "ok, that will do."
102 echo "not good$either."
106 $rm -rf foo d tryinst try try*.ls try.*
109 @if {test -f ../install.SH}
110 echo "Hopefully, $package comes with its own install script!"
122 I will be requiring a BSD-compatible install program (one that allows
123 options like -s to strip executables or -m to specify a file mode) to
126 If the question below contains a fully qualified default path, then it
127 is probably ok. If it is an unqualified name such as 'install', then it
128 means I was unable to find out a good install program I could use. If
129 @if {test -f ../install.SH}
130 you know of one, please tell me about it. If the default is './install',
131 then I shall be using the install script supplied with $package.
133 you know of one, please tell me about it.
137 @if {test -f ../install.SH}
138 fn='/fe~(install,./install)'
142 rp='Which install program shall I use?'
147 : how can we create nested directories?
149 echo "Ok, let's see how we can create nested directories..." >&4
150 case "$installdir" in
152 ?X: First time, maybe we already found out a working one in $creatdir above...
153 ?X: Prefer "mkdir -p" because of bugs in GNU install when not running as root
154 $mkdir -p foo/bar >/dev/null 2>&1
155 if $test -d foo/bar; then
156 echo "Great, we can build them using 'mkdir -p'."
161 if eval "$install -d foo/bar"; $test -d foo/bar; then
162 creatdir="install -d"
163 echo "It looks like '$creatdir' will do it for us."
167 eval "$creatdir foo/bar" >/dev/null 2>&1
168 if $test -d foo/bar; then
169 echo "Ah! We can use '$creatdir' to do just that."
179 echo "Heck! Another ancient system lacking the comfort of modern ones!"
180 @if {test -f ../install.SH}
181 echo "You can thank $package for bringing you its own install script!"
182 installdir='./install -d'
184 echo "We have no choice but to use plain old 'mkdir' -- wish me luck!"
188 *) installdir="$creatdir";;
191 *) echo "As you already told me, '$installdir' should work.";;