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