Merge commit 'release-4-0-0alpha1' into v4-0-test
[ira/wip.git] / source4 / script / installbin.sh
1 #!/bin/sh
2
3 INSTALLPERMS=$1
4 BASEDIR=$2
5 BINDIR=$3
6 LIBDIR=$4
7 VARDIR=$5
8 shift
9 shift
10 shift
11 shift
12 shift
13
14 for p in $*; do
15  p2=`basename $p`
16  echo Installing $p as $BINDIR/$p2
17  if [ -f $BINDIR/$p2 ]; then
18    rm -f $BINDIR/$p2.old
19    mv $BINDIR/$p2 $BINDIR/$p2.old
20  fi
21  cp $p $BINDIR/
22  chmod $INSTALLPERMS $BINDIR/$p2
23
24  # this is a special case, mount needs this in a specific location
25  if [ $p2 = smbmount ]; then
26    ln -sf $BINDIR/$p2 /sbin/mount.smbfs
27  fi
28 done
29
30
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
39
40 exit 0