[GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch.
[jra/samba/.git] / source3 / script / installbin.sh.in
1 #!/bin/sh
2
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
12
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
19  fi
20  cp $p $DESTDIR/$BINDIR/
21  chmod $INSTALLPERMS $DESTDIR/$BINDIR/$p2
22
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@
27    fi
28    echo "Creating sym link $DESTDIR/@rootsbindir@/mount.smbfs to $BINDIR/$p2 "
29    ln -sf $BINDIR/$p2 $DESTDIR/@rootsbindir@/mount.smbfs
30  fi
31 done
32
33
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
42
43 exit 0