summaryrefslogtreecommitdiffstats
path: root/crypto/heimdal/cf/install-catman.sh
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/heimdal/cf/install-catman.sh')
-rwxr-xr-xcrypto/heimdal/cf/install-catman.sh47
1 files changed, 33 insertions, 14 deletions
diff --git a/crypto/heimdal/cf/install-catman.sh b/crypto/heimdal/cf/install-catman.sh
index 4a5aa8e..872e162 100755
--- a/crypto/heimdal/cf/install-catman.sh
+++ b/crypto/heimdal/cf/install-catman.sh
@@ -1,14 +1,16 @@
#!/bin/sh
#
-# $Id: install-catman.sh,v 1.3 2001/09/29 16:05:38 assar Exp $
+# $Id: install-catman.sh 20232 2007-02-16 11:03:13Z lha $
#
# install preformatted manual pages
+cmd="$1"; shift
INSTALL_DATA="$1"; shift
mkinstalldirs="$1"; shift
srcdir="$1"; shift
manbase="$1"; shift
suffix="$1"; shift
+catinstall="${INSTALL_CATPAGES-yes}"
for f in "$@"; do
base=`echo "$f" | sed 's/\(.*\)\.\([^.]*\)$/\1/'`
@@ -17,37 +19,54 @@ for f in "$@"; do
catdir="$manbase/cat$section"
c="$base.cat$section"
- if test -f "$srcdir/$c"; then
- if test \! -d "$catdir"; then
- eval "$mkinstalldirs $catdir"
+ if test "$catinstall" = yes -a -f "$srcdir/$c"; then
+ if test "$cmd" = install ; then
+ if test \! -d "$catdir"; then
+ eval "$mkinstalldirs $catdir"
+ fi
+ eval "echo $INSTALL_DATA $srcdir/$c $catdir/$base.$suffix"
+ eval "$INSTALL_DATA $srcdir/$c $catdir/$base.$suffix"
+ elif test "$cmd" = uninstall ; then
+ eval "echo rm -f $catdir/$base.$suffix"
+ eval "rm -f $catdir/$base.$suffix"
fi
- eval "echo $INSTALL_DATA $srcdir/$c $catdir/$base.$suffix"
- eval "$INSTALL_DATA $srcdir/$c $catdir/$base.$suffix"
fi
for link in `sed -n -e '/SYNOPSIS/q;/DESCRIPTION/q;s/^\.Nm \([^ ]*\).*/\1/p' $srcdir/$f`; do
- if [ "$link" != "$base" ]; then
+ if test "$link" = "$base" ; then
+ continue
+ fi
+ if test "$cmd" = install ; then
target="$mandir/$link.$section"
- for cmd in "ln -f $mandir/$base.$section $target" \
+ for lncmd in "ln -f $mandir/$base.$section $target" \
"ln -s $base.$section $target" \
"cp -f $mandir/$base.$section $target"
do
- if eval "$cmd"; then
- eval echo "$cmd"
+ if eval "$lncmd"; then
+ eval echo "$lncmd"
break
fi
done
- if test -f "$srcdir/$c"; then
+ if test "$catinstall" = yes -a -f "$srcdir/$c"; then
target="$catdir/$link.$suffix"
- for cmd in "ln -f $catdir/$base.$suffix $target" \
+ for lncmd in "ln -f $catdir/$base.$suffix $target" \
"ln -fs $base.$suffix $target" \
"cp -f $catdir/$base.$suffix $target"
do
- if eval "$cmd"; then
- eval echo "$cmd"
+ if eval "$lncmd"; then
+ eval echo "$lncmd"
break
fi
done
fi
+ elif test "$cmd" = uninstall ; then
+ target="$mandir/$link.$section"
+ eval "echo rm -f $target"
+ eval "rm -f $target"
+ if test "$catinstall" = yes; then
+ target="$catdir/$link.$suffix"
+ eval "echo rm -f $target"
+ eval "rm -f $target"
+ fi
fi
done
done
OpenPOWER on IntegriCloud