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.
This commit is contained in:
Peter Wemm 1996-08-11 12:31:57 +00:00
parent 6ba7f9ff84
commit d5dcd8e63f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=17511

View File

@ -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