r20663: Do not install smbmount man page if we didn't called configure
[abartlet/samba.git/.git] / source3 / script / installman.sh
index 6278012635f006c202c7f532ee86129eda0b6a9b..b879c79022f9d70339fd3522bcb805e8a47e1cc8 100755 (executable)
@@ -18,6 +18,10 @@ if test ! -d $SRCDIR../docs/manpages; then
        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" = XC ]; then
        echo Installing default man pages in $MANDIR/
@@ -40,13 +44,21 @@ 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 ;;
+               smbmount.8) test -z "${SMBMOUNT_PROGS}" && 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