| @@ -1,802 +1,802 @@ | | | @@ -1,802 +1,802 @@ |
1 | # $NetBSD: bsd.pkg.mk,v 1.1980 2012/03/05 07:17:15 sbd Exp $ | | 1 | # $NetBSD: bsd.pkg.mk,v 1.1981 2012/05/24 11:34:15 abs Exp $ |
2 | # | | 2 | # |
3 | # This file is in the public domain. | | 3 | # This file is in the public domain. |
4 | # | | 4 | # |
5 | # Please see the pkgsrc/doc/guide manual for details on the | | 5 | # Please see the pkgsrc/doc/guide manual for details on the |
6 | # variables used in this make file template. | | 6 | # variables used in this make file template. |
7 | # | | 7 | # |
8 | # Default sequence for "all" is: | | 8 | # Default sequence for "all" is: |
9 | # | | 9 | # |
10 | # bootstrap-depends | | 10 | # bootstrap-depends |
11 | # fetch | | 11 | # fetch |
12 | # checksum | | 12 | # checksum |
13 | # depends | | 13 | # depends |
14 | # tools | | 14 | # tools |
15 | # extract | | 15 | # extract |
16 | # patch | | 16 | # patch |
17 | # wrapper | | 17 | # wrapper |
18 | # configure | | 18 | # configure |
19 | # build | | 19 | # build |
20 | # | | 20 | # |
21 | | | 21 | |
22 | .include "misc/common.mk" | | 22 | .include "misc/common.mk" |
23 | | | 23 | |
24 | ############################################################################ | | 24 | ############################################################################ |
25 | # Transform package Makefile variables and set defaults | | 25 | # Transform package Makefile variables and set defaults |
26 | # This is the early set used directly or indirectly in | | 26 | # This is the early set used directly or indirectly in |
27 | # the phase variables. | | 27 | # the phase variables. |
28 | ############################################################################ | | 28 | ############################################################################ |
29 | | | 29 | |
30 | ##### PKGBASE, PKGNAME[_NOREV], PKGVERSION | | 30 | ##### PKGBASE, PKGNAME[_NOREV], PKGVERSION |
31 | | | 31 | |
32 | PKGBASE?= ${PKGNAME:C/-[^-]*$//} | | 32 | PKGBASE?= ${PKGNAME:C/-[^-]*$//} |
33 | PKGVERSION?= ${PKGNAME:C/^.*-//} | | 33 | PKGVERSION?= ${PKGNAME:C/^.*-//} |
34 | .if defined(PKGREVISION) && !empty(PKGREVISION) && (${PKGREVISION} != "0") | | 34 | .if defined(PKGREVISION) && !empty(PKGREVISION) && (${PKGREVISION} != "0") |
35 | . if defined(PKGNAME) | | 35 | . if defined(PKGNAME) |
36 | PKGNAME_NOREV:= ${PKGNAME} | | 36 | PKGNAME_NOREV:= ${PKGNAME} |
37 | PKGNAME:= ${PKGNAME}nb${PKGREVISION} | | 37 | PKGNAME:= ${PKGNAME}nb${PKGREVISION} |
38 | . else | | 38 | . else |
39 | PKGNAME?= ${DISTNAME}nb${PKGREVISION} | | 39 | PKGNAME?= ${DISTNAME}nb${PKGREVISION} |
40 | PKGNAME_NOREV= ${DISTNAME} | | 40 | PKGNAME_NOREV= ${DISTNAME} |
41 | . endif | | 41 | . endif |
42 | .else | | 42 | .else |
43 | PKGNAME?= ${DISTNAME} | | 43 | PKGNAME?= ${DISTNAME} |
44 | PKGNAME_NOREV= ${PKGNAME} | | 44 | PKGNAME_NOREV= ${PKGNAME} |
45 | .endif | | 45 | .endif |
46 | PKGVERSION_NOREV= ${PKGNAME_NOREV:C/^.*-//} | | 46 | PKGVERSION_NOREV= ${PKGNAME_NOREV:C/^.*-//} |
47 | | | 47 | |
48 | # Fail-safe in the case of circular dependencies | | 48 | # Fail-safe in the case of circular dependencies |
49 | .if defined(_PKGSRC_DEPS) && defined(PKGNAME) && !empty(_PKGSRC_DEPS:M${PKGNAME}) | | 49 | .if defined(_PKGSRC_DEPS) && defined(PKGNAME) && !empty(_PKGSRC_DEPS:M${PKGNAME}) |
50 | PKG_FAIL_REASON+= "Circular dependency detected" | | 50 | PKG_FAIL_REASON+= "Circular dependency detected" |
51 | .endif | | 51 | .endif |
52 | | | 52 | |
53 | #### | | 53 | #### |
54 | | | 54 | |
55 | ############################################################################ | | 55 | ############################################################################ |
56 | # Allow various phases to define the default variables | | 56 | # Allow various phases to define the default variables |
57 | ############################################################################ | | 57 | ############################################################################ |
58 | .if defined(EMUL_PLATFORMS) && !empty(EMUL_PLATFORMS) | | 58 | .if defined(EMUL_PLATFORMS) && !empty(EMUL_PLATFORMS) |
59 | . include "emulator/emulator.mk" | | 59 | . include "emulator/emulator.mk" |
60 | .endif | | 60 | .endif |
61 | | | 61 | |
62 | .include "features/features.mk" | | 62 | .include "features/features.mk" |
63 | | | 63 | |
64 | .include "pkgformat/bsd.pkgformat-vars.mk" | | 64 | .include "pkgformat/bsd.pkgformat-vars.mk" |
65 | .include "check/bsd.check-vars.mk" | | 65 | .include "check/bsd.check-vars.mk" |
66 | .include "depends/bsd.depends-vars.mk" | | 66 | .include "depends/bsd.depends-vars.mk" |
67 | .include "fetch/bsd.fetch-vars.mk" | | 67 | .include "fetch/bsd.fetch-vars.mk" |
68 | .include "checksum/bsd.checksum-vars.mk" | | 68 | .include "checksum/bsd.checksum-vars.mk" |
69 | .include "extract/bsd.extract-vars.mk" | | 69 | .include "extract/bsd.extract-vars.mk" |
70 | .include "patch/bsd.patch-vars.mk" | | 70 | .include "patch/bsd.patch-vars.mk" |
71 | .include "configure/bsd.configure-vars.mk" | | 71 | .include "configure/bsd.configure-vars.mk" |
72 | .include "build/bsd.build-vars.mk" | | 72 | .include "build/bsd.build-vars.mk" |
73 | .include "install/bsd.install-vars.mk" | | 73 | .include "install/bsd.install-vars.mk" |
74 | | | 74 | |
75 | .include "bsd.pkg.error.mk" | | 75 | .include "bsd.pkg.error.mk" |
76 | | | 76 | |
77 | .include "bsd.hacks.mk" | | 77 | .include "bsd.hacks.mk" |
78 | | | 78 | |
79 | ############################################################################ | | 79 | ############################################################################ |
80 | # Transform package Makefile variables and set defaults | | 80 | # Transform package Makefile variables and set defaults |
81 | ############################################################################ | | 81 | ############################################################################ |
82 | | | 82 | |
83 | MKCRYPTO?= YES # build crypto packages by default | | 83 | MKCRYPTO?= YES # build crypto packages by default |
84 | | | 84 | |
85 | ##### Others | | 85 | ##### Others |
86 | | | 86 | |
87 | BUILD_DEPENDS?= # empty | | 87 | BUILD_DEPENDS?= # empty |
88 | COMMENT?= (no description) | | 88 | COMMENT?= (no description) |
89 | DEPENDS?= # empty | | 89 | DEPENDS?= # empty |
90 | DESCR_SRC?= ${PKGDIR}/DESCR | | 90 | DESCR_SRC?= ${PKGDIR}/DESCR |
91 | INTERACTIVE_STAGE?= none | | 91 | INTERACTIVE_STAGE?= none |
92 | .if defined(OWNER) | | 92 | .if defined(OWNER) |
93 | MAINTAINER=${OWNER} | | 93 | MAINTAINER=${OWNER} |
94 | .else | | 94 | .else |
95 | MAINTAINER?= pkgsrc-users@NetBSD.org | | 95 | MAINTAINER?= pkgsrc-users@NetBSD.org |
96 | .endif | | 96 | .endif |
97 | PKGWILDCARD?= ${PKGBASE}-[0-9]* | | 97 | PKGWILDCARD?= ${PKGBASE}-[0-9]* |
98 | SVR4_PKGNAME?= ${PKGNAME} | | 98 | SVR4_PKGNAME?= ${PKGNAME} |
99 | WRKSRC?= ${WRKDIR}/${DISTNAME} | | 99 | WRKSRC?= ${WRKDIR}/${DISTNAME} |
100 | | | 100 | |
101 | # Override for SU_CMD user check | | 101 | # Override for SU_CMD user check |
102 | _SU_ROOT_USER?= ${ROOT_USER} | | 102 | _SU_ROOT_USER?= ${ROOT_USER} |
103 | REAL_ROOT_USER?= ${ROOT_USER} | | 103 | REAL_ROOT_USER?= ${ROOT_USER} |
104 | REAL_ROOT_GROUP?= ${ROOT_GROUP} | | 104 | REAL_ROOT_GROUP?= ${ROOT_GROUP} |
105 | | | 105 | |
106 | .if (defined(INSTALL_UNSTRIPPED) && !empty(INSTALL_UNSTRIPPED:M[yY][eE][sS])) || defined(DEBUG_FLAGS) | | 106 | .if (defined(INSTALL_UNSTRIPPED) && !empty(INSTALL_UNSTRIPPED:M[yY][eE][sS])) || defined(DEBUG_FLAGS) |
107 | _INSTALL_UNSTRIPPED= # set (flag used by platform/*.mk) | | 107 | _INSTALL_UNSTRIPPED= # set (flag used by platform/*.mk) |
108 | .endif | | 108 | .endif |
109 | | | 109 | |
110 | ##### Transform USE_* into dependencies | | 110 | ##### Transform USE_* into dependencies |
111 | | | 111 | |
112 | .include "bsd.pkg.use.mk" | | 112 | .include "bsd.pkg.use.mk" |
113 | | | 113 | |
114 | ############################################################################ | | 114 | ############################################################################ |
115 | # Sanity checks | | 115 | # Sanity checks |
116 | ############################################################################ | | 116 | ############################################################################ |
117 | | | 117 | |
118 | .if defined(BUILDLINK_DEPTH) || defined(BUILDLINK_PACKAGES) || \ | | 118 | .if defined(BUILDLINK_DEPTH) || defined(BUILDLINK_PACKAGES) || \ |
119 | defined(BUILDLINK_DEPENDS) || defined(BUILDLINK_ORDER) | | 119 | defined(BUILDLINK_DEPENDS) || defined(BUILDLINK_ORDER) |
120 | PKG_FAIL_REASON+= "Out-dated buildlink3.mk detected, please update" | | 120 | PKG_FAIL_REASON+= "Out-dated buildlink3.mk detected, please update" |
121 | .endif | | 121 | .endif |
122 | | | 122 | |
123 | # PKG_INSTALLATION_TYPE can only be one of two values: "pkgviews" or | | 123 | # PKG_INSTALLATION_TYPE can only be one of two values: "pkgviews" or |
124 | # "overwrite". | | 124 | # "overwrite". |
125 | .if (${PKG_INSTALLATION_TYPE} != "pkgviews") && \ | | 125 | .if (${PKG_INSTALLATION_TYPE} != "pkgviews") && \ |
126 | (${PKG_INSTALLATION_TYPE} != "overwrite") | | 126 | (${PKG_INSTALLATION_TYPE} != "overwrite") |
127 | PKG_FAIL_REASON+= "PKG_INSTALLATION_TYPE must be \`\`pkgviews'' or \`\`overwrite''." | | 127 | PKG_FAIL_REASON+= "PKG_INSTALLATION_TYPE must be \`\`pkgviews'' or \`\`overwrite''." |
128 | .endif | | 128 | .endif |
129 | | | 129 | |
130 | .if empty(PKG_INSTALLATION_TYPES:M${PKG_INSTALLATION_TYPE}) | | 130 | .if empty(PKG_INSTALLATION_TYPES:M${PKG_INSTALLATION_TYPE}) |
131 | PKG_FAIL_REASON+= "This package doesn't support PKG_INSTALLATION_TYPE=${PKG_INSTALLATION_TYPE}." | | 131 | PKG_FAIL_REASON+= "This package doesn't support PKG_INSTALLATION_TYPE=${PKG_INSTALLATION_TYPE}." |
132 | .endif | | 132 | .endif |
133 | | | 133 | |
134 | .if !defined(CATEGORIES) || !defined(DISTNAME) | | 134 | .if !defined(CATEGORIES) || !defined(DISTNAME) |
135 | PKG_FAIL_REASON+='CATEGORIES and DISTNAME are mandatory.' | | 135 | PKG_FAIL_REASON+='CATEGORIES and DISTNAME are mandatory.' |
136 | .endif | | 136 | .endif |
137 | | | 137 | |
138 | .if defined(PKG_PATH) | | 138 | .if defined(PKG_PATH) |
139 | PKG_FAIL_REASON+='Please unset PKG_PATH before doing pkgsrc work!' | | 139 | PKG_FAIL_REASON+='Please unset PKG_PATH before doing pkgsrc work!' |
140 | .endif | | 140 | .endif |
141 | | | 141 | |
142 | # Allow variables to be set on a per-OS basis | | 142 | # Allow variables to be set on a per-OS basis |
143 | OPSYSVARS+= CFLAGS CXXFLAGS CPPFLAGS LDFLAGS LIBS | | 143 | OPSYSVARS+= CFLAGS CXXFLAGS CPPFLAGS LDFLAGS LIBS |
144 | .for _var_ in ${OPSYSVARS:O} | | 144 | .for _var_ in ${OPSYSVARS:O} |
145 | . if defined(${_var_}.${OPSYS}) | | 145 | . if defined(${_var_}.${OPSYS}) |
146 | ${_var_}+= ${${_var_}.${OPSYS}} | | 146 | ${_var_}+= ${${_var_}.${OPSYS}} |
147 | . elif defined(${_var_}.*) | | 147 | . elif defined(${_var_}.*) |
148 | ${_var_}+= ${${_var_}.*} | | 148 | ${_var_}+= ${${_var_}.*} |
149 | . endif | | 149 | . endif |
150 | .endfor | | 150 | .endfor |
151 | | | 151 | |
152 | CPPFLAGS+= ${CPP_PRECOMP_FLAGS} | | 152 | CPPFLAGS+= ${CPP_PRECOMP_FLAGS} |
153 | | | 153 | |
154 | # To sanitise environment set PKGSRC_SETENV=${SETENV} -i | | 154 | # To sanitise environment set PKGSRC_SETENV=${SETENV} -i |
155 | PKGSRC_SETENV= ${SETENV} | | 155 | PKGSRC_SETENV?= ${SETENV} |
156 | | | 156 | |
157 | ALL_ENV+= CC=${CC:Q} | | 157 | ALL_ENV+= CC=${CC:Q} |
158 | ALL_ENV+= CFLAGS=${CFLAGS:M*:Q} | | 158 | ALL_ENV+= CFLAGS=${CFLAGS:M*:Q} |
159 | ALL_ENV+= CPPFLAGS=${CPPFLAGS:M*:Q} | | 159 | ALL_ENV+= CPPFLAGS=${CPPFLAGS:M*:Q} |
160 | ALL_ENV+= CXX=${CXX:Q} | | 160 | ALL_ENV+= CXX=${CXX:Q} |
161 | ALL_ENV+= CXXFLAGS=${CXXFLAGS:M*:Q} | | 161 | ALL_ENV+= CXXFLAGS=${CXXFLAGS:M*:Q} |
162 | ALL_ENV+= COMPILER_RPATH_FLAG=${COMPILER_RPATH_FLAG:Q} | | 162 | ALL_ENV+= COMPILER_RPATH_FLAG=${COMPILER_RPATH_FLAG:Q} |
163 | ALL_ENV+= F77=${FC:Q} | | 163 | ALL_ENV+= F77=${FC:Q} |
164 | ALL_ENV+= FC=${FC:Q} | | 164 | ALL_ENV+= FC=${FC:Q} |
165 | ALL_ENV+= FFLAGS=${FFLAGS:M*:Q} | | 165 | ALL_ENV+= FFLAGS=${FFLAGS:M*:Q} |
166 | ALL_ENV+= LANG=C | | 166 | ALL_ENV+= LANG=C |
167 | ALL_ENV+= LC_COLLATE=C | | 167 | ALL_ENV+= LC_COLLATE=C |
168 | ALL_ENV+= LC_CTYPE=C | | 168 | ALL_ENV+= LC_CTYPE=C |
169 | ALL_ENV+= LC_MESSAGES=C | | 169 | ALL_ENV+= LC_MESSAGES=C |
170 | ALL_ENV+= LC_MONETARY=C | | 170 | ALL_ENV+= LC_MONETARY=C |
171 | ALL_ENV+= LC_NUMERIC=C | | 171 | ALL_ENV+= LC_NUMERIC=C |
172 | ALL_ENV+= LC_TIME=C | | 172 | ALL_ENV+= LC_TIME=C |
173 | ALL_ENV+= LDFLAGS=${LDFLAGS:M*:Q} | | 173 | ALL_ENV+= LDFLAGS=${LDFLAGS:M*:Q} |
174 | ALL_ENV+= LINKER_RPATH_FLAG=${LINKER_RPATH_FLAG:Q} | | 174 | ALL_ENV+= LINKER_RPATH_FLAG=${LINKER_RPATH_FLAG:Q} |
175 | ALL_ENV+= PATH=${PATH:Q}:${LOCALBASE}/bin:${X11BASE}/bin | | 175 | ALL_ENV+= PATH=${PATH:Q}:${LOCALBASE}/bin:${X11BASE}/bin |
176 | ALL_ENV+= PREFIX=${PREFIX} | | 176 | ALL_ENV+= PREFIX=${PREFIX} |
177 | | | 177 | |
178 | # This variable can be added to MAKE_ENV to ease installation of packages | | 178 | # This variable can be added to MAKE_ENV to ease installation of packages |
179 | # that use BSD-style Makefiles. | | 179 | # that use BSD-style Makefiles. |
180 | BSD_MAKE_ENV= BINOWN=${BINOWN} BINGRP=${BINGRP} | | 180 | BSD_MAKE_ENV= BINOWN=${BINOWN} BINGRP=${BINGRP} |
181 | BSD_MAKE_ENV+= GAMEOWN=${GAMEOWN} GAMEGRP=${GAMEGRP} | | 181 | BSD_MAKE_ENV+= GAMEOWN=${GAMEOWN} GAMEGRP=${GAMEGRP} |
182 | BSD_MAKE_ENV+= MANOWN=${MANOWN} MANGRP=${MANGRP} | | 182 | BSD_MAKE_ENV+= MANOWN=${MANOWN} MANGRP=${MANGRP} |
183 | BSD_MAKE_ENV+= SHAREOWN=${SHAREOWN} SHAREGRP=${SHAREGRP} | | 183 | BSD_MAKE_ENV+= SHAREOWN=${SHAREOWN} SHAREGRP=${SHAREGRP} |
184 | BSD_MAKE_ENV+= DOCOWN=${DOCOWN} DOCGRP=${DOCGRP} | | 184 | BSD_MAKE_ENV+= DOCOWN=${DOCOWN} DOCGRP=${DOCGRP} |
185 | BSD_MAKE_ENV+= BINMODE=${BINMODE} NONBINMODE=${NONBINMODE} | | 185 | BSD_MAKE_ENV+= BINMODE=${BINMODE} NONBINMODE=${NONBINMODE} |
186 | BSD_MAKE_ENV+= BINDIR=${PREFIX}/bin | | 186 | BSD_MAKE_ENV+= BINDIR=${PREFIX}/bin |
187 | BSD_MAKE_ENV+= INCSDIR=${PREFIX}/include | | 187 | BSD_MAKE_ENV+= INCSDIR=${PREFIX}/include |
188 | BSD_MAKE_ENV+= LIBDIR=${PREFIX}/lib | | 188 | BSD_MAKE_ENV+= LIBDIR=${PREFIX}/lib |
189 | BSD_MAKE_ENV+= MANDIR=${PREFIX}/${PKGMANDIR} | | 189 | BSD_MAKE_ENV+= MANDIR=${PREFIX}/${PKGMANDIR} |
190 | BSD_MAKE_ENV+= STRIPFLAG=${_STRIPFLAG_INSTALL:Q} | | 190 | BSD_MAKE_ENV+= STRIPFLAG=${_STRIPFLAG_INSTALL:Q} |
191 | BSD_MAKE_ENV+= MANINSTALL=${MANINSTALL:Q} | | 191 | BSD_MAKE_ENV+= MANINSTALL=${MANINSTALL:Q} |
192 | BSD_MAKE_ENV+= MKCATPAGES=${MKCATPAGES:Q} | | 192 | BSD_MAKE_ENV+= MKCATPAGES=${MKCATPAGES:Q} |
193 | BSD_MAKE_ENV+= MKHTML=no | | 193 | BSD_MAKE_ENV+= MKHTML=no |
194 | | | 194 | |
195 | _BUILD_DEFS= ${BUILD_DEFS} | | 195 | _BUILD_DEFS= ${BUILD_DEFS} |
196 | _BUILD_DEFS+= LOCALBASE | | 196 | _BUILD_DEFS+= LOCALBASE |
197 | _BUILD_DEFS+= PKGINFODIR | | 197 | _BUILD_DEFS+= PKGINFODIR |
198 | _BUILD_DEFS+= PKGMANDIR | | 198 | _BUILD_DEFS+= PKGMANDIR |
199 | _BUILD_DEFS+= _USE_DESTDIR | | 199 | _BUILD_DEFS+= _USE_DESTDIR |
200 | | | 200 | |
201 | # Store the result in the +BUILD_INFO file so we can query for the build | | 201 | # Store the result in the +BUILD_INFO file so we can query for the build |
202 | # options using "pkg_info -Q PKG_OPTIONS <pkg>". | | 202 | # options using "pkg_info -Q PKG_OPTIONS <pkg>". |
203 | # | | 203 | # |
204 | .if defined(PKG_SUPPORTED_OPTIONS) && defined(PKG_OPTIONS) | | 204 | .if defined(PKG_SUPPORTED_OPTIONS) && defined(PKG_OPTIONS) |
205 | _BUILD_DEFS+= PKG_OPTIONS | | 205 | _BUILD_DEFS+= PKG_OPTIONS |
206 | .endif | | 206 | .endif |
207 | | | 207 | |
208 | .if empty(DEPOT_SUBDIR) | | 208 | .if empty(DEPOT_SUBDIR) |
209 | PKG_FAIL_REASON+= "DEPOT_SUBDIR may not be empty." | | 209 | PKG_FAIL_REASON+= "DEPOT_SUBDIR may not be empty." |
210 | .endif | | 210 | .endif |
211 | | | 211 | |
212 | # Store the build options for multi-packages, i.e. packages that can | | 212 | # Store the build options for multi-packages, i.e. packages that can |
213 | # be built with multiple versions of Apache, Python, Ruby, PHP etc. | | 213 | # be built with multiple versions of Apache, Python, Ruby, PHP etc. |
214 | # | | 214 | # |
215 | .if defined(MULTI) | | 215 | .if defined(MULTI) |
216 | _BUILD_DEFS+= MULTI | | 216 | _BUILD_DEFS+= MULTI |
217 | .endif | | 217 | .endif |
218 | | | 218 | |
219 | # ZERO_FILESIZE_P exits with a successful return code if the given file | | 219 | # ZERO_FILESIZE_P exits with a successful return code if the given file |
220 | # has zero length. | | 220 | # has zero length. |
221 | # NONZERO_FILESIZE_P exits with a successful return code if the given file | | 221 | # NONZERO_FILESIZE_P exits with a successful return code if the given file |
222 | # has nonzero length. | | 222 | # has nonzero length. |
223 | # | | 223 | # |
224 | _ZERO_FILESIZE_P= ${AWK} 'END { exit (NR > 0) ? 1 : 0; }' | | 224 | _ZERO_FILESIZE_P= ${AWK} 'END { exit (NR > 0) ? 1 : 0; }' |
225 | _NONZERO_FILESIZE_P= ${AWK} 'END { exit (NR > 0) ? 0 : 1; }' | | 225 | _NONZERO_FILESIZE_P= ${AWK} 'END { exit (NR > 0) ? 0 : 1; }' |
226 | | | 226 | |
227 | # Automatically increase process limit where necessary for building. | | 227 | # Automatically increase process limit where necessary for building. |
228 | _ULIMIT_CMD= ${UNLIMIT_RESOURCES:@_lim_@${ULIMIT_CMD_${_lim_}};@} | | 228 | _ULIMIT_CMD= ${UNLIMIT_RESOURCES:@_lim_@${ULIMIT_CMD_${_lim_}};@} |
229 | | | 229 | |
230 | _NULL_COOKIE= ${WRKDIR}/.null | | 230 | _NULL_COOKIE= ${WRKDIR}/.null |
231 | | | 231 | |
232 | # Miscellaneous overridable commands: | | 232 | # Miscellaneous overridable commands: |
233 | SHCOMMENT?= ${ECHO_MSG} >/dev/null '***' | | 233 | SHCOMMENT?= ${ECHO_MSG} >/dev/null '***' |
234 | | | 234 | |
235 | LIBABISUFFIX?= | | 235 | LIBABISUFFIX?= |
236 | | | 236 | |
237 | TOUCH_FLAGS?= -f | | 237 | TOUCH_FLAGS?= -f |
238 | | | 238 | |
239 | # A few aliases for *-install targets | | 239 | # A few aliases for *-install targets |
240 | INSTALL= ${TOOLS_INSTALL} # XXX override sys.mk | | 240 | INSTALL= ${TOOLS_INSTALL} # XXX override sys.mk |
241 | INSTALL_PROGRAM?= \ | | 241 | INSTALL_PROGRAM?= \ |
242 | ${INSTALL} ${COPY} ${_STRIPFLAG_INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} | | 242 | ${INSTALL} ${COPY} ${_STRIPFLAG_INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} |
243 | INSTALL_GAME?= \ | | 243 | INSTALL_GAME?= \ |
244 | ${INSTALL} ${COPY} ${_STRIPFLAG_INSTALL} -o ${GAMEOWN} -g ${GAMEGRP} -m ${GAMEMODE} | | 244 | ${INSTALL} ${COPY} ${_STRIPFLAG_INSTALL} -o ${GAMEOWN} -g ${GAMEGRP} -m ${GAMEMODE} |
245 | INSTALL_SCRIPT?= \ | | 245 | INSTALL_SCRIPT?= \ |
246 | ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} | | 246 | ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} |
247 | INSTALL_LIB?= \ | | 247 | INSTALL_LIB?= \ |
248 | ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} | | 248 | ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} |
249 | INSTALL_DATA?= \ | | 249 | INSTALL_DATA?= \ |
250 | ${INSTALL} ${COPY} -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE} | | 250 | ${INSTALL} ${COPY} -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE} |
251 | INSTALL_GAME_DATA?= \ | | 251 | INSTALL_GAME_DATA?= \ |
252 | ${INSTALL} ${COPY} -o ${GAMEOWN} -g ${GAMEGRP} -m ${GAMEDATAMODE} | | 252 | ${INSTALL} ${COPY} -o ${GAMEOWN} -g ${GAMEGRP} -m ${GAMEDATAMODE} |
253 | INSTALL_MAN?= \ | | 253 | INSTALL_MAN?= \ |
254 | ${INSTALL} ${COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} | | 254 | ${INSTALL} ${COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} |
255 | INSTALL_PROGRAM_DIR?= \ | | 255 | INSTALL_PROGRAM_DIR?= \ |
256 | ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m ${PKGDIRMODE} | | 256 | ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m ${PKGDIRMODE} |
257 | INSTALL_GAME_DIR?= \ | | 257 | INSTALL_GAME_DIR?= \ |
258 | ${INSTALL} -d -o ${GAMEOWN} -g ${GAMEGRP} -m ${GAMEDIRMODE} | | 258 | ${INSTALL} -d -o ${GAMEOWN} -g ${GAMEGRP} -m ${GAMEDIRMODE} |
259 | INSTALL_SCRIPT_DIR?= \ | | 259 | INSTALL_SCRIPT_DIR?= \ |
260 | ${INSTALL_PROGRAM_DIR} | | 260 | ${INSTALL_PROGRAM_DIR} |
261 | INSTALL_LIB_DIR?= \ | | 261 | INSTALL_LIB_DIR?= \ |
262 | ${INSTALL_PROGRAM_DIR} | | 262 | ${INSTALL_PROGRAM_DIR} |
263 | INSTALL_DATA_DIR?= \ | | 263 | INSTALL_DATA_DIR?= \ |
264 | ${INSTALL} -d -o ${SHAREOWN} -g ${SHAREGRP} -m ${PKGDIRMODE} | | 264 | ${INSTALL} -d -o ${SHAREOWN} -g ${SHAREGRP} -m ${PKGDIRMODE} |
265 | INSTALL_MAN_DIR?= \ | | 265 | INSTALL_MAN_DIR?= \ |
266 | ${INSTALL} -d -o ${MANOWN} -g ${MANGRP} -m ${PKGDIRMODE} | | 266 | ${INSTALL} -d -o ${MANOWN} -g ${MANGRP} -m ${PKGDIRMODE} |
267 | | | 267 | |
268 | INSTALL_MACROS= BSD_INSTALL_PROGRAM=${INSTALL_PROGRAM:Q} \ | | 268 | INSTALL_MACROS= BSD_INSTALL_PROGRAM=${INSTALL_PROGRAM:Q} \ |
269 | BSD_INSTALL_SCRIPT=${INSTALL_SCRIPT:Q} \ | | 269 | BSD_INSTALL_SCRIPT=${INSTALL_SCRIPT:Q} \ |
270 | BSD_INSTALL_LIB=${INSTALL_LIB:Q} \ | | 270 | BSD_INSTALL_LIB=${INSTALL_LIB:Q} \ |
271 | BSD_INSTALL_DATA=${INSTALL_DATA:Q} \ | | 271 | BSD_INSTALL_DATA=${INSTALL_DATA:Q} \ |
272 | BSD_INSTALL_MAN=${INSTALL_MAN:Q} \ | | 272 | BSD_INSTALL_MAN=${INSTALL_MAN:Q} \ |
273 | BSD_INSTALL=${INSTALL:Q} \ | | 273 | BSD_INSTALL=${INSTALL:Q} \ |
274 | BSD_INSTALL_PROGRAM_DIR=${INSTALL_PROGRAM_DIR:Q} \ | | 274 | BSD_INSTALL_PROGRAM_DIR=${INSTALL_PROGRAM_DIR:Q} \ |
275 | BSD_INSTALL_SCRIPT_DIR=${INSTALL_SCRIPT_DIR:Q} \ | | 275 | BSD_INSTALL_SCRIPT_DIR=${INSTALL_SCRIPT_DIR:Q} \ |
276 | BSD_INSTALL_LIB_DIR=${INSTALL_LIB_DIR:Q} \ | | 276 | BSD_INSTALL_LIB_DIR=${INSTALL_LIB_DIR:Q} \ |
277 | BSD_INSTALL_DATA_DIR=${INSTALL_DATA_DIR:Q} \ | | 277 | BSD_INSTALL_DATA_DIR=${INSTALL_DATA_DIR:Q} \ |
278 | BSD_INSTALL_MAN_DIR=${INSTALL_MAN_DIR:Q} \ | | 278 | BSD_INSTALL_MAN_DIR=${INSTALL_MAN_DIR:Q} \ |
279 | BSD_INSTALL_GAME=${INSTALL_GAME:Q} \ | | 279 | BSD_INSTALL_GAME=${INSTALL_GAME:Q} \ |
280 | BSD_INSTALL_GAME_DATA=${INSTALL_GAME_DATA:Q} \ | | 280 | BSD_INSTALL_GAME_DATA=${INSTALL_GAME_DATA:Q} \ |
281 | BSD_INSTALL_GAME_DIR=${INSTALL_GAME_DIR:Q} | | 281 | BSD_INSTALL_GAME_DIR=${INSTALL_GAME_DIR:Q} |
282 | MAKE_ENV+= ${INSTALL_MACROS:M*} | | 282 | MAKE_ENV+= ${INSTALL_MACROS:M*} |
283 | SCRIPTS_ENV+= ${INSTALL_MACROS:M*} | | 283 | SCRIPTS_ENV+= ${INSTALL_MACROS:M*} |
284 | | | 284 | |
285 | # If pkgsrc is supposed to ensure that tests are run before installation | | 285 | # If pkgsrc is supposed to ensure that tests are run before installation |
286 | # of the package, then the build targets should be "build test", otherwise | | 286 | # of the package, then the build targets should be "build test", otherwise |
287 | # just "build" suffices. | | 287 | # just "build" suffices. |
288 | # | | 288 | # |
289 | .if !empty(PKGSRC_RUN_TEST:M[yY][eE][sS]) | | 289 | .if !empty(PKGSRC_RUN_TEST:M[yY][eE][sS]) |
290 | _PKGSRC_BUILD_TARGETS= build test | | 290 | _PKGSRC_BUILD_TARGETS= build test |
291 | .else | | 291 | .else |
292 | _PKGSRC_BUILD_TARGETS= build | | 292 | _PKGSRC_BUILD_TARGETS= build |
293 | .endif | | 293 | .endif |
294 | | | 294 | |
295 | # OVERRIDE_DIRDEPTH represents the common directory depth under | | 295 | # OVERRIDE_DIRDEPTH represents the common directory depth under |
296 | # ${WRKSRC} up to which we find the files that need to be | | 296 | # ${WRKSRC} up to which we find the files that need to be |
297 | # overridden. By default, we search two levels down, i.e., | | 297 | # overridden. By default, we search two levels down, i.e., |
298 | # */*/file. | | 298 | # */*/file. |
299 | # | | 299 | # |
300 | OVERRIDE_DIRDEPTH?= 2 | | 300 | OVERRIDE_DIRDEPTH?= 2 |
301 | | | 301 | |
302 | # Handle alternatives | | 302 | # Handle alternatives |
303 | # | | 303 | # |
304 | .include "alternatives.mk" | | 304 | .include "alternatives.mk" |
305 | | | 305 | |
306 | # Define SMART_MESSAGES in /etc/mk.conf for messages giving the tree | | 306 | # Define SMART_MESSAGES in /etc/mk.conf for messages giving the tree |
307 | # of dependencies for building, and the current target. | | 307 | # of dependencies for building, and the current target. |
308 | _PKGSRC_IN?= ===${SMART_MESSAGES:D> ${.TARGET} [${PKGNAME}${_PKGSRC_DEPS}] ===} | | 308 | _PKGSRC_IN?= ===${SMART_MESSAGES:D> ${.TARGET} [${PKGNAME}${_PKGSRC_DEPS}] ===} |
309 | | | 309 | |
310 | # Used to print all the '===>' style prompts - override this to turn them off. | | 310 | # Used to print all the '===>' style prompts - override this to turn them off. |
311 | ECHO_MSG?= ${ECHO} | | 311 | ECHO_MSG?= ${ECHO} |
312 | PHASE_MSG?= ${ECHO_MSG} ${_PKGSRC_IN:Q}\> | | 312 | PHASE_MSG?= ${ECHO_MSG} ${_PKGSRC_IN:Q}\> |
313 | STEP_MSG?= ${ECHO_MSG} "=>" | | 313 | STEP_MSG?= ${ECHO_MSG} "=>" |
314 | INFO_MSG?= ${ECHO_MSG} "INFO:" | | 314 | INFO_MSG?= ${ECHO_MSG} "INFO:" |
315 | WARNING_MSG?= ${ECHO_MSG} 1>&2 "WARNING:" | | 315 | WARNING_MSG?= ${ECHO_MSG} 1>&2 "WARNING:" |
316 | ERROR_MSG?= ${ECHO_MSG} 1>&2 "ERROR:" | | 316 | ERROR_MSG?= ${ECHO_MSG} 1>&2 "ERROR:" |
317 | FAIL_MSG?= ${FAIL} ${ERROR_MSG} | | 317 | FAIL_MSG?= ${FAIL} ${ERROR_MSG} |
318 | | | 318 | |
319 | WARNING_CAT?= ${SED} -e "s|^|WARNING: |" 1>&2 | | 319 | WARNING_CAT?= ${SED} -e "s|^|WARNING: |" 1>&2 |
320 | ERROR_CAT?= ${SED} -e "s|^|ERROR: |" 1>&2 | | 320 | ERROR_CAT?= ${SED} -e "s|^|ERROR: |" 1>&2 |
321 | | | 321 | |
322 | # How to do nothing. Override if you, for some strange reason, would rather | | 322 | # How to do nothing. Override if you, for some strange reason, would rather |
323 | # do something. | | 323 | # do something. |
324 | DO_NADA?= ${TRUE} | | 324 | DO_NADA?= ${TRUE} |
325 | | | 325 | |
326 | # the FAIL command executes its arguments and then exits with a non-zero | | 326 | # the FAIL command executes its arguments and then exits with a non-zero |
327 | # status. | | 327 | # status. |
328 | FAIL?= ${SH} ${PKGSRCDIR}/mk/scripts/fail | | 328 | FAIL?= ${SH} ${PKGSRCDIR}/mk/scripts/fail |
329 | | | 329 | |
330 | # | | 330 | # |
331 | # Config file related settings - see doc/pkgsrc.txt | | 331 | # Config file related settings - see doc/pkgsrc.txt |
332 | # | | 332 | # |
333 | PKG_SYSCONFVAR?= ${PKGBASE} | | 333 | PKG_SYSCONFVAR?= ${PKGBASE} |
334 | PKG_SYSCONFSUBDIR?= # empty | | 334 | PKG_SYSCONFSUBDIR?= # empty |
335 | .if ${PKG_INSTALLATION_TYPE} == "overwrite" | | 335 | .if ${PKG_INSTALLATION_TYPE} == "overwrite" |
336 | PKG_SYSCONFDEPOTBASE= # empty | | 336 | PKG_SYSCONFDEPOTBASE= # empty |
337 | PKG_SYSCONFBASEDIR= ${PKG_SYSCONFBASE} | | 337 | PKG_SYSCONFBASEDIR= ${PKG_SYSCONFBASE} |
338 | .else | | 338 | .else |
339 | . if !empty(PKG_SYSCONFBASE:M${PREFIX}) || \ | | 339 | . if !empty(PKG_SYSCONFBASE:M${PREFIX}) || \ |
340 | !empty(PKG_SYSCONFBASE:M${PREFIX}/*) | | 340 | !empty(PKG_SYSCONFBASE:M${PREFIX}/*) |
341 | PKG_SYSCONFDEPOTBASE= # empty | | 341 | PKG_SYSCONFDEPOTBASE= # empty |
342 | PKG_SYSCONFBASEDIR= ${PKG_SYSCONFBASE} | | 342 | PKG_SYSCONFBASEDIR= ${PKG_SYSCONFBASE} |
343 | . else | | 343 | . else |
344 | PKG_SYSCONFDEPOTBASE= ${PKG_SYSCONFBASE}/${DEPOT_SUBDIR} | | 344 | PKG_SYSCONFDEPOTBASE= ${PKG_SYSCONFBASE}/${DEPOT_SUBDIR} |
345 | PKG_SYSCONFBASEDIR= ${PKG_SYSCONFDEPOTBASE}/${PKGNAME} | | 345 | PKG_SYSCONFBASEDIR= ${PKG_SYSCONFDEPOTBASE}/${PKGNAME} |
346 | . endif | | 346 | . endif |
347 | .endif | | 347 | .endif |
348 | .if empty(PKG_SYSCONFSUBDIR) | | 348 | .if empty(PKG_SYSCONFSUBDIR) |
349 | DFLT_PKG_SYSCONFDIR:= ${PKG_SYSCONFBASEDIR} | | 349 | DFLT_PKG_SYSCONFDIR:= ${PKG_SYSCONFBASEDIR} |
350 | .else | | 350 | .else |
351 | DFLT_PKG_SYSCONFDIR:= ${PKG_SYSCONFBASEDIR}/${PKG_SYSCONFSUBDIR} | | 351 | DFLT_PKG_SYSCONFDIR:= ${PKG_SYSCONFBASEDIR}/${PKG_SYSCONFSUBDIR} |
352 | .endif | | 352 | .endif |
353 | PKG_SYSCONFDIR= ${DFLT_PKG_SYSCONFDIR} | | 353 | PKG_SYSCONFDIR= ${DFLT_PKG_SYSCONFDIR} |
354 | .if defined(PKG_SYSCONFDIR.${PKG_SYSCONFVAR}) | | 354 | .if defined(PKG_SYSCONFDIR.${PKG_SYSCONFVAR}) |
355 | PKG_SYSCONFDIR= ${PKG_SYSCONFDIR.${PKG_SYSCONFVAR}} | | 355 | PKG_SYSCONFDIR= ${PKG_SYSCONFDIR.${PKG_SYSCONFVAR}} |
356 | PKG_SYSCONFBASEDIR= ${PKG_SYSCONFDIR.${PKG_SYSCONFVAR}} | | 356 | PKG_SYSCONFBASEDIR= ${PKG_SYSCONFDIR.${PKG_SYSCONFVAR}} |
357 | PKG_SYSCONFDEPOTBASE= # empty | | 357 | PKG_SYSCONFDEPOTBASE= # empty |
358 | .endif | | 358 | .endif |
359 | PKG_SYSCONFDIR_PERMS?= ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 755 | | 359 | PKG_SYSCONFDIR_PERMS?= ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 755 |
360 | | | 360 | |
361 | ALL_ENV+= PKG_SYSCONFDIR=${PKG_SYSCONFDIR:Q} | | 361 | ALL_ENV+= PKG_SYSCONFDIR=${PKG_SYSCONFDIR:Q} |
362 | _BUILD_DEFS+= PKG_SYSCONFBASEDIR PKG_SYSCONFDIR | | 362 | _BUILD_DEFS+= PKG_SYSCONFBASEDIR PKG_SYSCONFDIR |
363 | | | 363 | |
364 | # These are all of the tools use by pkgsrc Makefiles. This should | | 364 | # These are all of the tools use by pkgsrc Makefiles. This should |
365 | # eventually be split up into lists of tools required by different | | 365 | # eventually be split up into lists of tools required by different |
366 | # phases of a pkgsrc build. | | 366 | # phases of a pkgsrc build. |
367 | # | | 367 | # |
368 | USE_TOOLS+= \ | | 368 | USE_TOOLS+= \ |
369 | [ awk basename cat chgrp chmod chown cmp cp cut dirname echo \ | | 369 | [ awk basename cat chgrp chmod chown cmp cp cut dirname echo \ |
370 | egrep env false file find grep head hostname id install ln ls \ | | 370 | egrep env false file find grep head hostname id install ln ls \ |
371 | mkdir mv printf pwd rm rmdir sed sh sort \ | | 371 | mkdir mv printf pwd rm rmdir sed sh sort \ |
372 | tail test touch tr true wc xargs | | 372 | tail test touch tr true wc xargs |
373 | | | 373 | |
374 | # bsd.wrapper.mk | | 374 | # bsd.wrapper.mk |
375 | USE_TOOLS+= expr | | 375 | USE_TOOLS+= expr |
376 | | | 376 | |
377 | # bsd.bulk-pkg.mk uses certain tools | | 377 | # bsd.bulk-pkg.mk uses certain tools |
378 | .if defined(BATCH) | | 378 | .if defined(BATCH) |
379 | USE_TOOLS+= tee tsort | | 379 | USE_TOOLS+= tee tsort |
380 | .endif | | 380 | .endif |
381 | | | 381 | |
382 | # INSTALL/DEINSTALL script framework | | 382 | # INSTALL/DEINSTALL script framework |
383 | .include "pkginstall/bsd.pkginstall.mk" | | 383 | .include "pkginstall/bsd.pkginstall.mk" |
384 | | | 384 | |
385 | # Locking | | 385 | # Locking |
386 | .include "internal/locking.mk" | | 386 | .include "internal/locking.mk" |
387 | | | 387 | |
388 | # Tools | | 388 | # Tools |
389 | .include "tools/bsd.tools.mk" | | 389 | .include "tools/bsd.tools.mk" |
390 | | | 390 | |
391 | # Barrier | | 391 | # Barrier |
392 | .include "bsd.pkg.barrier.mk" | | 392 | .include "bsd.pkg.barrier.mk" |
393 | | | 393 | |
394 | # Unprivileged builds | | 394 | # Unprivileged builds |
395 | .include "unprivileged.mk" | | 395 | .include "unprivileged.mk" |
396 | | | 396 | |
397 | # If NO_BUILD is defined, default to not needing a compiler. | | 397 | # If NO_BUILD is defined, default to not needing a compiler. |
398 | .if defined(NO_BUILD) | | 398 | .if defined(NO_BUILD) |
399 | USE_LANGUAGES?= # empty | | 399 | USE_LANGUAGES?= # empty |
400 | .endif | | 400 | .endif |
401 | | | 401 | |
402 | # Get the proper dependencies and set the PATH to use the compiler | | 402 | # Get the proper dependencies and set the PATH to use the compiler |
403 | # named in PKGSRC_COMPILER. | | 403 | # named in PKGSRC_COMPILER. |
404 | # | | 404 | # |
405 | .include "compiler.mk" | | 405 | .include "compiler.mk" |
406 | | | 406 | |
407 | #Fake up a home directory | | 407 | #Fake up a home directory |
408 | WRAPPER_TARGETS+= fake-home | | 408 | WRAPPER_TARGETS+= fake-home |
409 | FAKEHOMEDIR= ${WRKDIR}/.home | | 409 | FAKEHOMEDIR= ${WRKDIR}/.home |
410 | ALL_ENV+= HOME=${FAKEHOMEDIR} | | 410 | ALL_ENV+= HOME=${FAKEHOMEDIR} |
411 | .PHONY: fake-home | | 411 | .PHONY: fake-home |
412 | fake-home: ${FAKEHOMEDIR} | | 412 | fake-home: ${FAKEHOMEDIR} |
413 | ${FAKEHOMEDIR}: | | 413 | ${FAKEHOMEDIR}: |
414 | ${RUN} ${MKDIR} ${.TARGET} | | 414 | ${RUN} ${MKDIR} ${.TARGET} |
415 | | | 415 | |
416 | .include "wrapper/bsd.wrapper.mk" | | 416 | .include "wrapper/bsd.wrapper.mk" |
417 | | | 417 | |
418 | .if defined(ABI_DEPENDS) || defined(BUILD_ABI_DEPENDS) | | 418 | .if defined(ABI_DEPENDS) || defined(BUILD_ABI_DEPENDS) |
419 | . if !empty(USE_ABI_DEPENDS:M[yY][eE][sS]) | | 419 | . if !empty(USE_ABI_DEPENDS:M[yY][eE][sS]) |
420 | DEPENDS+= ${ABI_DEPENDS} | | 420 | DEPENDS+= ${ABI_DEPENDS} |
421 | BUILD_DEPENDS+= ${BUILD_ABI_DEPENDS} | | 421 | BUILD_DEPENDS+= ${BUILD_ABI_DEPENDS} |
422 | . else | | 422 | . else |
423 | _BUILD_DEFS+= USE_ABI_DEPENDS | | 423 | _BUILD_DEFS+= USE_ABI_DEPENDS |
424 | . endif | | 424 | . endif |
425 | .endif | | 425 | .endif |
426 | | | 426 | |
427 | # Find out the PREFIX of dependencies where the PREFIX is needed at build time. | | 427 | # Find out the PREFIX of dependencies where the PREFIX is needed at build time. |
428 | .if defined(EVAL_PREFIX) | | 428 | .if defined(EVAL_PREFIX) |
429 | FIND_PREFIX:= ${EVAL_PREFIX} | | 429 | FIND_PREFIX:= ${EVAL_PREFIX} |
430 | . include "find-prefix.mk" | | 430 | . include "find-prefix.mk" |
431 | .endif | | 431 | .endif |
432 | | | 432 | |
433 | .if !defined(_PATH_ORIG) | | 433 | .if !defined(_PATH_ORIG) |
434 | _PATH_ORIG:= ${PATH} | | 434 | _PATH_ORIG:= ${PATH} |
435 | MAKEFLAGS+= _PATH_ORIG=${_PATH_ORIG:Q} | | 435 | MAKEFLAGS+= _PATH_ORIG=${_PATH_ORIG:Q} |
436 | .endif | | 436 | .endif |
437 | | | 437 | |
438 | .if !empty(PREPEND_PATH:M*) | | 438 | .if !empty(PREPEND_PATH:M*) |
439 | # This is very Special. Because PREPEND_PATH is set with += in reverse order, | | 439 | # This is very Special. Because PREPEND_PATH is set with += in reverse order, |
440 | # this command reverses the order again (since bootstrap bmake doesn't | | 440 | # this command reverses the order again (since bootstrap bmake doesn't |
441 | # yet support the :[-1..1] construct). | | 441 | # yet support the :[-1..1] construct). |
442 | _PATH_CMD= \ | | 442 | _PATH_CMD= \ |
443 | path=${_PATH_ORIG:Q}; \ | | 443 | path=${_PATH_ORIG:Q}; \ |
444 | for i in ${PREPEND_PATH}; do path="$$i:$$path"; done; \ | | 444 | for i in ${PREPEND_PATH}; do path="$$i:$$path"; done; \ |
445 | ${ECHO} "$$path" | | 445 | ${ECHO} "$$path" |
446 | PATH= ${_PATH_CMD:sh} # DOES NOT use :=, to defer evaluation | | 446 | PATH= ${_PATH_CMD:sh} # DOES NOT use :=, to defer evaluation |
447 | .endif | | 447 | .endif |
448 | | | 448 | |
449 | ################################################################ | | 449 | ################################################################ |
450 | # Many ways to disable a package. | | 450 | # Many ways to disable a package. |
451 | # | | 451 | # |
452 | # Ignore packages that can't be resold if building for a CDROM. | | 452 | # Ignore packages that can't be resold if building for a CDROM. |
453 | # | | 453 | # |
454 | # Don't build a package if it's restricted and we don't want to | | 454 | # Don't build a package if it's restricted and we don't want to |
455 | # get into that. | | 455 | # get into that. |
456 | # | | 456 | # |
457 | # Don't build any package that utilizes strong cryptography, for | | 457 | # Don't build any package that utilizes strong cryptography, for |
458 | # when the law of the land forbids it. | | 458 | # when the law of the land forbids it. |
459 | # | | 459 | # |
460 | # Don't attempt to build packages against X if we don't have X. | | 460 | # Don't attempt to build packages against X if we don't have X. |
461 | # | | 461 | # |
462 | # Don't build a package if it's broken. | | 462 | # Don't build a package if it's broken. |
463 | ################################################################ | | 463 | ################################################################ |
464 | .if ${X11_TYPE} == "xorg" | | 464 | .if ${X11_TYPE} == "xorg" |
465 | PKG_FAIL_REASON+= "Support for X11_TYPE=xorg was removed." | | 465 | PKG_FAIL_REASON+= "Support for X11_TYPE=xorg was removed." |
466 | PKG_FAIL_REASON+= "Please switch to X11_TYPE=modular." | | 466 | PKG_FAIL_REASON+= "Please switch to X11_TYPE=modular." |
467 | X11_TYPE:= native | | 467 | X11_TYPE:= native |
468 | X11BASE:= /usr | | 468 | X11BASE:= /usr |
469 | .endif | | 469 | .endif |
470 | | | 470 | |
471 | .if !defined(NO_SKIP) | | 471 | .if !defined(NO_SKIP) |
472 | . if (defined(NO_BIN_ON_CDROM) && defined(FOR_CDROM)) | | 472 | . if (defined(NO_BIN_ON_CDROM) && defined(FOR_CDROM)) |
473 | PKG_FAIL_REASON+= "${PKGNAME} may not be placed in binary form on a CDROM:" \ | | 473 | PKG_FAIL_REASON+= "${PKGNAME} may not be placed in binary form on a CDROM:" \ |
474 | " "${NO_BIN_ON_CDROM:Q} | | 474 | " "${NO_BIN_ON_CDROM:Q} |
475 | . endif | | 475 | . endif |
476 | . if (defined(NO_SRC_ON_CDROM) && defined(FOR_CDROM)) | | 476 | . if (defined(NO_SRC_ON_CDROM) && defined(FOR_CDROM)) |
477 | PKG_FAIL_REASON+= "${PKGNAME} may not be placed in source form on a CDROM:" \ | | 477 | PKG_FAIL_REASON+= "${PKGNAME} may not be placed in source form on a CDROM:" \ |
478 | " "${NO_SRC_ON_CDROM:Q} | | 478 | " "${NO_SRC_ON_CDROM:Q} |
479 | . endif | | 479 | . endif |
480 | . if (defined(RESTRICTED) && defined(NO_RESTRICTED)) | | 480 | . if (defined(RESTRICTED) && defined(NO_RESTRICTED)) |
481 | PKG_FAIL_REASON+= "${PKGNAME} is restricted:" \ | | 481 | PKG_FAIL_REASON+= "${PKGNAME} is restricted:" \ |
482 | " "${RESTRICTED:Q} | | 482 | " "${RESTRICTED:Q} |
483 | . endif | | 483 | . endif |
484 | . if !(${MKCRYPTO} == "YES" || ${MKCRYPTO} == yes) | | 484 | . if !(${MKCRYPTO} == "YES" || ${MKCRYPTO} == yes) |
485 | . if defined(CRYPTO) | | 485 | . if defined(CRYPTO) |
486 | PKG_FAIL_REASON+= "${PKGNAME} may not be built, because it utilizes strong cryptography" | | 486 | PKG_FAIL_REASON+= "${PKGNAME} may not be built, because it utilizes strong cryptography" |
487 | . endif | | 487 | . endif |
488 | . endif | | 488 | . endif |
489 | . if defined(USE_X11) && (${X11_TYPE} == "native") && !exists(${X11BASE}) | | 489 | . if defined(USE_X11) && (${X11_TYPE} == "native") && !exists(${X11BASE}) |
490 | PKG_FAIL_REASON+= "${PKGNAME} uses X11, but ${X11BASE} not found" | | 490 | PKG_FAIL_REASON+= "${PKGNAME} uses X11, but ${X11BASE} not found" |
491 | . endif | | 491 | . endif |
492 | . if defined(BROKEN) | | 492 | . if defined(BROKEN) |
493 | PKG_FAIL_REASON+= "${PKGNAME} is marked as broken:" ${BROKEN:Q} | | 493 | PKG_FAIL_REASON+= "${PKGNAME} is marked as broken:" ${BROKEN:Q} |
494 | . endif | | 494 | . endif |
495 | | | 495 | |
496 | .include "license.mk" | | 496 | .include "license.mk" |
497 | | | 497 | |
498 | # Define __PLATFORM_OK only if the OS matches the pkg's allowed list. | | 498 | # Define __PLATFORM_OK only if the OS matches the pkg's allowed list. |
499 | . if defined(ONLY_FOR_PLATFORM) && !empty(ONLY_FOR_PLATFORM) | | 499 | . if defined(ONLY_FOR_PLATFORM) && !empty(ONLY_FOR_PLATFORM) |
500 | . for __tmp__ in ${ONLY_FOR_PLATFORM} | | 500 | . for __tmp__ in ${ONLY_FOR_PLATFORM} |
501 | . if ${MACHINE_PLATFORM:M${__tmp__}} != "" | | 501 | . if ${MACHINE_PLATFORM:M${__tmp__}} != "" |
502 | __PLATFORM_OK?= yes | | 502 | __PLATFORM_OK?= yes |
503 | . endif # MACHINE_PLATFORM | | 503 | . endif # MACHINE_PLATFORM |
504 | . endfor # __tmp__ | | 504 | . endfor # __tmp__ |
505 | . else # !ONLY_FOR_PLATFORM | | 505 | . else # !ONLY_FOR_PLATFORM |
506 | __PLATFORM_OK?= yes | | 506 | __PLATFORM_OK?= yes |
507 | . endif # ONLY_FOR_PLATFORM | | 507 | . endif # ONLY_FOR_PLATFORM |
508 | . for __tmp__ in ${NOT_FOR_PLATFORM} | | 508 | . for __tmp__ in ${NOT_FOR_PLATFORM} |
509 | . if ${MACHINE_PLATFORM:M${__tmp__}} != "" | | 509 | . if ${MACHINE_PLATFORM:M${__tmp__}} != "" |
510 | . undef __PLATFORM_OK | | 510 | . undef __PLATFORM_OK |
511 | . endif # MACHINE_PLATFORM | | 511 | . endif # MACHINE_PLATFORM |
512 | . endfor # __tmp__ | | 512 | . endfor # __tmp__ |
513 | . if !defined(__PLATFORM_OK) | | 513 | . if !defined(__PLATFORM_OK) |
514 | PKG_FAIL_REASON+= "${PKGNAME} is not available for ${MACHINE_PLATFORM}" | | 514 | PKG_FAIL_REASON+= "${PKGNAME} is not available for ${MACHINE_PLATFORM}" |
515 | . endif # !__PLATFORM_OK | | 515 | . endif # !__PLATFORM_OK |
516 | .endif | | 516 | .endif |
517 | | | 517 | |
518 | # Add these defs to the ones dumped into +BUILD_DEFS | | 518 | # Add these defs to the ones dumped into +BUILD_DEFS |
519 | _BUILD_DEFS+= PKGPATH | | 519 | _BUILD_DEFS+= PKGPATH |
520 | _BUILD_DEFS+= OPSYS OS_VERSION MACHINE_ARCH MACHINE_GNU_ARCH | | 520 | _BUILD_DEFS+= OPSYS OS_VERSION MACHINE_ARCH MACHINE_GNU_ARCH |
521 | _BUILD_DEFS+= ABI | | 521 | _BUILD_DEFS+= ABI |
522 | _BUILD_DEFS+= CPPFLAGS CFLAGS FFLAGS LDFLAGS | | 522 | _BUILD_DEFS+= CPPFLAGS CFLAGS FFLAGS LDFLAGS |
523 | _BUILD_DEFS+= OBJECT_FMT LICENSE RESTRICTED | | 523 | _BUILD_DEFS+= OBJECT_FMT LICENSE RESTRICTED |
524 | _BUILD_DEFS+= NO_SRC_ON_FTP NO_SRC_ON_CDROM | | 524 | _BUILD_DEFS+= NO_SRC_ON_FTP NO_SRC_ON_CDROM |
525 | _BUILD_DEFS+= NO_BIN_ON_FTP NO_BIN_ON_CDROM | | 525 | _BUILD_DEFS+= NO_BIN_ON_FTP NO_BIN_ON_CDROM |
526 | | | 526 | |
527 | .if defined(OSVERSION_SPECIFIC) | | 527 | .if defined(OSVERSION_SPECIFIC) |
528 | _BUILD_DEFS+= OSVERSION_SPECIFIC | | 528 | _BUILD_DEFS+= OSVERSION_SPECIFIC |
529 | DEPENDS+= osabi-${OPSYS}-${OS_VERSION}:../../pkgtools/osabi | | 529 | DEPENDS+= osabi-${OPSYS}-${OS_VERSION}:../../pkgtools/osabi |
530 | .endif # OSVERSION_SPECIFIC | | 530 | .endif # OSVERSION_SPECIFIC |
531 | | | 531 | |
532 | .for _pkg_ in ${_BUILTIN_PKGS} | | 532 | .for _pkg_ in ${_BUILTIN_PKGS} |
533 | . if defined(USE_BUILTIN.${_pkg_}) && \ | | 533 | . if defined(USE_BUILTIN.${_pkg_}) && \ |
534 | !empty(USE_BUILTIN.${_pkg_}:M[yY][eE][sS]) && \ | | 534 | !empty(USE_BUILTIN.${_pkg_}:M[yY][eE][sS]) && \ |
535 | defined(BUILTIN_PKG.${_pkg_}) && !empty(BUILTIN_PKG.${_pkg_}) | | 535 | defined(BUILTIN_PKG.${_pkg_}) && !empty(BUILTIN_PKG.${_pkg_}) |
536 | BUILTIN_PKGS+= ${BUILTIN_PKG.${_pkg_}} | | 536 | BUILTIN_PKGS+= ${BUILTIN_PKG.${_pkg_}} |
537 | . endif | | 537 | . endif |
538 | .endfor | | 538 | .endfor |
539 | .if defined(BUILTIN_PKGS) | | 539 | .if defined(BUILTIN_PKGS) |
540 | _BUILD_DEFS+= BUILTIN_PKGS | | 540 | _BUILD_DEFS+= BUILTIN_PKGS |
541 | .endif | | 541 | .endif |
542 | | | 542 | |
543 | .if defined(GLIBC_VERSION) | | 543 | .if defined(GLIBC_VERSION) |
544 | _BUILD_DEFS+= GLIBC_VERSION | | 544 | _BUILD_DEFS+= GLIBC_VERSION |
545 | .endif # GLIBC_VERSION | | 545 | .endif # GLIBC_VERSION |
546 | | | 546 | |
547 | .PHONY: all | | 547 | .PHONY: all |
548 | .if !target(all) | | 548 | .if !target(all) |
549 | all: ${_PKGSRC_BUILD_TARGETS} | | 549 | all: ${_PKGSRC_BUILD_TARGETS} |
550 | .endif | | 550 | .endif |
551 | | | 551 | |
552 | .PHONY: makedirs | | 552 | .PHONY: makedirs |
553 | makedirs: ${WRKDIR} | | 553 | makedirs: ${WRKDIR} |
554 | | | 554 | |
555 | ${WRKDIR}: | | 555 | ${WRKDIR}: |
556 | .if !defined(KEEP_WRKDIR) | | 556 | .if !defined(KEEP_WRKDIR) |
557 | . if ${WRKDIR_LOCKTYPE} != "none" | | 557 | . if ${WRKDIR_LOCKTYPE} != "none" |
558 | ${RUN} ${TEST} -f ${_WRKDIR_LOCKFILE} || ${RM} -fr ${WRKDIR} | | 558 | ${RUN} ${TEST} -f ${_WRKDIR_LOCKFILE} || ${RM} -fr ${WRKDIR} |
559 | . endif | | 559 | . endif |
560 | .endif | | 560 | .endif |
561 | ${RUN} umask 077 && ${MKDIR} ${WRKDIR} | | 561 | ${RUN} umask 077 && ${MKDIR} ${WRKDIR} |
562 | | | 562 | |
563 | # Create a symlink from ${WRKDIR} to the package directory if | | 563 | # Create a symlink from ${WRKDIR} to the package directory if |
564 | # CREATE_WRKDIR_SYMLINK is "yes". | | 564 | # CREATE_WRKDIR_SYMLINK is "yes". |
565 | # | | 565 | # |
566 | CREATE_WRKDIR_SYMLINK?= no | | 566 | CREATE_WRKDIR_SYMLINK?= no |
567 | | | 567 | |
568 | .if defined(WRKOBJDIR) && !empty(CREATE_WRKDIR_SYMLINK:M[Yy][Ee][Ss]) | | 568 | .if defined(WRKOBJDIR) && !empty(CREATE_WRKDIR_SYMLINK:M[Yy][Ee][Ss]) |
569 | makedirs: ${.CURDIR}/${WRKDIR_BASENAME} | | 569 | makedirs: ${.CURDIR}/${WRKDIR_BASENAME} |
570 | ${.CURDIR}/${WRKDIR_BASENAME}: | | 570 | ${.CURDIR}/${WRKDIR_BASENAME}: |
571 | . if ${WRKDIR_LOCKTYPE} != "none" | | 571 | . if ${WRKDIR_LOCKTYPE} != "none" |
572 | ${RUN} ${TEST} -f ${_WRKDIR_LOCKFILE} || ${RM} -f ${.TARGET} | | 572 | ${RUN} ${TEST} -f ${_WRKDIR_LOCKFILE} || ${RM} -f ${.TARGET} |
573 | . endif | | 573 | . endif |
574 | ${RUN} \ | | 574 | ${RUN} \ |
575 | if ${LN} -s ${WRKDIR} ${.TARGET} 2>/dev/null; then \ | | 575 | if ${LN} -s ${WRKDIR} ${.TARGET} 2>/dev/null; then \ |
576 | ${ECHO_MSG} "${.TARGET:T} -> ${WRKDIR}"; \ | | 576 | ${ECHO_MSG} "${.TARGET:T} -> ${WRKDIR}"; \ |
577 | fi | | 577 | fi |
578 | .endif | | 578 | .endif |
579 | | | 579 | |
580 | .include "pkgformat/bsd.pkgformat.mk" | | 580 | .include "pkgformat/bsd.pkgformat.mk" |
581 | | | 581 | |
582 | .include "depends/bsd.depends.mk" | | 582 | .include "depends/bsd.depends.mk" |
583 | .include "check/bsd.check.mk" | | 583 | .include "check/bsd.check.mk" |
584 | .include "fetch/bsd.fetch.mk" | | 584 | .include "fetch/bsd.fetch.mk" |
585 | .include "checksum/bsd.checksum.mk" | | 585 | .include "checksum/bsd.checksum.mk" |
586 | .include "extract/bsd.extract.mk" | | 586 | .include "extract/bsd.extract.mk" |
587 | .include "patch/bsd.patch.mk" | | 587 | .include "patch/bsd.patch.mk" |
588 | .include "configure/bsd.configure.mk" | | 588 | .include "configure/bsd.configure.mk" |
589 | .include "build/bsd.build.mk" | | 589 | .include "build/bsd.build.mk" |
590 | .include "install/bsd.install.mk" | | 590 | .include "install/bsd.install.mk" |
591 | .include "package/bsd.package.mk" | | 591 | .include "package/bsd.package.mk" |
592 | | | 592 | |
593 | .include "bsd.pkg.clean.mk" | | 593 | .include "bsd.pkg.clean.mk" |
594 | .include "bsd.pkg.update.mk" | | 594 | .include "bsd.pkg.update.mk" |
595 | | | 595 | |
596 | # su-target is a macro target that does just-in-time su-to-root before | | 596 | # su-target is a macro target that does just-in-time su-to-root before |
597 | # reinvoking the make process as root. It acquires root privileges and | | 597 | # reinvoking the make process as root. It acquires root privileges and |
598 | # invokes a new make process with the target named "su-${.TARGET}". | | 598 | # invokes a new make process with the target named "su-${.TARGET}". |
599 | # | | 599 | # |
600 | # MAKEFLAGS.su-${.TARGET} | | 600 | # MAKEFLAGS.su-${.TARGET} |
601 | # The additional flags that are passed to the make process. | | 601 | # The additional flags that are passed to the make process. |
602 | # | | 602 | # |
603 | | | 603 | |
604 | # XXX: Shouldn't the $${PATH} be ${PATH} here? This may be related to | | 604 | # XXX: Shouldn't the $${PATH} be ${PATH} here? This may be related to |
605 | # PR 34470. | | 605 | # PR 34470. |
606 | _ROOT_CMD= cd ${.CURDIR} && \ | | 606 | _ROOT_CMD= cd ${.CURDIR} && \ |
607 | ${PKGSRC_SETENV} ${PKGSRC_MAKE_ENV} \ | | 607 | ${PKGSRC_SETENV} ${PKGSRC_MAKE_ENV} \ |
608 | PATH="$${PATH}:"${SU_CMD_PATH_APPEND:Q} \ | | 608 | PATH="$${PATH}:"${SU_CMD_PATH_APPEND:Q} \ |
609 | ${MAKE} ${MAKEFLAGS} _PKGSRC_BARRIER=yes \ | | 609 | ${MAKE} ${MAKEFLAGS} _PKGSRC_BARRIER=yes \ |
610 | PKG_DEBUG_LEVEL=${PKG_DEBUG_LEVEL:Q} \ | | 610 | PKG_DEBUG_LEVEL=${PKG_DEBUG_LEVEL:Q} \ |
611 | su-${.TARGET} ${MAKEFLAGS.su-${.TARGET}} | | 611 | su-${.TARGET} ${MAKEFLAGS.su-${.TARGET}} |
612 | | | 612 | |
613 | .PHONY: su-target | | 613 | .PHONY: su-target |
614 | su-target: .USE | | 614 | su-target: .USE |
615 | ${RUN} \ | | 615 | ${RUN} \ |
616 | case ${PRE_CMD.su-${.TARGET}:Q}"" in \ | | 616 | case ${PRE_CMD.su-${.TARGET}:Q}"" in \ |
617 | "") ;; \ | | 617 | "") ;; \ |
618 | *) ${PRE_CMD.su-${.TARGET}} ;; \ | | 618 | *) ${PRE_CMD.su-${.TARGET}} ;; \ |
619 | esac; \ | | 619 | esac; \ |
620 | if ${TEST} `${ID} -u` = `${ID} -u ${_SU_ROOT_USER}`; then \ | | 620 | if ${TEST} `${ID} -u` = `${ID} -u ${_SU_ROOT_USER}`; then \ |
621 | ${_ROOT_CMD}; \ | | 621 | ${_ROOT_CMD}; \ |
622 | else \ | | 622 | else \ |
623 | case ${PRE_ROOT_CMD:Q}"" in \ | | 623 | case ${PRE_ROOT_CMD:Q}"" in \ |
624 | ${TRUE:Q}"") ;; \ | | 624 | ${TRUE:Q}"") ;; \ |
625 | *) ${WARNING_MSG} "Running: "${PRE_ROOT_CMD:Q} ;; \ | | 625 | *) ${WARNING_MSG} "Running: "${PRE_ROOT_CMD:Q} ;; \ |
626 | esac; \ | | 626 | esac; \ |
627 | ${PRE_ROOT_CMD}; \ | | 627 | ${PRE_ROOT_CMD}; \ |
628 | ${STEP_MSG} "Becoming \`\`${_SU_ROOT_USER}'' to make su-${.TARGET} (`${ECHO} ${SU_CMD} | ${AWK} '{ print $$1 }'`)"; \ | | 628 | ${STEP_MSG} "Becoming \`\`${_SU_ROOT_USER}'' to make su-${.TARGET} (`${ECHO} ${SU_CMD} | ${AWK} '{ print $$1 }'`)"; \ |
629 | ${SU_CMD} ${_ROOT_CMD:Q}; \ | | 629 | ${SU_CMD} ${_ROOT_CMD:Q}; \ |
630 | ${STEP_MSG} "Dropping \`\`${_SU_ROOT_USER}'' privileges."; \ | | 630 | ${STEP_MSG} "Dropping \`\`${_SU_ROOT_USER}'' privileges."; \ |
631 | fi | | 631 | fi |
632 | | | 632 | |
633 | ################################################################ | | 633 | ################################################################ |
634 | # Some more targets supplied for users' convenience | | 634 | # Some more targets supplied for users' convenience |
635 | ################################################################ | | 635 | ################################################################ |
636 | | | 636 | |
637 | # Run pkglint: | | 637 | # Run pkglint: |
638 | .PHONY: lint | | 638 | .PHONY: lint |
639 | lint: | | 639 | lint: |
640 | ${RUN} ${LOCALBASE}/bin/pkglint | | 640 | ${RUN} ${LOCALBASE}/bin/pkglint |
641 | | | 641 | |
642 | # List of flags to pass to pkg_add(1) for bin-install: | | 642 | # List of flags to pass to pkg_add(1) for bin-install: |
643 | | | 643 | |
644 | BIN_INSTALL_FLAGS?= # -v | | 644 | BIN_INSTALL_FLAGS?= # -v |
645 | .if ${PKG_INSTALLATION_TYPE} == "pkgviews" | | 645 | .if ${PKG_INSTALLATION_TYPE} == "pkgviews" |
646 | PKG_ARGS_ADD= -W ${LOCALBASE} -w ${DEFAULT_VIEW} | | 646 | PKG_ARGS_ADD= -W ${LOCALBASE} -w ${DEFAULT_VIEW} |
647 | .endif | | 647 | .endif |
648 | _BIN_INSTALL_FLAGS= ${BIN_INSTALL_FLAGS} | | 648 | _BIN_INSTALL_FLAGS= ${BIN_INSTALL_FLAGS} |
649 | .if defined(_AUTOMATIC) && !empty(_AUTOMATIC:M[Yy][Ee][Ss]) | | 649 | .if defined(_AUTOMATIC) && !empty(_AUTOMATIC:M[Yy][Ee][Ss]) |
650 | _BIN_INSTALL_FLAGS+= -A | | 650 | _BIN_INSTALL_FLAGS+= -A |
651 | .endif | | 651 | .endif |
652 | _BIN_INSTALL_FLAGS+= ${PKG_ARGS_ADD} | | 652 | _BIN_INSTALL_FLAGS+= ${PKG_ARGS_ADD} |
653 | | | 653 | |
654 | _SHORT_UNAME_R= ${:!${UNAME} -r!:C@\.([0-9]*)[_.-].*@.\1@} # n.n[_.]anything => n.n | | 654 | _SHORT_UNAME_R= ${:!${UNAME} -r!:C@\.([0-9]*)[_.-].*@.\1@} # n.n[_.]anything => n.n |
655 | | | 655 | |
656 | .include "install/bin-install.mk" | | 656 | .include "install/bin-install.mk" |
657 | | | 657 | |
658 | .PHONY: show-pkgtools-version | | 658 | .PHONY: show-pkgtools-version |
659 | .if !target(show-pkgtools-version) | | 659 | .if !target(show-pkgtools-version) |
660 | show-pkgtools-version: | | 660 | show-pkgtools-version: |
661 | @${ECHO} ${PKGTOOLS_VERSION} | | 661 | @${ECHO} ${PKGTOOLS_VERSION} |
662 | .endif | | 662 | .endif |
663 | | | 663 | |
664 | # convenience target, to display make variables from command line | | 664 | # convenience target, to display make variables from command line |
665 | # i.e. "make show-var VARNAME=var", will print var's value | | 665 | # i.e. "make show-var VARNAME=var", will print var's value |
666 | # | | 666 | # |
667 | # See also: | | 667 | # See also: |
668 | # show-vars, show-subdir-var | | 668 | # show-vars, show-subdir-var |
669 | # | | 669 | # |
670 | .PHONY: show-var | | 670 | .PHONY: show-var |
671 | show-var: | | 671 | show-var: |
672 | @${ECHO} ${${VARNAME}:Q} | | 672 | @${ECHO} ${${VARNAME}:Q} |
673 | | | 673 | |
674 | # enhanced version of target above, to display multiple variables | | 674 | # enhanced version of target above, to display multiple variables |
675 | .PHONY: show-vars | | 675 | .PHONY: show-vars |
676 | show-vars: | | 676 | show-vars: |
677 | .for VARNAME in ${VARNAMES} | | 677 | .for VARNAME in ${VARNAMES} |
678 | @${ECHO} ${${VARNAME}:Q} | | 678 | @${ECHO} ${${VARNAME}:Q} |
679 | .endfor | | 679 | .endfor |
680 | | | 680 | |
681 | # displays multiple variables as shell expressions | | 681 | # displays multiple variables as shell expressions |
682 | # VARS is space separated list of VARNAME:shellvarname | | 682 | # VARS is space separated list of VARNAME:shellvarname |
683 | .PHONY: show-vars-eval | | 683 | .PHONY: show-vars-eval |
684 | show-vars-eval: | | 684 | show-vars-eval: |
685 | .for var in ${VARS} | | 685 | .for var in ${VARS} |
686 | @${ECHO} ${var:C/^.*://}="${${var:C/:.*$//}:Q}" | | 686 | @${ECHO} ${var:C/^.*://}="${${var:C/:.*$//}:Q}" |
687 | .endfor | | 687 | .endfor |
688 | | | 688 | |
689 | LICENSE_FILE?= ${PKGSRCDIR}/licenses/${LICENSE} | | 689 | LICENSE_FILE?= ${PKGSRCDIR}/licenses/${LICENSE} |
690 | | | 690 | |
691 | .if !target(show-license) | | 691 | .if !target(show-license) |
692 | show-license show-licence: .PHONY | | 692 | show-license show-licence: .PHONY |
693 | @license=${LICENSE:Q}; \ | | 693 | @license=${LICENSE:Q}; \ |
694 | license_file=${LICENSE_FILE:Q}; \ | | 694 | license_file=${LICENSE_FILE:Q}; \ |
695 | pager=${PAGER:Q}; \ | | 695 | pager=${PAGER:Q}; \ |
696 | case "$$pager" in "") pager=${CAT:Q};; esac; \ | | 696 | case "$$pager" in "") pager=${CAT:Q};; esac; \ |
697 | case "$$license" in "") exit 0;; esac; \ | | 697 | case "$$license" in "") exit 0;; esac; \ |
698 | if ${TEST} -f "$$license_file"; then \ | | 698 | if ${TEST} -f "$$license_file"; then \ |
699 | $$pager "$$license_file"; \ | | 699 | $$pager "$$license_file"; \ |
700 | else \ | | 700 | else \ |
701 | ${ECHO} "Generic $$license information not available"; \ | | 701 | ${ECHO} "Generic $$license information not available"; \ |
702 | ${ECHO} "See the package description (pkg_info -d ${PKGNAME}) for more information."; \ | | 702 | ${ECHO} "See the package description (pkg_info -d ${PKGNAME}) for more information."; \ |
703 | fi | | 703 | fi |
704 | .endif | | 704 | .endif |
705 | | | 705 | |
706 | # This target is defined in bsd.options.mk for packages that use | | 706 | # This target is defined in bsd.options.mk for packages that use |
707 | # the options framework. | | 707 | # the options framework. |
708 | .if !target(show-options) | | 708 | .if !target(show-options) |
709 | .PHONY: show-options | | 709 | .PHONY: show-options |
710 | show-options: | | 710 | show-options: |
711 | @${ECHO} This package does not use the options framework. | | 711 | @${ECHO} This package does not use the options framework. |
712 | .endif | | 712 | .endif |
713 | | | 713 | |
714 | # Depend is generally meaningless for arbitrary packages, but if someone wants | | 714 | # Depend is generally meaningless for arbitrary packages, but if someone wants |
715 | # one they can override this. This is just to catch people who've gotten into | | 715 | # one they can override this. This is just to catch people who've gotten into |
716 | # the habit of typing `${MAKE} depend all install' as a matter of course. | | 716 | # the habit of typing `${MAKE} depend all install' as a matter of course. |
717 | # | | 717 | # |
718 | .PHONY: depend | | 718 | .PHONY: depend |
719 | .if !target(depend) | | 719 | .if !target(depend) |
720 | depend: | | 720 | depend: |
721 | .endif | | 721 | .endif |
722 | | | 722 | |
723 | # Same goes for tags | | 723 | # Same goes for tags |
724 | .PHONY: tags | | 724 | .PHONY: tags |
725 | .if !target(tags) | | 725 | .if !target(tags) |
726 | tags: | | 726 | tags: |
727 | .endif | | 727 | .endif |
728 | | | 728 | |
729 | .include "plist/bsd.plist.mk" | | 729 | .include "plist/bsd.plist.mk" |
730 | | | 730 | |
731 | .include "bsd.utils.mk" | | 731 | .include "bsd.utils.mk" |
732 | | | 732 | |
733 | .include "subst.mk" | | 733 | .include "subst.mk" |
734 | | | 734 | |
735 | # | | 735 | # |
736 | # For bulk build targets (bulk-install, bulk-package), the | | 736 | # For bulk build targets (bulk-install, bulk-package), the |
737 | # BATCH variable must be set in /etc/mk.conf: | | 737 | # BATCH variable must be set in /etc/mk.conf: |
738 | # | | 738 | # |
739 | .if defined(BATCH) | | 739 | .if defined(BATCH) |
740 | . include "bulk/bsd.bulk-pkg.mk" | | 740 | . include "bulk/bsd.bulk-pkg.mk" |
741 | .endif | | 741 | .endif |
742 | | | 742 | |
743 | # README generation code. | | 743 | # README generation code. |
744 | .include "bsd.pkg.readme.mk" | | 744 | .include "bsd.pkg.readme.mk" |
745 | | | 745 | |
746 | # Create a PKG_ERROR_HANDLER shell command for each class listed in | | 746 | # Create a PKG_ERROR_HANDLER shell command for each class listed in |
747 | # PKG_ERROR_CLASSES. The error handler is meant to be invoked within | | 747 | # PKG_ERROR_CLASSES. The error handler is meant to be invoked within |
748 | # a make target. | | 748 | # a make target. |
749 | # | | 749 | # |
750 | .for _class_ in ${PKG_ERROR_CLASSES} | | 750 | .for _class_ in ${PKG_ERROR_CLASSES} |
751 | PKG_ERROR_HANDLER.${_class_}?= { \ | | 751 | PKG_ERROR_HANDLER.${_class_}?= { \ |
752 | ec=$$?; \ | | 752 | ec=$$?; \ |
753 | for str in ${PKG_ERROR_MSG.${_class_}}; do \ | | 753 | for str in ${PKG_ERROR_MSG.${_class_}}; do \ |
754 | ${PHASE_MSG} "$$str"; \ | | 754 | ${PHASE_MSG} "$$str"; \ |
755 | done; \ | | 755 | done; \ |
756 | exit $$ec; \ | | 756 | exit $$ec; \ |
757 | } | | 757 | } |
758 | .endfor | | 758 | .endfor |
759 | | | 759 | |
760 | # Cache variables listed in MAKEVARS in a phase-specific "makevars.mk" | | 760 | # Cache variables listed in MAKEVARS in a phase-specific "makevars.mk" |
761 | # file. These variables are effectively passed to sub-make processes | | 761 | # file. These variables are effectively passed to sub-make processes |
762 | # that are invoked on the same Makefile. | | 762 | # that are invoked on the same Makefile. |
763 | # | | 763 | # |
764 | .for _phase_ in ${_ALL_PHASES} | | 764 | .for _phase_ in ${_ALL_PHASES} |
765 | ${_MAKEVARS_MK.${_phase_}}: ${WRKDIR} | | 765 | ${_MAKEVARS_MK.${_phase_}}: ${WRKDIR} |
766 | ${RUN}${RM} -f ${.TARGET}.tmp | | 766 | ${RUN}${RM} -f ${.TARGET}.tmp |
767 | . for _var_ in ${MAKEVARS:O:u} | | 767 | . for _var_ in ${MAKEVARS:O:u} |
768 | . if defined(${_var_}) | | 768 | . if defined(${_var_}) |
769 | ${RUN} \ | | 769 | ${RUN} \ |
770 | ${ECHO} ${_var_}"= "${${_var_}:Q} >> ${.TARGET}.tmp | | 770 | ${ECHO} ${_var_}"= "${${_var_}:Q} >> ${.TARGET}.tmp |
771 | . endif | | 771 | . endif |
772 | . endfor | | 772 | . endfor |
773 | ${RUN} \ | | 773 | ${RUN} \ |
774 | if ${TEST} -f ${.TARGET}.tmp; then \ | | 774 | if ${TEST} -f ${.TARGET}.tmp; then \ |
775 | ( ${ECHO} ".if !defined(_MAKEVARS_MK)"; \ | | 775 | ( ${ECHO} ".if !defined(_MAKEVARS_MK)"; \ |
776 | ${ECHO} "_MAKEVARS_MK= defined"; \ | | 776 | ${ECHO} "_MAKEVARS_MK= defined"; \ |
777 | ${ECHO} ""; \ | | 777 | ${ECHO} ""; \ |
778 | ${CAT} ${.TARGET}.tmp; \ | | 778 | ${CAT} ${.TARGET}.tmp; \ |
779 | ${ECHO} ""; \ | | 779 | ${ECHO} ""; \ |
780 | ${ECHO} ".endif # _MAKEVARS_MK"; \ | | 780 | ${ECHO} ".endif # _MAKEVARS_MK"; \ |
781 | ) > ${.TARGET}; \ | | 781 | ) > ${.TARGET}; \ |
782 | ${RM} -f ${.TARGET}.tmp; \ | | 782 | ${RM} -f ${.TARGET}.tmp; \ |
783 | fi | | 783 | fi |
784 | ${RUN}${TOUCH} ${TOUCH_FLAGS} ${.TARGET} | | 784 | ${RUN}${TOUCH} ${TOUCH_FLAGS} ${.TARGET} |
785 | .endfor | | 785 | .endfor |
786 | | | 786 | |
787 | .if make(pbulk-index) || make(pbulk-index-item) || make(pbulk-save-wrkdir) | | 787 | .if make(pbulk-index) || make(pbulk-index-item) || make(pbulk-save-wrkdir) |
788 | .include "pbulk/pbulk-index.mk" | | 788 | .include "pbulk/pbulk-index.mk" |
789 | .endif | | 789 | .endif |
790 | | | 790 | |
791 | .if defined(PKG_DEVELOPER) && ${PKG_DEVELOPER} != "no" | | 791 | .if defined(PKG_DEVELOPER) && ${PKG_DEVELOPER} != "no" |
792 | . include "misc/developer.mk" | | 792 | . include "misc/developer.mk" |
793 | .endif | | 793 | .endif |
794 | .include "misc/show.mk" | | 794 | .include "misc/show.mk" |
795 | .if make(debug) | | 795 | .if make(debug) |
796 | . include "bsd.pkg.debug.mk" | | 796 | . include "bsd.pkg.debug.mk" |
797 | .endif | | 797 | .endif |
798 | .include "misc/warnings.mk" | | 798 | .include "misc/warnings.mk" |
799 | .if make(import) | | 799 | .if make(import) |
800 | .include "misc/import.mk" | | 800 | .include "misc/import.mk" |
801 | .endif | | 801 | .endif |
802 | .include "misc/can-be-built-here.mk" | | 802 | .include "misc/can-be-built-here.mk" |