| 1 | #!/bin/sh | 
|---|
| 2 | #5 July 96 Dan.Shearer@unisa.edu.au  removed hardcoded values | 
|---|
| 3 | # | 
|---|
| 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) | 
|---|
| 7 |  | 
|---|
| 8 | MANDIR=`echo $1 | sed 's/\/\//\//g'` | 
|---|
| 9 | SRCDIR=$2/ | 
|---|
| 10 | langs=$3 | 
|---|
| 11 |  | 
|---|
| 12 | if [ $# -ge 4 ] ; then | 
|---|
| 13 | GROFF=$4                    # sh cmd line, including options | 
|---|
| 14 | fi | 
|---|
| 15 |  | 
|---|
| 16 | if test ! -d $SRCDIR../docs/manpages; then | 
|---|
| 17 | echo "No manpages present.  SVN development version maybe?" | 
|---|
| 18 | exit 0 | 
|---|
| 19 | fi | 
|---|
| 20 |  | 
|---|
| 21 | # Get the configured feature set | 
|---|
| 22 | test -f "${SRCDIR}/config.log" && \ | 
|---|
| 23 | eval `grep "^[[:alnum:]_]*=.*" "${SRCDIR}/config.log"` | 
|---|
| 24 |  | 
|---|
| 25 | for lang in $langs; do | 
|---|
| 26 | if [ "X$lang" = XC ]; then | 
|---|
| 27 | echo Installing default man pages in $MANDIR/ | 
|---|
| 28 | lang=. | 
|---|
| 29 | else | 
|---|
| 30 | echo Installing \"$lang\" man pages in $MANDIR/lang/$lang | 
|---|
| 31 | fi | 
|---|
| 32 |  | 
|---|
| 33 | langdir=$MANDIR/$lang | 
|---|
| 34 | for d in $MANDIR $langdir $langdir/man1 $langdir/man5 $langdir/man7 $langdir/man8; do | 
|---|
| 35 | if [ ! -d $d ]; then | 
|---|
| 36 | mkdir $d | 
|---|
| 37 | if [ ! -d $d ]; then | 
|---|
| 38 | echo Failed to make directory $d, does $USER have privileges? | 
|---|
| 39 | exit 1 | 
|---|
| 40 | fi | 
|---|
| 41 | fi | 
|---|
| 42 | done | 
|---|
| 43 |  | 
|---|
| 44 | for sect in 1 5 7 8 ; do | 
|---|
| 45 | for m in $langdir/man$sect ; do | 
|---|
| 46 | for s in $SRCDIR../docs/manpages/$lang/*$sect; do | 
|---|
| 47 | MP_BASENAME=`basename $s` | 
|---|
| 48 |  | 
|---|
| 49 | # Check if this man page if required by the configured feature set | 
|---|
| 50 | case "${MP_BASENAME}" in | 
|---|
| 51 | cifs.upcall.8) test -z "${CIFSUPCALL_PROGS}" && continue ;; | 
|---|
| 52 | smbsh.1) test -z "${SMBWRAPPER}" && continue ;; | 
|---|
| 53 | *) ;; | 
|---|
| 54 | esac | 
|---|
| 55 |  | 
|---|
| 56 | FNAME="$m/${MP_BASENAME}" | 
|---|
| 57 |  | 
|---|
| 58 | # Test for writability.  Involves | 
|---|
| 59 | # blowing away existing files. | 
|---|
| 60 |  | 
|---|
| 61 | if (rm -f $FNAME && touch $FNAME); then | 
|---|
| 62 | if [ "x$GROFF" = x ] ; then | 
|---|
| 63 | cp $s $m            # Copy raw nroff | 
|---|
| 64 | else | 
|---|
| 65 | echo "\t$FNAME"     # groff'ing can be slow, give the user | 
|---|
| 66 | #   a warm fuzzy. | 
|---|
| 67 | $GROFF $s > $FNAME  # Process nroff, because man(1) (on | 
|---|
| 68 | #   this system) doesn't . | 
|---|
| 69 | fi | 
|---|
| 70 | chmod 0644 $FNAME | 
|---|
| 71 | else | 
|---|
| 72 | echo Cannot create $FNAME... does $USER have privileges? | 
|---|
| 73 | fi | 
|---|
| 74 | done | 
|---|
| 75 | done | 
|---|
| 76 | done | 
|---|
| 77 | done | 
|---|
| 78 | cat << EOF | 
|---|
| 79 | ====================================================================== | 
|---|
| 80 | The man pages have been installed. You may uninstall them using the command | 
|---|
| 81 | the command "make uninstallman" or make "uninstall" to uninstall binaries, | 
|---|
| 82 | man pages and shell scripts. | 
|---|
| 83 | ====================================================================== | 
|---|
| 84 | EOF | 
|---|
| 85 |  | 
|---|
| 86 | exit 0 | 
|---|
| 87 |  | 
|---|