r16254: pulling klocwork fixes for 3.0.23rc3 (current up to r16251)
[Samba.git] / source / script / installbin.sh.in
blob59a6c31ca88fd4435a8ec963b58d5442b0212e2e
1 #!/bin/sh
3 INSTALLPERMS=$1
4 DESTDIR=$2
5 prefix=`echo $3 | sed 's/\/\//\//g'`
6 BINDIR=`echo $4 | sed 's/\/\//\//g'`
7 SBINDIR=@sbindir@
8 shift
9 shift
10 shift
11 shift
13 for p in $*; do
14 p2=`basename $p`
15 echo "Installing $p as $DESTDIR/$BINDIR/$p2 "
16 if [ -f $DESTDIR/$BINDIR/$p2 ]; then
17 rm -f $DESTDIR/$BINDIR/$p2.old
18 mv $DESTDIR/$BINDIR/$p2 $DESTDIR/$BINDIR/$p2.old
20 cp $p $DESTDIR/$BINDIR/
21 chmod $INSTALLPERMS $DESTDIR/$BINDIR/$p2
23 # this is a special case, mount needs this in a specific location
24 if [ $p2 = smbmount ]; then
25 if [ ! -d $DESTDIR/@rootsbindir@ ]; then
26 mkdir $DESTDIR/@rootsbindir@
28 echo "Creating sym link $DESTDIR/@rootsbindir@/mount.smbfs to $BINDIR/$p2 "
29 ln -sf $BINDIR/$p2 $DESTDIR/@rootsbindir@/mount.smbfs
31 done
34 cat << EOF
35 ======================================================================
36 The binaries are installed. You may restore the old binaries (if there
37 were any) using the command "make revert". You may uninstall the binaries
38 using the command "make uninstallbin" or "make uninstall" to uninstall
39 binaries, man pages and shell scripts.
40 ======================================================================
41 EOF
43 exit 0