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