# HG changeset patch # User Franz Glasner # Date 1663449560 -7200 # Node ID 490aed4639717ed3bfc153a93d2c7667a46c92fb # Parent d9f0c8e000199473a808a06a7def36c9c0182671 Implement a DOCS make option to build manual pages. BUGS: Just the by default generated local-bsdtools(1) page is included yet. No other manpage ist implemented yet. diff -r d9f0c8e00019 -r 490aed463971 .hgignore --- a/.hgignore Sat Sep 17 23:18:02 2022 +0200 +++ b/.hgignore Sat Sep 17 23:19:20 2022 +0200 @@ -1,3 +1,4 @@ syntax: regexp ^work/ +^docs/_build/ \ No newline at end of file diff -r d9f0c8e00019 -r 490aed463971 Makefile --- a/Makefile Sat Sep 17 23:18:02 2022 +0200 +++ b/Makefile Sat Sep 17 23:19:20 2022 +0200 @@ -15,9 +15,16 @@ RUN_DEPENDS= pkg:ports-mgmt/pkg NO_ARCH= yes -NO_BUILD= yes WRKSRC= ${WRKDIR}/local-bsdtools +OPTIONS_DEFINE= DOCS +OPTIONS_SUB= yes + +DOCS_BUILD_DEPENDS= sphinx-build:textproc/py-sphinx +DOCS_VARS_OFF= NO_BUILD=yes + +.include + SRC= ${.CURDIR} HGCANONICALPATH?= default @@ -51,6 +58,15 @@ ${SED} -i "" -e "s|@@PKGORIGIN@@|${PKGORIGIN}|" ${WRKSRC}/${_ef} .endfor +post-extract-DOCS-on: + ${MKDIR} ${WRKSRC}/docs + (${TAR} -C ${.CURDIR}/docs -c --exclude ./_build -f - . | ${TAR} -C ${WRKSRC}/docs -x -f - ) + +.if ${PORT_OPTIONS:MDOCS} +do-build: + (cd ${WRKSRC}/docs && sphinx-build -M man . _build) +.endif + do-install: .for _rp in sbin/check-ports sbin/fjail sbin/ftjail sbin/fzfs sbin/fpkg sbin/bsmtp2dma ${INSTALL_SCRIPT} ${WRKSRC}/${_rp} ${STAGEDIR}${PREFIX}/${_rp} @@ -64,4 +80,7 @@ ${INSTALL_SCRIPT} ${WRKSRC}/etc/periodic/daily/${_ps} ${STAGEDIR}${PREFIX}/etc/periodic/daily .endfor +post-install-DOCS-on: + ${INSTALL_DATA} ${WRKSRC}/docs/_build/man/local-bsdtools.1 ${STAGEDIR}${LOCALBASE}/man/man1/local-bsdtools.1 + .include diff -r d9f0c8e00019 -r 490aed463971 pkg-plist --- a/pkg-plist Sat Sep 17 23:18:02 2022 +0200 +++ b/pkg-plist Sat Sep 17 23:19:20 2022 +0200 @@ -6,6 +6,7 @@ sbin/ftjail sbin/fpkg sbin/fzfs +%%DOCS%%man/man1/local-bsdtools.1.gz @sample %%ETCDIR%%/bsmtp2dma.conf.sample @sample %%ETCDIR%%/package-mapping.conf.sample @sample %%ETCDIR%%/pkgtools.conf.sample