pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/mk/plist Add better support for small conditional part...
details: https://anonhg.NetBSD.org/pkgsrc/rev/fa88dcd037e9
branches: trunk
changeset: 540859:fa88dcd037e9
user: jlam <jlam%pkgsrc.org@localhost>
date: Tue Apr 08 20:52:15 2008 +0000
description:
Add better support for small conditional parts of PLISTs.
PLIST_VARS is the list of names corresponding to automatic variables
generated by plist.mk to simplify having conditionally-present entries
in the PLIST. If "var" is listed in PLIST_VARS, then the automatic
variable is named PLIST.var. If PLIST.var is defined, then in the PLIST
generation, the ${PLIST.var} symbol is replaced with the empty string,
or "@comment " otherwise.
diffstat:
mk/plist/plist.mk | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)
diffs (47 lines):
diff -r 376277fde5cc -r fa88dcd037e9 mk/plist/plist.mk
--- a/mk/plist/plist.mk Tue Apr 08 14:52:30 2008 +0000
+++ b/mk/plist/plist.mk Tue Apr 08 20:52:15 2008 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: plist.mk,v 1.36 2007/10/31 21:09:03 rillig Exp $
+# $NetBSD: plist.mk,v 1.37 2008/04/08 20:52:15 jlam Exp $
#
# This Makefile fragment handles the creation of PLISTs for use by
# pkg_create(8).
@@ -10,6 +10,13 @@
# are listed in files. Valid values are "dynamic" and "static",
# and the default value is "static".
#
+# PLIST_VARS is the list of names corresponding to automatic variables
+# generated by plist.mk to simplify having conditionally-present
+# entries in the PLIST. If "var" is listed in PLIST_VARS, then the
+# automatic variable is named PLIST.var. If PLIST.var is defined,
+# then in the PLIST generation, the ${PLIST.var} symbol is replaced
+# with the empty string, or "@comment " otherwise.
+#
# PLIST_SRC is the list of source files from which the PLIST file of
# the binary package will be generated. By default, its value is
# constructed from the PLIST.* files within the package directory,
@@ -32,9 +39,11 @@
_VARGROUPS+= plist
_USER_VARS.plist= # none
-_PKG_VARS.plist= PLIST_SUBST PLIST_SRC GENERATE_PLIST
+_PKG_VARS.plist= PLIST_SUBST PLIST_VARS PLIST_SRC GENERATE_PLIST
_SYS_VARS.plist= PLIST_TYPE PLIST
+PLIST_VARS?= # empty
+
.if ${PKG_INSTALLATION_TYPE} == "pkgviews"
PLIST_TYPE?= dynamic
.endif
@@ -153,6 +162,10 @@
TRUE=${TRUE:Q} \
PKGMANDIR=${PKGMANDIR:Q}
+.for _var_ in ${PLIST_VARS}
+PLIST_SUBST+= ${PLIST.${_var_}:DPLIST.${_var_}=:UPLIST.${_var_}="@comment "}
+.endfor
+
# Pass the PLIST_SUBST substitutions to the subst.awk script by prepending
# PLIST_" to all of the variable names and adding them into the environment.
#
Home |
Main Index |
Thread Index |
Old Index