summaryrefslogtreecommitdiffstats
path: root/share/mk/bsd.man.mk
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1996-08-11 12:31:57 +0000
committerpeter <peter@FreeBSD.org>1996-08-11 12:31:57 +0000
commita9ad33617398ec6667e8bed56280a4ecc27719e5 (patch)
tree6a27168ca28e6e26f8b09392a94d256922341b60 /share/mk/bsd.man.mk
parent7f92d67f080bc8b638fd375bc6cdef8e700d8e53 (diff)
downloadFreeBSD-src-a9ad33617398ec6667e8bed56280a4ecc27719e5.zip
FreeBSD-src-a9ad33617398ec6667e8bed56280a4ecc27719e5.tar.gz
Add a hook ``MANFILTER''. This optionally specifies a command to
pipe the man page source through before compressing or installing. This can be used to do do (eg) sed substitution on man pages from 3rd party packages (in particular, ncurses and bind-4.9.4) This should not affect anything already in the source tree.
Diffstat (limited to 'share/mk/bsd.man.mk')
-rw-r--r--share/mk/bsd.man.mk23
1 files changed, 22 insertions, 1 deletions
diff --git a/share/mk/bsd.man.mk b/share/mk/bsd.man.mk
index 446bce4..601afed 100644
--- a/share/mk/bsd.man.mk
+++ b/share/mk/bsd.man.mk
@@ -1,4 +1,4 @@
-# $Id: bsd.man.mk,v 1.12 1996/05/25 23:09:48 wosch Exp $
+# $Id: bsd.man.mk,v 1.13 1996/06/22 06:01:56 phk Exp $
#
# The include file <bsd.man.mk> handles installing manual pages and
# their links. <bsd.man.mk> includes the file named "../Makefile.inc"
@@ -37,6 +37,8 @@
# NOMANCOMPRESS If you do not want unformatted manual pages to be
# compressed when they are installed. [not set]
#
+# MANFILTER command to pipe the raw man page though before compressing
+# or installing. Can be used to do sed substitution.
#
# +++ targets +++
#
@@ -73,6 +75,21 @@ all-man: ${MANDEPEND}
COPY= -c
ZEXT=
+.if defined(MANFILTER)
+.for sect in ${SECTIONS}
+.if defined(MAN${sect}) && !empty(MAN${sect})
+CLEANFILES+= ${MAN${sect}}
+.for page in ${MAN${sect}}
+.for target in ${page}
+all-man: ${target}
+${target}: ${page}
+ ${MANFILT} < ${.ALLSRC} > ${.TARGET}
+.endfor
+.endfor
+.endif
+.endfor
+.endif
+
.else
ZEXT= ${ZEXTENSION}
@@ -84,7 +101,11 @@ CLEANFILES+= ${MAN${sect}:T:S/$/${ZEXTENSION}/g}
.for target in ${page:T:S/$/${ZEXTENSION}/}
all-man: ${target}
${target}: ${page}
+.if defined(MANFILT)
+ ${MANFILT} < ${.ALLSRC} | ${MCOMPRESS} > ${.TARGET}
+.else
${MCOMPRESS} ${.ALLSRC} > ${.TARGET}
+.endif
.endfor
.endfor
.endif
OpenPOWER on IntegriCloud