view Makefile @ 249:a91e1c5173cc

Also support direct mounting of the RW skeleton subdirs at a mountpoint
author Franz Glasner <fzglas.hg@dom66.de>
date Sun, 11 Sep 2022 13:02:39 +0200
parents 16feee945857
children 9163fc9c7597
line wrap: on
line source

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

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

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

LICENSE=	BSD3CLAUSE

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

NO_ARCH=	yes
NO_BUILD=	yes
WRKSRC=		${WRKDIR}/local-bsdtools

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

do-install:
.for _rp in sbin/check-ports sbin/fjail 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


.include <bsd.port.mk>