Merge branch 'v3-3-test' of ssh://git.samba.org/data/git/samba into docbook
[kai/samba.git] / source3 / script / installman.sh
index c7a8f45095144cc3b04e6a0f4fde543b45464ea4..869ce6ee38edb293d55b862ad0cfae2208f9f8fc 100755 (executable)
@@ -13,9 +13,17 @@ if [ $# -ge 4 ] ; then
   GROFF=$4                    # sh cmd line, including options 
 fi
 
+if test ! -d $SRCDIR../docs/manpages; then
+       echo "No manpages present.  SVN development version maybe?"
+       exit 0
+fi
+
+# Get the configured feature set
+test -f "${SRCDIR}/config.log" && \
+       eval `grep "^[[:alnum:]]*=.*" "${SRCDIR}/config.log"`
 
 for lang in $langs; do
-    if [ "X$lang" = Xen ]; then
+    if [ "X$lang" = XC ]; then
        echo Installing default man pages in $MANDIR/
        lang=.
     else
@@ -36,13 +44,20 @@ for lang in $langs; do
     for sect in 1 5 7 8 ; do
        for m in $langdir/man$sect ; do
            for s in $SRCDIR../docs/manpages/$lang/*$sect; do
-           FNAME=$m/`basename $s`
+           MP_BASENAME=`basename $s`
+
+           # Check if this man page if required by the configured feature set
+           case "${MP_BASENAME}" in
+               smbsh.1) test -z "${SMBWRAPPER}" && continue ;;
+               *) ;;
+           esac
+
+           FNAME="$m/${MP_BASENAME}"
+
            # Test for writability.  Involves 
            # blowing away existing files.
  
            if (rm -f $FNAME && touch $FNAME); then
-               rm $FNAME
                if [ "x$GROFF" = x ] ; then
                    cp $s $m            # Copy raw nroff 
                else