Changed install scripts so they don't have hardcoded values
[kai/samba.git] / source3 / script / installbin.sh
1 #!/bin/sh
2 INSTALLPERMS=$1
3 BASEDIR=$2
4 BINDIR=$3
5 LIBDIR=$4
6 VARDIR=$5
7 shift
8 shift
9 shift
10 shift
11 shift
12
13 for d in $BASEDIR $BINDIR $LIBDIR $VARDIR; do
14 if [ ! -d $d ]; then
15 mkdir $d
16 if [ ! -d $d ]; then
17   echo Failed to make directory $d
18   exit 1
19 fi
20 fi
21 done
22
23
24 for p in $*; do
25  echo Installing $p as $BINDIR/$p
26  if [ -f $BINDIR/$p ]; then
27    mv $BINDIR/$p $BINDIR/$p.old
28  fi
29  cp $p $BINDIR/$p
30  chmod $INSTALLPERMS $BINDIR/$p
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
44