diff Makefile @ 16:08fc189baf67

Put some keyword expansion into the port. This is done in the "extract" stage after copying by an inplace sed.
author Franz Glasner <hg@dom66.de>
date Fri, 27 Oct 2017 02:23:22 +0200
parents f5f04faa9acf
children 089afc4908c0
line wrap: on
line diff
--- a/Makefile	Thu Oct 26 23:04:22 2017 +0200
+++ b/Makefile	Fri Oct 27 02:23:22 2017 +0200
@@ -20,9 +20,18 @@
 
 PLIST_FILES=	bin/check-ports
 
+HGREVISION:=	${:!hg id -R "${.CURDIR}" -q!}
+HGROOT:=	${:!basename "${.CURDIR}"!}
+HGPATH:=	${:!hg paths default!}
+
 do-extract:
 	${MKDIR} ${WRKSRC}/bin
 	${CP} -R -v ${SRC}/bin/ ${WRKSRC}/bin
+.for _f in check-ports
+	${SED} -i "" -e "s|@@HGREVISION@@|\$$HGrevision: ${HGREVISION} \$$|" ${WRKSRC}/bin/${_f}
+	${SED} -i "" -e "s|@@HGROOT@@|\$$HGroot: ${HGROOT} \$$|" ${WRKSRC}/bin/${_f}
+	${SED} -i "" -e "s|@@HGSOURCE@@|\$$HGsource: ${HGPATH}/bin/${_f} \$$|" ${WRKSRC}/bin/${_f}
+.endfor
 
 do-install:
 	${INSTALL_SCRIPT} ${WRKSRC}/bin/check-ports ${STAGEDIR}${PREFIX}/bin/check-ports