r7711: update callers of ldb_connect() for new syntax
[Samba/ekacnet.git] / source4 / script / installman.sh
blob5b6bba69edbfb09bbe5aab2863894ffc8f4aa447
1 #!/bin/sh
2 #5 July 96 Dan.Shearer@unisa.edu.au removed hardcoded values
4 # 13 Aug 2001 Rafal Szczesniak <mimir@spin.ict.pwr.wroc.pl>
5 # modified to accomodate international man pages (inspired
6 # by Japanese edition's approach)
8 MANDIR=$1
9 SRCDIR=$2/
10 langs=$3
12 if [ $# -ge 4 ] ; then
13 GROFF=$4 # sh cmd line, including options
17 for lang in $langs; do
18 if [ "X$lang" = Xen ]; then
19 echo Installing default man pages in $MANDIR/
20 lang=.
21 else
22 echo Installing \"$lang\" man pages in $MANDIR/lang/$lang
25 langdir=$MANDIR/$lang
26 for d in $MANDIR $langdir $langdir/man1 $langdir/man5 $langdir/man7 $langdir/man8; do
27 if [ ! -d $d ]; then
28 mkdir $d
29 if [ ! -d $d ]; then
30 echo Failed to make directory $d, does $USER have privileges?
31 exit 1
34 done
36 for sect in 1 5 7 8 ; do
37 for m in $langdir/man$sect ; do
38 for s in $SRCDIR../docs/manpages/$lang/*$sect; do
39 FNAME=$m/`basename $s`
41 # Test for writability. Involves
42 # blowing away existing files.
44 if (rm -f $FNAME && touch $FNAME); then
45 rm $FNAME
46 if [ "x$GROFF" = x ] ; then
47 cp $s $m # Copy raw nroff
48 else
49 echo "\t$FNAME" # groff'ing can be slow, give the user
50 # a warm fuzzy.
51 $GROFF $s > $FNAME # Process nroff, because man(1) (on
52 # this system) doesn't .
54 chmod 0644 $FNAME
55 else
56 echo Cannot create $FNAME... does $USER have privileges?
58 done
59 done
60 done
61 done
62 cat << EOF
63 ======================================================================
64 The man pages have been installed. You may uninstall them using the command
65 the command "make uninstallman" or make "uninstall" to uninstall binaries,
66 man pages and shell scripts.
67 ======================================================================
68 EOF
70 exit 0