view Makefile @ 286:258a1dfd52eb

Separate manual page documentation and "normal" HTML documentation. No "orphaned" source files should be there now. Also the HTML theme for the is changed from "alabaster" to "agogo".
author Franz Glasner <fzglas.hg@dom66.de>
date Sun, 18 Sep 2022 10:25:55 +0200
parents 106cd5d9da7e
children e6ccee6a7144
line wrap: on
line source

# Created by: Franz Glasner <freebsd-dev@dom66.de>

PORTNAME=	local-bsdtools
DISTVERSION=	0.18.2
CATEGORIES=	sysutils
MASTER_SITES=	# none
DISTFILES=	# none

MAINTAINER=	freebsd-dev@dom66.de
COMMENT=	Collection of private system management tools

LICENSE=	BSD3CLAUSE

EXTRACT_DEPENDS=	hg:devel/mercurial
RUN_DEPENDS=		pkg:ports-mgmt/pkg

NO_ARCH=	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 <bsd.port.options.mk>

SRC=		${.CURDIR}

HGCANONICALPATH?=	default
HGREVISION=	${:!hg id -R "${SRC}" -q!}
HGDATE=		${:!hg log -R "${SRC}" -r "${HGREVISION:S/+//}" --template '{date|isodatesec}'!}
HGAUTHOR=	${:!hg log -R "${SRC}" -r "${HGREVISION:S/+//}" --template '{author|person}' | ${TR} ' ' '+'!}
HGPATH=		${:!hg --config ui.paginate=never path -R "${SRC}" ${HGCANONICALPATH} || echo "file://\$$\(hg root)"!}
HGPHASE=	${:!hg phase!:[2]}

do-extract:
	${MKDIR} ${WRKSRC}/bin
	${MKDIR} ${WRKSRC}/sbin
.for _rp in sbin/check-ports sbin/fjail sbin/ftjail sbin/fzfs sbin/fpkg sbin/bsmtp2dma
	${CP} -v ${SRC}/${_rp} ${WRKSRC}/${_rp}
	${SED} -i "" -E -e "s|\\\$$Date\\\$$|\$$Date: ${HGDATE} \$$|" ${WRKSRC}/${_rp}
	${SED} -i "" -E -e "s|\\\$$Revision\\\$$|\$$Revision: ${HGREVISION} \$$|" ${WRKSRC}/${_rp}
	${SED} -i "" -E -e "s|\\\$$Author\\\$$|\$$Author: ${HGAUTHOR} \$$|" ${WRKSRC}/${_rp}
	${SED} -i "" -e "s|\\\$$HGpath\\\$$|\$$HGpath: ${HGPATH} \$$|" ${WRKSRC}/${_rp}
	${SED} -i "" -e "s|\\\$$HGsource\\\$$|\$$HGsource: ${HGPATH}/${_rp} \$$|" ${WRKSRC}/${_rp}
	${SED} -i "" -e "s|\\\$$Header\\\$$|\$$Header: ${_rp} ${HGREVISION} ${HGDATE} ${HGAUTHOR} ${HGPHASE} \$$|" ${WRKSRC}/${_rp}
	${SED} -i "" -e "s|\\\$$HGid\\\$$|\$$HGid: ${HGPATH}/${_rp} ${HGREVISION} ${HGDATE} ${HGAUTHOR} ${HGPHASE} \$$|" ${WRKSRC}/${_rp}
	${SED} -i "" -e "s|@@VERSION@@|${PORTVERSION}|" ${WRKSRC}/${_rp}
	${SED} -i "" -e "s|@@HGREVISION@@|${HGREVISION}|" ${WRKSRC}/${_rp}
	${SED} -i "" -e "s|@@ETCDIR@@|${ETCDIR}|" ${WRKSRC}/${_rp}
	${SED} -i "" -e "s|@@PKGORIGIN@@|${PKGORIGIN}|" ${WRKSRC}/${_rp}
.endfor
	${MKDIR} ${WRKSRC}/etc/periodic/daily
.for _ef in etc/package-mapping.conf.sample etc/pkgtools.conf.sample etc/bsmtp2dma.conf.sample etc/periodic/daily/800.local-ipv6-refresh
	${CP} -v ${SRC}/${_ef} ${WRKSRC}/${_ef}
	${SED} -i "" -e "s|\\\$$HGid\\\$$|\$$HGid: ${HGPATH}/${_ef} ${HGREVISION} ${HGDATE} ${HGAUTHOR} ${HGPHASE} \$$|" ${WRKSRC}/${_ef}
	${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}
.endfor
	${MKDIR} ${STAGEDIR}${ETCDIR}
.for _ef in package-mapping.conf.sample pkgtools.conf.sample bsmtp2dma.conf.sample
	${INSTALL_DATA} ${WRKSRC}/etc/${_ef} ${STAGEDIR}${ETCDIR}/${_ef}
.endfor
	${MKDIR} ${STAGEDIR}${PREFIX}/etc/periodic/daily
.for _ps in 800.local-ipv6-refresh
	${INSTALL_SCRIPT} ${WRKSRC}/etc/periodic/daily/${_ps} ${STAGEDIR}${PREFIX}/etc/periodic/daily
.endfor

post-install-DOCS-on:
.for _mp in local-bsdtools.8 fzfs.8 fzfs-mount.8 fzfs-umount.8
	${INSTALL_DATA} ${WRKSRC}/docs/_build/man/${_mp} ${STAGEDIR}${LOCALBASE}/man/man8/${_mp}
.endfor

.include <bsd.port.mk>