2 # %% (c) Copyright 1993, 1994 Hewlett-Packard Company
3 # %% (c) Copyright 1993, 1994 International Business Machines Corp.
4 # %% (c) Copyright 1993, 1994 Sun Microsystems, Inc.
5 # %% (c) Copyright 1993, 1994 Novell, Inc.
6 # %% $XConsortium: ttinstall.sh /main/3 1995/10/20 16:23:17 rswiston $
7 # @(#)ttinstall.sh 1.10 30 Jul 1993
8 # Shell script for doing installs.
9 # The old bsd install did pretty much what we want, but the SYSV install
10 # doesn't. Hence this shell script which does what we need.
12 # Usage: ttinstall <version> <dest-dir> file...
14 # ttinstall will create dest-dir if needed and copy each named file
15 # to that directory. If a file's name ends in .so.[0-9] or .so.[0-9][0-9],
16 # a symlink is created in the destination directory without the version.
17 # (This breaks if any shared library has a version over 99, but I'm not
19 # If the file is ELF (binary or shared library), then mcs is used to
20 # strip the comment and replace it with a short one containing
23 if [ "$RECURSING_ON" != "$0" ]; then
29 # HP-UX mkdir -p fails to work if any of the components
30 # in the name are automounter symlinks... so fake mkdir -p with
31 # a recursive shell function.
35 # if directory names have trailing /, we get called with a null string
39 # bail out if directory already exists -- this means recursion stops
40 # as soon as we back up into an existing directory
44 # only recurse if path has a slash in it.
57 datestamp=`date '+%d %h %y'`
59 if [[ ! -d $destdir ]]
60 then print -n -u2 Creating directory $destdir ...
67 do file="`basename $1`"
68 print -n -u2 Installing $1 in $destdir ...
69 rm -f $destdir/${1##*/}
70 # Try to install by linking, otherwise copy
71 ln $1 $destdir || cp $1 $destdir
73 *.so.[0-9]) print -n -u2 adding symlink ...
74 rm -f $destdir/${file%.[0-9]}
75 ln -s $file $destdir/${file%.[0-9]}
77 *.so.[0-9][0-9]) print -n -u2 adding symlink ...
78 rm -f $destdir/${file%.[0-9][0-9]}
79 ln -s $file $destdir/${file%.[0-9][0-9]}
85 *ELF*) print -n -u2 stripping comments ...
86 mcs -d -a "@(#)ToolTalk $version $datestamp" $destdir/${1##*/}