| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $NetBSD: plist.mk,v 1.53 2020/01/05 21:38:54 rillig Exp $ | | 1 | # $NetBSD: plist.mk,v 1.54 2020/03/30 22:54:24 rillig Exp $ |
2 | # | | 2 | # |
3 | # This Makefile fragment handles the creation of PLISTs for use by | | 3 | # This Makefile fragment handles the creation of PLISTs for use by |
4 | # pkg_create(8). | | 4 | # pkg_create(8). |
5 | # | | 5 | # |
6 | # The following variables affect the PLIST generation: | | 6 | # The following variables affect the PLIST generation: |
7 | # | | 7 | # |
8 | # PLIST_TYPE specifies whether the generated PLIST is derived | | 8 | # PLIST_TYPE specifies whether the generated PLIST is derived |
9 | # automatically from the installed files, or if the PLIST entries | | 9 | # automatically from the installed files, or if the PLIST entries |
10 | # are listed in files. Valid values are "dynamic" and "static", | | 10 | # are listed in files. Valid values are "dynamic" and "static", |
11 | # and the default value is "static". | | 11 | # and the default value is "static". |
12 | # | | 12 | # |
13 | # PLIST_VARS is the list of names corresponding to automatic variables | | 13 | # PLIST_VARS is the list of names corresponding to automatic variables |
14 | # generated by plist.mk to simplify having conditionally-present | | 14 | # generated by plist.mk to simplify having conditionally-present |
| @@ -46,47 +46,38 @@ _USER_VARS.plist= # none | | | @@ -46,47 +46,38 @@ _USER_VARS.plist= # none |
46 | _PKG_VARS.plist= PLIST_SUBST PLIST_VARS PLIST_SRC GENERATE_PLIST | | 46 | _PKG_VARS.plist= PLIST_SUBST PLIST_VARS PLIST_SRC GENERATE_PLIST |
47 | _SYS_VARS.plist= PLIST_TYPE PLIST | | 47 | _SYS_VARS.plist= PLIST_TYPE PLIST |
48 | _SORTED_VARS.plist= *_SUBST *_VARS | | 48 | _SORTED_VARS.plist= *_SUBST *_VARS |
49 | _LISTED_VARS.plist= *_SRC GENERATE_PLIST | | 49 | _LISTED_VARS.plist= *_SRC GENERATE_PLIST |
50 | | | 50 | |
51 | PLIST_VARS?= # empty | | 51 | PLIST_VARS?= # empty |
52 | PLIST_AWK?= # empty | | 52 | PLIST_AWK?= # empty |
53 | PLIST_AWK_ENV?= # empty | | 53 | PLIST_AWK_ENV?= # empty |
54 | | | 54 | |
55 | PLIST_TYPE?= static | | 55 | PLIST_TYPE?= static |
56 | | | 56 | |
57 | ###################################################################### | | 57 | ###################################################################### |
58 | | | 58 | |
59 | .if exists(${PKGDIR}/PLIST.common) | | 59 | .for f in \ |
60 | PLIST_SRC_DFLT+= ${PKGDIR}/PLIST.common | | 60 | PLIST.common \ |
61 | .endif | | 61 | PLIST.${OPSYS} \ |
62 | .if exists(${PKGDIR}/PLIST.${OPSYS}) | | 62 | PLIST.${MACHINE_ARCH:C/i[3-6]86/i386/g} \ |
63 | PLIST_SRC_DFLT+= ${PKGDIR}/PLIST.${OPSYS} | | 63 | PLIST.${OPSYS}-${MACHINE_ARCH:C/i[3-6]86/i386/g} \ |
64 | .endif | | 64 | ${defined(EMUL_PLATFORM):?PLIST.${EMUL_PLATFORM}:} \ |
65 | .if exists(${PKGDIR}/PLIST.${MACHINE_ARCH:C/i[3-6]86/i386/g}) | | 65 | PLIST \ |
66 | PLIST_SRC_DFLT+= ${PKGDIR}/PLIST.${MACHINE_ARCH:C/i[3-6]86/i386/g} | | 66 | PLIST.common_end |
67 | .endif | | 67 | . if exists(${PKGDIR}/${f}) |
68 | .if exists(${PKGDIR}/PLIST.${OPSYS}-${MACHINE_ARCH:C/i[3-6]86/i386/g}) | | 68 | PLIST_SRC_DFLT+= ${PKGDIR}/${f} |
69 | PLIST_SRC_DFLT+= ${PKGDIR}/PLIST.${OPSYS}-${MACHINE_ARCH:C/i[3-6]86/i386/g} | | 69 | . endif |
70 | .endif | | 70 | .endfor |
71 | .if defined(EMUL_PLATFORM) && exists(${PKGDIR}/PLIST.${EMUL_PLATFORM}) | | | |
72 | PLIST_SRC_DFLT+= ${PKGDIR}/PLIST.${EMUL_PLATFORM} | | | |
73 | .endif | | | |
74 | .if exists(${PKGDIR}/PLIST) | | | |
75 | PLIST_SRC_DFLT+= ${PKGDIR}/PLIST | | | |
76 | .endif | | | |
77 | .if exists(${PKGDIR}/PLIST.common_end) | | | |
78 | PLIST_SRC_DFLT+= ${PKGDIR}/PLIST.common_end | | | |
79 | .endif | | | |
80 | | | 71 | |
81 | # | | 72 | # |
82 | # If the following 3 conditions hold, then fail the package build: | | 73 | # If the following 3 conditions hold, then fail the package build: |
83 | # | | 74 | # |
84 | # (1) The package doesn't set PLIST_SRC. | | 75 | # (1) The package doesn't set PLIST_SRC. |
85 | # (2) The package doesn't set GENERATE_PLIST. | | 76 | # (2) The package doesn't set GENERATE_PLIST. |
86 | # (3) There are no PLIST files. | | 77 | # (3) There are no PLIST files. |
87 | # | | 78 | # |
88 | .if !defined(PLIST_SRC) && !defined(GENERATE_PLIST) | | 79 | .if !defined(PLIST_SRC) && !defined(GENERATE_PLIST) |
89 | . if !defined(PLIST_SRC_DFLT) || empty(PLIST_SRC_DFLT) | | 80 | . if !defined(PLIST_SRC_DFLT) || empty(PLIST_SRC_DFLT) |
90 | PKG_FAIL_REASON+= "Missing PLIST file or PLIST/GENERATE_PLIST definition." | | 81 | PKG_FAIL_REASON+= "Missing PLIST file or PLIST/GENERATE_PLIST definition." |
91 | . endif | | 82 | . endif |
92 | .endif | | 83 | .endif |
| @@ -135,28 +126,39 @@ _PLIST_AWK_ENV+= IGNORE_INFO_PATH=${_IGN | | | @@ -135,28 +126,39 @@ _PLIST_AWK_ENV+= IGNORE_INFO_PATH=${_IGN |
135 | _PLIST_AWK_ENV+= PKGINFODIR=${PKGINFODIR:Q} | | 126 | _PLIST_AWK_ENV+= PKGINFODIR=${PKGINFODIR:Q} |
136 | _PLIST_AWK_ENV+= IGNORE_LIBTOOLIZE=${IGNORE_LIBTOOLIZE:Q} | | 127 | _PLIST_AWK_ENV+= IGNORE_LIBTOOLIZE=${IGNORE_LIBTOOLIZE:Q} |
137 | _PLIST_AWK_ENV+= LIBTOOLIZE_PLIST=${LIBTOOLIZE_PLIST:Q} | | 128 | _PLIST_AWK_ENV+= LIBTOOLIZE_PLIST=${LIBTOOLIZE_PLIST:Q} |
138 | _PLIST_AWK_ENV+= LIBTOOL_EXPAND=${_LIBTOOL_EXPAND:Q} | | 129 | _PLIST_AWK_ENV+= LIBTOOL_EXPAND=${_LIBTOOL_EXPAND:Q} |
139 | _PLIST_AWK_ENV+= LS=${TOOLS_LS:Q} | | 130 | _PLIST_AWK_ENV+= LS=${TOOLS_LS:Q} |
140 | _PLIST_AWK_ENV+= MANINSTALL=${_PLIST_MANINSTALL:Q} | | 131 | _PLIST_AWK_ENV+= MANINSTALL=${_PLIST_MANINSTALL:Q} |
141 | _PLIST_AWK_ENV+= MANZ=${_MANZ:Q} | | 132 | _PLIST_AWK_ENV+= MANZ=${_MANZ:Q} |
142 | _PLIST_AWK_ENV+= PKGGNUDIR=${PKGGNUDIR:Q} | | 133 | _PLIST_AWK_ENV+= PKGGNUDIR=${PKGGNUDIR:Q} |
143 | _PLIST_AWK_ENV+= PKGMANDIR=${PKGMANDIR:Q} | | 134 | _PLIST_AWK_ENV+= PKGMANDIR=${PKGMANDIR:Q} |
144 | _PLIST_AWK_ENV+= PREFIX=${DESTDIR:Q}${PREFIX:Q} | | 135 | _PLIST_AWK_ENV+= PREFIX=${DESTDIR:Q}${PREFIX:Q} |
145 | _PLIST_AWK_ENV+= TEST=${TOOLS_TEST:Q} | | 136 | _PLIST_AWK_ENV+= TEST=${TOOLS_TEST:Q} |
146 | _PLIST_AWK_ENV+= ${PLIST_AWK_ENV} | | 137 | _PLIST_AWK_ENV+= ${PLIST_AWK_ENV} |
147 | | | 138 | |
148 | # PLIST_SUBST contains package-settable "${variable}" to "value" | | 139 | # PLIST_SUBST contains package-settable VAR=value substitutions that are |
149 | # substitutions for PLISTs | | 140 | # used when generating the actual file list for the package from the |
| | | 141 | # package's PLIST files, as listed in PLIST_SRC. These files may contain |
| | | 142 | # placeholders of the form ${VAR}, which are then substituted by their |
| | | 143 | # corresponding value from PLIST_SUBST. |
| | | 144 | # |
| | | 145 | # Example: PLIST_SUBST+= PKGNAME=${PKGNAME_NOREV} means that the package's |
| | | 146 | # PLIST file may contain the placeholder ${PKGNAME}, which will be replaced |
| | | 147 | # with the package version excluding the "nb13" extension. |
| | | 148 | # |
| | | 149 | # The other direction of generating the package's PLIST file from the list |
| | | 150 | # of actually installed files is covered by PRINT_PLIST_AWK. This is only |
| | | 151 | # needed when developing the package itself, for example after an update. |
150 | # | | 152 | # |
151 | PLIST_SUBST+= OPSYS=${OPSYS:Q} \ | | 153 | PLIST_SUBST+= OPSYS=${OPSYS:Q} \ |
152 | OS_VERSION=${OS_VERSION:Q} \ | | 154 | OS_VERSION=${OS_VERSION:Q} \ |
153 | MACHINE_ARCH=${MACHINE_ARCH:Q} \ | | 155 | MACHINE_ARCH=${MACHINE_ARCH:Q} \ |
154 | MACHINE_GNU_ARCH=${MACHINE_GNU_ARCH:Q} \ | | 156 | MACHINE_GNU_ARCH=${MACHINE_GNU_ARCH:Q} \ |
155 | MACHINE_GNU_PLATFORM=${MACHINE_GNU_PLATFORM:Q} \ | | 157 | MACHINE_GNU_PLATFORM=${MACHINE_GNU_PLATFORM:Q} \ |
156 | LN=${LN:Q} \ | | 158 | LN=${LN:Q} \ |
157 | LOWER_VENDOR=${LOWER_VENDOR:Q} \ | | 159 | LOWER_VENDOR=${LOWER_VENDOR:Q} \ |
158 | LOWER_OPSYS=${LOWER_OPSYS:Q} \ | | 160 | LOWER_OPSYS=${LOWER_OPSYS:Q} \ |
159 | LOWER_OS_VERSION=${LOWER_OS_VERSION:Q} \ | | 161 | LOWER_OS_VERSION=${LOWER_OS_VERSION:Q} \ |
160 | PKGBASE=${PKGBASE:Q} \ | | 162 | PKGBASE=${PKGBASE:Q} \ |
161 | PKGNAME=${PKGNAME_NOREV:Q} \ | | 163 | PKGNAME=${PKGNAME_NOREV:Q} \ |
162 | PKGLOCALEDIR=${PKGLOCALEDIR:Q} \ | | 164 | PKGLOCALEDIR=${PKGLOCALEDIR:Q} \ |