pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/mk/plist



Module Name:    pkgsrc
Committed By:   rillig
Date:           Mon Mar 30 22:54:24 UTC 2020

Modified Files:
        pkgsrc/mk/plist: plist.mk

Log Message:
mk/plist/plist.mk: use less verbose code for picking up PLIST files

While here, add more verbose documentation on PLIST_SUBST since the way
from the package's PLIST file to the +PLIST file can easily be confused
with the other way round, which is handled by print-PLIST.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 pkgsrc/mk/plist/plist.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/mk/plist/plist.mk
diff -u pkgsrc/mk/plist/plist.mk:1.53 pkgsrc/mk/plist/plist.mk:1.54
--- pkgsrc/mk/plist/plist.mk:1.53       Sun Jan  5 21:38:54 2020
+++ pkgsrc/mk/plist/plist.mk    Mon Mar 30 22:54:24 2020
@@ -1,4 +1,4 @@
-# $NetBSD: plist.mk,v 1.53 2020/01/05 21:38:54 rillig Exp $
+# $NetBSD: plist.mk,v 1.54 2020/03/30 22:54:24 rillig Exp $
 #
 # This Makefile fragment handles the creation of PLISTs for use by
 # pkg_create(8).
@@ -56,27 +56,18 @@ PLIST_TYPE?=        static
 
 ######################################################################
 
-.if exists(${PKGDIR}/PLIST.common)
-PLIST_SRC_DFLT+=       ${PKGDIR}/PLIST.common
-.endif
-.if exists(${PKGDIR}/PLIST.${OPSYS})
-PLIST_SRC_DFLT+=       ${PKGDIR}/PLIST.${OPSYS}
-.endif
-.if exists(${PKGDIR}/PLIST.${MACHINE_ARCH:C/i[3-6]86/i386/g})
-PLIST_SRC_DFLT+=       ${PKGDIR}/PLIST.${MACHINE_ARCH:C/i[3-6]86/i386/g}
-.endif
-.if exists(${PKGDIR}/PLIST.${OPSYS}-${MACHINE_ARCH:C/i[3-6]86/i386/g})
-PLIST_SRC_DFLT+=       ${PKGDIR}/PLIST.${OPSYS}-${MACHINE_ARCH:C/i[3-6]86/i386/g}
-.endif
-.if defined(EMUL_PLATFORM) && exists(${PKGDIR}/PLIST.${EMUL_PLATFORM})
-PLIST_SRC_DFLT+=       ${PKGDIR}/PLIST.${EMUL_PLATFORM}
-.endif
-.if exists(${PKGDIR}/PLIST)
-PLIST_SRC_DFLT+=       ${PKGDIR}/PLIST
-.endif
-.if exists(${PKGDIR}/PLIST.common_end)
-PLIST_SRC_DFLT+=       ${PKGDIR}/PLIST.common_end
-.endif
+.for f in \
+       PLIST.common \
+       PLIST.${OPSYS} \
+       PLIST.${MACHINE_ARCH:C/i[3-6]86/i386/g} \
+       PLIST.${OPSYS}-${MACHINE_ARCH:C/i[3-6]86/i386/g} \
+       ${defined(EMUL_PLATFORM):?PLIST.${EMUL_PLATFORM}:} \
+       PLIST \
+       PLIST.common_end
+.  if exists(${PKGDIR}/${f})
+PLIST_SRC_DFLT+=       ${PKGDIR}/${f}
+.  endif
+.endfor
 
 #
 # If the following 3 conditions hold, then fail the package build:
@@ -145,8 +136,19 @@ _PLIST_AWK_ENV+=   PREFIX=${DESTDIR:Q}${PR
 _PLIST_AWK_ENV+=       TEST=${TOOLS_TEST:Q}
 _PLIST_AWK_ENV+=       ${PLIST_AWK_ENV}
 
-# PLIST_SUBST contains package-settable "${variable}" to "value"
-# substitutions for PLISTs
+# PLIST_SUBST contains package-settable VAR=value substitutions that are
+# used when generating the actual file list for the package from the
+# package's PLIST files, as listed in PLIST_SRC. These files may contain
+# placeholders of the form ${VAR}, which are then substituted by their
+# corresponding value from PLIST_SUBST.
+#
+# Example: PLIST_SUBST+= PKGNAME=${PKGNAME_NOREV} means that the package's
+# PLIST file may contain the placeholder ${PKGNAME}, which will be replaced
+# with the package version excluding the "nb13" extension.
+#
+# The other direction of generating the package's PLIST file from the list
+# of actually installed files is covered by PRINT_PLIST_AWK. This is only
+# needed when developing the package itself, for example after an update.
 #
 PLIST_SUBST+=  OPSYS=${OPSYS:Q}                                        \
                OS_VERSION=${OS_VERSION:Q}                              \



Home | Main Index | Thread Index | Old Index