merge from the autoconf2 branch to the main branch
[kai/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       cp $s $m || echo Cannot create $FNAME... does $USER have privileges?
24       chmod 0644 $FNAME
25     done
26   done
27 done
28
29 cat << EOF
30 ======================================================================
31 The man pages have been installed. You may uninstall them using the command
32 the command "make uninstallman" or make "uninstall" to uninstall binaries,
33 man pages and shell scripts.
34 ======================================================================
35 EOF
36
37 exit 0
38