aboutsummaryrefslogtreecommitdiff
path: root/gnu/usr.bin/man/makewhatis
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/man/makewhatis')
-rw-r--r--gnu/usr.bin/man/makewhatis/Makefile4
-rw-r--r--gnu/usr.bin/man/makewhatis/makewhatis.sh9
2 files changed, 11 insertions, 2 deletions
diff --git a/gnu/usr.bin/man/makewhatis/Makefile b/gnu/usr.bin/man/makewhatis/Makefile
index f146c9d4da2d..bd14975c490a 100644
--- a/gnu/usr.bin/man/makewhatis/Makefile
+++ b/gnu/usr.bin/man/makewhatis/Makefile
@@ -5,11 +5,13 @@ CLEANFILES= makewhatis
beforeinstall: makewhatis
install -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
- ${.CURDIR}/makewhatis.sh ${DESTDIR}${BINDIR}/makewhatis
+ makewhatis ${DESTDIR}${BINDIR}
.include <bsd.prog.mk>
makewhatis: makewhatis.sh
sed -e 's/%sections%/ "1", "n", "l", "6", "8", "2", "3", "4", "5", "7", "p", "o", NULL/' \
+ -e 's,%zcat%,${zcat},' \
+ -e 's,%compext%,${compext},' \
${.CURDIR}/makewhatis.sh > makewhatis
diff --git a/gnu/usr.bin/man/makewhatis/makewhatis.sh b/gnu/usr.bin/man/makewhatis/makewhatis.sh
index 1d86d1993946..28b871d22da8 100644
--- a/gnu/usr.bin/man/makewhatis/makewhatis.sh
+++ b/gnu/usr.bin/man/makewhatis/makewhatis.sh
@@ -30,9 +30,16 @@ do
then
for f in `find $subdir -type f -print`
do
+ suffix=`echo $f | sed -e 's/.*\\.//'`
+ if [ ".$suffix" = "%compext%" ]; then
+ output=%zcat%
+ else
+ output=cat
+ fi
+ $output $f | \
sed -n '/^\.TH.*$/p
/^\.Dt.*$/p
- /^\.S[hH][ ]*NAME/,/^\.S[hH]/p' $f |\
+ /^\.S[hH][ ]*NAME/,/^\.S[hH]/p'|\
sed -e 's/\\[ ]*\-/-/
s/^.P[Pp].*$//
s/\\(em//