Wed Jan 16 04:43:42 2019 UTC ()
mk/plist/plist.mk: amend MACHINE_ARCH examples in a comment

To avoid potential confusion, amend the example MACHINE_ARCH to what it
really is. While here, fix a rather subtle typo.


(gutteridge)
diff -r1.51 -r1.52 pkgsrc/mk/plist/plist.mk

cvs diff -r1.51 -r1.52 pkgsrc/mk/plist/plist.mk (switch to unified diff)

--- pkgsrc/mk/plist/plist.mk 2018/11/30 18:38:20 1.51
+++ pkgsrc/mk/plist/plist.mk 2019/01/16 04:43:42 1.52
@@ -1,302 +1,302 @@ @@ -1,302 +1,302 @@
1# $NetBSD: plist.mk,v 1.51 2018/11/30 18:38:20 rillig Exp $ 1# $NetBSD: plist.mk,v 1.52 2019/01/16 04:43:42 gutteridge 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
15# entries in the PLIST. If "var" is listed in PLIST_VARS, then the 15# entries in the PLIST. If "var" is listed in PLIST_VARS, then the
16# automatic variable is named PLIST.var. If PLIST.var is defined, 16# automatic variable is named PLIST.var. If PLIST.var is defined,
17# then in the PLIST generation, the ${PLIST.var} symbol is replaced 17# then in the PLIST generation, the ${PLIST.var} symbol is replaced
18# with the empty string, or "@comment " otherwise. 18# with the empty string, or "@comment " otherwise.
19# 19#
20# PLIST_AWK_ENV holds the shell environment passed to PLIST_AWK. 20# PLIST_AWK_ENV holds the shell environment passed to PLIST_AWK.
21# 21#
22# PLIST_AWK is the awk script that does post-processing of the PLIST. 22# PLIST_AWK is the awk script that does post-processing of the PLIST.
23# 23#
24# PLIST_SRC is the list of source files from which the PLIST file of 24# PLIST_SRC is the list of source files from which the PLIST file of
25# the binary package will be generated. By default, its value is 25# the binary package will be generated. By default, its value is
26# constructed from the PLIST.* files within the package directory, 26# constructed from the PLIST.* files within the package directory,
27# in the following order (if the files are present): 27# in the following order (if the files are present):
28# 28#
29# PLIST.common 29# PLIST.common
30# PLIST.${OPSYS} (e.g., PLIST.NetBSD) 30# PLIST.${OPSYS} (e.g., PLIST.NetBSD)
31# PLIST.${MACHINE_ARCH} (e.g,, PLIST.macppc) 31# PLIST.${MACHINE_ARCH} (e.g., PLIST.powerpc)
32# PLIST.${OPSYS}-${MACHINE_ARCH} (e.g., PLIST.NetBSD-macppc) 32# PLIST.${OPSYS}-${MACHINE_ARCH} (e.g., PLIST.NetBSD-powerpc)
33# PLIST 33# PLIST
34# PLIST.common_end 34# PLIST.common_end
35# 35#
36# GENERATE_PLIST is a sequence of commands, terminating in a semicolon, 36# GENERATE_PLIST is a sequence of commands, terminating in a semicolon,
37# that outputs contents for a PLIST to stdout and is appended to 37# that outputs contents for a PLIST to stdout and is appended to
38# the contents of ${PLIST_SRC}. 38# the contents of ${PLIST_SRC}.
39# 39#
40# IGNORE_INFO_DIRS is a list of ${PREFIX}-relative paths that do 40# IGNORE_INFO_DIRS is a list of ${PREFIX}-relative paths that do
41# *not* contain info files. 41# *not* contain info files.
42# 42#
43 43
44_VARGROUPS+= plist 44_VARGROUPS+= plist
45_USER_VARS.plist= # none 45_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
51PLIST_VARS?= # empty 51PLIST_VARS?= # empty
52PLIST_AWK?= # empty 52PLIST_AWK?= # empty
53PLIST_AWK_ENV?= # empty 53PLIST_AWK_ENV?= # empty
54 54
55PLIST_TYPE?= static 55PLIST_TYPE?= static
56 56
57###################################################################### 57######################################################################
58 58
59.if exists(${PKGDIR}/PLIST.common) 59.if exists(${PKGDIR}/PLIST.common)
60PLIST_SRC_DFLT+= ${PKGDIR}/PLIST.common 60PLIST_SRC_DFLT+= ${PKGDIR}/PLIST.common
61.endif 61.endif
62.if exists(${PKGDIR}/PLIST.${OPSYS}) 62.if exists(${PKGDIR}/PLIST.${OPSYS})
63PLIST_SRC_DFLT+= ${PKGDIR}/PLIST.${OPSYS} 63PLIST_SRC_DFLT+= ${PKGDIR}/PLIST.${OPSYS}
64.endif 64.endif
65.if exists(${PKGDIR}/PLIST.${MACHINE_ARCH:C/i[3-6]86/i386/g}) 65.if exists(${PKGDIR}/PLIST.${MACHINE_ARCH:C/i[3-6]86/i386/g})
66PLIST_SRC_DFLT+= ${PKGDIR}/PLIST.${MACHINE_ARCH:C/i[3-6]86/i386/g} 66PLIST_SRC_DFLT+= ${PKGDIR}/PLIST.${MACHINE_ARCH:C/i[3-6]86/i386/g}
67.endif 67.endif
68.if exists(${PKGDIR}/PLIST.${OPSYS}-${MACHINE_ARCH:C/i[3-6]86/i386/g}) 68.if exists(${PKGDIR}/PLIST.${OPSYS}-${MACHINE_ARCH:C/i[3-6]86/i386/g})
69PLIST_SRC_DFLT+= ${PKGDIR}/PLIST.${OPSYS}-${MACHINE_ARCH:C/i[3-6]86/i386/g} 69PLIST_SRC_DFLT+= ${PKGDIR}/PLIST.${OPSYS}-${MACHINE_ARCH:C/i[3-6]86/i386/g}
70.endif 70.endif
71.if defined(EMUL_PLATFORM) && exists(${PKGDIR}/PLIST.${EMUL_PLATFORM}) 71.if defined(EMUL_PLATFORM) && exists(${PKGDIR}/PLIST.${EMUL_PLATFORM})
72PLIST_SRC_DFLT+= ${PKGDIR}/PLIST.${EMUL_PLATFORM} 72PLIST_SRC_DFLT+= ${PKGDIR}/PLIST.${EMUL_PLATFORM}
73.endif 73.endif
74.if exists(${PKGDIR}/PLIST) 74.if exists(${PKGDIR}/PLIST)
75PLIST_SRC_DFLT+= ${PKGDIR}/PLIST 75PLIST_SRC_DFLT+= ${PKGDIR}/PLIST
76.endif 76.endif
77.if exists(${PKGDIR}/PLIST.common_end) 77.if exists(${PKGDIR}/PLIST.common_end)
78PLIST_SRC_DFLT+= ${PKGDIR}/PLIST.common_end 78PLIST_SRC_DFLT+= ${PKGDIR}/PLIST.common_end
79.endif 79.endif
80 80
81# 81#
82# If the following 3 conditions hold, then fail the package build: 82# If the following 3 conditions hold, then fail the package build:
83# 83#
84# (1) The package doesn't set PLIST_SRC. 84# (1) The package doesn't set PLIST_SRC.
85# (2) The package doesn't set GENERATE_PLIST. 85# (2) The package doesn't set GENERATE_PLIST.
86# (3) There are no PLIST files. 86# (3) There are no PLIST files.
87# 87#
88.if !defined(PLIST_SRC) && !defined(GENERATE_PLIST) 88.if !defined(PLIST_SRC) && !defined(GENERATE_PLIST)
89. if !defined(PLIST_SRC_DFLT) || empty(PLIST_SRC_DFLT) 89. if !defined(PLIST_SRC_DFLT) || empty(PLIST_SRC_DFLT)
90PKG_FAIL_REASON+= "Missing PLIST file or PLIST/GENERATE_PLIST definition." 90PKG_FAIL_REASON+= "Missing PLIST file or PLIST/GENERATE_PLIST definition."
91. endif 91. endif
92.endif 92.endif
93 93
94PLIST_SRC?= ${PLIST_SRC_DFLT} 94PLIST_SRC?= ${PLIST_SRC_DFLT}
95 95
96# This is the path to the generated PLIST file. 96# This is the path to the generated PLIST file.
97PLIST= ${WRKDIR}/.PLIST 97PLIST= ${WRKDIR}/.PLIST
98_PLIST_NOKEYWORDS=${PLIST}_nokeywords 98_PLIST_NOKEYWORDS=${PLIST}_nokeywords
99 99
100###################################################################### 100######################################################################
101 101
102.if (defined(USE_IMAKE) || !empty(USE_TOOLS:Mimake)) 102.if (defined(USE_IMAKE) || !empty(USE_TOOLS:Mimake))
103_IMAKE_MANINSTALL= ${IMAKE_MANINSTALL} 103_IMAKE_MANINSTALL= ${IMAKE_MANINSTALL}
104_PLIST_MANINSTALL= ${IMAKE_MANINSTALL} 104_PLIST_MANINSTALL= ${IMAKE_MANINSTALL}
105.else 105.else
106_IMAKE_MANINSTALL= # empty 106_IMAKE_MANINSTALL= # empty
107_PLIST_MANINSTALL= ${MANINSTALL} 107_PLIST_MANINSTALL= ${MANINSTALL}
108.endif 108.endif
109 109
110_LIBTOOL_EXPAND= \ 110_LIBTOOL_EXPAND= \
111 ${PKGSRC_SETENV} ECHO=${TOOLS_ECHO:Q} GREP=${TOOLS_GREP:Q} \ 111 ${PKGSRC_SETENV} ECHO=${TOOLS_ECHO:Q} GREP=${TOOLS_GREP:Q} \
112 SORT=${TOOLS_SORT:Q} TEST=${TOOLS_TEST:Q} \ 112 SORT=${TOOLS_SORT:Q} TEST=${TOOLS_TEST:Q} \
113 BASENAME=${BASENAME:Q} DIRNAME=${DIRNAME:Q} \ 113 BASENAME=${BASENAME:Q} DIRNAME=${DIRNAME:Q} \
114 PWD_CMD=${PWD_CMD:Q} \ 114 PWD_CMD=${PWD_CMD:Q} \
115 SHLIB_TYPE=${SHLIB_TYPE:Q} \ 115 SHLIB_TYPE=${SHLIB_TYPE:Q} \
116 ${SH} ${.CURDIR}/../../mk/plist/libtool-expand 116 ${SH} ${.CURDIR}/../../mk/plist/libtool-expand
117 117
118.if !defined(_IGNORE_INFO_PATH) 118.if !defined(_IGNORE_INFO_PATH)
119. for _dir_ in ${IGNORE_INFO_DIRS} 119. for _dir_ in ${IGNORE_INFO_DIRS}
120_IGNORE_INFO_PATH:= ${_IGNORE_INFO_PATH}:${_dir_} 120_IGNORE_INFO_PATH:= ${_IGNORE_INFO_PATH}:${_dir_}
121. endfor 121. endfor
122_IGNORE_INFO_PATH:= ${_IGNORE_INFO_PATH:S/^://} 122_IGNORE_INFO_PATH:= ${_IGNORE_INFO_PATH:S/^://}
123.endif 123.endif
124MAKEVARS+= _IGNORE_INFO_PATH 124MAKEVARS+= _IGNORE_INFO_PATH
125 125
126# _PLIST_AWK_ENV holds the shell environment passed to the awk script 126# _PLIST_AWK_ENV holds the shell environment passed to the awk script
127# that does post-processing of the PLIST. See the individual *.awk 127# that does post-processing of the PLIST. See the individual *.awk
128# scripts for information on each of the variable set in the environment. 128# scripts for information on each of the variable set in the environment.
129# 129#
130_PLIST_AWK_ENV+= PKGLOCALEDIR=${PKGLOCALEDIR:Q} 130_PLIST_AWK_ENV+= PKGLOCALEDIR=${PKGLOCALEDIR:Q}
131_PLIST_AWK_ENV+= USE_PKGLOCALEDIR=${USE_PKGLOCALEDIR:Dyes:Uno} 131_PLIST_AWK_ENV+= USE_PKGLOCALEDIR=${USE_PKGLOCALEDIR:Dyes:Uno}
132_PLIST_AWK_ENV+= CATMAN_SECTION_SUFFIX=${CATMAN_SECTION_SUFFIX:Q} 132_PLIST_AWK_ENV+= CATMAN_SECTION_SUFFIX=${CATMAN_SECTION_SUFFIX:Q}
133_PLIST_AWK_ENV+= IMAKE_MANINSTALL=${_IMAKE_MANINSTALL:Q} 133_PLIST_AWK_ENV+= IMAKE_MANINSTALL=${_IMAKE_MANINSTALL:Q}
134_PLIST_AWK_ENV+= IGNORE_INFO_PATH=${_IGNORE_INFO_PATH:Q} 134_PLIST_AWK_ENV+= IGNORE_INFO_PATH=${_IGNORE_INFO_PATH:Q}
135_PLIST_AWK_ENV+= PKGINFODIR=${PKGINFODIR:Q} 135_PLIST_AWK_ENV+= PKGINFODIR=${PKGINFODIR:Q}
136_PLIST_AWK_ENV+= IGNORE_LIBTOOLIZE=${IGNORE_LIBTOOLIZE:Q} 136_PLIST_AWK_ENV+= IGNORE_LIBTOOLIZE=${IGNORE_LIBTOOLIZE:Q}
137_PLIST_AWK_ENV+= LIBTOOLIZE_PLIST=${LIBTOOLIZE_PLIST:Q} 137_PLIST_AWK_ENV+= LIBTOOLIZE_PLIST=${LIBTOOLIZE_PLIST:Q}
138_PLIST_AWK_ENV+= LIBTOOL_EXPAND=${_LIBTOOL_EXPAND:Q} 138_PLIST_AWK_ENV+= LIBTOOL_EXPAND=${_LIBTOOL_EXPAND:Q}
139_PLIST_AWK_ENV+= LS=${TOOLS_LS:Q} 139_PLIST_AWK_ENV+= LS=${TOOLS_LS:Q}
140_PLIST_AWK_ENV+= MANINSTALL=${_PLIST_MANINSTALL:Q} 140_PLIST_AWK_ENV+= MANINSTALL=${_PLIST_MANINSTALL:Q}
141_PLIST_AWK_ENV+= MANZ=${_MANZ:Q} 141_PLIST_AWK_ENV+= MANZ=${_MANZ:Q}
142_PLIST_AWK_ENV+= PKGGNUDIR=${PKGGNUDIR:Q} 142_PLIST_AWK_ENV+= PKGGNUDIR=${PKGGNUDIR:Q}
143_PLIST_AWK_ENV+= PKGMANDIR=${PKGMANDIR:Q} 143_PLIST_AWK_ENV+= PKGMANDIR=${PKGMANDIR:Q}
144_PLIST_AWK_ENV+= PREFIX=${DESTDIR:Q}${PREFIX:Q} 144_PLIST_AWK_ENV+= PREFIX=${DESTDIR:Q}${PREFIX:Q}
145_PLIST_AWK_ENV+= TEST=${TOOLS_TEST:Q} 145_PLIST_AWK_ENV+= TEST=${TOOLS_TEST:Q}
146_PLIST_AWK_ENV+= ${PLIST_AWK_ENV} 146_PLIST_AWK_ENV+= ${PLIST_AWK_ENV}
147 147
148# PLIST_SUBST contains package-settable "${variable}" to "value" 148# PLIST_SUBST contains package-settable "${variable}" to "value"
149# substitutions for PLISTs 149# substitutions for PLISTs
150# 150#
151PLIST_SUBST+= OPSYS=${OPSYS:Q} \ 151PLIST_SUBST+= OPSYS=${OPSYS:Q} \
152 OS_VERSION=${OS_VERSION:Q} \ 152 OS_VERSION=${OS_VERSION:Q} \
153 MACHINE_ARCH=${MACHINE_ARCH:Q} \ 153 MACHINE_ARCH=${MACHINE_ARCH:Q} \
154 MACHINE_GNU_ARCH=${MACHINE_GNU_ARCH:Q} \ 154 MACHINE_GNU_ARCH=${MACHINE_GNU_ARCH:Q} \
155 MACHINE_GNU_PLATFORM=${MACHINE_GNU_PLATFORM:Q} \ 155 MACHINE_GNU_PLATFORM=${MACHINE_GNU_PLATFORM:Q} \
156 LN=${LN:Q} \ 156 LN=${LN:Q} \
157 LOWER_VENDOR=${LOWER_VENDOR:Q} \ 157 LOWER_VENDOR=${LOWER_VENDOR:Q} \
158 LOWER_OPSYS=${LOWER_OPSYS:Q} \ 158 LOWER_OPSYS=${LOWER_OPSYS:Q} \
159 LOWER_OS_VERSION=${LOWER_OS_VERSION:Q} \ 159 LOWER_OS_VERSION=${LOWER_OS_VERSION:Q} \
160 PKGBASE=${PKGBASE:Q} \ 160 PKGBASE=${PKGBASE:Q} \
161 PKGNAME=${PKGNAME_NOREV:Q} \ 161 PKGNAME=${PKGNAME_NOREV:Q} \
162 PKGLOCALEDIR=${PKGLOCALEDIR:Q} \ 162 PKGLOCALEDIR=${PKGLOCALEDIR:Q} \
163 PKGVERSION=${PKGVERSION:C/nb[0-9]*$//:Q} \ 163 PKGVERSION=${PKGVERSION:C/nb[0-9]*$//:Q} \
164 LOCALBASE=${LOCALBASE:Q} \ 164 LOCALBASE=${LOCALBASE:Q} \
165 VIEWBASE=${VIEWBASE:Q} \ 165 VIEWBASE=${VIEWBASE:Q} \
166 X11BASE=${X11BASE:Q} \ 166 X11BASE=${X11BASE:Q} \
167 CHGRP=${CHGRP:Q} \ 167 CHGRP=${CHGRP:Q} \
168 CHMOD=${CHMOD:Q} \ 168 CHMOD=${CHMOD:Q} \
169 CHOWN=${CHOWN:Q} \ 169 CHOWN=${CHOWN:Q} \
170 MKDIR=${MKDIR:Q} \ 170 MKDIR=${MKDIR:Q} \
171 RMDIR=${RMDIR:Q} \ 171 RMDIR=${RMDIR:Q} \
172 RM=${RM:Q} \ 172 RM=${RM:Q} \
173 TRUE=${TRUE:Q} \ 173 TRUE=${TRUE:Q} \
174 PKGGNUDIR=${PKGGNUDIR:Q} \ 174 PKGGNUDIR=${PKGGNUDIR:Q} \
175 PKGMANDIR=${PKGMANDIR:Q} 175 PKGMANDIR=${PKGMANDIR:Q}
176 176
177.for _var_ in ${PLIST_VARS} 177.for _var_ in ${PLIST_VARS}
178PLIST_SUBST+= ${PLIST.${_var_}:DPLIST.${_var_}=:UPLIST.${_var_}="@comment "} 178PLIST_SUBST+= ${PLIST.${_var_}:DPLIST.${_var_}=:UPLIST.${_var_}="@comment "}
179.endfor 179.endfor
180 180
181# Pass the PLIST_SUBST substitutions to the subst.awk script by prepending 181# Pass the PLIST_SUBST substitutions to the subst.awk script by prepending
182# PLIST_" to all of the variable names and adding them into the environment. 182# PLIST_" to all of the variable names and adding them into the environment.
183# 183#
184_PLIST_AWK_ENV+= ${PLIST_SUBST:S/^/PLIST_/} 184_PLIST_AWK_ENV+= ${PLIST_SUBST:S/^/PLIST_/}
185_PLIST_AWK_ENV+= PLIST_SUBST_VARS=${PLIST_SUBST:S/^/PLIST_/:C/=.*//:M*:Q} 185_PLIST_AWK_ENV+= PLIST_SUBST_VARS=${PLIST_SUBST:S/^/PLIST_/:C/=.*//:M*:Q}
186 186
187_PLIST_1_AWK+= -f ${PKGSRCDIR}/mk/plist/plist-functions.awk 187_PLIST_1_AWK+= -f ${PKGSRCDIR}/mk/plist/plist-functions.awk
188_PLIST_1_AWK+= -f ${PKGSRCDIR}/mk/plist/plist-subst.awk 188_PLIST_1_AWK+= -f ${PKGSRCDIR}/mk/plist/plist-subst.awk
189_PLIST_1_AWK+= -f ${PKGSRCDIR}/mk/plist/plist-macros.awk 189_PLIST_1_AWK+= -f ${PKGSRCDIR}/mk/plist/plist-macros.awk
190 190
191_PLIST_AWK+= -f ${.CURDIR}/../../mk/plist/plist-functions.awk 191_PLIST_AWK+= -f ${.CURDIR}/../../mk/plist/plist-functions.awk
192_PLIST_AWK+= -f ${.CURDIR}/../../mk/plist/plist-locale.awk 192_PLIST_AWK+= -f ${.CURDIR}/../../mk/plist/plist-locale.awk
193_PLIST_AWK+= -f ${.CURDIR}/../../mk/plist/plist-gnu.awk 193_PLIST_AWK+= -f ${.CURDIR}/../../mk/plist/plist-gnu.awk
194_PLIST_AWK+= -f ${.CURDIR}/../../mk/plist/plist-info.awk 194_PLIST_AWK+= -f ${.CURDIR}/../../mk/plist/plist-info.awk
195_PLIST_AWK+= -f ${.CURDIR}/../../mk/plist/plist-man.awk 195_PLIST_AWK+= -f ${.CURDIR}/../../mk/plist/plist-man.awk
196_PLIST_AWK+= -f ${.CURDIR}/../../mk/plist/plist-libtool.awk 196_PLIST_AWK+= -f ${.CURDIR}/../../mk/plist/plist-libtool.awk
197.if ${OPSYS} == "Cygwin" 197.if ${OPSYS} == "Cygwin"
198_PLIST_AWK+= -f ${.CURDIR}/../../mk/plist/plist-cygwin.awk 198_PLIST_AWK+= -f ${.CURDIR}/../../mk/plist/plist-cygwin.awk
199.endif 199.endif
200_PLIST_AWK+= ${PLIST_AWK} 200_PLIST_AWK+= ${PLIST_AWK}
201_PLIST_AWK+= -f ${.CURDIR}/../../mk/plist/plist-default.awk 201_PLIST_AWK+= -f ${.CURDIR}/../../mk/plist/plist-default.awk
202 202
203_PLIST_INFO_AWK+= -f ${.CURDIR}/../../mk/plist/plist-functions.awk 203_PLIST_INFO_AWK+= -f ${.CURDIR}/../../mk/plist/plist-functions.awk
204_PLIST_INFO_AWK+= -f ${.CURDIR}/../../mk/plist/plist-info.awk 204_PLIST_INFO_AWK+= -f ${.CURDIR}/../../mk/plist/plist-info.awk
205 205
206_PLIST_SHLIB_AWK= -f ${_SHLIB_AWKFILE.${SHLIB_TYPE}} 206_PLIST_SHLIB_AWK= -f ${_SHLIB_AWKFILE.${SHLIB_TYPE}}
207_SHLIB_AWKFILE.ECOFF= ${.CURDIR}/../../mk/plist/shlib-elf.awk 207_SHLIB_AWKFILE.ECOFF= ${.CURDIR}/../../mk/plist/shlib-elf.awk
208_SHLIB_AWKFILE.ELF= ${.CURDIR}/../../mk/plist/shlib-elf.awk 208_SHLIB_AWKFILE.ELF= ${.CURDIR}/../../mk/plist/shlib-elf.awk
209_SHLIB_AWKFILE.SOM= ${.CURDIR}/../../mk/plist/shlib-som.awk 209_SHLIB_AWKFILE.SOM= ${.CURDIR}/../../mk/plist/shlib-som.awk
210_SHLIB_AWKFILE.aixlib= ${.CURDIR}/../../mk/plist/shlib-elf.awk 210_SHLIB_AWKFILE.aixlib= ${.CURDIR}/../../mk/plist/shlib-elf.awk
211_SHLIB_AWKFILE.a.out= ${.CURDIR}/../../mk/plist/shlib-aout.awk 211_SHLIB_AWKFILE.a.out= ${.CURDIR}/../../mk/plist/shlib-aout.awk
212_SHLIB_AWKFILE.PEwin= ${.CURDIR}/../../mk/plist/shlib-pe.awk 212_SHLIB_AWKFILE.PEwin= ${.CURDIR}/../../mk/plist/shlib-pe.awk
213_SHLIB_AWKFILE.dylib= ${.CURDIR}/../../mk/plist/shlib-dylib.awk 213_SHLIB_AWKFILE.dylib= ${.CURDIR}/../../mk/plist/shlib-dylib.awk
214_SHLIB_AWKFILE.none= ${.CURDIR}/../../mk/plist/shlib-none.awk 214_SHLIB_AWKFILE.none= ${.CURDIR}/../../mk/plist/shlib-none.awk
215 215
216###################################################################### 216######################################################################
217 217
218# GENERATE_PLIST is a sequence of commands, terminating in a semicolon, 218# GENERATE_PLIST is a sequence of commands, terminating in a semicolon,
219# that outputs contents for a PLIST to stdout and is appended to 219# that outputs contents for a PLIST to stdout and is appended to
220# the contents of ${PLIST_SRC}. 220# the contents of ${PLIST_SRC}.
221# 221#
222.if empty(PLIST_SRC) 222.if empty(PLIST_SRC)
223GENERATE_PLIST?= ${ECHO} "@comment "${PKGNAME:Q}" has no files."; 223GENERATE_PLIST?= ${ECHO} "@comment "${PKGNAME:Q}" has no files.";
224.else 224.else
225GENERATE_PLIST?= ${TRUE}; 225GENERATE_PLIST?= ${TRUE};
226.endif 226.endif
227 227
228_BUILD_DEFS+= _PLIST_IGNORE_FILES 228_BUILD_DEFS+= _PLIST_IGNORE_FILES
229 229
230.if ${PLIST_TYPE} == "dynamic" 230.if ${PLIST_TYPE} == "dynamic"
231_PLIST_IGNORE_CMD= \ 231_PLIST_IGNORE_CMD= \
232 ( while read i; do \ 232 ( while read i; do \
233 ignore=no; \ 233 ignore=no; \
234 for p in ${_PLIST_IGNORE_FILES}; do \ 234 for p in ${_PLIST_IGNORE_FILES}; do \
235 case "$$i" in \ 235 case "$$i" in \
236 $$p) ignore=yes; break ;; \ 236 $$p) ignore=yes; break ;; \
237 esac; \ 237 esac; \
238 done; \ 238 done; \
239 [ "$$ignore" = "yes" ] || ${ECHO} "$$i"; \ 239 [ "$$ignore" = "yes" ] || ${ECHO} "$$i"; \
240 done ) 240 done )
241_GENERATE_PLIST= \ 241_GENERATE_PLIST= \
242 ${FIND} ${DESTDIR}${PREFIX} \! -type d -print | ${SORT} | \ 242 ${FIND} ${DESTDIR}${PREFIX} \! -type d -print | ${SORT} | \
243 ${SED} -e "s|^${DESTDIR}${PREFIX}/||" | \ 243 ${SED} -e "s|^${DESTDIR}${PREFIX}/||" | \
244 ${_PLIST_IGNORE_CMD}; \ 244 ${_PLIST_IGNORE_CMD}; \
245 ${FIND} ${DESTDIR}${PREFIX} -type d -print | ${SORT} -r | \ 245 ${FIND} ${DESTDIR}${PREFIX} -type d -print | ${SORT} -r | \
246 ${GREP} -v "^${PREFIX}$$" | \ 246 ${GREP} -v "^${PREFIX}$$" | \
247 ${_PLIST_IGNORE_CMD} | \ 247 ${_PLIST_IGNORE_CMD} | \
248 ${SED} -e "s|^${DESTDIR}${PREFIX}/|@unexec ${RMDIR} -p %D/|" \ 248 ${SED} -e "s|^${DESTDIR}${PREFIX}/|@unexec ${RMDIR} -p %D/|" \
249 -e "s,$$, 2>/dev/null || ${TRUE},"; 249 -e "s,$$, 2>/dev/null || ${TRUE},";
250.else 250.else
251_GENERATE_PLIST= ${CAT} /dev/null ${PLIST_SRC}; ${GENERATE_PLIST} 251_GENERATE_PLIST= ${CAT} /dev/null ${PLIST_SRC}; ${GENERATE_PLIST}
252.endif 252.endif
253 253
254.PHONY: plist 254.PHONY: plist
255plist: ${PLIST} ${_PLIST_NOKEYWORDS} 255plist: ${PLIST} ${_PLIST_NOKEYWORDS}
256 256
257.if (${PLIST_TYPE} == "static") && !empty(PLIST_SRC) 257.if (${PLIST_TYPE} == "static") && !empty(PLIST_SRC)
258${PLIST}: ${PLIST_SRC} 258${PLIST}: ${PLIST_SRC}
259.endif 259.endif
260${PLIST}: 260${PLIST}:
261 ${RUN} ${MKDIR} ${.TARGET:H} 261 ${RUN} ${MKDIR} ${.TARGET:H}
262 ${RUN} { ${_GENERATE_PLIST} } > ${.TARGET}-1src 262 ${RUN} { ${_GENERATE_PLIST} } > ${.TARGET}-1src
263 ${RUN} ${PKGSRC_SETENV} ${_PLIST_AWK_ENV} ${AWK} ${_PLIST_1_AWK} < ${.TARGET}-1src > ${.TARGET}-2mac 263 ${RUN} ${PKGSRC_SETENV} ${_PLIST_AWK_ENV} ${AWK} ${_PLIST_1_AWK} < ${.TARGET}-1src > ${.TARGET}-2mac
264 ${RUN} ${PKGSRC_SETENV} ${_PLIST_AWK_ENV} ${AWK} ${_PLIST_AWK} < ${.TARGET}-2mac > ${.TARGET}-3mag 264 ${RUN} ${PKGSRC_SETENV} ${_PLIST_AWK_ENV} ${AWK} ${_PLIST_AWK} < ${.TARGET}-2mac > ${.TARGET}-3mag
265 ${RUN} ${PKGSRC_SETENV} ${_PLIST_AWK_ENV} ${AWK} ${_PLIST_SHLIB_AWK} < ${.TARGET}-3mag > ${.TARGET} 265 ${RUN} ${PKGSRC_SETENV} ${_PLIST_AWK_ENV} ${AWK} ${_PLIST_SHLIB_AWK} < ${.TARGET}-3mag > ${.TARGET}
266 266
267# for list of keywords see pkg_create(1) 267# for list of keywords see pkg_create(1)
268${_PLIST_NOKEYWORDS}: ${PLIST} 268${_PLIST_NOKEYWORDS}: ${PLIST}
269 ${RUN} ${AWK} < ${PLIST} > ${.TARGET} ' \ 269 ${RUN} ${AWK} < ${PLIST} > ${.TARGET} ' \
270 BEGIN { \ 270 BEGIN { \
271 FILTER="@("; \ 271 FILTER="@("; \
272 FILTER=FILTER"cd|cwd|src|exec|unexec|mode|option";\ 272 FILTER=FILTER"cd|cwd|src|exec|unexec|mode|option";\
273 FILTER=FILTER"|owner|group|comment|ignore"; \ 273 FILTER=FILTER"|owner|group|comment|ignore"; \
274 FILTER=FILTER"|ignore_inst|name|dirrm|mtree"; \ 274 FILTER=FILTER"|ignore_inst|name|dirrm|mtree"; \
275 FILTER=FILTER"|display|pkgdep|blddep|pkgcfl"; \ 275 FILTER=FILTER"|display|pkgdep|blddep|pkgcfl"; \
276 FILTER=FILTER")[[:space:]]"; \ 276 FILTER=FILTER")[[:space:]]"; \
277 }; \ 277 }; \
278 $$0 ~ FILTER { next }; \ 278 $$0 ~ FILTER { next }; \
279 { print }' 279 { print }'
280 280
281.if defined(INFO_FILES) 281.if defined(INFO_FILES)
282INFO_FILES_cmd= \ 282INFO_FILES_cmd= \
283 ${CAT} ${PLIST} | \ 283 ${CAT} ${PLIST} | \
284 ${PKGSRC_SETENV} ${_PLIST_AWK_ENV} ${AWK} ${_PLIST_INFO_AWK} | \ 284 ${PKGSRC_SETENV} ${_PLIST_AWK_ENV} ${AWK} ${_PLIST_INFO_AWK} | \
285 ${AWK} '($$0 !~ "-[0-9]*(\\.gz)?$$") { print }' 285 ${AWK} '($$0 !~ "-[0-9]*(\\.gz)?$$") { print }'
286.endif 286.endif
287 287
288ICON_THEMES_cmd= \ 288ICON_THEMES_cmd= \
289 ${CAT} ${PLIST} | \ 289 ${CAT} ${PLIST} | \
290 ${PKGSRC_SETENV} ${_PLIST_AWK_ENV} ${AWK} -F / \ 290 ${PKGSRC_SETENV} ${_PLIST_AWK_ENV} ${AWK} -F / \
291 '$$0 ~ "^share/icons/[^/]+/.*$$" { print $$3 }' | \ 291 '$$0 ~ "^share/icons/[^/]+/.*$$" { print $$3 }' | \
292 ${SORT} -u 292 ${SORT} -u
293 293
294###################################################################### 294######################################################################
295### plist-clean (PRIVATE) 295### plist-clean (PRIVATE)
296###################################################################### 296######################################################################
297### plist-clean removes the files for the "plist" 297### plist-clean removes the files for the "plist"
298### so that the "plist" target may be re-invoked. 298### so that the "plist" target may be re-invoked.
299### 299###
300.PHONY: plist-clean 300.PHONY: plist-clean
301plist-clean: 301plist-clean:
302 ${RUN} ${RM} -f ${PLIST} ${_PLIST_NOKEYWORDS} ${_DEPENDS_PLIST} 302 ${RUN} ${RM} -f ${PLIST} ${_PLIST_NOKEYWORDS} ${_DEPENDS_PLIST}