diff options
author | sakamoto <sakamoto@pkgsrc.org> | 1999-08-31 09:20:21 +0000 |
---|---|---|
committer | sakamoto <sakamoto@pkgsrc.org> | 1999-08-31 09:20:21 +0000 |
commit | 6ab2a30c02fab29c055176a43fee96c027fdb0a1 (patch) | |
tree | 7c3023ec7a03900366bf74379aca48c505bd85d6 | |
parent | b394b1b76b9413300ee0f9a86c01cb4d1417e9b9 (diff) | |
download | pkgsrc-6ab2a30c02fab29c055176a43fee96c027fdb0a1.tar.gz |
Add support for PLIST_SUB variable. It is a list of "VAR=VALUE" pairs,
and will substitute ${VAR} with the value of VALUE in the PLIST.
This implementation was taken from FreeBSD.
Default PLIST_SUB:
OPSYS=${OPSYS} OS_VERSION=${OS_VERSION}
MACHINE_ARCH=${MACHINE_ARCH} MACHINE_GNU_ARCH=${MACHINE_GNU_ARCH}
MACHINE_GNU_PLATFORM=${MACHINE_GNU_PLATFORM}
LOWER_VENDOR=${LOWER_VENDOR} LOWER_OPSYS=${LOWER_OPSYS}
PKGNAME=${PKGNAME}
-rw-r--r-- | mk/bsd.pkg.mk | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk index 8d400611c58..ea504e90de0 100644 --- a/mk/bsd.pkg.mk +++ b/mk/bsd.pkg.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.mk,v 1.328 1999/08/31 08:32:16 rh Exp $ +# $NetBSD: bsd.pkg.mk,v 1.329 1999/08/31 09:20:21 sakamoto Exp $ # # This file is in the public domain. # @@ -334,6 +334,16 @@ PLIST= ${WRKDIR}/.PLIST DLIST= ${WRKDIR}/.DLIST DDIR= ${WRKDIR}/.DDIR +# Set PLIST_SUB to substitute "${variable}" to "value" in PLIST +PLIST_SUB+= OPSYS=${OPSYS} \ + OS_VERSION=${OS_VERSION} \ + MACHINE_ARCH=${MACHINE_ARCH} \ + MACHINE_GNU_ARCH=${MACHINE_GNU_ARCH} \ + MACHINE_GNU_PLATFORM=${MACHINE_GNU_PLATFORM} \ + LOWER_VENDOR=${LOWER_VENDOR} \ + LOWER_OPSYS=${LOWER_OPSYS} \ + PKGNAME=${PKGNAME} + # Set INSTALL_FILE to be the name of any INSTALL file .if !defined(INSTALL_FILE) && exists(${PKGDIR}/INSTALL) INSTALL_FILE= ${PKGDIR}/INSTALL @@ -2367,7 +2377,7 @@ MANCOMPRESSED= yes # - fixing list of man-pages according to MANCOMPRESSED/MANZ # (we don't take any notice of MANCOMPRESSED as many packages have .gz # pages in PLIST even when they install manpages without compressing them) -# - substituting ${OPSYS}, ${MACHINE_ARCH} and ${MACHINE_GNU_ARCH} +# - substituting by ${PLIST_SUB} .if ${OPSYS} == "NetBSD" IMAKE_MAN_CMD= @@ -2421,14 +2431,7 @@ ${PLIST}: ${PLIST_SRC} ${MANZ_NAWK_CMD} \ ${IMAKE_MAN_CMD} \ ${SED} ${MANZ_EXPRESSION} \ - -e 's|\$${OPSYS}|${OPSYS}|g' \ - -e 's|\$${OS_VERSION}|${OS_VERSION}|g' \ - -e 's|\$${MACHINE_ARCH}|${MACHINE_ARCH}|g' \ - -e 's|\$${MACHINE_GNU_ARCH}|${MACHINE_GNU_ARCH}|g' \ - -e 's|\$${MACHINE_GNU_PLATFORM}|${MACHINE_GNU_PLATFORM}|g' \ - -e 's|\$${LOWER_VENDOR}|${LOWER_VENDOR}|g'\ - -e 's|\$${LOWER_OPSYS}|${LOWER_OPSYS}|g'\ - -e 's|\$${PKGNAME}|${PKGNAME}|g' \ + ${PLIST_SUB:S/=/}!/:S/$/!g/:S/^/ -e s!\\\${/} \ > ${PLIST}; \ fi |