fixed the installation scripts for the new layout
[samba.git] / source3 / script / installman.sh
1 #!/bin/sh
2 #5 July 96 Dan.Shearer@unisa.edu.au  removed hardcoded values
3
4 MANDIR=$1
5 SRCDIR=$2/
6
7 echo Installing man pages in $MANDIR
8
9 for d in $MANDIR $MANDIR/man1 $MANDIR/man5 $MANDIR/man7 $MANDIR/man8; do
10 if [ ! -d $d ]; then
11 mkdir $d
12 if [ ! -d $d ]; then
13   echo Failed to make directory $d, does $USER have privileges?
14   exit 1
15 fi
16 fi
17 done
18
19 for sect in 1 5 7 8 ; do
20   for m in $MANDIR/man$sect ; do
21     for s in $SRCDIR../docs/*$sect; do
22       FNAME=$m/`basename $s`
23       echo Installing $FNAME
24       cp $s $m || echo Cannot create $FNAME... does $USER have privileges?
25       chmod 0644 $FNAME
26     done
27   done
28 done
29
30 cat << EOF
31 ======================================================================
32 The man pages have been installed. You may uninstall them using the command
33 the command "make uninstallman" or make "uninstall" to uninstall binaries,
34 man pages and shell scripts.
35 ======================================================================
36 EOF
37
38 exit 0
39