Build manpages and neomuttrc when DOCS is off

Using BINARY_ALIAS, we can trick neomutt into building the manpages and
the neomuttrc. Neomutt already gracefully handles pieces of the documentation
being unavailable during installation, and pkg-create(8) takes care of the
rest.

PORTREVISION bump because the plist has changed for anybody building without
DOCS.
This commit is contained in:
Adam Weinberger 2017-10-17 14:38:17 +00:00
parent 38119b4777
commit 85afcd3e40
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=452278
2 changed files with 15 additions and 18 deletions

View file

@ -3,6 +3,7 @@
PORTNAME= neomutt
PORTVERSION= 20171013
DISTVERSIONPREFIX= ${PORTNAME}-
PORTREVISION= 1
CATEGORIES= mail
MAINTAINER= bapt@FreeBSD.org
@ -88,26 +89,22 @@ SLANG_VARS= PKGMESSAGE=${FILESDIR}/pkg-message.slang
NCURSES_USES= ncurses
DOCS_CONFIGURE_ENABLE= doc
DOCS_BUILD_DEPENDS= xsltproc:textproc/libxslt \
${LOCALBASE}/share/xsl/docbook/html/docbook.xsl:textproc/docbook-xsl \
lynx:www/lynx
post-build-DOCS-off:
${SED} -e 's,@docdir@,${DOCSDIR},' ${WRKSRC}/doc/neomuttrc.head > ${WRKSRC}/doc/neomuttrc
cd ${WRKSRC} && ${CC} -I. -o doc/makedoc doc/makedoc.c
cd ${WRKSRC} && ${CPP} -isystem ${LOCALBASE}/include -D_MAKEDOC -C -I. ./init.h | doc/makedoc -c >> doc/neomuttrc
.include <bsd.port.options.mk>
# Trick neomutt into building manpages and neomuttrc
.if empty(PORT_OPTIONS:MDOCS)
BINARY_ALIAS= xsltproc=true
.endif
post-install:
${RM} ${STAGEDIR}${PREFIX}/etc/mime*
${MV} ${STAGEDIR}${PREFIX}/etc/neomuttrc ${STAGEDIR}${PREFIX}/etc/neomuttrc.dist
${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/neomutt \
${STAGEDIR}${PREFIX}/lib/neomutt/pgpring \
${STAGEDIR}${PREFIX}/lib/neomutt/pgpewrap
post-install-DOCS-on:
${MV} ${STAGEDIR}${PREFIX}/etc/neomuttrc ${STAGEDIR}${PREFIX}/etc/neomuttrc.dist
post-install-DOCS-off:
${INSTALL_DATA} ${WRKSRC}/doc/neomuttrc ${STAGEDIR}${PREFIX}/etc/neomuttrc.dist
.include <bsd.port.mk>

View file

@ -2,13 +2,13 @@ bin/neomutt
lib/neomutt/pgpewrap
lib/neomutt/pgpring
lib/neomutt/smime_keys
%%PORTDOCS%%man/man1/neomutt.1.gz
%%PORTDOCS%%man/man1/pgpewrap_neomutt.1.gz
%%PORTDOCS%%man/man1/pgpring_neomutt.1.gz
%%PORTDOCS%%man/man1/smime_keys_neomutt.1.gz
%%PORTDOCS%%man/man5/mbox_neomutt.5.gz
%%PORTDOCS%%man/man5/mmdf_neomutt.5.gz
%%PORTDOCS%%man/man5/neomuttrc.5.gz
man/man1/neomutt.1.gz
man/man1/pgpewrap_neomutt.1.gz
man/man1/pgpring_neomutt.1.gz
man/man1/smime_keys_neomutt.1.gz
man/man5/mbox_neomutt.5.gz
man/man5/mmdf_neomutt.5.gz
man/man5/neomuttrc.5.gz
@sample etc/neomuttrc.dist etc/neomuttrc
%%NLS%%share/locale/bg/LC_MESSAGES/neomutt.mo
%%NLS%%share/locale/ca/LC_MESSAGES/neomutt.mo