r14053: Implement Simo's suggestion: don't use /dev/null for a 'bad' path for
[Samba.git] / source / script / installbin.sh
blob8859c953414d26c9afea2a30db76117de29974f6
1 #!/bin/sh
3 INSTALLPERMS=$1
4 DESTDIR=$2
5 BINDIR=`echo $3 | sed 's/\/\//\//g'`
6 shift
7 shift
8 shift
10 for p in $*; do
11 p2=`basename $p`
12 echo "Installing $p as $DESTDIR/$BINDIR/$p2 "
13 if [ -f $DESTDIR/$BINDIR/$p2 ]; then
14 rm -f $DESTDIR/$BINDIR/$p2.old
15 mv $DESTDIR/$BINDIR/$p2 $DESTDIR/$BINDIR/$p2.old
17 cp $p $DESTDIR/$BINDIR/
18 chmod $INSTALLPERMS $DESTDIR/$BINDIR/$p2
20 # this is a special case, mount needs this in a specific location
21 if [ $p2 = smbmount ]; then
22 if [ ! -d $DESTDIR/sbin ]; then
23 mkdir $DESTDIR/sbin
25 echo "Creating sym link $DESTDIR/sbin/mount.smbfs to $BINDIR/$p2 "
26 ln -sf $BINDIR/$p2 $DESTDIR/sbin/mount.smbfs
28 done
31 cat << EOF
32 ======================================================================
33 The binaries are installed. You may restore the old binaries (if there
34 were any) using the command "make revert". You may uninstall the binaries
35 using the command "make uninstallbin" or "make uninstall" to uninstall
36 binaries, man pages and shell scripts.
37 ======================================================================
38 EOF
40 exit 0