5 # install preformatted manual pages
7 INSTALL_DATA
="$1"; shift
8 mkinstalldirs
="$1"; shift
14 base
=`echo "$f" | sed 's/\(.*\)\.\([^.]*\)$/\1/'`
15 section
=`echo "$f" | sed 's/\(.*\)\.\([^.]*\)$/\2/'`
16 mandir
="$manbase/man$section"
17 catdir
="$manbase/cat$section"
20 if test -f "$srcdir/$c"; then
21 if test \
! -d "$catdir"; then
22 eval "$mkinstalldirs $catdir"
24 eval "echo $INSTALL_DATA $srcdir/$c $catdir/$base.$suffix"
25 eval "$INSTALL_DATA $srcdir/$c $catdir/$base.$suffix"
27 for link
in `sed -n -e '/SYNOPSIS/q;/DESCRIPTION/q;s/^\.Nm \([^ ]*\).*/\1/p' $srcdir/$f`; do
28 if [ "$link" != "$base" ]; then
29 target
="$mandir/$link.$section"
30 for cmd
in "ln -f $mandir/$base.$section $target" \
31 "ln -s $base.$section $target" \
32 "cp -f $mandir/$base.$section $target"
39 if test -f "$srcdir/$c"; then
40 target
="$catdir/$link.$suffix"
41 for cmd
in "ln -f $catdir/$base.$suffix $target" \
42 "ln -fs $base.$suffix $target" \
43 "cp -f $catdir/$base.$suffix $target"