fixed the installation scripts for the new layout
[ira/wip.git] / source3 / 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 d in $BASEDIR $BINDIR $LIBDIR $VARDIR; do
15 if [ ! -d $d ]; then
16 mkdir $d
17 if [ ! -d $d ]; then
18   echo Failed to make directory $d
19   exit 1
20 fi
21 fi
22 done
23
24
25 for p in $*; do
26  p2=`basename $p`
27  echo Installing $p as $BINDIR/$p2
28  if [ -f $BINDIR/$p2 ]; then
29    mv $BINDIR/$p2 $BINDIR/$p2.old
30  fi
31  cp $p $BINDIR/
32  chmod $INSTALLPERMS $BINDIR/$p2
33 done
34
35
36 cat << EOF
37 ======================================================================
38 The binaries are installed. You may restore the old binaries (if there
39 were any) using the command "make revert". You may uninstall the binaries
40 using the command "make uninstallbin" or "make uninstall" to uninstall
41 binaries, man pages and shell scripts.
42 ======================================================================
43 EOF
44
45 exit 0
46