summaryrefslogtreecommitdiff
path: root/mk/plist
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2007-10-25 22:00:39 +0000
committerjlam <jlam@pkgsrc.org>2007-10-25 22:00:39 +0000
commitae9b935fd018aee0bd2410c581458d429b05b38b (patch)
treec90ec620445350ca4c742747e452c31b2a96cf95 /mk/plist
parent84cf6490a4fd5185ef689e72a77e137737f650bd (diff)
downloadpkgsrc-ae9b935fd018aee0bd2410c581458d429b05b38b.tar.gz
* If PLIST_SRC is explicitly set to an empty value in a package Makefile,
then automatically generate a PLIST that says "${PKGNAME} has no files". * If PLIST_SRC and GENERATE_PLIST are not set in a package Makefile, and no PLIST files exist, then fail during the package build with PKG_FAIL_REASON. * Remove "intentionally empty" PLISTs again. Now, the easy way to say that a package installs no files is to just add the following to the package Makefile: PLIST_SRC= # empty
Diffstat (limited to 'mk/plist')
-rw-r--r--mk/plist/plist.mk24
1 files changed, 19 insertions, 5 deletions
diff --git a/mk/plist/plist.mk b/mk/plist/plist.mk
index 5dab832656a..533733145fe 100644
--- a/mk/plist/plist.mk
+++ b/mk/plist/plist.mk
@@ -1,4 +1,4 @@
-# $NetBSD: plist.mk,v 1.34 2007/10/25 17:49:45 jlam Exp $
+# $NetBSD: plist.mk,v 1.35 2007/10/25 22:02:18 jlam Exp $
#
# This Makefile fragment handles the creation of PLISTs for use by
# pkg_create(8).
@@ -63,6 +63,20 @@ PLIST_SRC_DFLT+= ${PKGDIR}/PLIST
.if exists(${PKGDIR}/PLIST.common_end)
PLIST_SRC_DFLT+= ${PKGDIR}/PLIST.common_end
.endif
+
+#
+# If the following 3 conditions hold, then fail the package build:
+#
+# (1) The package doesn't set PLIST_SRC.
+# (2) The package doesn't set GENERATE_PLIST.
+# (3) There are no PLIST files.
+#
+.if !defined(PLIST_SRC) && !defined(GENERATE_PLIST)
+. if !defined(PLIST_SRC_DFLT) || empty(PLIST_SRC_DFLT)
+PKG_FAIL_REASON+= "Missing PLIST file or PLIST/GENERATE_PLIST definition."
+. endif
+.endif
+
PLIST_SRC?= ${PLIST_SRC_DFLT}
# This is the path to the generated PLIST file.
@@ -171,11 +185,11 @@ _SHLIB_AWKFILE.none= ${.CURDIR}/../../mk/plist/shlib-none.awk
# that outputs contents for a PLIST to stdout and is appended to
# the contents of ${PLIST_SRC}.
#
-.if empty(PLIST_SRC) && empty(GENERATE_PLIST)
-PKG_FAIL_REASON+= "Missing PLIST file or GENERATE_PLIST definition."
-.endif
-
+.if empty(PLIST_SRC)
+GENERATE_PLIST?= ${ECHO} "@comment "${PKGNAME:Q}" has no files.";
+.else
GENERATE_PLIST?= ${TRUE};
+.endif
.if ${PKG_INSTALLATION_TYPE} == "pkgviews"
#