/[ports]/head/Mk/bsd.port.mk
ViewVC logotype

Contents of /head/Mk/bsd.port.mk

Parent Directory Parent Directory | Revision Log Revision Log


Revision 421635 - (show annotations) (download)
Fri Sep 9 19:42:46 2016 UTC (7 years, 9 months ago) by amdmi3
File MIME type: text/plain
File size: 181095 byte(s)
Most commonly used build systems support silent builds, when they
hide actual commands executed and only show short summary line (like
"CC foo.c"). CMake and ninja enable this by default, some autotools
using ports do as well. This is unacceptable because we need complete
build logs at any time, so we now switch to verbose build logs
unconditionally. Note that this change deliberately affects ALL
builds and not only package builds on cluster, because we need to
be sure that user experiencing failure can always provide informative
build log regardless of settings and without rerunning the build.

Change summary:

- Always do verbose builds for cmake, ninja and GNU configure (the
  latter includes check if --disable-silent-rules is actually supported
  by the configure script; there are isolated cases when it's not true)
- Remove CMAKE_VERBOSE, NINJA_VERBOSE and
  CONFIGURE_ARGS=--disable-silent-rules from all ports which set them
  for this is no longer needed
- Revert hacks for --disable-silent-rules support priorly committed
  to biology/ncbi-blast+ and net-p2p/mldonkey - no longer needed as well

Submitted by:	amdmi3
Reviewed by:	mat
Exp-run by:	antoine
Approved by:	portmgr (mat, antoine)
Differential Revision:	D7534

1 #-*- tab-width: 4; -*-
2 # ex:ts=4
3 #
4 # $FreeBSD$
5 # $NetBSD: $
6 #
7 # bsd.port.mk - 940820 Jordan K. Hubbard.
8 # This file is in the public domain.
9 #
10 # Please view me with 4 column tabs!
11
12 # This is the master file for the most common elements to all port
13 # Makefile in the ports system. For a more general overview of its
14 # use and importance, see the Porter's Handbook.
15
16 # There are two different types of "maintainers" in the ports framework.
17 # The maintainer alias of the bsd.port.mk file is listed below in the
18 # FreeBSD_MAINTAINER entry. You should consult them if you have any
19 # questions/suggestions regarding this file.
20 #
21 # DO NOT COMMIT CHANGES TO THIS FILE BY YOURSELF, EVEN IF YOU DID NOT GET
22 # A RESPONSE FROM THE MAINTAINER(S) WITHIN A REASONABLE TIMEFRAME! ALL
23 # UNAUTHORISED CHANGES WILL BE UNCONDITIONALLY REVERTED!
24
25 FreeBSD_MAINTAINER= portmgr@FreeBSD.org
26
27 # For each port, the MAINTAINER variable is what you should consult for
28 # contact information on the person(s) to contact if you have questions/
29 # suggestions about that specific port. By default (if no MAINTAINER
30 # is listed), a port is maintained by the subscribers of the ports@FreeBSD.org
31 # mailing list, and any correspondence should be directed there.
32 #
33 # MAINTAINER - The e-mail address of the contact person for this port.
34 # Default: ports@FreeBSD.org
35 #
36 # These are meta-variables that are automatically set to the system
37 # you are running on. These are provided in case you need to take
38 # different actions for different values.
39 #
40 # ARCH - The architecture of the target machine, such as would be
41 # returned by "uname -p".
42 # OPSYS - Portability clause. This is the operating system the
43 # makefile is being used on. Automatically set to
44 # "FreeBSD," "NetBSD," or "OpenBSD" as appropriate.
45 # OSREL - The release version (numeric) of the operating system.
46 # OSVERSION - The value of __FreeBSD_version.
47 #
48 # This is the beginning of the list of all variables that need to be
49 # defined in a port, listed in order that they should be included
50 # to fit in with existing conventions. (Exception: MAINTAINER actually
51 # should appear after EXTRACT_ONLY and before MASTER_SITE_BACKUP).
52 #
53 # These variables are used to identify your port.
54 #
55 # PORTNAME - Name of software. Mandatory.
56 # PORTVERSION - Version of software. Mandatory when no DISTVERSION is given.
57 # PORTREVISION - Version of port. Optional. Commonly used to indicate
58 # that an update has happened that affects the port
59 # framework itself, but not the distributed software
60 # (e.g., local patches or Makefile changes).
61 # PORTEPOCH - Optional. In certain odd cases, the PORTREVISION logic
62 # can be fooled by ports that appear to go backwards
63 # numerically (e.g. if port-0.3 is newer than port-1998).
64 # In this case, incrementing PORTEPOCH forces the revision.
65 # Default: 0 (no effect).
66 # PKGNAME - Always defined as
67 # ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}-${PORTVERSION}.
68 # Do not define this in your Makefile.
69 # PKGNAMEPREFIX - Prefix to specify that port is language-specific, etc.
70 # Optional.
71 # PKGNAMESUFFIX - Suffix to specify compilation options or a version
72 # designator (in case there are different versions of
73 # one port as is the case for Tcl).
74 # Optional.
75 # PKGVERSION - Always defined as ${PORTVERSION}.
76 # Do not define this in your Makefile.
77 # DISTVERSION - Vendor version of the distribution.
78 # Default: ${PORTVERSION}
79 # DISTNAME - Name of port or distribution used in generating
80 # WRKSRC and DISTFILES below.
81 # Default:
82 # ${PORTNAME}-${DISTVERSIONPREFIX}${DISTVERSION}${DISTVERSIONSUFFIX}
83 # CATEGORIES - A list of descriptive categories into which this port falls.
84 # Mandatory.
85 #
86 # These variable describe how to fetch files required for building the port.
87 #
88 # DISTFILES - Name(s) of archive file(s) containing distribution.
89 # Set this to an empty string if the port doesn't require it.
90 # Default: ${DISTNAME}${EXTRACT_SUFX}
91 # EXTRACT_SUFX - Suffix for archive names
92 # You never have to set both DISTFILES and EXTRACT_SUFX.
93 # Default: .tar.bz2 if USES=tar:bzip2 is set, .tar.xz if
94 # USES=tar:xz USE_XZ is set, .tar.gz otherwise).
95 # MASTER_SITES - Primary location(s) for distribution files if not found
96 # locally. See bsd.sites.mk for common choices for
97 # MASTER_SITES.
98 # MASTER_SITE_SUBDIR
99 # - Subdirectory of MASTER_SITES. Will sometimes need to be
100 # set to ${PORTNAME} for (e.g.) MASTER_SITE_SOURCEFORGE.
101 # Only guaranteed to work for choices of ${MASTER_SITES}
102 # defined in bsd.sites.mk.
103 # Default: not set.
104 # PATCHFILES - Name(s) of additional files that contain distribution
105 # patches. Make will look for them at PATCH_SITES (see below).
106 # They will automatically be uncompressed before patching if
107 # the names end with ".gz", ".bz2" or ".Z".
108 # For each file you can optionally specify a strip
109 # flag of patch(1) after a colon if it has a different
110 # base directory, e.g. "file1 file2:-p1 file3".
111 # You can also use a :group at the end for matching up to
112 # dist file groups. See Porters Handbook for more information.
113 # Syntax: PATCHFILES= patch[:-pX][:group]
114 # Default: not set.
115 # PATCH_SITES - Primary location(s) for distribution patch files
116 # if not found locally.
117 # DIST_SUBDIR - Suffix to ${DISTDIR}. If set, all ${DISTFILES} and
118 # ${PATCHFILES} will be put in this subdirectory of
119 # ${DISTDIR} (see below). Also they will be fetched in this
120 # subdirectory from FreeBSD mirror sites.
121 # ALLFILES - All of ${DISTFILES} and ${PATCHFILES}.
122 # NOFETCHFILES - If set, don't download these files from the ${MASTER_SITES}
123 # or ${MASTER_SITE_BACKUP} (but do from
124 # ${MASTER_SITE_OVERRIDE})
125 # EXTRACT_ONLY - If set, a subset of ${DISTFILES} you want to
126 # actually extract.
127 # ALWAYS_KEEP_DISTFILES
128 # - If set, the package building cluster will save the distfiles
129 # along with the packages. This may be required to comply with
130 # some licenses, e.g. GPL in some cases.
131 # Default: not set.
132 #
133 # (NOTE: by convention, the MAINTAINER entry (see above) should go here.)
134 #
135 # These variables are typically set in /etc/make.conf to indicate
136 # the user's preferred location to fetch files from. You should
137 # rarely need to set these.
138 #
139 # MASTER_SITE_BACKUP
140 # - Backup location(s) for distribution files and patch
141 # files if not found locally and ${MASTER_SITES}/${PATCH_SITES}.
142 # This should *not* be changed.
143 # Default:
144 # http://distcache.FreeBSD.org/ports-distfiles/${DIST_SUBDIR}/
145 # MASTER_SITE_OVERRIDE
146 # - If set, prepend the MASTER_SITES setting with this value.
147 # MASTER_SITE_FREEBSD
148 # - If set, prepend ${MASTER_SITE_BACKUP} in MASTER_SITES.
149 #
150 # Set these if your port should not be built under certain circumstances.
151 # These are string variables; you should set them to the reason why
152 # they are necessary.
153 #
154 # RESTRICTED - Prevent the distribution of distfiles and packages to
155 # the FTP sites or on CDROM (e.g. forbidden by license
156 # considerations).
157 # NO_CDROM - Packages and distfiles may not go on CDROM (e.g. must
158 # not be re-sold) but can go on FTP sites.
159 # NO_PACKAGE - Port should not be packaged for ftp sites or CDROMs,
160 # but distfiles can be put on ftp sites and CDROMs.
161 # FORBIDDEN - Package build should not be attempted because of
162 # security vulnerabilities.
163 # LEGAL_TEXT - Port has legal issues (e.g., special permission to distribute, lacks a license).
164 # LEGAL_PACKAGE - Port has no legal issues but defines NO_PACKAGE
165 # IGNORE - Package build should be skipped entirely (e.g.
166 # because of serious unfixable problems in the build,
167 # because it cannot be manually fetched, etc). Error
168 # logs will not appear on pointyhat, so this should be
169 # used sparingly.
170 # IGNORE_${ARCH} - Port should be ignored on ${ARCH}.
171 # IGNORE_${OPSYS} - Port should be ignored on ${OPSYS}.
172 # IGNORE_${OPSYS}_${OSREL:R} - Port should be ignored on a single
173 # release of ${OPSYS}, e.g IGNORE_FreeBSD_8
174 # would affect all point releases of FreeBSD 8.
175 # IGNORE_${OPSYS}_${OSREL:R}_${ARCH} - Port should be ignored on a
176 # single release of ${OPSYS} and specific architecture,
177 # e.g IGNORE_FreeBSD_8_i386 would affect all point
178 # releases of FreeBSD 8 in i386.
179 # BROKEN - Port is believed to be broken. Package builds can
180 # still be attempted using TRYBROKEN to test this
181 # assumption.
182 # BROKEN_${ARCH} - Port is believed to be broken on ${ARCH}. Package builds
183 # can still be attempted using TRYBROKEN to
184 # test this assumption.
185 # BROKEN_${OPSYS} - Port is believed to be broken on ${OPSYS}. Package builds
186 # can still be attempted using TRYBROKEN to
187 # test this assumption.
188 # BROKEN_${OPSYS}_${OSREL:R} - Port is believed to be broken on a single
189 # release of ${OPSYS}, e.g BROKEN_FreeBSD_8
190 # would affect all point releases of FreeBSD 8
191 # unless TRYBROKEN is also set.
192 # BROKEN_${OPSYS}_${OSREL:R}_${ARCH} - Port is believed to be broken on a
193 # single release of ${OPSYS} and specific architecture,
194 # e.g BROKEN_FreeBSD_8_i386 would affect all point
195 # releases of FreeBSD 8 in i386
196 # unless TRYBROKEN is also set.
197 # DEPRECATED - Port is deprecated to install. Advisory only.
198 # EXPIRATION_DATE
199 # - If DEPRECATED is set, determines a date when
200 # the port is planed to remove. The date format is
201 # ISO 8601 (YYYY-MM-DD).
202 #
203 # DISABLE_VULNERABILITIES
204 # - If set, do not check if the port is listed in the
205 # vulnerabilities database.
206 #
207 # In addition to RESTRICTED or NO_CDROM, if only a subset of distfiles
208 # or patchfiles have redistribution restrictions, set the following
209 # to the list of such files.
210 #
211 # RESTRICTED_FILES
212 # - List of files that cannot be redistributed.
213 # Default: "${DISTFILES} ${PATCHFILES}" if RESTRICTED
214 # or NO_CDROM is set, empty otherwise.
215 #
216 # These variables are booleans, so you don't need to set them to the reason.
217 #
218 # IS_INTERACTIVE
219 # - Set this if your port needs to interact with the user
220 # during any step in a package build. User can then decide
221 # to skip this port by setting ${BATCH}, or compiling only
222 # the interactive ports by setting ${INTERACTIVE}.
223 # Default: not set.
224 # USE_SUBMAKE - Set this if you want that each of the port's main 7 targets
225 # (extract, patch, configure, build, stage, install and
226 # package) to be executed in a separate make(1) process.
227 # Useful when one of the stages needs to influence make(1)
228 # variables of the later stages using ${WRKDIR}/Makefile.inc
229 # generated on the fly.
230 # Default: not set.
231 #
232 # NO_ARCH - Set this if port is architecture neutral.
233 #
234 # Set these if your port only makes sense to certain architectures.
235 # They are lists containing names for them (e.g., "amd64 i386").
236 # (Defaults: not set.)
237 #
238 # ONLY_FOR_ARCHS
239 # - Only build ports if ${ARCH} matches one of these.
240 # NOT_FOR_ARCHS - Only build ports if ${ARCH} doesn't match one of these.
241 # ONLY_FOR_ARCHS_REASON
242 # ONLY_FOR_ARCHS_REASON_${ARCH}
243 # - Reason why it's only for ${ONLY_FOR_ARCHS}s
244 # NOT_FOR_ARCHS_REASON
245 # NOT_FOR_ARCHS_REASON_${ARCH}
246 # - Reason why it's not for ${NOT_FOR_ARCHS}s
247 # IA32_BINARY_PORT
248 # - Set this instead of ONLY_FOR_ARCHS if the given port
249 # fetches and installs compiled i386 binaries.
250 #
251 # Dependency checking. Use these if your port requires another port
252 # not in the list below. (Default: empty.)
253 #
254 # EXTRACT_DEPENDS
255 # - A list of "path:dir[:target]" tuples of other ports this
256 # package depends on in the "extract" stage. "path" is
257 # the name of a file if it starts with a slash (/), an
258 # executable otherwise. make will test for the existence
259 # (if it is a full pathname) or search for it in your
260 # $PATH (if it is an executable) and go into "dir" to do
261 # a "make all install" if it's not found. If the third
262 # field ("target") exists, it will be used instead of
263 # ${DEPENDS_TARGET}. The first field also supports a
264 # package name with a version range, in the form package>=1.2
265 # if a particular version is desired.
266 # PATCH_DEPENDS - A list of "path:dir[:target]" tuples of other ports this
267 # package depends on in the "patch" stage. "path" is the
268 # name of a file if it starts with a slash (/), an
269 # executable otherwise. make will test for the existence
270 # (if it is a full pathname) or search for it in your
271 # $PATH (if it is an executable) and go into "dir" to do
272 # a "make all install" if it's not found. If the third
273 # field ("target") exists, it will be used instead of
274 # ${DEPENDS_TARGET}. The first field also supports a
275 # package name with a version range, in the form package>=1.2
276 # if a particular version is desired.
277 # FETCH_DEPENDS - A list of "path:dir[:target]" tuples of other ports this
278 # package depends in the "fetch" stage. "path" is the
279 # name of a file if it starts with a slash (/), an
280 # executable otherwise. make will test for the
281 # existence (if it is a full pathname) or search for
282 # it in your $PATH (if it is an executable) and go
283 # into "dir" to do a "make all install" if it's not
284 # found. If the third field ("target") exists, it will
285 # be used instead of ${DEPENDS_TARGET}. The first field
286 # also supports a package name with a version range, in
287 # the form package>=1.2 if a particular version is desired.
288 # BUILD_DEPENDS - A list of "path:dir[:target]" tuples of other ports this
289 # package depends to build (between the "extract" and
290 # "build" stages, inclusive). The test done to
291 # determine the existence of the dependency is the
292 # same as FETCH_DEPENDS. If the third field ("target")
293 # exists, it will be used instead of ${DEPENDS_TARGET}.
294 # RUN_DEPENDS - A list of "path:dir[:target]" tuples of other ports this
295 # package depends to run. The test done to determine
296 # the existence of the dependency is the same as
297 # FETCH_DEPENDS. This will be checked during the
298 # "install" stage and the name of the dependency will
299 # be put into the package as well. If the third field
300 # ("target") exists, it will be used instead of
301 # ${DEPENDS_TARGET}. The first field also supports a
302 # package name with a version range, in the form package>=1.2
303 # if a particular version is desired.
304 # LIB_DEPENDS - A list of "lib:dir[:target]" tuples of other ports this
305 # package depends on. "lib" is the name of a shared library.
306 # TEST_DEPENDS - A list of "path:dir[:target]" tuples of other ports this
307 # package depends on in the "test" stage. "path" is the
308 # name of a file if it starts with a slash (/), an
309 # executable otherwise. make will test for the existence
310 # (if it is a full pathname) or search for it in your
311 # $PATH (if it is an executable) and go into "dir" to do
312 # a "make all install" if it's not found. If the third
313 # field ("target") exists, it will be used instead of
314 # ${DEPENDS_TARGET}. The first field also supports a
315 # package name with a version range, in the form package>=1.2
316 # if a particular version is desired.
317 # DEPENDS_TARGET
318 # - The default target to execute when a port is calling a
319 # dependency.
320 # Default: install
321 #
322 # These variables control options about how a port gets built and/or
323 # are shorthand notations for common sets of dependencies.
324 # Use these if your port uses some of the common software packages. By
325 # convention these should be set to 'yes', although they only need to be
326 # defined. Defaults: not set, unless explicitly indicated below.
327 #
328 # Note: the distinction between the USE_* and WANT_* variables, and the
329 # WITH_* and WITHOUT_* variables, are that the former are restricted to
330 # usage inside the ports framework, and the latter are reserved for user-
331 # settable options. (Setting USE_* in /etc/make.conf is always wrong).
332 #
333 # WITH_DEBUG - If set, debugging flags are added to CFLAGS and the
334 # binaries don't get stripped by INSTALL_PROGRAM or
335 # INSTALL_LIB. Besides, individual ports might
336 # add their specific to produce binaries for debugging
337 # purposes. You can override the debug flags that are
338 # passed to the compiler by setting DEBUG_FLAGS. It is
339 # set to "-g" at default.
340 #
341 # WITH_DEBUG_PORTS - A list of origins for which WITH_DEBUG will be set
342 #
343 # WITHOUT_SSP - Disable SSP.
344 #
345 # SSP_CFLAGS - Defaults to -fstack-protector. This value
346 # is added to CFLAGS and the necessary flags
347 # are added to LDFLAGS. Note that SSP_UNSAFE
348 # can be used in Makefiles by port maintainers
349 # if a port breaks with it (it should be
350 # extremely rare).
351 #
352 # USE_GCC - If set, this port requires this version of gcc, either in
353 # the system or installed from a port.
354 # USE_CSTD - Override the default C language standard (gnu89, gnu99)
355 # USE_CXXSTD Override the default C++ language standard
356 # USE_BINUTILS - Use binutils suite from port instead of the version in base.
357 # CFLAGS_${ARCH} Append the cflags to CFLAGS only on the specified architecture
358 # CXXFLAGS_${ARCH}
359 # Append the cxxflags to CXXFLAGS only on the specified architecture
360 ##
361 # USE_GL - A list of Mesa or GL related dependencies needed by the port.
362 # Supported components are: egl, glesv2, glut, glu, glw, and gl.
363 # If set to "yes", this is equivalent to "glu". Note that
364 # glew and glut depend on glu, glw and glu depend on gl.
365 ##
366 # USE_SDL - If set, this port uses the sdl libraries.
367 # See bsd.sdl.mk for more information.
368 ##
369 # USE_OPENLDAP - If set, this port uses the OpenLDAP libraries.
370 # Implies: WANT_OPENLDAP_VER?=24
371 # WANT_OPENLDAP_VER
372 # - Legal values are: 23, 24
373 # If set to an unknown value, the port is marked BROKEN.
374 # WANT_OPENLDAP_SASL
375 # - If set, the system should use OpenLDAP libraries
376 # with SASL support.
377 ##
378 # USE_AUTOTOOLS - If set, this port uses various GNU autotools
379 # (libtool, autoconf, autoheader, automake et al.)
380 # See bsd.autotools.mk for more details.
381 ##
382 # USE_FPC - If set, this port relies on the Free Pascal language.
383 # Implies inclusion of bsd.fpc.mk. (Also see
384 # that file for more information on WANT_FPC_*).
385 # USE_JAVA - If set, this port relies on the Java language.
386 # Implies inclusion of bsd.java.mk. (Also see
387 # that file for more information on USE_JAVA_*).
388 # USE_OCAML - If set, this port relies on the OCaml language.
389 # Implies inclusion of bsd.ocaml.mk. (Also see
390 # that file for more information on USE_OCAML*).
391 # USE_RUBY - If set, this port relies on the Ruby language.
392 # Implies inclusion of bsd.ruby.mk. (Also see
393 # that file for more information on USE_RUBY_*).
394 ##
395 # USE_GECKO - If set, this port uses the Gecko/Mozilla product.
396 # See bsd.gecko.mk for more details.
397 ##
398 # USE_WX - If set, this port uses the WxWidgets library and related
399 # components. See bsd.wx.mk for more details.
400 ##
401 #
402 # USE_QT4 - A list of the Qt 4 dependencies the port has (e.g,
403 # corelib, webkit). Implies that the port needs Qt.
404 # Implies the inclusion of bsd.qt.mk. See bsd.qt.mk
405 # for more details.
406 #
407 # USE_QT5 - A list of the Qt 5 dependencies the port has (e.g,
408 # core, webkit). Implies that the port needs Qt.
409 # Implies the inclusion of bsd.qt.mk. See bsd.qt.mk
410 # for more details.
411 ##
412 # USE_LINUX_PREFIX
413 # - Controls the action of PREFIX (see above). Only use this
414 # if the port is a Linux infrastructure port (e.g. contains libs
415 # or a sound server which supports the FreeBSD native one),
416 # use the default prefix if it's a leaf port (e.g. a game or
417 # program).
418 # Implies NO_LICENSES_INSTALL=yes, NO_MTREE=yes, and causes
419 # Linux ldconfig to be used when USE_LDCONFIG is defined.
420 ##
421 # USE_XORG - Set to a list of X.org module dependencies.
422 # Implies inclusion of bsd.xorg.mk.
423 ##
424 # USE_TEX - A list of the TeX dependencies the port has.
425 #
426 ##
427 # USE_RC_SUBR - If set, the ports startup/shutdown script uses the common
428 # routines found in /etc/rc.subr.
429 # If this is set to a list of files, these files will be
430 # automatically added to ${SUB_FILES}, some %%VAR%%'s will
431 # automatically be expanded, they will be installed in
432 # ${PREFIX}/etc/rc.d if ${PREFIX} is not /usr, otherwise they
433 # will be installed in /etc/rc.d/ and added to the packing list.
434 ##
435 # USE_APACHE - If set, this port relies on an apache webserver.
436 #
437 # Conflict checking. Use if your port cannot be installed at the same time as
438 # another package.
439 #
440 # CONFLICTS - A list of package name patterns that the port conflicts
441 # with, separated by blanks. The names may include shell
442 # pattern meta-characters "*", "?", "[", "]", and "!".
443 # Example: apache*-1.2* apache*-1.3.[012345] apache-*+ssl_*
444 #
445 # CONFLICTS_BUILD
446 # - Check conflict prior to the build.
447 #
448 # CONFLICTS_INSTALL
449 # - Check conflict prior to the installation stage.
450 #
451 # Various directory definitions and variables to control them.
452 # You rarely need to redefine any of these except WRKSRC and NO_WRKSUBDIR.
453 #
454 # LOCALBASE - Where ports install things.
455 # Default: /usr/local
456 # LINUXBASE - Where Linux ports install things.
457 # Default: /compat/linux
458 # PREFIX - Where *this* port installs its files.
459 # Default: ${LINUXBASE} if USE_LINUX_PREFIX is set,
460 # otherwise ${LOCALBASE}
461 #
462 # IGNORE_PATH_CHECKS
463 # - There are some sanity checks against PREFIX.
464 # You can disable these checks with defining
465 # this variable, but this is not recommended!
466 # Only do this if you really know what you are
467 # doing. These sanity checks are the following:
468 # - PREFIX has to be an absolute path.
469 # - PREFIX can't have a trailing slash.
470 #
471 # BUNDLE_LIBS Teach pkg(8) to not automatically add all shared libraries
472 # installed by a port as shared libraries "provided" for
473 # other packages (i.e., do not expose them in the solver).
474 # This has to be used for ports that bundle third party
475 # libraries for internal usage.
476 # MASTERDIR - Where the port finds patches, package files, etc. Define
477 # this is you have two or more ports that share most of the
478 # files.
479 # Default: ${.CURDIR}
480 # PORTSDIR - The root of the ports tree.
481 # Default: /usr/ports
482 # DISTDIR - Where to search for and store copies of original sources
483 # Default: ${PORTSDIR}/distfiles
484 # PACKAGES - A top level directory where all packages go (rather than
485 # going locally to each port).
486 # Default: ${PORTSDIR}/packages
487 # WRKDIRPREFIX - The place to root the temporary working directory
488 # hierarchy.
489 # Default: none
490 # WRKDIR - A temporary working directory that gets *clobbered* on clean
491 # Default: ${WRKDIRPREFIX}${.CURDIR}/work
492 # WRKSRC - A subdirectory of ${WRKDIR} where the distribution actually
493 # unpacks to.
494 # Default: ${WRKDIR}/${DISTNAME}
495 # WRKSRC_SUBDIR - A subdirectory of ${WRKSRC} where the distribution actually
496 # builds in.
497 # Default: not set
498 # NO_WRKSUBDIR - Assume port unpacks without a subdirectory, and extract it in
499 # ${WRKSRC} instead of ${WRKDIR}.
500 # PATCHDIR - A directory containing any additional patches you made
501 # to port this software to FreeBSD.
502 # Default: ${MASTERDIR}/files
503 # SCRIPTDIR - A directory containing any auxiliary scripts
504 # Default: ${MASTERDIR}/scripts
505 # FILESDIR - A directory containing any miscellaneous additional files.
506 # Default: ${MASTERDIR}/files
507 # PKGDIR - A directory containing any package creation files.
508 # Default: ${MASTERDIR}
509 # SRC_BASE - The root of the src tree. (Some ports require this to get
510 # kernel sources). Default: /usr/src
511 # UID_FILES - A list of files containing information about registered UIDs.
512 # Note that files have decreasing priority.
513 # GID_FILES - A list of files containing information about registered GIDs.
514 # Note that files have decreasing priority.
515 #
516 # Variables that serve as convenient "aliases" for your *-install targets.
517 # Use these like: "${INSTALL_PROGRAM} ${WRKSRC}/prog ${PREFIX}/bin".
518 #
519 # INSTALL_PROGRAM
520 # - A command to install binary executables. (By
521 # default, also strips them, unless ${STRIP} is
522 # overridden to be the empty string).
523 # INSTALL_KLD - As INSTALL_PROGRAM, but without the STRIP.
524 # INSTALL_LIB - As INSTALL_DATA, but also strips the file.
525 # INSTALL_SCRIPT
526 # - A command to install executable scripts.
527 # INSTALL_DATA - A command to install sharable data and static libs.
528 # INSTALL_MAN - A command to install manpages and documentation.
529 # COPYTREE_BIN
530 # COPYTREE_SHARE
531 # - Similiar to INSTALL_PROGRAM and INSTALL_DATA commands but
532 # working on whole trees of directories, takes 3 arguments,
533 # last one is find(1) arguments and optional.
534 # Example use:
535 # cd ${WRKSRC}/doc && ${COPYTREE_SHARE} . ${DOCSDIR} "! -name *\.bak"
536 #
537 # Installs all directories and files from ${WRKSRC}/doc
538 # to ${DOCSDIR} except sed(1) backup files.
539 #
540 # MANPREFIX - The directory prefix for ${MAN<sect>} and ${MLINKS}.
541 # Default: ${PREFIX}
542 # MAN<sect>PREFIX
543 # - If manual pages of some sections install in different
544 # locations than others, use these.
545 # Default: ${MANPREFIX}
546 #
547 # Set the following to specify all .info files your port installs.
548 #
549 # INFO - A list of .info files (omitting the trailing ".info");
550 # only one entry per document! These files are listed in
551 # the path relative to ${INFO_PATH}.
552 # INFO_PATH - Path, where all .info files will be installed by your
553 # port, relative to ${PREFIX}
554 # Default: "share/info" if ${PREFIX} is equal to /usr
555 # and "info" otherwise.
556 #
557 # Set the following to specify all documentation your port installs into
558 # ${DOCSDIR}
559 #
560 # PORTDOCS - A list of files and directories relative to DOCSDIR.
561 # Shell glob patterns can be used, directories include
562 # the entire subtree of contained files and directories.
563 # Should not be set when no documentation files are
564 # installed.
565 # Useful for dynamically generated documentation.
566 #
567 # Set the following to specify all documentation your port installs into
568 # ${EXAMPLESDIR}
569 #
570 # PORTEXAMPLES - A list of files and directories relative to EXAMPLESDIR.
571 # Shell glob patterns can be used, directories include
572 # the entire subtree of contained files and directories.
573 # Should not be set when no examples files are
574 # installed.
575 # Useful for dynamically generated examples.
576 #
577 # Set the following to specify all files and directories your port installs into
578 # ${DATADIR}
579 #
580 # PORTDATA - A list of files and directories relative to DATADIR.
581 # Shell glob patterns can be used, directories include
582 # the entire subtree of contained files and directories.
583 # Should not be set when no data files are
584 # installed.
585 # Useful for dynamically generated data files.
586 #
587 # Default targets and their behaviors:
588 #
589 # fetch - Retrieves missing ${DISTFILES} and ${PATCHFILES} for this
590 # port.
591 # fetch-list - Show list of commands to retrieve missing ${DISTFILES} and
592 # ${PATCHFILES} for this port.
593 # fetch-recursive
594 # - Retrieves missing ${DISTFILES} and ${PATCHFILES} for this
595 # port and dependencies.
596 # fetch-recursive-list
597 # - Show list of commands to retrieve missing ${DISTFILES} and
598 # ${PATCHFILES} for this port and dependencies.
599 # fetch-required
600 # - Retrieves missing ${DISTFILES} and ${PATCHFILES} for this
601 # port and dependencies.
602 # fetch-required-list
603 # - Show list of commands to retrieve missing ${DISTFILES} and
604 # ${PATCHFILES} for this port and dependencies.
605 # fetch-url-list
606 # - Show list of URLS to retrieve missing ${DISTFILES} and
607 # ${PATCHFILES} for this port.
608 # fetch-urlall-list
609 # - Show list of URLS to retrieve ${DISTFILES} and
610 # ${PATCHFILES} for this port.
611 #
612 # all-depends-list
613 # - Show all directories which are dependencies
614 # for this port.
615 # build-depends-list
616 # - Show all directories which are build-dependencies
617 # for this port.
618 # package-depends-list
619 # - Show all directories which are package-dependencies
620 # for this port. This is based upon the dependency
621 # tree as recorded in the Makefiles of the ports
622 # collection, not as recorded in the currently
623 # installed ports.
624 # actual-package-depends
625 # - Like package-depends-list but with the difference
626 # that the dependencies of the currently installed
627 # ports are used instead of the dependencies as
628 # recorded in the ports collection.
629 # run-depends-list
630 # - Show all directories which are run-dependencies
631 # for this port.
632 # test-depends-list
633 # - Show all directories which are test-dependencies
634 # for this port.
635 #
636 # extract - Unpacks ${DISTFILES} into ${WRKDIR}.
637 # patch - Apply any provided patches to the source.
638 # configure - Runs either GNU configure, one or more local configure
639 # scripts or nothing, depending on what's available.
640 # build - Actually compile the sources.
641 # install - Install the results of a build.
642 # reinstall - Install the results of a build, ignoring "already installed"
643 # flag.
644 # deinstall - Remove the installation.
645 # deinstall-all - Remove all installations with the same PKGORIGIN.
646 # test - Run tests for the port.
647 # package - Create a package from an _installed_ port.
648 # package-recursive
649 # - Create a package for a port and _all_ of its dependencies.
650 # describe - Try to generate a one-line description for each port for
651 # use in INDEX files and the like.
652 # check-plist - Checks for files missing from the plist, and files in the plist
653 # that are not installed by the port.
654 # check-sanity - Perform some basic checks of the port layout.
655 # checkpatch - Do a "patch -C" instead of a "patch". Note that it may
656 # give incorrect results if multiple patches deal with
657 # the same file.
658 # checksum - Use distinfo to ensure that your distfiles are valid.
659 # checksum-recursive
660 # - Run checksum in this port and all dependencies.
661 # makesum - Generate distinfo (only do this for your own ports!).
662 # clean - Remove ${WRKDIR} and other temporary files used for building.
663 # clean-depends - Do a "make clean" for all dependencies.
664 # config - Configure options for this port (using ${DIALOG}).
665 # Automatically run prior to extract, patch, configure, build,
666 # install, and package.
667 # config-recursive
668 # - Configure options for this port for a port and all its
669 # dependencies.
670 # showconfig - Display options config for this port.
671 # showconfig-recursive
672 # - Display options config for this port and all its
673 # dependencies.
674 # rmconfig - Remove the options config for this port.
675 # rmconfig-recursive
676 # - Remove the options config for this port and all its
677 # dependencies.
678 #
679 # Default sequence for "all" is:
680 #
681 # check-sanity fetch checksum extract patch configure build
682 #
683 # Please read the comments in the targets section below; you
684 # should be able to use the pre-* or post-* targets/scripts
685 # (which are available for every stage except checksum) or
686 # override the do-* targets to do pretty much anything you want.
687 #
688 # The TARGET_ORDER_OVERRIDE variable can be set to multiple <priority>:<target>
689 # to change the ordering of targets, have a look at the _SEQ variables at the
690 # end of this file for the default order and priorities.
691 #
692 # NEVER override the "regular" targets unless you want to open
693 # a major can of worms.
694 #
695 # Set these variables if your port doesn't need some of the steps.
696 # Note that there are no NO_PATCH or NO_CONFIGURE variables because
697 # those steps are empty by default. NO_EXTRACT is not allowed anymore
698 # since we need to at least create ${WRKDIR}. Also, NO_CHECKSUM is a user
699 # variable and is not to be set in a port's Makefile. See above for NO_PACKAGE.
700 #
701 # NO_BUILD - Use a dummy (do-nothing) build target.
702 # NO_INSTALL - Use a dummy (do-nothing) install target.
703 # NO_TEST - Use a dummy (do-nothing) test target.
704 #
705 # Here are some variables used in various stages.
706 #
707 # For options see bsd.options.mk
708 #
709 # For fetch:
710 #
711 # FETCH_BINARY - Path to ftp/http fetch command if not in $PATH.
712 # Default: "/usr/bin/fetch"
713 # FETCH_ARGS - Arguments to ftp/http fetch command.
714 # Default: "-Fpr"
715 # FETCH_CMD - ftp/http fetch command.
716 # Default: ${FETCH_BINARY} ${FETCH_ARGS}
717 # FETCH_BEFORE_ARGS
718 # - Arguments to ${FETCH_CMD} before filename.
719 # Default: none
720 # FETCH_AFTER_ARGS
721 # - Arguments to ${FETCH_CMD} following filename.
722 # Default: none
723 # FETCH_ENV - Environment to pass to ${FETCH_CMD}.
724 # Default: none
725 # FETCH_REGET - Times to retry fetching of files on checksum errors.
726 # Default: 1
727 # CLEAN_FETCH_ENV
728 # - Disable package dependency in fetch target for mass
729 # fetching. User settable.
730 #
731 # For extract:
732 #
733 # EXTRACT_CMD - Command for extracting archive
734 # Default: ${TAR}
735 # EXTRACT_BEFORE_ARGS
736 # - Arguments to ${EXTRACT_CMD} before filename.
737 # Default: "-xf"
738 # EXTRACT_AFTER_ARGS
739 # - Arguments to ${EXTRACT_CMD} following filename.
740 # Default: "--no-same-owner --no-same-permissions"
741 # For patch:
742 #
743 # EXTRA_PATCHES - Define this variable if you have patches not in
744 # ${PATCHDIR}. This usually happens when you need to
745 # do some pre-processing before some distribution
746 # patches can be applied. In that case, fetch them as
747 # extra distfiles, put the processed results in
748 # ${WRKDIR}, then point EXTRA_PATCHES to them.
749 # The patches specified by this variable will be
750 # applied after the normal distribution patches but
751 # before those in ${PATCHDIR}.
752 # PATCH_WRKSRC - Directory to apply patches in.
753 # Default: ${WRKSRC}
754 #
755 # For configure:
756 #
757 # HAS_CONFIGURE - If set, this port has its own configure script. The
758 # configure stage will not do anything if this is not set.
759 # GNU_CONFIGURE - If set, you are using GNU configure (optional). Implies
760 # HAS_CONFIGURE.
761 # CONFIGURE_OUTSOURCE - If set, this port builds in an empty ${CONFIGURE_WRKSRC}
762 # not being under ${WRKSRC}.
763 # CONFIGURE_WRKSRC
764 # - Directory to run configure in.
765 # Default: ${WRKSRC}
766 # CONFIGURE_SCRIPT
767 # - Name of configure script, relative to ${CONFIGURE_WRKSRC}.
768 # Default: "Makefile.PL" if USES=perl5 and USE_PERL5=configure
769 # are set, "configure" otherwise.
770 # CONFIGURE_TARGET
771 # - The name of target to call when GNU_CONFIGURE is
772 # defined.
773 # Default: ${ARCH}-portbld-${OPSYS:tl}${OSREL}
774 # GNU_CONFIGURE_PREFIX
775 # - The directory passed as prefix to the configure script if
776 # GNU_CONFIGURE is set.
777 # Default: ${PREFIX}
778 # CONFIGURE_ARGS
779 # - Pass these args to configure if ${HAS_CONFIGURE} is set.
780 # Default: "--prefix=${GNU_CONFIGURE_PREFIX}
781 # --infodir=${PREFIX}/${INFO_PATH} --localstatedir=/var
782 # --mandir=${MANPREFIX}/man --build=${CONFIGURE_TARGET}" if
783 # GNU_CONFIGURE is set, "CC=${CC} CFLAGS=${CFLAGS}
784 # PREFIX=${PREFIX} INSTALLPRIVLIB=${PREFIX}/lib
785 # INSTALLARCHLIB=${PREFIX}/lib" if USES=perl5 and
786 # USE_PERL5=configure are set, empty otherwise.
787 # CONFIGURE_ENV - Pass these env (shell-like) to configure if
788 # ${HAS_CONFIGURE} is set.
789 # CONFIGURE_LOG - The name of configure log file. It will be printed to
790 # the screen if configure fails.
791 # Default: config.log
792 # CONFIGURE_FAIL_MESSAGE
793 # - A message displayed to users when configure
794 # fails (note: this assumes the do-configure
795 # target has not been overwritten). This message
796 # will be passed through /usr/bin/fmt before
797 # being shown to the user.
798 #
799 # WITHOUT_FBSD10_FIX Disable FreeBSD 10.0 autotools workaround.
800 #
801 # For build and install:
802 #
803 # MAKEFILE - Name of the makefile.
804 # Default: Makefile
805 # ALL_TARGET - Default target for sub-make in build stage.
806 # Default: all
807 # BUILD_WRKSRC - Directory to do build in (default: ${WRKSRC}).
808 # MAKE_ENV - Additional environment vars passed to sub-make in build
809 # and install stages.
810 # Default: see below
811 # MAKE_ARGS - Any extra arguments to sub-make in build and install stages.
812 # Default: none
813 ##
814 # MAKE_JOBS_UNSAFE
815 # - Disallow multiple jobs even when user set a global override.
816 # To be used with known bad ports.
817 # DISABLE_MAKE_JOBS
818 # - Set to disable the multiple jobs feature. User settable.
819 # MAKE_JOBS_NUMBER
820 # - Override the number of make jobs to be used. User settable.
821 # MAKE_JOBS_NUMBER_LIMIT
822 # - Set a limit for maximum number of make jobs allowed to be
823 # used.
824 ## cacche
825 #
826 # WITH_CCACHE_BUILD
827 # - Enable CCACHE support (devel/ccache). User settable.
828 # CCACHE_DIR
829 # - Which directory to use for ccache (default: $HOME/.ccache)
830 # NO_CCACHE
831 # - Disable CCACHE support for example for certain ports if
832 # CCACHE is enabled. User settable.
833 #
834 # For test:
835 #
836 # TEST_TARGET - Target for sub-make in test stage. If not defined,
837 # no default test target is provided.
838 # Default: (none)
839 # TEST_WRKSRC - Directory to do test in (default: ${WRKSRC}).
840 # TEST_ENV - Additional environment vars passed to sub-make in test
841 # stage
842 # Default: ${MAKE_ENV}
843 # TEST_ARGS - Any extra arguments to sub-make in test stage
844 # Default: ${MAKE_ARGS}
845 #
846 # For install:
847 #
848 # INSTALL_TARGET
849 # - Default target for sub-make in install stage.
850 # Default: install
851 # INSTALL_WRKSRC
852 # - Directory to install from
853 # Default: ${WRKSRC}
854 # NO_MTREE - If set, will not invoke mtree from bsd.port.mk from
855 # the "install" target.
856 # MTREE_FILE - The name of the mtree file.
857 # Default: ${PORTSDIR}/Templates/BSD.local.dist or
858 # /etc/mtree/BSD.usr.dist if ${PREFIX} == "/usr".
859 # PLIST_DIRS - Directories to be added to packing list
860 # PLIST_FILES - Files and symbolic links to be added to packing list
861 #
862 # PLIST - Name of the `packing list' file.
863 # Change this to ${WRKDIR}/PLIST or something if you
864 # need to write to it. (It is not a good idea for a port
865 # to write to any file outside ${WRKDIR} during a normal
866 # build.)
867 # Default: ${PKGDIR}/pkg-plist
868 # TMPPLIST - Name of the `packing list' file after processing
869 # Default: ${WRKDIR}/.PLIST.mktmp
870 # PLIST_SUB - List of "variable=value" pair for substitution in ${PLIST}
871 # Default: see below
872 #
873 # SUB_FILES - Files that should be passed through sed(1) and redirected to
874 # ${WRKDIR}.
875 # - For each file specified in SUB_FILES, there must be a
876 # corresponding file in ${FILESDIR} whose suffix is ".in". For
877 # instance, if the Makefile specifies "SUB_FILES= pkg-message"
878 # then there must be a file called pkg-message.in in
879 # ${FILESDIR}.
880 # - The substitution process is the same as PLIST_FILES, as
881 # described below except that any line beginning with @comment
882 # is deleted.
883 # SUB_LIST - List of "variable=value" pair for substitution in ${SUB_FILES}
884 # Some pairs are added by default: eg. PREFIX=${PREFIX}
885 #
886 # USE_LDCONFIG - If set to "yes", this adds ${PREFIX}/lib to the list of
887 # directories to be searched for shared libraries.
888 # Otherwise, this is a list of directories to be added to that
889 # list. The directory names are written to
890 # ${LOCALBASE}/libdata/ldconfig/${PKGBASE} which is then
891 # used by the ldconfig startup script.
892 # This mechanism replaces ldconfig scripts installed by some
893 # ports, often under such names as 000.${UNQUENAME}.sh.
894 # If USE_LINUX_PREFIX is defined, the Linux version of
895 # ldconfig will be used instead of the native FreeBSD
896 # version, and the directory list given will be ignored.
897 # USE_LDCONFIG32
898 # - Same as USE_LDCONFIG but the target file is
899 # ${LOCALBASE}/libdata/ldconfig32/${PKGBASE} instead.
900 # Note: that should only be used on 64-bit architectures.
901 #
902 # DOCSDIR - Name of the directory to install the packages docs in.
903 # Default: ${PREFIX}/share/doc/${PORTNAME}
904 # DOCSDIR_REL - The DOCSDIR relative to ${PREFIX}
905 # EXAMPLESDIR - Name of the directory to install the packages examples in.
906 # Default: ${PREFIX}/share/examples/${PORTNAME}
907 # EXAMPLESDIR_REL
908 # - The EXAMPLESDIR relative to ${PREFIX}
909 # DATADIR - Name of the directory to install the packages shared data in.
910 # Default: ${PREFIX}/share/${PORTNAME}
911 # DATADIR_REL - The DATADIR relative to ${PREFIX}
912 #
913 # WWWDIR - Name of the directory to install the packages www data in.
914 # Default: ${PREFIX}/www/${PORTNAME}
915 # WWWDIR_REL - The WWWDIR relative to ${PREFIX}
916 #
917 # USERS - List of users to create at install time. Each login must
918 # have a corresponding entry in ${UID_FILES}.
919 # GROUPS - List of groups to create at install time. Each group must
920 # have a corresponding entry in ${GID_FILES}.
921 #
922 # DESKTOPDIR - Name of the directory to install ${DESKTOP_ENTRIES} in.
923 # Default: ${PREFIX}/share/applications
924 # DESKTOP_ENTRIES
925 # - List of desktop entry files to generate and install in
926 # ${DESKTOPDIR}. The format is
927 # "Name" "Comment" "Icon" "Exec" "Categories" StartupNotify
928 # Rules:
929 # * Only add desktop entries for applications which do not
930 # require a terminal (ie. X applications).
931 # * If the upstream distribution already installs .desktop
932 # files, you do not need to use this.
933 # * If you require a more elaborate .desktop file than this
934 # variable permits, write it yourself and install it
935 # in ${DESKTOPDIR}.
936 # Notes:
937 # * Comment, Icon and StartupNotify may be empty
938 # strings (""). Categories may be an empty string in some
939 # cases (see below). The other fields are mandatory.
940 # * If Comment is an empty string, port ${COMMENT} will be
941 # used.
942 # * If set, Icon must be either absolute path (usually
943 # ${PREFIX}/share/pixmaps/${PORTNAME}.png) or icon name
944 # without extension if installed icons follow Icon Theme
945 # Specification.
946 # * If Categories is an empty string, bsd.port.mk will try
947 # to deduce a default value using the CATEGORIES variable.
948 # If the deduction fails, you will have to set Categories
949 # manually. You should check the generated value using
950 # "make desktop-categories", and override it if necessary.
951 # * Exec will also be used to name the .desktop file.
952 # * StartupNotify may be true, false or empty (see Desktop
953 # Entry Specification for details).
954 # * The files will be automatically added to ${PLIST}.
955 # Example:
956 # "X Window Information" \
957 # "Get information about X windows" \
958 # "${PREFIX}/share/pixmaps/wininfo.png" \
959 # "${PREFIX}/bin/wininfo" \
960 # "System;" \
961 # ""
962 # See http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html
963 # for an explanation of the fields. If you need to create more
964 # than one file, just chain them into a single variable.
965 #
966 # Note that the install target will automatically add manpages (see
967 # above) and also substitute special sequences of characters (delimited
968 # by "%%") as defined in PLIST_SUB to generate ${TMPPLIST}. For
969 # instance, "OSREL=${OSREL}" in PLIST_SUB causes all occurrences of
970 # "%%OSREL%%" in ${PLIST} to be substituted by the value of OSREL.
971 # ${TMPPLIST} is generated before the do-install stage. If you are
972 # generating the packing list on-the-fly, make sure it's generated before
973 # do-install is called!
974 #
975 # This is used in all stages:
976 #
977 # SCRIPTS_ENV - Additional environment vars passed to scripts in
978 # ${SCRIPTDIR} executed by bsd.port.mk.
979 # Default: see below
980 #
981 # Finally, variables to change if you want a special behavior. These
982 # are for debugging purposes. Don't set them in your Makefile.
983 #
984 # ECHO_MSG - Used to print all the '===>' style prompts - override this
985 # to turn them off.
986 # Default: ${ECHO_CMD}
987 # PATCH_DEBUG - If set, print out more information about the patches as
988 # it attempts to apply them.
989 # PKG_DBDIR - Where package installation is recorded; this directory
990 # must not contain anything else.
991 # Default: /var/db/pkg
992 # PORT_DBDIR - Where port configuration options are recorded.
993 # Default: /var/db/ports
994 # NO_PKG_REGISTER
995 # - Don't register a port installation as a package.
996 # FORCE_PKG_REGISTER
997 # - If set, it will overwrite any existing package
998 # registration information in ${PKG_DBDIR}/${PKGNAME}.
999 # NO_DEPENDS - Don't verify build of dependencies.
1000 # STRICT_DEPENDS
1001 # - Verify dependencies but consider missing dependencies as
1002 # fatal.
1003 # CHECKSUM_ALGORITHMS
1004 # - Different checksum algorithms to check for verifying the
1005 # integrity of the distfiles. The absence of the algorithm
1006 # in distinfo doesn't make it fail.
1007 # Default: sha256
1008 # NO_CHECKSUM - Don't verify the checksum. Typically used when
1009 # when you noticed the distfile you just fetched has
1010 # a different checksum and you intend to verify if
1011 # the port still works with it.
1012 # USE_PACKAGE_DEPENDS
1013 # - Try to install dependencies from existing packages instead
1014 # of building the port from scratch. Fallback on source
1015 # if an existing package is not present.
1016 # USE_PACKAGE_DEPENDS_ONLY
1017 # - Like USE_PACKAGE_DEPENDS, but do not fallback on source.
1018 # INSTALL_AS_USER
1019 # - Define this to install as the current user, intended
1020 # for systems where you have no root access.
1021 # DISABLE_SIZE - Do not check the size of a distfile even if the SIZE field
1022 # has been specified in distinfo. This is useful
1023 # when using an alternate FETCH_CMD.
1024 #
1025 # PKG_CREATE_VERBOSE - If set, pass the -v option to pkg create which
1026 # ensures periodic output during packaging and
1027 # will help prevent timeouts by build monitors
1028 #
1029 # End of the list of all variables that need to be defined in a port.
1030 # Most port authors should not need to understand anything after this point.
1031 #
1032
1033 # These need to be absolute since we don't know how deep in the ports
1034 # tree we are and thus can't go relative. They can, of course, be overridden
1035 # by individual Makefiles or local system make configuration.
1036 PORTSDIR?= /usr/ports
1037 LOCALBASE?= /usr/local
1038 LINUXBASE?= /compat/linux
1039 DISTDIR?= ${PORTSDIR}/distfiles
1040 _DISTDIR?= ${DISTDIR}/${DIST_SUBDIR}
1041 INDEXDIR?= ${PORTSDIR}
1042 SRC_BASE?= /usr/src
1043 USESDIR?= ${PORTSDIR}/Mk/Uses
1044 SCRIPTSDIR?= ${PORTSDIR}/Mk/Scripts
1045 LIB_DIRS?= /lib /usr/lib ${LOCALBASE}/lib
1046 STAGEDIR?= ${WRKDIR}/stage
1047 NOTPHONY?=
1048 MINIMAL_PKG_VERSION= 1.6.0
1049
1050 # make sure bmake treats -V as expected
1051 .MAKE.EXPAND_VARIABLES= yes
1052
1053 .include "${PORTSDIR}/Mk/bsd.commands.mk"
1054
1055 .if defined(CROSS_TOOLCHAIN)
1056 .if !defined(.PARSEDIR)
1057 IGNORE= Cross building can only be done when using bmake(1) as make(1)
1058 .endif
1059 .if !defined(CROSS_SYSROOT)
1060 IGNORE= CROSS_SYSROOT should be defined
1061 .endif
1062 .include "${LOCALBASE}/share/toolchains/${CROSS_TOOLCHAIN}.mk"
1063 # Do not define CPP on purpose
1064 .if !defined(HOSTCC)
1065 HOSTCC:= ${CC}
1066 HOSTCXX:= ${CXX}
1067 .endif
1068 CC= ${XCC}
1069 CXX= ${XCXX}
1070 CFLAGS+= --sysroot=${CROSS_SYSROOT} -isystem ${CROSS_SYSROOT}/usr/include
1071 CXXFLAGS+= --sysroot=${CROSS_SYSROOT} -isystem ${CROSS_SYSROOT}/usr/include/c++/v1 -nostdinc++
1072 LDFLAGS+= --sysroot=${CROSS_SYSROOT}
1073 .for _tool in AS AR LD NM OBJCOPY RANLIB SIZE STRINGS
1074 ${_tool}= ${CROSS_BINUTILS_PREFIX}${tool:tl}
1075 .endfor
1076 STRIP_CMD= ${CROSS_BINUTILS_PREFIX}strip
1077 # only bmake support the below
1078 STRIPBIN= ${STRIP_CMD}
1079 .export.env STRIPBIN
1080 .endif
1081
1082 #
1083 # DESTDIR section to start a chrooted process if invoked with DESTDIR set
1084 #
1085
1086 .if defined(DESTDIR) && !empty(DESTDIR) && !defined(CHROOTED) && \
1087 !defined(BEFOREPORTMK) && !defined(INOPTIONSMK)
1088
1089 .include "${PORTSDIR}/Mk/bsd.destdir.mk"
1090
1091 .else
1092
1093 .if !target(makepatch)
1094 makepatch:
1095 @${SETENV} WRKDIR=${WRKDIR} PATCHDIR=${PATCHDIR} \
1096 PATCH_WRKSRC=${PATCH_WRKSRC} \
1097 STRIP_COMPONENTS="${PATCH_STRIP:S/-p//}" \
1098 ${SH} ${SCRIPTSDIR}/smart_makepatch.sh
1099 .endif
1100
1101
1102 # Start of options section
1103 .if defined(INOPTIONSMK) || ( !defined(USEOPTIONSMK) && !defined(AFTERPORTMK) )
1104
1105
1106 # Get the default maintainer
1107 MAINTAINER?= ports@FreeBSD.org
1108
1109 # Get the architecture
1110 .if !defined(ARCH)
1111 ARCH!= ${UNAME} -p
1112 .endif
1113 _EXPORTED_VARS+= ARCH
1114
1115 # Get the operating system type
1116 .if !defined(OPSYS)
1117 OPSYS!= ${UNAME} -s
1118 .endif
1119 _EXPORTED_VARS+= OPSYS
1120
1121 .if !defined(_OSRELEASE)
1122 _OSRELEASE!= ${UNAME} -r
1123 .endif
1124 _EXPORTED_VARS+= _OSRELEASE
1125
1126 # Get the operating system revision
1127 OSREL?= ${_OSRELEASE:C/-.*//}
1128 _EXPORTED_VARS+= OSREL
1129
1130 # Get __FreeBSD_version
1131 .if !defined(OSVERSION)
1132 .if exists(/usr/include/sys/param.h)
1133 OSVERSION!= ${AWK} '/^\#define[[:blank:]]__FreeBSD_version/ {print $$3}' < /usr/include/sys/param.h
1134 .elif exists(${SRC_BASE}/sys/sys/param.h)
1135 OSVERSION!= ${AWK} '/^\#define[[:blank:]]__FreeBSD_version/ {print $$3}' < ${SRC_BASE}/sys/sys/param.h
1136 .else
1137 .error Unable to determine OS version. Either define OSVERSION, install /usr/include/sys/param.h or define SRC_BASE.
1138 .endif
1139 .endif
1140 _EXPORTED_VARS+= OSVERSION
1141
1142 # Convert OSVERSION to major release number
1143 _OSVERSION_MAJOR= ${OSVERSION:C/([0-9]?[0-9])([0-9][0-9])[0-9]{3}/\1/}
1144 # Sanity checks for chroot/jail building.
1145 # Skip if OSVERSION specified on cmdline for testing. Only works for bmake.
1146 .if !defined(.MAKEOVERRIDES) || !${.MAKEOVERRIDES:MOSVERSION}
1147 .if ${_OSVERSION_MAJOR} != ${_OSRELEASE:R}
1148 .error UNAME_r (${_OSRELEASE}) and OSVERSION (${OSVERSION}) do not agree on major version number.
1149 .elif ${_OSVERSION_MAJOR} != ${OSREL:R}
1150 .error OSREL (${OSREL}) and OSVERSION (${OSVERSION}) do not agree on major version number.
1151 .endif
1152 .endif
1153
1154 # Only define tools here (for transition period with between pkg tools)
1155 .include "${PORTSDIR}/Mk/bsd.commands.mk"
1156
1157 .if !defined(_PKG_CHECKED) && !defined(PACKAGE_BUILDING) && exists(${PKG_BIN})
1158 .if !defined(_PKG_VERSION)
1159 _PKG_VERSION!= ${PKG_BIN} -v
1160 .endif
1161 _PKG_STATUS!= ${PKG_BIN} version -t ${_PKG_VERSION:C/-.*//g} ${MINIMAL_PKG_VERSION}
1162 .if ${_PKG_STATUS} == "<"
1163 IGNORE= pkg(8) must be version ${MINIMAL_PKG_VERSION} or greater, but you have ${_PKG_VERSION}. You must upgrade the ${PKG_ORIGIN} port first
1164 .endif
1165 _PKG_CHECKED= 1
1166 .endif
1167 _EXPORTED_VARS+= _PKG_CHECKED
1168
1169 MASTERDIR?= ${.CURDIR}
1170
1171 .if ${MASTERDIR} != ${.CURDIR}
1172 SLAVE_PORT?= yes
1173 MASTER_PORT?=${MASTERDIR:C/[^\/]+\/\.\.\///:C/[^\/]+\/\.\.\///:C/^.*\/([^\/]+\/[^\/]+)$/\\1/}
1174 .else
1175 SLAVE_PORT?= no
1176 MASTER_PORT?=
1177 .endif
1178
1179 # If they exist, include Makefile.inc, then architecture/operating
1180 # system specific Makefiles, then local Makefile.local.
1181
1182 .if ${MASTERDIR} != ${.CURDIR} && exists(${.CURDIR}/../Makefile.inc)
1183 .include "${.CURDIR}/../Makefile.inc"
1184 USE_SUBMAKE= yes
1185 .endif
1186
1187 .if exists(${MASTERDIR}/../Makefile.inc)
1188 .include "${MASTERDIR}/../Makefile.inc"
1189 USE_SUBMAKE= yes
1190 .endif
1191
1192 .if exists(${MASTERDIR}/Makefile.${ARCH}-${OPSYS})
1193 .include "${MASTERDIR}/Makefile.${ARCH}-${OPSYS}"
1194 USE_SUBMAKE= yes
1195 .elif exists(${MASTERDIR}/Makefile.${OPSYS})
1196 .include "${MASTERDIR}/Makefile.${OPSYS}"
1197 USE_SUBMAKE= yes
1198 .elif exists(${MASTERDIR}/Makefile.${ARCH})
1199 .include "${MASTERDIR}/Makefile.${ARCH}"
1200 USE_SUBMAKE= yes
1201 .endif
1202
1203 .if exists(${MASTERDIR}/Makefile.local)
1204 .include "${MASTERDIR}/Makefile.local"
1205 USE_SUBMAKE= yes
1206 .elif ${MASTERDIR} != ${.CURDIR} && exists(${.CURDIR}/Makefile.local)
1207 .include "${.CURDIR}/Makefile.local"
1208 USE_SUBMAKE= yes
1209 .endif
1210
1211 .for _CATEGORY in ${CATEGORIES}
1212 PKGCATEGORY?= ${_CATEGORY}
1213 .endfor
1214 _PORTDIRNAME= ${.CURDIR:T}
1215 PORTDIRNAME?= ${_PORTDIRNAME}
1216 PKGORIGIN?= ${PKGCATEGORY}/${PORTDIRNAME}
1217
1218 # where 'make config' records user configuration options
1219 PORT_DBDIR?= /var/db/ports
1220
1221 UID_FILES?= ${PORTSDIR}/UIDs
1222 GID_FILES?= ${PORTSDIR}/GIDs
1223 UID_OFFSET?= 0
1224 GID_OFFSET?= 0
1225
1226 # predefined accounts from src/etc/master.passwd
1227 # alpha numeric sort order
1228 USERS_BLACKLIST= _dhcp _pflogd _ypldap auditdistd bin bind daemon games hast kmem mailnull man news nobody operator pop proxy root smmsp sshd toor tty unbound uucp www
1229
1230 # predefined accounts from src/etc/group
1231 # alpha numeric sort order
1232 GROUPS_BLACKLIST= _dhcp _pflogd _ypldap audit authpf bin bind daemon dialer ftp games guest hast kmem mail mailnull man network news nobody nogroup operator proxy smmsp sshd staff sys tty unbound uucp wheel www
1233
1234 LDCONFIG_DIR= libdata/ldconfig
1235 LDCONFIG32_DIR= libdata/ldconfig32
1236
1237 .endif
1238
1239 # At least KDE needs TMPDIR for the package building,
1240 # so we're setting it to the known default value.
1241 .if defined(PACKAGE_BUILDING)
1242 TMPDIR?= /tmp
1243 .endif # defined(PACKAGE_BUILDING)
1244
1245 .if defined(WITH_DEBUG_PORTS)
1246 .if ${WITH_DEBUG_PORTS:M${PKGORIGIN}}
1247 WITH_DEBUG= yes
1248 .endif
1249 .endif
1250
1251 .include "${PORTSDIR}/Mk/bsd.options.mk"
1252
1253 # Start of pre-makefile section.
1254 .if !defined(AFTERPORTMK) && !defined(INOPTIONSMK)
1255
1256 .if defined(PORTNAME)
1257 .include "${PORTSDIR}/Mk/bsd.sanity.mk"
1258 .endif
1259
1260 _PREMKINCLUDED= yes
1261
1262 .include "${PORTSDIR}/Mk/bsd.default-versions.mk"
1263
1264 .if defined(PORTVERSION)
1265 .if ${PORTVERSION:M*[-_,]*}x != x
1266 IGNORE= PORTVERSION ${PORTVERSION} may not contain '-' '_' or ','
1267 .endif
1268 DISTVERSION?= ${PORTVERSION:S/:/::/g}
1269 .elif defined(DISTVERSION)
1270 PORTVERSION= ${DISTVERSION:tl:C/([a-z])[a-z]+/\1/g:C/([0-9])([a-z])/\1.\2/g:C/:(.)/\1/g:C/[^a-z0-9+]+/./g}
1271 .endif
1272
1273 PORTREVISION?= 0
1274 .if ${PORTREVISION} != 0
1275 _SUF1= _${PORTREVISION}
1276 .endif
1277
1278 PORTEPOCH?= 0
1279 .if ${PORTEPOCH} != 0
1280 _SUF2= ,${PORTEPOCH}
1281 .endif
1282
1283 PKGVERSION= ${PORTVERSION:C/[-_,]/./g}${_SUF1}${_SUF2}
1284 PKGNAME= ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}-${PKGVERSION}
1285 DISTVERSIONFULL= ${DISTVERSIONPREFIX}${DISTVERSION:C/:(.)/\1/g}${DISTVERSIONSUFFIX}
1286 .if defined(USE_GITHUB) && empty(MASTER_SITES:MGHC) && empty(DISTNAME) && empty(USE_GITHUB:Mnodefault)
1287 _GITHUB_MUST_SET_DISTNAME= yes
1288 .else
1289 DISTNAME?= ${PORTNAME}-${DISTVERSIONFULL}
1290 .endif
1291
1292 INDEXFILE?= INDEX-${OSVERSION:C/([0-9]*)[0-9]{5}/\1/}
1293
1294 .if defined(USE_XORG) || defined(XORG_CAT)
1295 .include "${PORTSDIR}/Mk/bsd.xorg.mk"
1296 .endif
1297
1298 PACKAGES?= ${PORTSDIR}/packages
1299 TEMPLATES?= ${PORTSDIR}/Templates
1300 KEYWORDS?= ${PORTSDIR}/Keywords
1301
1302 PATCHDIR?= ${MASTERDIR}/files
1303 FILESDIR?= ${MASTERDIR}/files
1304 SCRIPTDIR?= ${MASTERDIR}/scripts
1305 PKGDIR?= ${MASTERDIR}
1306
1307 PREFIX?= ${LOCALBASE}
1308
1309 PKGCOMPATDIR?= ${LOCALBASE}/lib/compat/pkg
1310
1311 .if defined(USE_LOCAL_MK)
1312 .include "${PORTSDIR}/Mk/bsd.local.mk"
1313 .endif
1314
1315 .if defined(USE_OPENSSL)
1316 USES+= ssl
1317 .endif
1318
1319 .if defined(USE_EMACS)
1320 .include "${PORTSDIR}/Mk/bsd.emacs.mk"
1321 .endif
1322
1323 .if defined(USE_PHP) && (!defined(USES) || ( defined(USES) && !${USES:Mphp*} ))
1324 DEV_WARNING+= "Using USE_PHP alone is deprecated, please use USES=php"
1325 USES+= php
1326 .endif
1327
1328 .if defined(USE_FPC) || defined(WANT_FPC_BASE) || defined(WANT_FPC_ALL)
1329 .include "${PORTSDIR}/Mk/bsd.fpc.mk"
1330 .endif
1331
1332 .if defined(USE_JAVA)
1333 .include "${PORTSDIR}/Mk/bsd.java.mk"
1334 .endif
1335
1336 .if defined(USE_RUBY) || defined(USE_LIBRUBY)
1337 .include "${PORTSDIR}/Mk/bsd.ruby.mk"
1338 .endif
1339
1340 .if defined(USE_OCAML)
1341 .include "${PORTSDIR}/Mk/bsd.ocaml.mk"
1342 .endif
1343
1344 .if defined(USE_APACHE) || defined(USE_APACHE_BUILD) || defined(USE_APACHE_RUN)
1345 .include "${PORTSDIR}/Mk/bsd.apache.mk"
1346 .endif
1347
1348 .if defined(USE_QT4) || defined(USE_QT5)
1349 .include "${PORTSDIR}/Mk/bsd.qt.mk"
1350 .endif
1351
1352 .if defined(USE_TEX)
1353 .include "${PORTSDIR}/Mk/bsd.tex.mk"
1354 .endif
1355
1356 .if defined(USE_GECKO)
1357 .include "${PORTSDIR}/Mk/bsd.gecko.mk"
1358 .endif
1359
1360 .if defined(WANT_GNOME) || defined(USE_GNOME) || defined(INSTALLS_ICONS)
1361 USES+= gnome
1362 .endif
1363
1364 .if defined(USE_MATE)
1365 USES+= mate
1366 .endif
1367
1368 .if defined(USE_MYSQL)
1369 USE_MYSQL:= ${USE_MYSQL:N[yY][eE][sS]:Nclient}
1370 .if defined(WANT_MYSQL_VER)
1371 .if empty(USE_MYSQL)
1372 USE_MYSQL:=${WANT_MYSQL_VER}
1373 .else
1374 USE_MYSQL:=${USE_MYSQL},${WANT_MYSQL_VER}
1375 .endif
1376 .endif
1377 USES+=mysql:${USE_MYSQL}
1378 .endif
1379
1380 .if defined(WANT_WX) || defined(USE_WX) || defined(USE_WX_NOT)
1381 .include "${PORTSDIR}/Mk/bsd.wx.mk"
1382 .endif
1383
1384 .if defined(WANT_GSTREAMER) || defined(USE_GSTREAMER) || defined(USE_GSTREAMER1)
1385 .include "${PORTSDIR}/Mk/bsd.gstreamer.mk"
1386 .endif
1387
1388 .if defined(USE_SDL)
1389 .include "${PORTSDIR}/Mk/bsd.sdl.mk"
1390 .endif
1391
1392 .if !defined(UID)
1393 UID!= ${ID} -u
1394 .endif
1395
1396 DESTDIRNAME?= DESTDIR
1397
1398 # setup empty variables for USES targets
1399 .for target in sanity fetch extract patch configure build install test package stage
1400 _USES_${target}?=
1401 .endfor
1402
1403 # Loading features
1404 .for f in ${USES}
1405 _f:= ${f:C/\:.*//}
1406 .if !defined(${_f}_ARGS)
1407 ${_f}_ARGS:= ${f:C/^[^\:]*(\:|\$)//:S/,/ /g}
1408 .endif
1409 .endfor
1410 .for f in ${USES}
1411 .include "${USESDIR}/${f:C/\:.*//}.mk"
1412 .endfor
1413
1414 EXTRACT_SUFX?= .tar.gz
1415
1416 .if defined(USE_LINUX_PREFIX)
1417 PREFIX= ${LINUXBASE}
1418 DATADIR?= ${PREFIX}/usr/share/${PORTNAME}
1419 DOCSDIR?= ${PREFIX}/usr/share/doc/${PORTNAME}-${PORTVERSION}
1420 NO_LICENSES_INSTALL= yes
1421 NO_MTREE= yes
1422 .endif
1423
1424 # You can force skipping these test by defining IGNORE_PATH_CHECKS
1425 .if !defined(IGNORE_PATH_CHECKS)
1426 .if ! ${PREFIX:M/*}
1427 .BEGIN:
1428 @${ECHO_MSG} "PREFIX must be defined as an absolute path so that when 'make'"
1429 @${ECHO_MSG} "is invoked in the work area PREFIX points to the right place."
1430 @${FALSE}
1431 .endif
1432 .endif
1433
1434 DATADIR?= ${PREFIX}/share/${PORTNAME}
1435 DOCSDIR?= ${PREFIX}/share/doc/${PORTNAME}
1436 ETCDIR?= ${PREFIX}/etc/${PORTNAME}
1437 EXAMPLESDIR?= ${PREFIX}/share/examples/${PORTNAME}
1438 WWWDIR?= ${PREFIX}/www/${PORTNAME}
1439
1440 # Owner and group of the WWW user
1441 WWWOWN?= www
1442 WWWGRP?= www
1443
1444 # Keep PKGNG_ORIGIN/WITH_PKGNG for compat with scripts which are looking for it
1445 PKG_ORIGIN?= ports-mgmt/pkg
1446 PKGNG_ORIGIN= ${PKG_ORIGIN}
1447 WITH_PKGNG?= yes
1448 WITH_PKG?= ${WITH_PKGNG}
1449
1450 .endif
1451 # End of pre-makefile section.
1452
1453 # Start of post-makefile section.
1454 .if !defined(BEFOREPORTMK) && !defined(INOPTIONSMK)
1455
1456 .if defined(_POSTMKINCLUDED)
1457 DEV_ERROR+= "${PKGNAME}: Makefile error: you cannot include bsd.port[.post].mk twice"
1458 @${FALSE}
1459 .endif
1460
1461 _POSTMKINCLUDED= yes
1462
1463 .if defined(BUNDLE_LIBS)
1464 PKG_NOTES+= no_provide_shlib
1465 PKG_NOTE_no_provide_shlib= yes
1466 .endif
1467
1468 TEST_ARGS?= ${MAKE_ARGS}
1469 TEST_ENV?= ${MAKE_ENV}
1470
1471 PKG_ENV+= PORTSDIR=${PORTSDIR}
1472 CONFIGURE_ENV+= XDG_DATA_HOME=${WRKDIR} \
1473 XDG_CONFIG_HOME=${WRKDIR} \
1474 HOME=${WRKDIR}
1475 MAKE_ENV+= XDG_DATA_HOME=${WRKDIR} \
1476 XDG_CONFIG_HOME=${WRKDIR} \
1477 HOME=${WRKDIR}
1478 # Respect TMPDIR passed via make.conf or similar and pass it down
1479 # to configure and make.
1480 .if defined(TMPDIR)
1481 MAKE_ENV+= TMPDIR="${TMPDIR}"
1482 CONFIGURE_ENV+= TMPDIR="${TMPDIR}"
1483 .endif # defined(TMPDIR)
1484
1485 QA_ENV+= STAGEDIR=${STAGEDIR} \
1486 PREFIX=${PREFIX} \
1487 LINUXBASE=${LINUXBASE} \
1488 LOCALBASE=${LOCALBASE} \
1489 "STRIP=${STRIP}" \
1490 TMPPLIST=${TMPPLIST} \
1491 BUNDLE_LIBS=${BUNDLE_LIBS} \
1492 LDCONFIG_DIR="${LDCONFIG_DIR}" \
1493 PKGORIGIN=${PKGORIGIN} \
1494 LIB_RUN_DEPENDS='${_LIB_RUN_DEPENDS:C,[^:]*:([^:]*):?.*,\1,}' \
1495 PKGBASE=${PKGBASE}
1496 .if !empty(USES:Mssl)
1497 QA_ENV+= USESSSL=yes
1498 .endif
1499 .if !empty(USES:Mdesktop-file-utils)
1500 QA_ENV+= USESDESKTOPFILEUTILS=yes
1501 .endif
1502 .if !empty(USES:Mlibtool*)
1503 QA_ENV+= USESLIBTOOL=yes
1504 .endif
1505 .if !empty(USES:Mshared-mime-info)
1506 QA_ENV+= USESSHAREDMIMEINFO=yes
1507 .endif
1508 .if !empty(USES:Mterminfo)
1509 QA_ENV+= USESTERMINFO=yes
1510 .endif
1511
1512 CO_ENV+= STAGEDIR=${STAGEDIR} \
1513 PREFIX=${PREFIX} \
1514 LOCALBASE=${LOCALBASE} \
1515 WRKDIR=${WRKDIR} \
1516 WRKSRC=${WRKSRC} \
1517 MTREE_FILE=${MTREE_FILE} \
1518 TMPPLIST=${TMPPLIST} \
1519 SCRIPTSDIR=${SCRIPTSDIR} \
1520 PLIST_SUB_SED="${PLIST_SUB_SED}" \
1521 PORT_OPTIONS="${PORT_OPTIONS}" \
1522 PORTSDIR="${PORTSDIR}"
1523
1524 .if defined(CROSS_SYSROOT)
1525 PKG_ENV+= ABI_FILE=${CROSS_SYSROOT}/bin/sh
1526 MAKE_ENV+= NM=${NM} \
1527 STRIPBIN=${STRIPBIN} \
1528 PKG_CONFIG_SYSROOT_DIR="${CROSS_SYSROOT}"
1529 CONFIGURE_ENV+= PKG_CONFIG_SYSROOT_DIR="${CROSS_SYSROOT}"
1530 .endif
1531
1532 WRKDIR?= ${WRKDIRPREFIX}${.CURDIR}/work
1533 .if !defined(IGNORE_MASTER_SITE_GITHUB) && defined(USE_GITHUB)
1534 WRKSRC?= ${WRKDIR}/${GH_PROJECT}-${GH_TAGNAME_EXTRACT}
1535 .endif
1536 # If the distname is not extracting into a specific subdirectory, have the
1537 # ports framework force extract into a subdirectory so that metadata files
1538 # do not get in the way of the build, and vice-versa.
1539 .if defined(NO_WRKSUBDIR)
1540 # Some ports have DISTNAME=PORTNAME, and USE_RC_SUBR=PORTNAME, in those case,
1541 # the rc file will conflict with WRKSRC, as WRKSRC is artificial, make it the
1542 # most unlikely to conflict as we can.
1543 WRKSRC?= ${WRKDIR}/${PKGNAME}
1544 EXTRACT_WRKDIR:= ${WRKSRC}
1545 .else
1546 WRKSRC?= ${WRKDIR}/${DISTNAME}
1547 EXTRACT_WRKDIR:= ${WRKDIR}
1548 .endif
1549 .if defined(WRKSRC_SUBDIR)
1550 WRKSRC:= ${WRKSRC}/${WRKSRC_SUBDIR}
1551 .endif
1552
1553 .if defined(CONFIGURE_OUTSOURCE)
1554 CONFIGURE_CMD?= ${WRKSRC}/${CONFIGURE_SCRIPT}
1555 CONFIGURE_WRKSRC?= ${WRKDIR}/.build
1556 BUILD_WRKSRC?= ${CONFIGURE_WRKSRC}
1557 INSTALL_WRKSRC?= ${CONFIGURE_WRKSRC}
1558 TEST_WRKSRC?= ${CONFIGURE_WRKSRC}
1559 .endif
1560
1561 PATCH_WRKSRC?= ${WRKSRC}
1562 CONFIGURE_WRKSRC?= ${WRKSRC}
1563 BUILD_WRKSRC?= ${WRKSRC}
1564 INSTALL_WRKSRC?=${WRKSRC}
1565 TEST_WRKSRC?= ${WRKSRC}
1566
1567 PLIST_SUB+= OSREL=${OSREL} PREFIX=%D LOCALBASE=${LOCALBASE} \
1568 RESETPREFIX=${PREFIX}
1569 SUB_LIST+= PREFIX=${PREFIX} LOCALBASE=${LOCALBASE} \
1570 DATADIR=${DATADIR} DOCSDIR=${DOCSDIR} EXAMPLESDIR=${EXAMPLESDIR} \
1571 WWWDIR=${WWWDIR} ETCDIR=${ETCDIR}
1572 # This is used for check-stagedir.sh and check_leftover.sh to replace
1573 # directories/files with PLIST_SUB %%KEYS%%.
1574 # Remove VARS which values are PLIST_SUB_SED_MIN long or shorter
1575 PLIST_SUB_SED_MIN?= 2
1576 PLIST_SUB_SED_tmp1= ${PLIST_SUB:C/.*=.{1,${PLIST_SUB_SED_MIN}}$//g}
1577 # Remove VARS that are too generic
1578 # Remove empty values
1579 # Remove @comment values
1580 PLIST_SUB_SED_tmp2= ${PLIST_SUB_SED_tmp1:NEXTRACT_SUFX=*:NOSREL=*:NLIB32DIR=*:NPREFIX=*:NLOCALBASE=*:NRESETPREFIX=*:N*="":N*="@comment*}
1581 # Handle VARS for which there is a _regex entry
1582 PLIST_SUB_SED_tmp3?= ${PLIST_SUB_SED_tmp2:C/(${PLIST_SUB:M*_regex=*:C/_regex=.*/=.*/:Q:S/\\ /|/g:S/\\//g})//:C/(.*)_regex=(.*)/\1=\2/}
1583 # Remove quotes
1584 # Replace . with \. for later sed(1) usage
1585 PLIST_SUB_SED?= ${PLIST_SUB_SED_tmp3:C/([^=]*)="?([^"]*)"?/s!\2!%%\1%%!g;/g:C/\./\\./g}
1586
1587 # kludge to strip trailing whitespace from CFLAGS;
1588 # sub-configure will not # survive double space
1589 CFLAGS:= ${CFLAGS:C/ $//}
1590
1591 .if defined(WITHOUT_CPU_CFLAGS)
1592 .if defined(_CPUCFLAGS)
1593 .if !empty(_CPUCFLAGS)
1594 CFLAGS:= ${CFLAGS:C/${_CPUCFLAGS}//}
1595 .endif
1596 .endif
1597 .endif
1598
1599 # Reset value from bsd.own.mk.
1600 .if defined(WITH_DEBUG) && !defined(WITHOUT_DEBUG)
1601 .if !defined(INSTALL_STRIPPED)
1602 STRIP= #none
1603 MAKE_ENV+= DONTSTRIP=yes
1604 STRIP_CMD= ${TRUE}
1605 .endif
1606 DEBUG_FLAGS?= -g
1607 CFLAGS:= ${CFLAGS:N-O*:N-fno-strict*} ${DEBUG_FLAGS}
1608 .if defined(INSTALL_TARGET)
1609 INSTALL_TARGET:= ${INSTALL_TARGET:S/^install-strip$/install/g}
1610 .endif
1611 .endif
1612
1613 .if !defined(WITHOUT_SSP)
1614 .include "${PORTSDIR}/Mk/bsd.ssp.mk"
1615 .endif
1616
1617 # XXX PIE support to be added here
1618 MAKE_ENV+= NO_PIE=yes
1619 # We prefer to pass MK_*=no but it was only supported after a certain
1620 # revision. Passing WITHOUT_* may conflict with a make.conf or src.conf's
1621 # WITH_* value. Note that ports *do* pull in src.conf.
1622 .if (${OSVERSION} >= 903510 && ${OSVERSION} < 1000000) || \
1623 (${OSVERSION} >= 1003503 && ${OSVERSION} < 1100000) || \
1624 ${OSVERSION} >= 1100000
1625 # We will control debug files. Don't let builds that use /usr/share/mk
1626 # split out debug symbols since the plist won't know to expect it.
1627 MAKE_ENV+= MK_DEBUG_FILES=no
1628 MAKE_ENV+= MK_KERNEL_SYMBOLS=no
1629 .else
1630 MAKE_ENV+= WITHOUT_DEBUG_FILES=yes
1631 MAKE_ENV+= WITHOUT_KERNEL_SYMBOLS=yes
1632 .endif
1633
1634 .if defined(NOPORTDOCS)
1635 PLIST_SUB+= PORTDOCS="@comment "
1636 .else
1637 PLIST_SUB+= PORTDOCS=""
1638 .endif
1639
1640 .if defined(NOPORTEXAMPLES)
1641 PLIST_SUB+= PORTEXAMPLES="@comment "
1642 .else
1643 PLIST_SUB+= PORTEXAMPLES=""
1644 .endif
1645
1646 CONFIGURE_SHELL?= ${SH}
1647 MAKE_SHELL?= ${SH}
1648
1649 CONFIGURE_ENV+= SHELL=${CONFIGURE_SHELL} CONFIG_SHELL=${CONFIGURE_SHELL}
1650 MAKE_ENV+= SHELL=${MAKE_SHELL} NO_LINT=YES
1651
1652 .if defined(PATCHFILES) && ${PATCHFILES:M*.zip}
1653 PATCH_DEPENDS+= ${LOCALBASE}/bin/unzip:archivers/unzip
1654 .endif
1655
1656 # Check the compatibility layer for amd64/ia64
1657
1658 .if ${ARCH} == "amd64" || ${ARCH} =="ia64"
1659 .if exists(/usr/lib32)
1660 HAVE_COMPAT_IA32_LIBS?= YES
1661 .endif
1662 .if !defined(HAVE_COMPAT_IA32_KERN)
1663 HAVE_COMPAT_IA32_KERN!= if ${SYSCTL} -n compat.ia32.maxvmem >/dev/null 2>&1; then echo YES; fi; echo
1664 .if empty(HAVE_COMPAT_IA32_KERN)
1665 .undef HAVE_COMPAT_IA32_KERN
1666 .endif
1667 .endif
1668 .endif
1669 _EXPORTED_VARS+= HAVE_COMPAT_IA32_KERN
1670
1671 .if defined(IA32_BINARY_PORT) && ${ARCH} != "i386"
1672 .if ${ARCH} == "amd64" || ${ARCH} == "ia64"
1673 .if !defined(HAVE_COMPAT_IA32_KERN)
1674 IGNORE= requires a kernel with compiled-in IA32 compatibility
1675 .elif !defined(HAVE_COMPAT_IA32_LIBS)
1676 IGNORE= requires 32-bit libraries installed under /usr/lib32
1677 .endif
1678 _LDCONFIG_FLAGS=-32
1679 LIB32DIR= lib32
1680 .else
1681 IGNORE= requires i386 (or compatible) platform to run
1682 .endif
1683 .else
1684 LIB32DIR= lib
1685 .endif
1686 PLIST_SUB+= LIB32DIR=${LIB32DIR}
1687
1688 .if ${WITH_PKG} == devel
1689 PKG_ORIGIN= ports-mgmt/pkg-devel
1690 .endif
1691
1692 .if !defined(PKG_DEPENDS) && !defined(CLEAN_FETCH_ENV)
1693 PKG_DEPENDS+= ${LOCALBASE}/sbin/pkg:${PKG_ORIGIN}
1694 .endif
1695
1696 .if defined(USE_GCC)
1697 .include "${PORTSDIR}/Mk/bsd.gcc.mk"
1698 .endif
1699
1700 .if defined(USE_BINUTILS) && !defined(DISABLE_BINUTILS)
1701 BUILD_DEPENDS+= ${LOCALBASE}/bin/as:devel/binutils
1702 BINUTILS?= ADDR2LINE AR AS CPPFILT GPROF LD NM OBJCOPY OBJDUMP RANLIB \
1703 READELF SIZE STRINGS
1704 BINUTILS_NO_MAKE_ENV?=
1705 . for b in ${BINUTILS}
1706 ${b}= ${LOCALBASE}/bin/${b:C/PP/++/:tl}
1707 . if defined(GNU_CONFIGURE) || defined(BINUTILS_CONFIGURE)
1708 CONFIGURE_ENV+= ${b}="${${b}}"
1709 . endif
1710 . if ${BINUTILS_NO_MAKE_ENV:M${b}} == ""
1711 MAKE_ENV+= ${b}="${${b}}"
1712 . endif
1713 . endfor
1714 .endif
1715
1716 .if defined(USE_OPENLDAP) || defined(WANT_OPENLDAP_VER)
1717 .include "${PORTSDIR}/Mk/bsd.ldap.mk"
1718 .endif
1719
1720 .if defined(USE_RC_SUBR)
1721 SUB_FILES+= ${USE_RC_SUBR}
1722 .endif
1723
1724 .if defined(USE_RCORDER)
1725 SUB_FILES+= ${USE_RCORDER}
1726 .endif
1727
1728 .if defined(USE_LDCONFIG) && ${USE_LDCONFIG:tl} == "yes"
1729 USE_LDCONFIG= ${PREFIX}/lib
1730 .endif
1731 .if defined(USE_LDCONFIG32) && ${USE_LDCONFIG32:tl} == "yes"
1732 IGNORE= has USE_LDCONFIG32 set to yes, which is not correct
1733 .endif
1734
1735 PKG_IGNORE_DEPENDS?= 'this_port_does_not_exist'
1736
1737 _GL_gbm_LIB_DEPENDS= libgbm.so:graphics/gbm
1738 _GL_glesv2_BUILD_DEPENDS= libglesv2>0:graphics/libglesv2
1739 _GL_glesv2_RUN_DEPENDS= libglesv2>0:graphics/libglesv2
1740 _GL_egl_BUILD_DEPENDS= libEGL>0:graphics/libEGL
1741 _GL_egl_RUN_DEPENDS= libEGL>0:graphics/libEGL
1742 _GL_gl_BUILD_DEPENDS= libGL>0:graphics/libGL
1743 _GL_gl_RUN_DEPENDS= libGL>0:graphics/libGL
1744 _GL_gl_USE_XORG= glproto dri2proto
1745 _GL_glew_LIB_DEPENDS= libGLEW.so:graphics/glew
1746 _GL_glu_LIB_DEPENDS= libGLU.so:graphics/libGLU
1747 _GL_glu_USE_XORG= glproto dri2proto
1748 _GL_glw_LIB_DEPENDS= libGLw.so:graphics/libGLw
1749 _GL_glut_LIB_DEPENDS= libglut.so:graphics/freeglut
1750
1751 .if defined(USE_GL)
1752 . if ${USE_GL:tl} == "yes"
1753 USE_GL= glu
1754 . endif
1755 . for _component in ${USE_GL}
1756 . if !defined(_GL_${_component}_LIB_DEPENDS) && \
1757 !defined(_GL_${_component}_RUN_DEPENDS)
1758 IGNORE= uses unknown GL component
1759 . else
1760 USE_XORG+= ${_GL_${_component}_USE_XORG}
1761 BUILD_DEPENDS+= ${_GL_${_component}_BUILD_DEPENDS}
1762 LIB_DEPENDS+= ${_GL_${_component}_LIB_DEPENDS}
1763 RUN_DEPENDS+= ${_GL_${_component}_RUN_DEPENDS}
1764 . endif
1765 . endfor
1766 .endif
1767
1768 .if defined(_DESTDIR_VIA_ENV)
1769 MAKE_ENV+= ${DESTDIRNAME}=${STAGEDIR}
1770 .else
1771 MAKE_ARGS+= ${DESTDIRNAME}=${STAGEDIR}
1772 .endif
1773
1774 .if defined(NO_PREFIX_RMDIR)
1775 CO_ENV+= NO_PREFIX_RMDIR=1
1776 .else
1777 CO_ENV+= NO_PREFIX_RMDIR=0
1778 .endif
1779
1780
1781 METADIR= ${WRKDIR}/.metadir
1782
1783 PKGPREINSTALL?= ${PKGDIR}/pkg-pre-install
1784 PKGPOSTINSTALL?= ${PKGDIR}/pkg-post-install
1785 PKGPREDEINSTALL?= ${PKGDIR}/pkg-pre-deinstall
1786 PKGPOSTDEINSTALL?= ${PKGDIR}/pkg-post-deinstall
1787 PKGPREUPGRADE?= ${PKGDIR}/pkg-pre-upgrade
1788 PKGPOSTUPGRADE?= ${PKGDIR}/pkg-post-upgrade
1789 PKGUPGRADE?= ${PKGDIR}/pkg-upgrade
1790
1791 _FORCE_POST_PATTERNS= rmdir kldxref mkfontscale mkfontdir fc-cache \
1792 fonts.dir fonts.scale gtk-update-icon-cache \
1793 gio-querymodules \
1794 gtk-query-immodules \
1795 ldconfig \
1796 load-octave-pkg \
1797 ocamlfind \
1798 update-desktop-database update-mime-database \
1799 gdk-pixbuf-query-loaders catalog.ports \
1800 glib-compile-schemas \
1801 ccache-update-links
1802
1803 .if defined(USE_LOCAL_MK)
1804 .include "${PORTSDIR}/Mk/bsd.local.mk"
1805 .endif
1806
1807 .if defined(USE_XORG) || defined(XORG_CAT)
1808 .include "${PORTSDIR}/Mk/bsd.xorg.mk"
1809 .endif
1810
1811 .if defined(WANT_GSTREAMER) || defined(USE_GSTREAMER) || defined(USE_GSTREAMER1)
1812 .include "${PORTSDIR}/Mk/bsd.gstreamer.mk"
1813 .endif
1814
1815 .if defined(USE_JAVA)
1816 .include "${PORTSDIR}/Mk/bsd.java.mk"
1817 .endif
1818
1819 .if defined(USE_OCAML)
1820 .include "${PORTSDIR}/Mk/bsd.ocaml.mk"
1821 .endif
1822
1823 .if defined(USE_QT4) || defined(USE_QT5)
1824 .include "${PORTSDIR}/Mk/bsd.qt.mk"
1825 .endif
1826
1827 .if defined(USE_SDL)
1828 .include "${PORTSDIR}/Mk/bsd.sdl.mk"
1829 .endif
1830
1831 .if defined(USE_PHP) && (!defined(USES) || ( defined(USES) && !${USES:Mphp*} ))
1832 DEV_WARNING+= "Using USE_PHP alone is deprecated, please use USES=php"
1833 _USES_POST+= php
1834 .endif
1835
1836 .if defined(USE_WX) || defined(USE_WX_NOT)
1837 .include "${PORTSDIR}/Mk/bsd.wx.mk"
1838 .endif
1839
1840 .if defined(USE_APACHE) || defined(USE_APACHE_BUILD) || defined(USE_APACHE_RUN)
1841 .include "${PORTSDIR}/Mk/bsd.apache.mk"
1842 .endif
1843
1844 .if defined(USE_AUTOTOOLS)
1845 .include "${PORTSDIR}/Mk/bsd.autotools.mk"
1846 .endif
1847
1848 .if defined(USE_FPC) || defined(WANT_FPC_BASE) || defined(WANT_FPC_ALL)
1849 .include "${PORTSDIR}/Mk/bsd.fpc.mk"
1850 .endif
1851
1852 .if defined(USE_GECKO)
1853 .include "${PORTSDIR}/Mk/bsd.gecko.mk"
1854 .endif
1855
1856 .if exists(${PORTSDIR}/Makefile.inc)
1857 .include "${PORTSDIR}/Makefile.inc"
1858 USE_SUBMAKE= yes
1859 .endif
1860
1861 # Loading features
1862 .for f in ${_USES_POST}
1863 _f:= ${f:C/\:.*//}
1864 .if !defined(${_f}_ARGS)
1865 ${_f}_ARGS:= ${f:C/^[^\:]*(\:|\$)//:S/,/ /g}
1866 .endif
1867 .endfor
1868 .for f in ${_USES_POST}
1869 .include "${USESDIR}/${f:C/\:.*//}.mk"
1870 .endfor
1871
1872 .if defined(USE_XORG)
1873 # Add explicit X options to avoid problems with false positives in configure
1874 .if defined(GNU_CONFIGURE)
1875 CONFIGURE_ARGS+=--x-libraries=${LOCALBASE}/lib --x-includes=${LOCALBASE}/include
1876 .endif
1877 .endif
1878
1879 # Macro for doing in-place file editing using regexps
1880 REINPLACE_ARGS?= -i.bak
1881 REINPLACE_CMD?= ${SED} ${REINPLACE_ARGS}
1882
1883 # Names of cookies used to skip already completed stages
1884 EXTRACT_COOKIE?= ${WRKDIR}/.extract_done.${PORTNAME}.${PREFIX:S/\//_/g}
1885 CONFIGURE_COOKIE?= ${WRKDIR}/.configure_done.${PORTNAME}.${PREFIX:S/\//_/g}
1886 INSTALL_COOKIE?= ${WRKDIR}/.install_done.${PORTNAME}.${PREFIX:S/\//_/g}
1887 BUILD_COOKIE?= ${WRKDIR}/.build_done.${PORTNAME}.${PREFIX:S/\//_/g}
1888 PATCH_COOKIE?= ${WRKDIR}/.patch_done.${PORTNAME}.${PREFIX:S/\//_/g}
1889 PACKAGE_COOKIE?= ${WRKDIR}/.package_done.${PORTNAME}.${PREFIX:S/\//_/g}
1890 STAGE_COOKIE?= ${WRKDIR}/.stage_done.${PORTNAME}.${PREFIX:S/\//_/g}
1891
1892 # How to do nothing. Override if you, for some strange reason, would rather
1893 # do something.
1894 DO_NADA?= ${TRUE}
1895
1896 # Use this as the first operand to always build dependency.
1897 NONEXISTENT?= /nonexistent
1898
1899 CHECKSUM_ALGORITHMS?= sha256
1900
1901 DISTINFO_FILE?= ${MASTERDIR}/distinfo
1902
1903 MAKE_FLAGS?= -f
1904 MAKEFILE?= Makefile
1905 MAKE_CMD?= ${BSDMAKE}
1906 MAKE_ENV+= PREFIX=${PREFIX} \
1907 LOCALBASE=${LOCALBASE} \
1908 LIBDIR="${LIBDIR}" \
1909 CC="${CC}" CFLAGS="${CFLAGS}" \
1910 CPP="${CPP}" CPPFLAGS="${CPPFLAGS}" \
1911 LDFLAGS="${LDFLAGS}" LIBS="${LIBS}" \
1912 CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" \
1913 MANPREFIX="${MANPREFIX}"
1914
1915 # Add -fno-strict-aliasing to CFLAGS with optimization level -O2 or higher.
1916 # gcc 4.x enable strict aliasing optimization with -O2 which is known to break
1917 # a lot of ports.
1918 .if !defined(WITHOUT_NO_STRICT_ALIASING)
1919 .if ${CC} != "icc"
1920 .if empty(CFLAGS:M-fno-strict-aliasing)
1921 CFLAGS+= -fno-strict-aliasing
1922 .endif
1923 .endif
1924 .endif
1925
1926 .for lang in C CXX
1927 .if defined(USE_${lang}STD)
1928 ${lang}FLAGS:= ${${lang}FLAGS:N-std=*} -std=${USE_${lang}STD}
1929 .endif
1930
1931 .if defined(${lang}FLAGS_${ARCH})
1932 ${lang}FLAGS+= ${${lang}FLAGS_${ARCH}}
1933 .endif
1934 .endfor
1935
1936 # Multiple make jobs support
1937 .if defined(DISABLE_MAKE_JOBS) || defined(MAKE_JOBS_UNSAFE)
1938 _MAKE_JOBS?= #
1939 MAKE_JOBS_NUMBER= 1
1940 .else
1941 .if defined(MAKE_JOBS_NUMBER)
1942 _MAKE_JOBS_NUMBER:= ${MAKE_JOBS_NUMBER}
1943 .else
1944 .if !defined(_SMP_CPUS)
1945 _SMP_CPUS!= ${SYSCTL} -n kern.smp.cpus
1946 .endif
1947 _EXPORTED_VARS+= _SMP_CPUS
1948 _MAKE_JOBS_NUMBER= ${_SMP_CPUS}
1949 .endif
1950 .if defined(MAKE_JOBS_NUMBER_LIMIT) && ( ${MAKE_JOBS_NUMBER_LIMIT} < ${_MAKE_JOBS_NUMBER} )
1951 MAKE_JOBS_NUMBER= ${MAKE_JOBS_NUMBER_LIMIT}
1952 .else
1953 MAKE_JOBS_NUMBER= ${_MAKE_JOBS_NUMBER}
1954 .endif
1955 _MAKE_JOBS?= -j${MAKE_JOBS_NUMBER}
1956 BUILD_FAIL_MESSAGE+= Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to the maintainer.
1957 .endif
1958
1959 .include "${PORTSDIR}/Mk/bsd.ccache.mk"
1960
1961 FETCH_ENV?= SSL_NO_VERIFY_PEER=1 SSL_NO_VERIFY_HOSTNAME=1
1962 FETCH_BINARY?= /usr/bin/fetch
1963 FETCH_ARGS?= -Fpr
1964 FETCH_REGET?= 1
1965 FETCH_CMD?= ${FETCH_BINARY} ${FETCH_ARGS}
1966
1967 .if defined(RANDOMIZE_MASTER_SITES)
1968 .if exists(/usr/games/random)
1969 RANDOM_CMD?= /usr/games/random
1970 RANDOM_ARGS?= -w -f -
1971 _RANDOMIZE_SITES= |${RANDOM_CMD} ${RANDOM_ARGS}
1972 .endif
1973 .endif
1974
1975 TOUCH?= /usr/bin/touch
1976 TOUCH_FLAGS?= -f
1977
1978 DISTORIG?= .bak.orig
1979 PATCH?= /usr/bin/patch
1980 PATCH_STRIP?= -p0
1981 PATCH_DIST_STRIP?= -p0
1982 .if defined(PATCH_DEBUG)
1983 PATCH_DEBUG_TMP= yes
1984 PATCH_ARGS?= -d ${PATCH_WRKSRC} -E ${PATCH_STRIP}
1985 PATCH_DIST_ARGS?= --suffix ${DISTORIG} -d ${PATCH_WRKSRC} -E ${PATCH_DIST_STRIP}
1986 .else
1987 PATCH_DEBUG_TMP= no
1988 PATCH_ARGS?= -d ${PATCH_WRKSRC} --forward --quiet -E ${PATCH_STRIP}
1989 PATCH_DIST_ARGS?= --suffix ${DISTORIG} -d ${PATCH_WRKSRC} --forward --quiet -E ${PATCH_DIST_STRIP}
1990 .endif
1991 .if !defined(QUIET)
1992 PATCH_SILENT= PATCH_SILENT=yes
1993 .endif
1994 .if defined(BATCH)
1995 PATCH_ARGS+= --batch
1996 PATCH_DIST_ARGS+= --batch
1997 .endif
1998
1999 # Prevent breakage with VERSION_CONTROL=numbered
2000 PATCH_ARGS+= -V simple
2001
2002 .if defined(PATCH_CHECK_ONLY)
2003 PATCH_ARGS+= -C
2004 PATCH_DIST_ARGS+= -C
2005 .endif
2006
2007 .if ${PATCH} == "/usr/bin/patch"
2008 PATCH_ARGS+= --suffix .orig
2009 PATCH_DIST_ARGS+= --suffix .orig
2010 .endif
2011
2012 TAR?= /usr/bin/tar
2013
2014 # EXTRACT_SUFX is defined in .pre.mk section
2015 EXTRACT_CMD?= ${TAR}
2016 EXTRACT_BEFORE_ARGS?= -xf
2017 EXTRACT_AFTER_ARGS?= --no-same-owner --no-same-permissions
2018
2019 # Figure out where the local mtree file is
2020 .if !defined(MTREE_FILE) && !defined(NO_MTREE)
2021 .if ${PREFIX} == /usr
2022 MTREE_FILE= /etc/mtree/BSD.usr.dist
2023 .else
2024 MTREE_FILE= ${PORTSDIR}/Templates/BSD.local.dist
2025 .endif
2026 .endif
2027 MTREE_CMD?= /usr/sbin/mtree
2028 MTREE_ARGS?= -U ${MTREE_FOLLOWS_SYMLINKS} -f ${MTREE_FILE} -d -e -p
2029
2030 _SHAREMODE?= 0644
2031
2032 # A few aliases for *-install targets
2033 INSTALL_PROGRAM= ${INSTALL} ${COPY} ${STRIP} -m ${BINMODE}
2034 INSTALL_KLD= ${INSTALL} ${COPY} -m ${BINMODE}
2035 INSTALL_LIB= ${INSTALL} ${COPY} ${STRIP} -m ${SHAREMODE}
2036 INSTALL_SCRIPT= ${INSTALL} ${COPY} -m ${BINMODE}
2037 INSTALL_DATA= ${INSTALL} ${COPY} -m ${_SHAREMODE}
2038 INSTALL_MAN= ${INSTALL} ${COPY} -m ${MANMODE}
2039
2040 INSTALL_MACROS= BSD_INSTALL_PROGRAM="${INSTALL_PROGRAM}" \
2041 BSD_INSTALL_LIB="${INSTALL_LIB}" \
2042 BSD_INSTALL_SCRIPT="${INSTALL_SCRIPT}" \
2043 BSD_INSTALL_DATA="${INSTALL_DATA}" \
2044 BSD_INSTALL_MAN="${INSTALL_MAN}"
2045 MAKE_ENV+= ${INSTALL_MACROS}
2046 SCRIPTS_ENV+= ${INSTALL_MACROS}
2047
2048 # Macro for copying entire directory tree with correct permissions
2049 COPYTREE_BIN= ${SH} -c '(${FIND} -d $$0 $$2 | ${CPIO} -dumpl $$1 >/dev/null \
2050 2>&1) && \
2051 ${FIND} -d $$0 $$2 -type d -exec chmod 755 $$1/{} \; && \
2052 ${FIND} -d $$0 $$2 -type f -exec chmod ${BINMODE} $$1/{} \;' --
2053 COPYTREE_SHARE= ${SH} -c '(${FIND} -d $$0 $$2 | ${CPIO} -dumpl $$1 >/dev/null \
2054 2>&1) && \
2055 ${FIND} -d $$0 $$2 -type d -exec chmod 755 $$1/{} \; && \
2056 ${FIND} -d $$0 $$2 -type f -exec chmod ${SHAREMODE} $$1/{} \;' --
2057
2058 # The user can override the NO_PACKAGE by specifying this from
2059 # the make command line
2060 .if defined(FORCE_PACKAGE)
2061 .undef NO_PACKAGE
2062 .endif
2063
2064 DESCR?= ${PKGDIR}/pkg-descr
2065 PLIST?= ${PKGDIR}/pkg-plist
2066 PKGHELP?= ${PKGDIR}/pkg-help
2067 PKGINSTALL?= ${PKGDIR}/pkg-install
2068 PKGDEINSTALL?= ${PKGDIR}/pkg-deinstall
2069 PKGREQ?= ${PKGDIR}/pkg-req
2070 PKGMESSAGE?= ${PKGDIR}/pkg-message
2071 _PKGMESSAGES+= ${PKGMESSAGE}
2072
2073 TMPPLIST?= ${WRKDIR}/.PLIST.mktmp
2074 TMPPLIST_SORT?= ${WRKDIR}/.PLIST.mktmp.sorted
2075 TMPGUCMD?= ${WRKDIR}/.PLIST.gucmd
2076
2077 .if defined(PKG_NOCOMPRESS)
2078 PKG_SUFX?= .tar
2079 .else
2080 PKG_SUFX?= .txz
2081 .endif
2082 # where pkg_add records its dirty deeds.
2083 PKG_DBDIR?= /var/db/pkg
2084
2085 ALL_TARGET?= all
2086 INSTALL_TARGET?= install
2087 INSTALL_TARGET+= ${LATE_INSTALL_ARGS}
2088
2089 # Integrate with the license auditing framework
2090 .if !defined (DISABLE_LICENSES)
2091 .include "${PORTSDIR}/Mk/bsd.licenses.mk"
2092 .endif
2093
2094 # Popular master sites
2095 .include "${PORTSDIR}/Mk/bsd.sites.mk"
2096
2097 # Empty declaration to avoid "variable MASTER_SITES recursive" error
2098 MASTER_SITES?=
2099 PATCH_SITES?=
2100 _MASTER_SITES_DEFAULT?=
2101 _PATCH_SITES_DEFAULT?=
2102
2103 # Feed internal _{MASTER,PATCH}_SITES_n where n is a group designation
2104 # as per grouping rules (:something)
2105 # Organize _{MASTER,PATCH}_SITES_{DEFAULT,[^/:]+} according to grouping
2106 # rules (:something)
2107 .for _S in ${MASTER_SITES}
2108 _S_TEMP= ${_S:S/^${_S:C@/?:[^/:]+$@/@}//:S/^://}
2109 . if !empty(_S_TEMP)
2110 . for _group in ${_S_TEMP:S/,/ /g}
2111 _G_TEMP= ${_group}
2112 . if ${_G_TEMP:C/[a-zA-Z0-9_]//g}
2113 check-makevars::
2114 @${ECHO_MSG} "The ${_S} MASTER_SITES line has"
2115 @${ECHO_MSG} "a group with invalid characters, only use [a-zA-Z0-9_]"
2116 @${FALSE}
2117 . endif
2118 . if ${_G_TEMP} == all || ${_G_TEMP} == ALL || ${_G_TEMP} == default
2119 check-makevars::
2120 @${ECHO_MSG} "Makefile error: the words all, ALL and default are reserved and cannot be"
2121 @${ECHO_MSG} "used in group definitions. Please fix your MASTER_SITES"
2122 @${FALSE}
2123 . endif
2124 _MASTER_SITES_${_group}+= ${_S:C@^(.*/):[^/:]+$@\1@}
2125 . endfor
2126 . else
2127 _MASTER_SITES_DEFAULT+= ${_S:C@^(.*/):[^/:]+$@\1@}
2128 . endif
2129 .endfor
2130 .for _S in ${PATCH_SITES}
2131 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://}
2132 . if !empty(_S_TEMP)
2133 . for _group in ${_S_TEMP:S/,/ /g}
2134 _G_TEMP= ${_group}
2135 . if ${_G_TEMP:C/[a-zA-Z0-9_]//g}
2136 check-makevars::
2137 @${ECHO_MSG} "The ${_S} PATCH_SITES line has"
2138 @${ECHO_MSG} "a group with invalid characters, only use [a-zA-Z0-9_]"
2139 @${FALSE}
2140 . endif
2141 . if ${_G_TEMP} == all || ${_G_TEMP} == ALL || ${_G_TEMP} == default
2142 check-makevars::
2143 @${ECHO_MSG} "The words all, ALL and default are reserved and cannot be"
2144 @${ECHO_MSG} "used in group definitions. Please fix your PATCH_SITES"
2145 @${FALSE}
2146 . endif
2147 _PATCH_SITES_${_group}+= ${_S:C@^(.*/):[^/:]+$@\1@}
2148 . endfor
2149 . else
2150 _PATCH_SITES_DEFAULT+= ${_S:C@^(.*/):[^/:]+$@\1@}
2151 . endif
2152 .endfor
2153
2154 # Feed internal _{MASTER,PATCH}_SITE_SUBDIR_n where n is a group designation
2155 # as per grouping rules (:something)
2156 # Organize _{MASTER,PATCH}_SITE_SUBDIR_{DEFAULT,[^/:]+} according to grouping
2157 # rules (:something)
2158 .for _S in ${MASTER_SITE_SUBDIR}
2159 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://}
2160 . if !empty(_S_TEMP)
2161 . for _group in ${_S_TEMP:S/,/ /g}
2162 _G_TEMP= ${_group}
2163 . if ${_G_TEMP} == all || ${_G_TEMP} == ALL || ${_G_TEMP} == default
2164 check-makevars::
2165 @${ECHO_MSG} "Makefile error: the words all, ALL and default are reserved and cannot be"
2166 @${ECHO_MSG} "used in group definitions. Please fix your MASTER_SITE_SUBDIR"
2167 @${FALSE}
2168 . endif
2169 . if defined(_MASTER_SITES_${_group})
2170 _MASTER_SITE_SUBDIR_${_group}+= ${_S:C@^(.*)/:[^/:]+$@\1@}
2171 . endif
2172 . endfor
2173 . else
2174 . if defined(_MASTER_SITES_DEFAULT)
2175 _MASTER_SITE_SUBDIR_DEFAULT+= ${_S:C@^(.*)/:[^/:]+$@\1@}
2176 . endif
2177 . endif
2178 .endfor
2179 .for _S in ${PATCH_SITE_SUBDIR}
2180 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://}
2181 . if !empty(_S_TEMP)
2182 . for _group in ${_S_TEMP:S/,/ /g}
2183 _G_TEMP= ${_group}
2184 . if ${_G_TEMP} == all || ${_G_TEMP} == ALL || ${_G_TEMP} == default
2185 check-makevars::
2186 @${ECHO_MSG} "Makefile error: the words all, ALL and default are reserved and cannot be"
2187 @${ECHO_MSG} "used in group definitions. Please fix your PATCH_SITE_SUBDIR"
2188 @${FALSE}
2189 . endif
2190 . if defined(_PATCH_SITES_${_group})
2191 _PATCH_SITE_SUBDIR_${_group}+= ${_S:C@^(.*)/:[^/:]+$@\1@}
2192 . endif
2193 . endfor
2194 . else
2195 . if defined(_PATCH_SITES_DEFAULT)
2196 _PATCH_SITE_SUBDIR_DEFAULT+= ${_S:C@^(.*)/:[^/:]+$@\1@}
2197 . endif
2198 . endif
2199 .endfor
2200
2201 # Substitute subdirectory names
2202 # XXX simpler/faster solution but not the best space wise, suggestions please
2203 .for _S in ${MASTER_SITES}
2204 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://}
2205 . if !empty(_S_TEMP)
2206 . for _group in ${_S_TEMP:S/,/ /g}
2207 . if !defined(_MASTER_SITE_SUBDIR_${_group})
2208 MASTER_SITES_TMP= ${_MASTER_SITES_${_group}:S^%SUBDIR%/^^}
2209 . else
2210 _S_TEMP_TEMP= ${_MASTER_SITES_${_group}:M*%SUBDIR%/*}
2211 . if empty(_S_TEMP_TEMP)
2212 MASTER_SITES_TMP= ${_MASTER_SITES_${_group}}
2213 . else
2214 MASTER_SITES_TMP=
2215 . for site in ${_MASTER_SITES_${_group}}
2216 _S_TEMP_TEMP= ${site:M*%SUBDIR%/*}
2217 . if empty(_S_TEMP_TEMP)
2218 MASTER_SITES_TMP+= ${site}
2219 . else
2220 . for dir in ${_MASTER_SITE_SUBDIR_${_group}}
2221 MASTER_SITES_TMP+= ${site:S^%SUBDIR%^\${dir}^}
2222 . endfor
2223 . endif
2224 . endfor
2225 . endif
2226 . endif
2227 _MASTER_SITES_${_group}:= ${MASTER_SITES_TMP}
2228 . endfor
2229 . endif
2230 .endfor
2231 .if defined(_MASTER_SITE_SUBDIR_DEFAULT)
2232 _S_TEMP= ${_MASTER_SITES_DEFAULT:M*%SUBDIR%/*}
2233 . if empty(_S_TEMP)
2234 MASTER_SITES_TMP= ${_MASTER_SITES_DEFAULT}
2235 . else
2236 MASTER_SITES_TMP=
2237 . for site in ${_MASTER_SITES_DEFAULT}
2238 _S_TEMP_TEMP= ${site:M*%SUBDIR%/*}
2239 . if empty(_S_TEMP_TEMP)
2240 MASTER_SITES_TMP+= ${site}
2241 . else
2242 . for dir in ${_MASTER_SITE_SUBDIR_DEFAULT}
2243 MASTER_SITES_TMP+= ${site:S^%SUBDIR%^\${dir}^}
2244 . endfor
2245 . endif
2246 . endfor
2247 . endif
2248 .else
2249 MASTER_SITES_TMP= ${_MASTER_SITES_DEFAULT:S^%SUBDIR%/^^}
2250 .endif
2251 _MASTER_SITES_DEFAULT:= ${MASTER_SITES_TMP}
2252 MASTER_SITES_TMP=
2253 .for _S in ${PATCH_SITES}
2254 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://}
2255 . if !empty(_S_TEMP)
2256 . for _group in ${_S_TEMP:S/,/ /g}
2257 . if !defined(_PATCH_SITE_SUBDIR_${_group})
2258 PATCH_SITES_TMP= ${_PATCH_SITES_${_group}:S^%SUBDIR%/^^}
2259 . else
2260 _S_TEMP_TEMP= ${_PATCH_SITES_${_group}:M*%SUBDIR%/*}
2261 . if empty(_S_TEMP_TEMP)
2262 PATCH_SITES_TMP= ${_PATCH_SITES_${_group}}
2263 . else
2264 PATCH_SITES_TMP=
2265 . for site in ${_PATCH_SITES_${_group}}
2266 _S_TEMP_TEMP= ${site:M*%SUBDIR%/*}
2267 . if empty(_S_TEMP_TEMP)
2268 PATCH_SITES_TMP+= ${site}
2269 . else
2270 . for dir in ${_PATCH_SITE_SUBDIR_${_group}}
2271 PATCH_SITES_TMP+= ${site:S^%SUBDIR%^\${dir}^}
2272 . endfor
2273 . endif
2274 . endfor
2275 . endif
2276 . endif
2277 _PATCH_SITES_${_group}:= ${PATCH_SITES_TMP}
2278 . endfor
2279 . endif
2280 .endfor
2281 .if defined(_PATCH_SITE_SUBDIR_DEFAULT)
2282 _S_TEMP= ${_PATCH_SITES_DEFAULT:M*%SUBDIR%/*}
2283 . if empty(_S_TEMP)
2284 PATCH_SITES_TMP= ${_PATCH_SITES_DEFAULT}
2285 . else
2286 PATCH_SITES_TMP=
2287 . for site in ${_PATCH_SITES_DEFAULT}
2288 _S_TEMP_TEMP= ${site:M*%SUBDIR%/*}
2289 . if empty(_S_TEMP_TEMP)
2290 PATCH_SITES_TMP+= ${site}
2291 . else
2292 . for dir in ${_PATCH_SITE_SUBDIR_DEFAULT}
2293 PATCH_SITES_TMP+= ${site:S^%SUBDIR%^\${dir}^}
2294 . endfor
2295 . endif
2296 . endfor
2297 . endif
2298 .else
2299 PATCH_SITES_TMP= ${_PATCH_SITES_DEFAULT:S^%SUBDIR%/^^}
2300 .endif
2301 _PATCH_SITES_DEFAULT:= ${PATCH_SITES_TMP}
2302 PATCH_SITES_TMP=
2303
2304 # The primary backup site.
2305 MASTER_SITE_BACKUP?= \
2306 http://distcache.FreeBSD.org/ports-distfiles/${DIST_SUBDIR}/
2307 MASTER_SITE_BACKUP:= ${MASTER_SITE_BACKUP:S^\${DIST_SUBDIR}/^^}
2308
2309 # If the user has MASTER_SITE_FREEBSD set, go to the FreeBSD repository
2310 # for everything, but don't search it twice by appending it to the end.
2311 .if defined(MASTER_SITE_FREEBSD)
2312 _MASTER_SITE_OVERRIDE:= ${MASTER_SITE_BACKUP}
2313 _MASTER_SITE_BACKUP:= # empty
2314 .else
2315 _MASTER_SITE_OVERRIDE= ${MASTER_SITE_OVERRIDE}
2316 _MASTER_SITE_BACKUP= ${MASTER_SITE_BACKUP}
2317 .endif
2318
2319 NOFETCHFILES?=
2320
2321 # Organize DISTFILES, PATCHFILES, _MASTER_SITES_ALL, _PATCH_SITES_ALL
2322 # according to grouping rules (:something)
2323 DISTFILES?= ${DISTNAME}${EXTRACT_SUFX}
2324 _MASTER_SITES_ALL= ${_MASTER_SITES_DEFAULT}
2325 _PATCH_SITES_ALL= ${_PATCH_SITES_DEFAULT}
2326 _G_TEMP= DEFAULT
2327 .for _D in ${DISTFILES}
2328 _D_TEMP= ${_D:S/^${_D:C/:[^:]+$//}//}
2329 . if !empty(_D_TEMP)
2330 . for _group in ${_D_TEMP:S/^://:S/,/ /g}
2331 . if !defined(_MASTER_SITES_${_group})
2332 _G_TEMP_TEMP= ${_G_TEMP:M/${_group}/}
2333 . if empty(_G_TEMP_TEMP)
2334 _G_TEMP+= ${_group}
2335 _MASTER_SITES_ALL+= ${_MASTER_SITES_${_group}}
2336 . endif
2337 . endif
2338 . endfor
2339 _DISTFILES+= ${_D:C/:[^:]+$//}
2340 . else
2341 _DISTFILES+= ${_D}
2342 . endif
2343 .endfor
2344 _G_TEMP= DEFAULT
2345 .for _P in ${PATCHFILES}
2346 _P_TEMP= ${_P:C/:[^-:][^:]*$//}
2347 _P_groups= ${_P:S/^${_P:C/:[^:]+$//}//:S/^://}
2348 _P_file= ${_P_TEMP:C/:-[^:]+$//}
2349 _P_strip= ${_P_TEMP:S/^${_P_TEMP:C/:-[^:]*$//}//:S/^://}
2350 . if !empty(_P_groups)
2351 . for _group in ${_P_groups:S/,/ /g}
2352 . if !defined(_PATCH_SITES_${_group})
2353 _G_TEMP_TEMP= ${_G_TEMP:M/${_group}/}
2354 . if empty(_G_TEMP_TEMP)
2355 _G_TEMP+= ${_group}
2356 _PATCH_SITES_ALL+= ${_PATCH_SITES_${_group}}
2357 . endif
2358 . endif
2359 . endfor
2360 . endif
2361 _PATCHFILES:= ${_PATCHFILES} ${_P_file}
2362 . if !empty(_P_strip)
2363 _PATCH_DIST_STRIP_CASES:= ${_PATCH_DIST_STRIP_CASES} ("${_P_file}") printf %s "${_P_strip}" ;;
2364 . endif
2365 .endfor
2366 _P_groups=
2367 _P_file=
2368 _P_strip=
2369 _G_TEMP=
2370 _G_TEMP_TEMP=
2371 ALLFILES?= ${_DISTFILES} ${_PATCHFILES}
2372
2373 #
2374 # Sort the master site list according to the patterns in MASTER_SORT
2375 #
2376 MASTER_SORT?=
2377 MASTER_SORT_REGEX?=
2378 MASTER_SORT_REGEX+= ${MASTER_SORT:S|.|\\.|g:S|^|://[^/]*|:S|$|/|}
2379
2380 MASTER_SORT_AWK= BEGIN { RS = " "; ORS = " "; IGNORECASE = 1 ; gl = "${MASTER_SORT_REGEX:S|\\|\\\\|g}"; }
2381 .for srt in ${MASTER_SORT_REGEX}
2382 MASTER_SORT_AWK+= /${srt:S|/|\\/|g}/ { good["${srt:S|\\|\\\\|g}"] = good["${srt:S|\\|\\\\|g}"] " " $$0 ; next; }
2383 .endfor
2384 MASTER_SORT_AWK+= { rest = rest " " $$0; } END { n=split(gl, gla); for(i=1;i<=n;i++) { print good[gla[i]]; } print rest; }
2385
2386 #
2387 # Hackery to enable simple fetch targets with several dynamic MASTER_SITES
2388 #
2389 _MASTER_SITES_ENV= _MASTER_SITES_DEFAULT=${_MASTER_SITES_DEFAULT:Q}
2390 .for _F in ${DISTFILES}
2391 _F_TEMP= ${_F:S/^${_F:C/:[^:]+$//}//:S/^://}
2392 . if !empty(_F_TEMP)
2393 . for _group in ${_F_TEMP:S/,/ /g}
2394 . if defined(_MASTER_SITES_${_group})
2395 _MASTER_SITES_ENV+= _MASTER_SITES_${_group}=${_MASTER_SITES_${_group}:Q}
2396 . endif
2397 . endfor
2398 . endif
2399 .endfor
2400 _PATCH_SITES_ENV= _PATCH_SITES_DEFAULT=${_PATCH_SITES_DEFAULT:Q}
2401 .for _F in ${PATCHFILES}
2402 _F_TEMP= ${_F:S/^${_F:C/:[^-:][^:]*$//}//:S/^://}
2403 . if !empty(_F_TEMP)
2404 . for _group in ${_F_TEMP:S/,/ /g}
2405 . if defined(_PATCH_SITES_${_group})
2406 _PATCH_SITES_ENV+= _PATCH_SITES_${_group}=${_PATCH_SITES_${_group}:Q}
2407 . endif
2408 . endfor
2409 . endif
2410 .endfor
2411
2412 CKSUMFILES= ${ALLFILES}
2413
2414 # List of all files, with ${DIST_SUBDIR} in front. Used for checksum.
2415 .if defined(DIST_SUBDIR)
2416 .if defined(CKSUMFILES) && ${CKSUMFILES}!=""
2417 _CKSUMFILES?= ${CKSUMFILES:S/^/${DIST_SUBDIR}\//}
2418 .endif
2419 .else
2420 _CKSUMFILES?= ${CKSUMFILES}
2421 .endif
2422
2423 # This is what is actually going to be extracted, and is overridable
2424 # by user.
2425 EXTRACT_ONLY?= ${_DISTFILES}
2426
2427 .if !target(maintainer)
2428 maintainer:
2429 @${ECHO_CMD} "${MAINTAINER}"
2430 .endif
2431
2432 .if !defined(CATEGORIES)
2433 check-categories:
2434 @${ECHO_MSG} "${PKGNAME}: Makefile error: CATEGORIES is mandatory."
2435 @${FALSE}
2436 .else
2437
2438 VALID_CATEGORIES+= accessibility afterstep arabic archivers astro audio \
2439 benchmarks biology cad chinese comms converters databases \
2440 deskutils devel docs dns editors elisp emulators enlightenment finance french ftp \
2441 games geography german gnome gnustep graphics hamradio haskell hebrew hungarian \
2442 ipv6 irc japanese java kde kld korean lang linux lisp \
2443 mail mate math mbone misc multimedia net net-im net-mgmt net-p2p news \
2444 palm parallel pear perl5 plan9 polish portuguese ports-mgmt \
2445 print python ruby rubygems russian \
2446 scheme science security shells spanish sysutils \
2447 tcl textproc tk \
2448 ukrainian vietnamese windowmaker www \
2449 x11 x11-clocks x11-drivers x11-fm x11-fonts x11-servers x11-themes \
2450 x11-toolkits x11-wm xfce zope
2451
2452 check-categories:
2453 .for cat in ${CATEGORIES}
2454 . if empty(VALID_CATEGORIES:M${cat})
2455 @${ECHO_MSG} "${PKGNAME}: Makefile error: category ${cat} not in list of valid categories."; \
2456 ${FALSE};
2457 . endif
2458 .endfor
2459 .endif
2460
2461 PKGREPOSITORYSUBDIR?= All
2462 PKGREPOSITORY?= ${PACKAGES}/${PKGREPOSITORYSUBDIR}
2463 .if exists(${PACKAGES})
2464 PKGFILE?= ${PKGREPOSITORY}/${PKGNAME}${PKG_SUFX}
2465 .else
2466 PKGFILE?= ${.CURDIR}/${PKGNAME}${PKG_SUFX}
2467 .endif
2468 WRKDIR_PKGFILE= ${WRKDIR}/pkg/${PKGNAME}${PKG_SUFX}
2469
2470 # The "latest version" link -- ${PKGNAME} minus everthing after the last '-'
2471 PKGLATESTREPOSITORY?= ${PACKAGES}/Latest
2472 PKGBASE?= ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}
2473 PKGLATESTFILE= ${PKGLATESTREPOSITORY}/${PKGBASE}${PKG_SUFX}
2474
2475 CONFIGURE_SCRIPT?= configure
2476 CONFIGURE_CMD?= ./${CONFIGURE_SCRIPT}
2477 CONFIGURE_TARGET?= ${ARCH}-portbld-${OPSYS:tl}${OSREL}
2478 CONFIGURE_TARGET:= ${CONFIGURE_TARGET:S/--build=//}
2479 CONFIGURE_LOG?= config.log
2480
2481 # A default message to print if do-configure fails.
2482 CONFIGURE_FAIL_MESSAGE?= "Please report the problem to ${MAINTAINER} [maintainer] and attach the \"${CONFIGURE_WRKSRC}/${CONFIGURE_LOG}\" including the output of the failure of your make command. Also, it might be a good idea to provide an overview of all packages installed on your system (e.g. a ${PKG_INFO} -Ea)."
2483
2484 .if defined(GNU_CONFIGURE)
2485 # Maximum command line length
2486 .if !defined(CONFIGURE_MAX_CMD_LEN)
2487 CONFIGURE_MAX_CMD_LEN!= ${SYSCTL} -n kern.argmax
2488 .endif
2489 _EXPORTED_VARS+= CONFIGURE_MAX_CMD_LEN
2490 GNU_CONFIGURE_PREFIX?= ${PREFIX}
2491 GNU_CONFIGURE_MANPREFIX?= ${MANPREFIX}
2492 CONFIG_SITE?= ${PORTSDIR}/Templates/config.site
2493 CONFIGURE_ARGS+= --prefix=${GNU_CONFIGURE_PREFIX} $${_LATE_CONFIGURE_ARGS}
2494 .if defined(CROSS_TOOLCHAIN)
2495 CROSS_HOST= ${CROSS_TOOLCHAIN:C,-.*$,,}-${OPSYS:tl}
2496 CONFIGURE_ARGS+= --host=${CROSS_HOST}
2497 .endif
2498 CONFIGURE_ENV+= CONFIG_SITE=${CONFIG_SITE} lt_cv_sys_max_cmd_len=${CONFIGURE_MAX_CMD_LEN}
2499 HAS_CONFIGURE= yes
2500
2501 SET_LATE_CONFIGURE_ARGS= \
2502 _LATE_CONFIGURE_ARGS="" ; \
2503 if [ -z "${CONFIGURE_ARGS:M--localstatedir=*:Q}" ] && \
2504 ${CONFIGURE_CMD} --help 2>&1 | ${GREP} -- --localstatedir > /dev/null; then \
2505 _LATE_CONFIGURE_ARGS="$${_LATE_CONFIGURE_ARGS} --localstatedir=/var" ; \
2506 fi ; \
2507 if [ ! -z "`${CONFIGURE_CMD} --help 2>&1 | ${GREP} -- '--mandir'`" ]; then \
2508 _LATE_CONFIGURE_ARGS="$${_LATE_CONFIGURE_ARGS} --mandir=${GNU_CONFIGURE_MANPREFIX}/man" ; \
2509 fi ; \
2510 if [ ! -z "`${CONFIGURE_CMD} --help 2>&1 | ${GREP} -- '--disable-silent-rules'`" ]; then \
2511 _LATE_CONFIGURE_ARGS="$${_LATE_CONFIGURE_ARGS} --disable-silent-rules" ; \
2512 fi ; \
2513 if [ ! -z "`${CONFIGURE_CMD} --help 2>&1 | ${GREP} -- '--infodir'`" ]; then \
2514 _LATE_CONFIGURE_ARGS="$${_LATE_CONFIGURE_ARGS} --infodir=${GNU_CONFIGURE_PREFIX}/${INFO_PATH}/${INFO_SUBDIR}" ; \
2515 fi ; \
2516 if [ -z "`${CONFIGURE_CMD} --version 2>&1 | ${EGREP} -i '(autoconf.*2\.13|Unrecognized option)'`" ]; then \
2517 _LATE_CONFIGURE_ARGS="$${_LATE_CONFIGURE_ARGS} --build=${CONFIGURE_TARGET}" ; \
2518 else \
2519 _LATE_CONFIGURE_ARGS="$${_LATE_CONFIGURE_ARGS} ${CONFIGURE_TARGET}" ; \
2520 fi ;
2521 .endif
2522
2523 # Passed to most of script invocations
2524 SCRIPTS_ENV+= CURDIR=${MASTERDIR} DISTDIR=${DISTDIR} \
2525 WRKDIR=${WRKDIR} WRKSRC=${WRKSRC} PATCHDIR=${PATCHDIR} \
2526 SCRIPTDIR=${SCRIPTDIR} FILESDIR=${FILESDIR} \
2527 PORTSDIR=${PORTSDIR} PREFIX=${PREFIX} LOCALBASE=${LOCALBASE}
2528
2529 .if defined(BATCH)
2530 SCRIPTS_ENV+= BATCH=yes
2531 .endif
2532
2533 .if ${PREFIX} == /usr
2534 MANPREFIX?= /usr/share
2535 .else
2536 MANPREFIX?= ${PREFIX}
2537 .endif
2538
2539 MANDIRS+= ${MANPREFIX}/man
2540 .for sect in 1 2 3 4 5 6 7 8 9
2541 MAN${sect}PREFIX?= ${MANPREFIX}
2542 .endfor
2543 MANLPREFIX?= ${MANPREFIX}
2544 MANNPREFIX?= ${MANPREFIX}
2545
2546 .if ${PREFIX} == /usr
2547 INFO_PATH?= share/info
2548 .else
2549 INFO_PATH?= info
2550 .endif
2551
2552 .if defined(INFO)
2553 RUN_DEPENDS+= indexinfo:print/indexinfo
2554
2555 . for D in ${INFO:H}
2556 RD:= ${D}
2557 . if ${RD} != "."
2558 . if !defined(INFO_SUBDIR)
2559 INFO_SUBDIR:= ${RD}
2560 . elif ${INFO_SUBDIR} != ${RD}
2561 BROKEN= only one subdirectory in INFO is allowed
2562 . endif
2563 . endif
2564 .undef RD
2565 . endfor
2566 .endif
2567
2568 DOCSDIR_REL?= ${DOCSDIR:S,^${PREFIX}/,,}
2569 EXAMPLESDIR_REL?= ${EXAMPLESDIR:S,^${PREFIX}/,,}
2570 DATADIR_REL?= ${DATADIR:S,^${PREFIX}/,,}
2571 WWWDIR_REL?= ${WWWDIR:S,^${PREFIX}/,,}
2572 ETCDIR_REL?= ${ETCDIR:S,^${PREFIX}/,,}
2573
2574 PLIST_SUB+= DOCSDIR="${DOCSDIR_REL}" \
2575 EXAMPLESDIR="${EXAMPLESDIR_REL}" \
2576 DATADIR="${DATADIR_REL}" \
2577 WWWDIR="${WWWDIR_REL}" \
2578 ETCDIR="${ETCDIR_REL}"
2579
2580 DESKTOPDIR?= ${PREFIX}/share/applications
2581
2582 .MAIN: all
2583
2584 ################################################################
2585 # Many ways to disable a port.
2586 #
2587 # If we're in BATCH mode and the port is interactive, or we're
2588 # in interactive mode and the port is non-interactive, skip all
2589 # the important targets. The reason we have two modes is that
2590 # one might want to leave a build in BATCH mode running
2591 # overnight, then come back in the morning and do _only_ the
2592 # interactive ones that required your intervention.
2593 #
2594 # Ignore ports that can't be resold if building for a CDROM.
2595 #
2596 # Don't build a port if it's restricted and we don't want to get
2597 # into that.
2598 #
2599 # Don't build a port if it's broken, unless we're running a parallel
2600 # build (in case it's fixed).
2601 #
2602 # Don't build a port if it's forbidden for whatever reason.
2603 #
2604 # Don't build a port if the system is too old.
2605 ################################################################
2606
2607 # Check the machine architectures
2608 .if defined(ONLY_FOR_ARCHS)
2609 .for __ARCH in ${ONLY_FOR_ARCHS}
2610 .if ${ARCH:M${__ARCH}} != ""
2611 __ARCH_OK?= 1
2612 .endif
2613 .endfor
2614 .else
2615 __ARCH_OK?= 1
2616 .endif
2617
2618 .if defined(NOT_FOR_ARCHS)
2619 .for __NARCH in ${NOT_FOR_ARCHS}
2620 .if ${ARCH:M${__NARCH}} != ""
2621 .undef __ARCH_OK
2622 .endif
2623 .endfor
2624 .endif
2625
2626 .if !defined(__ARCH_OK)
2627 .if defined(ONLY_FOR_ARCHS)
2628 IGNORE= is only for ${ONLY_FOR_ARCHS},
2629 .else # defined(NOT_FOR_ARCHS)
2630 IGNORE= does not run on ${NOT_FOR_ARCHS},
2631 .endif
2632 IGNORE+= while you are running ${ARCH}
2633
2634 .if defined(ONLY_FOR_ARCHS_REASON_${ARCH})
2635 IGNORE+= (reason: ${ONLY_FOR_ARCHS_REASON_${ARCH}})
2636 .elif defined(ONLY_FOR_ARCHS_REASON)
2637 IGNORE+= (reason: ${ONLY_FOR_ARCHS_REASON})
2638 .endif
2639
2640 .if defined(NOT_FOR_ARCHS_REASON_${ARCH})
2641 IGNORE+= (reason: ${NOT_FOR_ARCHS_REASON_${ARCH}})
2642 .elif defined(NOT_FOR_ARCHS_REASON)
2643 IGNORE+= (reason: ${NOT_FOR_ARCHS_REASON})
2644 .endif
2645
2646 .endif
2647
2648 # Check the user interaction and legal issues
2649 .if !defined(NO_IGNORE)
2650 .if (defined(IS_INTERACTIVE) && defined(BATCH))
2651 IGNORE= is an interactive port
2652 .elif (!defined(IS_INTERACTIVE) && defined(INTERACTIVE))
2653 IGNORE= is not an interactive port
2654 .elif (defined(NO_CDROM) && defined(FOR_CDROM))
2655 IGNORE= may not be placed on a CDROM: ${NO_CDROM}
2656 .elif (defined(RESTRICTED) && defined(NO_RESTRICTED))
2657 IGNORE= is restricted: ${RESTRICTED}
2658 .elif (defined(NO_PACKAGE) && defined(PACKAGE_BUILDING))
2659 IGNORE= may not be packaged: ${NO_PACKAGE}
2660 .elif defined(IGNORE_${ARCH})
2661 IGNORE= ${IGNORE_${ARCH}}
2662 .elif defined(IGNORE_${OPSYS}_${OSREL:R}_${ARCH})
2663 IGNORE= ${IGNORE_${OPSYS}_${OSREL:R}_${ARCH}}
2664 .elif defined(IGNORE_${OPSYS}_${OSREL:R})
2665 IGNORE= ${IGNORE_${OPSYS}_${OSREL:R}}
2666 .elif defined(IGNORE_${OPSYS})
2667 IGNORE= ${IGNORE_${OPSYS}}
2668 .elif defined(BROKEN)
2669 .if !defined(TRYBROKEN)
2670 IGNORE= is marked as broken: ${BROKEN}
2671 .endif
2672 .elif defined(BROKEN_${ARCH})
2673 .if !defined(TRYBROKEN)
2674 IGNORE= is marked as broken on ${ARCH}: ${BROKEN_${ARCH}}
2675 .endif
2676 .elif defined(BROKEN_${OPSYS}_${OSREL:R}_${ARCH})
2677 .if !defined(TRYBROKEN)
2678 IGNORE= is marked as broken on ${OPSYS} ${OSREL} ${ARCH}: ${BROKEN_${OPSYS}_${OSREL:R}_${ARCH}}
2679 .endif
2680 .elif defined(BROKEN_${OPSYS}_${OSREL:R})
2681 .if !defined(TRYBROKEN)
2682 IGNORE= is marked as broken on ${OPSYS} ${OSREL}: ${BROKEN_${OPSYS}_${OSREL:R}}
2683 .endif
2684 .elif defined(BROKEN_${OPSYS})
2685 .if !defined(TRYBROKEN)
2686 IGNORE= is marked as broken on ${OPSYS}: ${BROKEN_${OPSYS}}
2687 .endif
2688 .elif defined(FORBIDDEN)
2689 IGNORE= is forbidden: ${FORBIDDEN}
2690 .endif
2691
2692 # Define the text to be output to LEGAL
2693 .if defined(LEGAL_TEXT)
2694 LEGAL= ${LEGAL_TEXT}
2695 .elif defined(RESTRICTED)
2696 LEGAL= ${RESTRICTED}
2697 .elif defined(NO_CDROM)
2698 LEGAL= ${NO_CDROM}
2699 .elif defined(NO_PACKAGE) && ! defined(LEGAL_PACKAGE)
2700 LEGAL= ${NO_PACKAGE}
2701 .endif
2702
2703 .if (defined(MANUAL_PACKAGE_BUILD) && defined(PACKAGE_BUILDING))
2704 IGNORE= has to be built manually: ${MANUAL_PACKAGE_BUILD}
2705 clean:
2706 @${IGNORECMD}
2707 .endif
2708
2709 .if defined(IGNORE)
2710 .if defined(IGNORE_SILENT)
2711 IGNORECMD= ${DO_NADA}
2712 .else
2713 IGNORECMD= ${ECHO_MSG} "===> ${PKGNAME} "${IGNORE:Q}. | ${FMT} 75 79 ; exit 1
2714 .endif
2715
2716 _TARGETS= check-sanity fetch checksum extract patch configure all build \
2717 install reinstall test package stage restage
2718
2719 .for target in ${_TARGETS}
2720 .if !target(${target})
2721 ${target}:
2722 @${IGNORECMD}
2723 .if defined(INSTALLS_DEPENDS)
2724 @${FALSE}
2725 .endif
2726 .endif
2727 .endfor
2728
2729 .endif
2730
2731 .endif # !defined(NO_IGNORE)
2732
2733 .if defined(IGNORE) || defined(NO_PACKAGE)
2734 ignorelist: package-name
2735 .else
2736 ignorelist:
2737 @${DO_NADA}
2738 .endif
2739
2740 .if defined(IGNORE) || defined(NO_PACKAGE)
2741 ignorelist-verbose:
2742 .if defined(IGNORE)
2743 @${ECHO_CMD} "${PKGNAME}|IGNORE: "${IGNORE:Q}
2744 .else
2745 @${ECHO_CMD} "${PKGNAME}|NO_PACKAGE: "${NO_PACKAGE:Q}
2746 .endif
2747 .else
2748 ignorelist-verbose:
2749 @${DO_NADA}
2750 .endif
2751
2752 ################################################################
2753 # Clean directories for ftp or CDROM.
2754 ################################################################
2755
2756 .if !defined(LICENSE)
2757
2758 .if defined(RESTRICTED)
2759 clean-restricted: delete-distfiles delete-package
2760 clean-restricted-list: delete-distfiles-list delete-package-list
2761 RESTRICTED_FILES?= ${_DISTFILES} ${_PATCHFILES}
2762 .else
2763 clean-restricted:
2764 clean-restricted-list:
2765 .endif
2766
2767 .if defined(NO_CDROM)
2768 clean-for-cdrom: delete-distfiles delete-package
2769 clean-for-cdrom-list: delete-distfiles-list delete-package-list
2770 RESTRICTED_FILES?= ${_DISTFILES} ${_PATCHFILES}
2771 .else
2772 clean-for-cdrom:
2773 clean-for-cdrom-list:
2774 .endif
2775
2776 .endif # !defined(LICENSE)
2777
2778 .if defined(ALL_HOOK)
2779 all:
2780 @cd ${.CURDIR} && ${SETENV} CURDIR=${.CURDIR} DISTNAME=${DISTNAME} \
2781 DISTDIR=${DISTDIR} WRKDIR=${WRKDIR} WRKSRC=${WRKSRC} \
2782 PATCHDIR=${PATCHDIR} SCRIPTDIR=${SCRIPTDIR} \
2783 FILESDIR=${FILESDIR} PORTSDIR=${PORTSDIR} PREFIX=${PREFIX} \
2784 BUILD_DEPENDS="${BUILD_DEPENDS}" RUN_DEPENDS="${RUN_DEPENDS}" \
2785 CONFLICTS="${CONFLICTS}" \
2786 ${ALL_HOOK}
2787 .endif
2788
2789 .if !target(all)
2790 all: stage
2791 .endif
2792
2793 .if !defined(DEPENDS_TARGET)
2794 .if defined(DEPENDS_PRECLEAN)
2795 DEPENDS_TARGET= clean
2796 DEPENDS_ARGS= NOCLEANDEPENDS=yes
2797 .endif
2798 .if make(reinstall)
2799 DEPENDS_TARGET+= reinstall
2800 .else
2801 DEPENDS_TARGET+= install
2802 .endif
2803 .if defined(DEPENDS_CLEAN)
2804 DEPENDS_TARGET+= clean
2805 DEPENDS_ARGS+= NOCLEANDEPENDS=yes
2806 .endif
2807 .endif
2808
2809 ################################################################
2810 #
2811 # Do preliminary work to detect if we need to run the config
2812 # target or not.
2813 #
2814 ################################################################
2815 .if ((!defined(OPTIONS_DEFINE) && !defined(OPTIONS_SINGLE) && !defined(OPTIONS_MULTI)) \
2816 && !defined(OPTIONS_GROUP) && !defined(OPTIONS_RADIO) \
2817 || defined(CONFIG_DONE_${PKGBASE:tu}) || \
2818 defined(PACKAGE_BUILDING) || defined(BATCH))
2819 _OPTIONS_OK=yes
2820 .endif
2821
2822 ################################################################
2823 # The following are used to create easy dummy targets for
2824 # disabling some bit of default target behavior you don't want.
2825 # They still check to see if the target exists, and if so don't
2826 # do anything, since you might want to set this globally for a
2827 # group of ports in a Makefile.inc, but still be able to
2828 # override from an individual Makefile.
2829 ################################################################
2830
2831 # Disable checksum
2832 .if defined(NO_CHECKSUM) && !target(checksum)
2833 checksum: fetch
2834 @${DO_NADA}
2835 .endif
2836
2837 # Disable build
2838 .if defined(NO_BUILD) && !target(build)
2839 build: configure
2840 @${TOUCH} ${TOUCH_FLAGS} ${BUILD_COOKIE}
2841 .endif
2842
2843 # Disable test
2844 .if defined(NO_TEST) && !target(test)
2845 test: stage
2846 @${DO_NADA}
2847 .endif
2848
2849 # Disable package
2850 .if defined(NO_PACKAGE) && !target(package)
2851 package:
2852 .if defined(IGNORE_SILENT)
2853 @${DO_NADA}
2854 .else
2855 @${ECHO_MSG} "===> ${PKGNAME} may not be packaged: "${NO_PACKAGE:Q}.
2856 .endif
2857 .endif
2858
2859 # Disable describe
2860 .if defined(NO_DESCRIBE) && !target(describe)
2861 describe:
2862 @${DO_NADA}
2863 .endif
2864
2865 ################################################################
2866 # More standard targets start here.
2867 #
2868 # These are the body of the build/install framework. If you are
2869 # not happy with the default actions, and you can't solve it by
2870 # adding pre-* or post-* targets/scripts, override these.
2871 ################################################################
2872
2873 # Pre-everything
2874
2875 pre-everything::
2876 @${DO_NADA}
2877
2878 .if defined(TRYBROKEN) && defined(BROKEN)
2879 buildanyway-message:
2880 @${ECHO_MSG} "Trying build of ${PKGNAME} even though it is marked BROKEN."
2881 .endif
2882
2883 options-message:
2884 .if defined(GNOME_OPTION_MSG) && (!defined(PACKAGE_BUILDING) || !defined(BATCH))
2885 @for m in ${GNOME_OPTION_MSG}; do \
2886 ${ECHO_MSG} $$m; \
2887 done
2888 .else
2889 @${DO_NADA}
2890 .endif
2891 .if defined(_OPTIONS_READ)
2892 @${ECHO_MSG} "===> Found saved configuration for ${_OPTIONS_READ}"
2893 .endif
2894
2895 ${PKG_DBDIR} ${PREFIX} ${WRKDIR} ${EXTRACT_WRKDIR}:
2896 @${MKDIR} ${.TARGET}
2897
2898 # Warn user about deprecated packages. Advisory only.
2899
2900 .if !target(check-deprecated)
2901 # Try and keep these messages in sync with the ones in Mk/Scripts/create-manifest.sh
2902 check-deprecated:
2903 .if ${MAINTAINER} == "ports@FreeBSD.org"
2904 @${ECHO_MSG} "===> NOTICE:"
2905 @${ECHO_MSG}
2906 @${ECHO_MSG} "The ${PORTNAME} port currently does not have a maintainer. As a result, it is"
2907 @${ECHO_MSG} "more likely to have unresolved issues, not be up-to-date, or even be removed in"
2908 @${ECHO_MSG} "the future. To volunteer to maintain this port, please create an issue at:"
2909 @${ECHO_MSG}
2910 @${ECHO_MSG} "https://bugs.freebsd.org/bugzilla"
2911 @${ECHO_MSG}
2912 @${ECHO_MSG} "More information about port maintainership is available at:"
2913 @${ECHO_MSG}
2914 @${ECHO_MSG} "https://www.freebsd.org/doc/en/articles/contributing/ports-contributing.html#maintain-port"
2915 @${ECHO_MSG}
2916 .endif
2917 .if defined(DEPRECATED)
2918 @${ECHO_MSG} "===> NOTICE:"
2919 @${ECHO_MSG}
2920 @${ECHO_MSG} "This port is deprecated; you may wish to reconsider installing it:"
2921 @${ECHO_MSG}
2922 @${ECHO_MSG} ${DEPRECATED:Q}.
2923 @${ECHO_MSG}
2924 .if defined(EXPIRATION_DATE)
2925 @${ECHO_MSG} "It is scheduled to be removed on or after ${EXPIRATION_DATE}."
2926 @${ECHO_MSG}
2927 .endif
2928 .endif
2929 .endif
2930
2931 # Check if the port is listed in the vulnerability database
2932
2933 AUDITFILE?= ${PKG_DBDIR}/vuln.xml
2934
2935 check-vulnerable:
2936 .if !defined(DISABLE_VULNERABILITIES) && !defined(PACKAGE_BUILDING) \
2937 && exists(${AUDITFILE})
2938 @${SETENV} \
2939 dp_ECHO_MSG="${ECHO_MSG}" \
2940 dp_PKG_BIN="${PKG_BIN}" \
2941 dp_PORTNAME="${PORTNAME}" \
2942 dp_PKGNAME="${PKGNAME}" \
2943 dp_SCRIPTSDIR="${SCRIPTSDIR}" \
2944 ${SH} ${SCRIPTSDIR}/check-vulnerable.sh
2945 .endif
2946
2947 # Quote simply quote all variables, except FETCH_ENV, some ports are creative
2948 # with it, and it needs to be quoted twice to pass through the echo/eval in
2949 # do-fetch.
2950 _DO_FETCH_ENV= \
2951 dp_DISABLE_SIZE='${DISABLE_SIZE}' \
2952 dp_DISTDIR='${_DISTDIR}' \
2953 dp_DISTINFO_FILE='${DISTINFO_FILE}' \
2954 dp_DIST_SUBDIR='${DIST_SUBDIR}' \
2955 dp_ECHO_MSG='${ECHO_MSG}' \
2956 dp_FETCH_AFTER_ARGS='${FETCH_AFTER_ARGS}' \
2957 dp_FETCH_BEFORE_ARGS='${FETCH_BEFORE_ARGS}' \
2958 dp_FETCH_CMD='${FETCH_CMD}' \
2959 dp_FETCH_ENV=${FETCH_ENV:Q} \
2960 dp_FORCE_FETCH_ALL='${FORCE_FETCH_ALL}' \
2961 dp_FORCE_FETCH_LIST='${FORCE_FETCH_LIST}' \
2962 dp_MASTER_SITE_BACKUP='${_MASTER_SITE_BACKUP}' \
2963 dp_MASTER_SITE_OVERRIDE='${_MASTER_SITE_OVERRIDE}' \
2964 dp_MASTER_SORT_AWK='${MASTER_SORT_AWK}' \
2965 dp_NO_CHECKSUM='${NO_CHECKSUM}' \
2966 dp_RANDOMIZE_SITES='${_RANDOMIZE_SITES}' \
2967 dp_SCRIPTSDIR='${SCRIPTSDIR}' \
2968 dp_TARGET='${.TARGET}'
2969 .if defined(DEVELOPER)
2970 _DO_FETCH_ENV+= dp_DEVELOPER=yes
2971 .else
2972 _DO_FETCH_ENV+= dp_DEVELOPER=
2973 .endif
2974
2975 # Fetch
2976
2977 .if !target(do-fetch)
2978 do-fetch:
2979 .if !empty(DISTFILES)
2980 @${SETENV} \
2981 ${_DO_FETCH_ENV} ${_MASTER_SITES_ENV} \
2982 dp_SITE_FLAVOR=MASTER \
2983 ${SH} ${SCRIPTSDIR}/do-fetch.sh ${DISTFILES:C/.*/'&'/}
2984 .endif
2985 .if defined(PATCHFILES) && !empty(PATCHFILES)
2986 @${SETENV} \
2987 ${_DO_FETCH_ENV} ${_PATCH_SITES_ENV} \
2988 dp_SITE_FLAVOR=PATCH \
2989 ${SH} ${SCRIPTSDIR}/do-fetch.sh ${PATCHFILES:C/:-p[0-9]//:C/.*/'&'/}
2990 .endif
2991 .endif
2992 #
2993 # Prints out a list of files to fetch (useful to do a batch fetch)
2994
2995 .if !target(fetch-list)
2996 fetch-list:
2997 .if !empty(DISTFILES)
2998 @${SETENV} \
2999 ${_DO_FETCH_ENV} ${_MASTER_SITES_ENV} \
3000 dp_SITE_FLAVOR=MASTER \
3001 ${SH} ${SCRIPTSDIR}/do-fetch.sh ${DISTFILES:C/.*/'&'/}
3002 .endif
3003 .if defined(PATCHFILES) && !empty(PATCHFILES)
3004 @${SETENV} \
3005 ${_DO_FETCH_ENV} ${_PATCH_SITES_ENV} \
3006 dp_SITE_FLAVOR=PATCH \
3007 ${SH} ${SCRIPTSDIR}/do-fetch.sh ${PATCHFILES:C/:-p[0-9]//:C/.*/'&'/}
3008 .endif
3009 .endif
3010
3011 # Used by fetch-urlall-list and fetch-url-list
3012
3013 .if !target(fetch-url-list-int)
3014 fetch-url-list-int:
3015 .if !empty(DISTFILES)
3016 @${SETENV} \
3017 ${_DO_FETCH_ENV} ${_MASTER_SITES_ENV} \
3018 dp_SITE_FLAVOR=MASTER \
3019 ${SH} ${SCRIPTSDIR}/do-fetch.sh ${DISTFILES:C/.*/'&'/}
3020 .endif
3021 .if defined(PATCHFILES) && !empty(PATCHFILES)
3022 @${SETENV} \
3023 ${_DO_FETCH_ENV} ${_PATCH_SITES_ENV} \
3024 dp_SITE_FLAVOR=PATCH \
3025 ${SH} ${SCRIPTSDIR}/do-fetch.sh ${PATCHFILES:C/:-p[0-9]//:C/.*/'&'/}
3026 .endif
3027 .endif
3028
3029 # Prints out all the URL for all the DISTFILES and PATCHFILES.
3030
3031 .if !target(fetch-urlall-list)
3032 fetch-urlall-list:
3033 @cd ${.CURDIR} && ${SETENV} FORCE_FETCH_ALL=yes ${MAKE} fetch-url-list-int
3034 .endif
3035
3036 # Prints the URL for all the DISTFILES and PATCHFILES that are not here
3037
3038 .if !target(fetch-url-list)
3039 fetch-url-list: fetch-url-list-int
3040 .endif
3041
3042
3043 # Extract
3044
3045 clean-wrkdir:
3046 @${RM} -rf ${WRKDIR}
3047
3048 .if !target(do-extract)
3049 do-extract:
3050 @for file in ${EXTRACT_ONLY}; do \
3051 if ! (cd ${EXTRACT_WRKDIR} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/$$file ${EXTRACT_AFTER_ARGS});\
3052 then \
3053 exit 1; \
3054 fi; \
3055 done
3056 @if [ ${UID} = 0 ]; then \
3057 ${CHMOD} -R ug-s ${WRKDIR}; \
3058 ${CHOWN} -R 0:0 ${WRKDIR}; \
3059 fi
3060 .endif
3061
3062 # Patch
3063
3064 .if !target(do-patch)
3065 do-patch:
3066 .if defined(PATCHFILES)
3067 @${ECHO_MSG} "===> Applying distribution patches for ${PKGNAME}"
3068 @(set -e; \
3069 cd ${_DISTDIR}; \
3070 patch_dist_strip () { \
3071 case "$$1" in \
3072 ${_PATCH_DIST_STRIP_CASES} \
3073 esac; \
3074 }; \
3075 for i in ${_PATCHFILES}; do \
3076 if [ ${PATCH_DEBUG_TMP} = yes ]; then \
3077 ${ECHO_MSG} "===> Applying distribution patch $$i" ; \
3078 fi ; \
3079 case $$i in \
3080 *.Z|*.gz) ${GZCAT} $$i ;; \
3081 *.bz2) ${BZCAT} $$i ;; \
3082 *.xz) ${XZCAT} $$i ;; \
3083 *.zip) ${UNZIP_NATIVE_CMD} -p $$i ;; \
3084 *) ${CAT} $$i ;; \
3085 esac | ${PATCH} ${PATCH_DIST_ARGS} `patch_dist_strip $$i` ; \
3086 done )
3087 .endif
3088 .if defined(EXTRA_PATCHES)
3089 @set -e ; \
3090 for i in ${EXTRA_PATCHES}; do \
3091 case $$i in \
3092 *:-p[0-9]) patch_file=$${i%:*} ; patch_strip=$${i##*:} ;; \
3093 *) patch_file=$$i ;; \
3094 esac ; \
3095 ${ECHO_MSG} "===> Applying extra patch $$patch_file" ; \
3096 case $$patch_file in \
3097 *.Z|*.gz) ${GZCAT} $$patch_file ;; \
3098 *.bz2) ${BZCAT} $$patch_file ;; \
3099 *.xz) ${XZCAT} $$patch_file ;; \
3100 *.zip) ${UNZIP_NATIVE_CMD} -p $$patch_file ;; \
3101 *) ${CAT} $$patch_file ;; \
3102 esac | ${PATCH} ${PATCH_ARGS} $$patch_strip ; \
3103 done
3104 .endif
3105 @set -e ;\
3106 if [ -d ${PATCHDIR} ]; then \
3107 if [ "`${ECHO_CMD} ${PATCHDIR}/patch-*`" != "${PATCHDIR}/patch-*" ]; then \
3108 ${ECHO_MSG} "===> Applying ${OPSYS} patches for ${PKGNAME}" ; \
3109 PATCHES_APPLIED="" ; \
3110 for i in ${PATCHDIR}/patch-*; do \
3111 case $$i in \
3112 *.orig|*.rej|*~|*,v) \
3113 ${ECHO_MSG} "===> Ignoring patchfile $$i" ; \
3114 ;; \
3115 *) \
3116 if [ ${PATCH_DEBUG_TMP} = yes ]; then \
3117 ${ECHO_MSG} "===> Applying ${OPSYS} patch $$i" ; \
3118 fi; \
3119 if ${PATCH} ${PATCH_ARGS} < $$i ; then \
3120 PATCHES_APPLIED="$$PATCHES_APPLIED $$i" ; \
3121 else \
3122 ${ECHO_MSG} `${ECHO_CMD} "=> Patch $$i failed to apply cleanly." | ${SED} "s|${PATCHDIR}/||"` ; \
3123 if [ x"$$PATCHES_APPLIED" != x"" -a ${PATCH_SILENT} != "yes" ]; then \
3124 ${ECHO_MSG} `${ECHO_CMD} "=> Patch(es) $$PATCHES_APPLIED applied cleanly." | ${SED} "s|${PATCHDIR}/||g"` ; \
3125 fi; \
3126 ${FALSE} ; \
3127 fi; \
3128 ;; \
3129 esac; \
3130 done; \
3131 fi; \
3132 fi
3133 .endif
3134
3135 .if !target(run-autotools-fixup)
3136 run-autotools-fixup:
3137 # Work around an issue where FreeBSD 10.0 is detected as FreeBSD 1.x.
3138 .if ${OSVERSION} >= 1000000 && !defined(WITHOUT_FBSD10_FIX)
3139 -@for f in `${FIND} ${WRKDIR} -type f \( -name config.libpath -o \
3140 -name config.rpath -o -name configure -o -name libtool.m4 -o \
3141 -name ltconfig -o -name libtool -o -name aclocal.m4 -o \
3142 -name acinclude.m4 \)` ; do \
3143 ${SED} -i.fbsd10bak \
3144 -e 's|freebsd1\*)|freebsd1.\*)|g' \
3145 -e 's|freebsd\[12\]\*)|freebsd[12].*)|g' \
3146 -e 's|freebsd\[123\]\*)|freebsd[123].*)|g' \
3147 -e 's|freebsd\[\[12\]\]\*)|freebsd[[12]].*)|g' \
3148 -e 's|freebsd\[\[123\]\]\*)|freebsd[[123]].*)|g' \
3149 $${f} ; \
3150 cmp -s $${f}.fbsd10bak $${f} || \
3151 ${ECHO_MSG} "===> FreeBSD 10 autotools fix applied to $${f}"; \
3152 ${TOUCH} ${TOUCH_FLAGS} -mr $${f}.fbsd10bak $${f} ; \
3153 ${RM} -f $${f}.fbsd10bak ; \
3154 done
3155 .endif
3156 .endif
3157
3158 # Configure
3159
3160 .if !target(do-configure)
3161 do-configure:
3162 @if [ -f ${SCRIPTDIR}/configure ]; then \
3163 cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \
3164 ${SCRIPTDIR}/configure; \
3165 fi
3166 .if defined(GNU_CONFIGURE)
3167 @CONFIG_GUESS_DIRS=$$(${FIND} ${WRKDIR} -name config.guess -o -name config.sub \
3168 | ${XARGS} -n 1 ${DIRNAME}); \
3169 for _D in $${CONFIG_GUESS_DIRS}; do \
3170 ${RM} $${_D}/config.guess; \
3171 ${CP} ${TEMPLATES}/config.guess $${_D}/config.guess; \
3172 ${CHMOD} a+rx $${_D}/config.guess; \
3173 ${RM} $${_D}/config.sub; \
3174 ${CP} ${TEMPLATES}/config.sub $${_D}/config.sub; \
3175 ${CHMOD} a+rx $${_D}/config.sub; \
3176 done
3177 .endif
3178 .if defined(HAS_CONFIGURE)
3179 @${MKDIR} ${CONFIGURE_WRKSRC}
3180 @(cd ${CONFIGURE_WRKSRC} && \
3181 ${SET_LATE_CONFIGURE_ARGS} \
3182 if ! ${SETENV} CC="${CC}" CPP="${CPP}" CXX="${CXX}" \
3183 CFLAGS="${CFLAGS}" CPPFLAGS="${CPPFLAGS}" CXXFLAGS="${CXXFLAGS}" \
3184 LDFLAGS="${LDFLAGS}" LIBS="${LIBS}" \
3185 INSTALL="/usr/bin/install -c" \
3186 INSTALL_DATA="${INSTALL_DATA}" \
3187 INSTALL_LIB="${INSTALL_LIB}" \
3188 INSTALL_PROGRAM="${INSTALL_PROGRAM}" \
3189 INSTALL_SCRIPT="${INSTALL_SCRIPT}" \
3190 ${CONFIGURE_ENV} ${CONFIGURE_CMD} ${CONFIGURE_ARGS}; then \
3191 ${ECHO_MSG} "===> Script \"${CONFIGURE_SCRIPT}\" failed unexpectedly."; \
3192 (${ECHO_CMD} ${CONFIGURE_FAIL_MESSAGE}) | ${FMT} 75 79 ; \
3193 ${FALSE}; \
3194 fi)
3195 .endif
3196 .endif
3197
3198 # Build
3199 # XXX: ${MAKE_ARGS:N${DESTDIRNAME}=*} would be easier but it is not valid with the old fmake
3200 DO_MAKE_BUILD?= ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_FLAGS} ${MAKEFILE} ${_MAKE_JOBS} ${MAKE_ARGS:C,^${DESTDIRNAME}=.*,,g}
3201 .if !target(do-build)
3202 do-build:
3203 @(cd ${BUILD_WRKSRC}; if ! ${DO_MAKE_BUILD} ${ALL_TARGET}; then \
3204 if [ -n "${BUILD_FAIL_MESSAGE}" ] ; then \
3205 ${ECHO_MSG} "===> Compilation failed unexpectedly."; \
3206 (${ECHO_CMD} "${BUILD_FAIL_MESSAGE}") | ${FMT} 75 79 ; \
3207 fi; \
3208 ${FALSE}; \
3209 fi)
3210 .endif
3211
3212 # Check conflicts
3213
3214 .if !target(check-conflicts)
3215 check-conflicts: check-build-conflicts check-install-conflicts
3216 .endif
3217
3218 .if !target(check-build-conflicts)
3219 check-build-conflicts:
3220 .if ( defined(CONFLICTS) || defined(CONFLICTS_BUILD) ) && !defined(DISABLE_CONFLICTS) && !defined(DEFER_CONFLICTS_CHECK)
3221 @conflicts_with=$$( \
3222 { ${PKG_QUERY} -g "%n-%v %p %o" ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_BUILD:C/.+/'&'/} 2>/dev/null || : ; } \
3223 | while read pkgname prfx orgn; do \
3224 if [ "/${PREFIX}" = "/$${prfx}" -a "/${PKGORIGIN}" != "/$${orgn}" ]; then \
3225 ${ECHO_CMD} -n " $${pkgname}"; \
3226 fi; \
3227 done); \
3228 if [ -n "$${conflicts_with}" ]; then \
3229 ${ECHO_MSG}; \
3230 ${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \
3231 for entry in $${conflicts_with}; do \
3232 ${ECHO_MSG} " $${entry}"; \
3233 done; \
3234 ${ECHO_MSG}; \
3235 ${ECHO_MSG} " They will not build together."; \
3236 ${ECHO_MSG} " Please remove them first with pkg delete."; \
3237 exit 1;\
3238 fi
3239 .endif
3240 .endif
3241
3242 .if !target(identify-install-conflicts)
3243 identify-install-conflicts:
3244 .if ( defined(CONFLICTS) || defined(CONFLICTS_INSTALL) ) && !defined(DISABLE_CONFLICTS)
3245 @conflicts_with=$$( \
3246 { ${PKG_QUERY} -g "%n-%v %p %o" ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_INSTALL:C/.+/'&'/} 2>/dev/null || : ; } \
3247 | while read pkgname prfx orgn; do \
3248 if [ "/${PREFIX}" = "/$${prfx}" -a "/${PKGORIGIN}" != "/$${orgn}" ]; then \
3249 ${ECHO_CMD} -n " $${pkgname}"; \
3250 fi; \
3251 done); \
3252 if [ -n "$${conflicts_with}" ]; then \
3253 ${ECHO_MSG}; \
3254 ${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \
3255 for entry in $${conflicts_with}; do \
3256 ${ECHO_MSG} " $${entry}"; \
3257 done; \
3258 ${ECHO_MSG}; \
3259 ${ECHO_MSG} " They install files into the same place."; \
3260 ${ECHO_MSG} " You may want to stop build with Ctrl + C."; \
3261 sleep 10; \
3262 fi
3263 .endif
3264 .endif
3265
3266 .if !target(check-install-conflicts)
3267 check-install-conflicts:
3268 .if ( defined(CONFLICTS) || defined(CONFLICTS_INSTALL) || ( defined(CONFLICTS_BUILD) && defined(DEFER_CONFLICTS_CHECK) ) ) && !defined(DISABLE_CONFLICTS)
3269 .if defined(DEFER_CONFLICTS_CHECK)
3270 @conflicts_with=$$( \
3271 { ${PKG_QUERY} -g "%n-%v %p %o" ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_BUILD:C/.+/'&'/} ${CONFLICTS_INSTALL:C/.+/'&'/} 2>/dev/null || : ; } \
3272 | while read pkgname prfx orgn; do \
3273 if [ "/${PREFIX}" = "/$${prfx}" -a "/${PKGORIGIN}" != "/$${orgn}" ]; then \
3274 ${ECHO_CMD} -n " $${pkgname}"; \
3275 fi; \
3276 done); \
3277 if [ -n "$${conflicts_with}" ]; then \
3278 ${ECHO_MSG}; \
3279 ${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \
3280 for entry in $${conflicts_with}; do \
3281 ${ECHO_MSG} " $${entry}"; \
3282 done; \
3283 ${ECHO_MSG}; \
3284 ${ECHO_MSG} " Please remove them first with pkg delete."; \
3285 exit 1; \
3286 fi
3287 .else
3288 @conflicts_with=$$( \
3289 { ${PKG_QUERY} -g "%n-%v %p %o" ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_INSTALL:C/.+/'&'/} 2>/dev/null || : ; } \
3290 | while read pkgname prfx orgn; do \
3291 if [ "/${PREFIX}" = "/$${prfx}" -a "/${PKGORIGIN}" != "/$${orgn}" ]; then \
3292 ${ECHO_CMD} -n " $${pkgname}"; \
3293 fi; \
3294 done); \
3295 if [ -n "$${conflicts_with}" ]; then \
3296 ${ECHO_MSG}; \
3297 ${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \
3298 for entry in $${conflicts_with}; do \
3299 ${ECHO_MSG} " $${entry}"; \
3300 done; \
3301 ${ECHO_MSG}; \
3302 ${ECHO_MSG} " They install files into the same place."; \
3303 ${ECHO_MSG} " Please remove them first with pkg delete."; \
3304 exit 1; \
3305 fi
3306 .endif # defined(DEFER_CONFLICTS_CHECK)
3307 .endif
3308 .endif
3309
3310 # Install
3311
3312 .if !target(do-install) && !defined(NO_INSTALL)
3313 do-install:
3314 @(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${FAKEROOT} ${MAKE_CMD} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET})
3315 .endif
3316
3317 # Test
3318
3319 .if !target(do-test) && defined(TEST_TARGET)
3320 DO_MAKE_TEST?= ${SETENV} ${TEST_ENV} ${MAKE_CMD} ${MAKE_FLAGS} ${MAKEFILE} ${TEST_ARGS:C,^${DESTDIRNAME}=.*,,g}
3321 do-test:
3322 @(cd ${TEST_WRKSRC}; if ! ${DO_MAKE_TEST} ${TEST_TARGET}; then \
3323 if [ -n "${TEST_FAIL_MESSAGE}" ] ; then \
3324 ${ECHO_MSG} "===> Tests failed unexpectedly."; \
3325 (${ECHO_CMD} "${TEST_FAIL_MESSAGE}") | ${FMT} 75 79 ; \
3326 fi; \
3327 ${FALSE}; \
3328 fi)
3329 .elif !target(do-test)
3330 do-test:
3331 @${DO_NADA}
3332 .endif
3333
3334 # Package
3335
3336 .if !target(do-package)
3337 PKG_CREATE_ARGS= -r ${STAGEDIR} -m ${METADIR} -p ${TMPPLIST}
3338 .if defined(PKG_CREATE_VERBOSE)
3339 PKG_CREATE_ARGS+= -v
3340 .endif
3341 do-package: create-manifest
3342 do-package: ${TMPPLIST}
3343 @if [ -d ${PACKAGES} ]; then \
3344 if [ ! -d ${PKGREPOSITORY} ]; then \
3345 if ! ${MKDIR} ${PKGREPOSITORY}; then \
3346 ${ECHO_MSG} "=> Can't create directory ${PKGREPOSITORY}."; \
3347 exit 1; \
3348 fi; \
3349 fi; \
3350 fi
3351 @for cat in ${CATEGORIES}; do \
3352 ${RM} -f ${PACKAGES}/$$cat/${PKGNAMEPREFIX}${PORTNAME}*${PKG_SUFX} ; \
3353 done
3354 @${MKDIR} ${WRKDIR}/pkg
3355 @if ${SETENV} ${PKG_ENV} FORCE_POST="${_FORCE_POST_PATTERNS}" ${PKG_CREATE} ${PKG_CREATE_ARGS} -f ${PKG_SUFX:S/.//} -o ${WRKDIR}/pkg ${PKGNAME}; then \
3356 if [ -d ${PKGREPOSITORY} -a -w ${PKGREPOSITORY} ]; then \
3357 ${LN} -f ${WRKDIR_PKGFILE} ${PKGFILE} 2>/dev/null \
3358 || ${CP} -f ${WRKDIR_PKGFILE} ${PKGFILE}; \
3359 if [ "${PKGORIGIN}" = "ports-mgmt/pkg" -o "${PKGORIGIN}" = "ports-mgmt/pkg-devel" ]; then \
3360 if [ ! -d ${PKGLATESTREPOSITORY} ]; then \
3361 if ! ${MKDIR} ${PKGLATESTREPOSITORY}; then \
3362 ${ECHO_MSG} "=> Can't create directory ${PKGLATESTREPOSITORY}."; \
3363 exit 1; \
3364 fi; \
3365 fi ; \
3366 ${LN} -sf ../${PKGREPOSITORYSUBDIR}/${PKGNAME}${PKG_SUFX} ${PKGLATESTFILE} ; \
3367 fi; \
3368 elif [ ! -d ${PACKAGES} ]; then \
3369 ${LN} -f ${WRKDIR_PKGFILE} ${PKGFILE} 2>/dev/null \
3370 || ${CP} -f ${WRKDIR_PKGFILE} ${PKGFILE}; \
3371 fi; \
3372 else \
3373 cd ${.CURDIR} && eval ${MAKE} delete-package >/dev/null; \
3374 exit 1; \
3375 fi
3376 .endif
3377 # Some support rules for do-package
3378
3379 .if !target(delete-package)
3380 delete-package:
3381 @${ECHO_MSG} "===> Deleting package for ${PKGNAME}"
3382 # When staging, the package may only be in the workdir if not root
3383 @${RM} -f ${PKGFILE} ${WRKDIR_PKGFILE} 2>/dev/null || :
3384 .endif
3385
3386 .if !target(delete-package-list)
3387 delete-package-list:
3388 @${ECHO_CMD} "[ -f ${PKGFILE} ] && (${ECHO_CMD} deleting ${PKGFILE}; ${RM} -f ${PKGFILE})"
3389 .endif
3390
3391 # Used by scripts and users to install a package from local repository.
3392 # Poudriere -i uses this, please keep.
3393 .if !target(install-package)
3394 .if defined(FORCE_PKG_REGISTER)
3395 _INSTALL_PKG_ARGS= -f
3396 .endif
3397 .if defined(INSTALLS_DEPENDS)
3398 _INSTALL_PKG_ARGS+= -A
3399 .endif
3400 install-package:
3401 @if [ -f "${WRKDIR}/pkg/${PKGNAME}${PKG_SUFX}" ]; then \
3402 _pkgfile="${WRKDIR_PKGFILE}"; \
3403 else \
3404 _pkgfile="${PKGFILE}"; \
3405 fi; \
3406 ${PKG_ADD} ${_INSTALL_PKG_ARGS} $${_pkgfile}
3407 .endif
3408
3409
3410 # Utility targets follow
3411
3412 .if !target(check-already-installed)
3413 .if !defined(NO_PKG_REGISTER) && !defined(FORCE_PKG_REGISTER)
3414 check-already-installed:
3415 @${ECHO_MSG} "===> Checking if ${PKGBASE} already installed"; \
3416 pkgname=`${PKG_INFO} -q -O ${PKGBASE}`; \
3417 if [ -n "$${pkgname}" ]; then \
3418 v=`${PKG_VERSION} -t $${pkgname} ${PKGNAME}`; \
3419 if [ "$${v}" = "<" ]; then \
3420 ${ECHO_CMD} "===> An older version of ${PKGBASE} is already installed ($${pkgname})"; \
3421 else \
3422 ${ECHO_CMD} "===> ${PKGNAME} is already installed"; \
3423 fi; \
3424 ${ECHO_MSG} " You may wish to \`\`make deinstall'' and install this port again"; \
3425 ${ECHO_MSG} " by \`\`make reinstall'' to upgrade it properly."; \
3426 ${ECHO_MSG} " If you really wish to overwrite the old port of ${PKGBASE}"; \
3427 ${ECHO_MSG} " without deleting it first, set the variable \"FORCE_PKG_REGISTER\""; \
3428 ${ECHO_MSG} " in your environment or the \"make install\" command line."; \
3429 exit 1; \
3430 fi
3431 .endif
3432 .endif
3433
3434 .if !target(check-umask)
3435 check-umask:
3436 @if [ `${SH} -c umask` != 0022 ]; then \
3437 ${ECHO_MSG} "===> Warning: your umask is \"`${SH} -c umask`"\".; \
3438 ${ECHO_MSG} " If this is not desired, set it to an appropriate value"; \
3439 ${ECHO_MSG} " and install this port again by \`\`make reinstall''."; \
3440 fi
3441 .endif
3442
3443 .if !target(install-mtree)
3444 install-mtree:
3445 @${DO_NADA}
3446 .endif
3447
3448 .if !target(install-ldconfig-file)
3449 install-ldconfig-file:
3450 . if defined(USE_LDCONFIG) || defined(USE_LDCONFIG32)
3451 . if defined(USE_LDCONFIG)
3452 . if !defined(USE_LINUX_PREFIX)
3453 . if ${USE_LDCONFIG} != "${LOCALBASE}/lib" && !defined(INSTALL_AS_USER)
3454 @${ECHO_MSG} "===> Installing ldconfig configuration file"
3455 . if defined(NO_MTREE) || ${PREFIX} != ${LOCALBASE}
3456 @${MKDIR} ${STAGEDIR}${LOCALBASE}/${LDCONFIG_DIR}
3457 . endif
3458 @${ECHO_CMD} ${USE_LDCONFIG} | ${TR} ' ' '\n' \
3459 > ${STAGEDIR}${LOCALBASE}/${LDCONFIG_DIR}/${PKGBASE}
3460 @${ECHO_CMD} ${LOCALBASE}/${LDCONFIG_DIR}/${PKGBASE} >> ${TMPPLIST}
3461 . if ${PREFIX} != ${LOCALBASE}
3462 @${ECHO_CMD} "@dir ${LOCALBASE}/${LDCONFIG_DIR}" >> ${TMPPLIST}
3463 . endif
3464 . endif
3465 . endif
3466 . endif
3467 . if defined(USE_LDCONFIG32)
3468 . if !defined(INSTALL_AS_USER)
3469 @${ECHO_MSG} "===> Installing 32-bit ldconfig configuration file"
3470 . if defined(NO_MTREE) || ${PREFIX} != ${LOCALBASE}
3471 @${MKDIR} ${STAGEDIR}${LOCALBASE}/${LDCONFIG32_DIR}
3472 . endif
3473 @${ECHO_CMD} ${USE_LDCONFIG32} | ${TR} ' ' '\n' \
3474 > ${STAGEDIR}${LOCALBASE}/${LDCONFIG32_DIR}/${PKGBASE}
3475 @${ECHO_CMD} ${LOCALBASE}/${LDCONFIG32_DIR}/${PKGBASE} >> ${TMPPLIST}
3476 . if ${PREFIX} != ${LOCALBASE}
3477 @${ECHO_CMD} "@dir ${LOCALBASE}/${LDCONFIG32_DIR}" >> ${TMPPLIST}
3478 . endif
3479 . endif
3480 . endif
3481 . endif
3482 .endif
3483
3484 .if !target(create-users-groups)
3485 .if defined(GROUPS) || defined(USERS)
3486 _UG_INSTALL= ${WRKDIR}/users-groups-install.sh
3487 _UG_DEINSTALL= ${WRKDIR}/users-groups-deinstall.sh
3488 PKGPREINSTALL+= ${_UG_INSTALL}
3489 PKGPOSTDEINSTALL+= ${_UG_DEINSTALL}
3490 create-users-groups:
3491 @${SETENV} \
3492 dp_ECHO_MSG="${ECHO_MSG}" \
3493 dp_GID_FILES="${GID_FILES}" \
3494 dp_GID_OFFSET="${GID_OFFSET}" \
3495 dp_GROUPS_BLACKLIST="${GROUPS_BLACKLIST}" \
3496 dp_INSTALL="${INSTALL}" \
3497 dp_OPSYS="${OPSYS}" \
3498 dp_OSVERSION="${OSVERSION}" \
3499 dp_PREFIX="${PREFIX}" \
3500 dp_PW="${PW}" \
3501 dp_SCRIPTSDIR="${SCRIPTSDIR}" \
3502 dp_UG_DEINSTALL="${_UG_DEINSTALL}" \
3503 dp_UG_INSTALL="${_UG_INSTALL}" \
3504 dp_UID_FILES="${UID_FILES}" \
3505 dp_UID_OFFSET="${UID_OFFSET}" \
3506 dp_USERS_BLACKLIST="${USERS_BLACKLIST}" \
3507 ${SH} ${SCRIPTSDIR}/do-users-groups.sh "${USERS}" "${GROUPS}"
3508 .endif
3509 .endif
3510
3511 .if !defined(DISABLE_SECURITY_CHECK)
3512 .if !target(security-check)
3513 security-check: ${TMPPLIST}
3514 # Scan PLIST for:
3515 # 1. setugid files
3516 # 2. accept()/recvfrom() which indicates network listening capability
3517 # 3. insecure functions (gets/mktemp/tempnam/[XXX])
3518 # 4. startup scripts, in conjunction with 2.
3519 # 5. world-writable files/dirs
3520 #
3521 -@${RM} -f ${WRKDIR}/.PLIST.setuid ${WRKDIR}/.PLIST.writable ${WRKDIR}/.PLIST.objdump; \
3522 ${AWK} -v prefix='${PREFIX}' ' \
3523 match($$0, /^@cwd /) { prefix = substr($$0, RSTART + RLENGTH); if (prefix == "/") prefix=""; next; } \
3524 /^@/ { next; } \
3525 /^\// { print; next; } \
3526 { print prefix "/" $$0; } \
3527 ' ${TMPPLIST} > ${WRKDIR}/.PLIST.flattened; \
3528 ${TR} '\n' '\0' < ${WRKDIR}/.PLIST.flattened \
3529 | ${XARGS} -0 -J % ${FIND} % -prune ! -type l -type f \( -perm -4000 -o -perm -2000 \) \( -perm -0010 -o -perm -0001 \) 2> /dev/null > ${WRKDIR}/.PLIST.setuid; \
3530 ${TR} '\n' '\0' < ${WRKDIR}/.PLIST.flattened \
3531 | ${XARGS} -0 -J % ${FIND} % -prune -perm -0002 \! -type l 2> /dev/null > ${WRKDIR}/.PLIST.writable; \
3532 ${TR} '\n' '\0' < ${WRKDIR}/.PLIST.flattened \
3533 | ${XARGS} -0 -J % ${FIND} % -prune ! -type l -type f -print0 2> /dev/null \
3534 | ${XARGS} -0 -n 1 ${OBJDUMP} -R 2> /dev/null > ${WRKDIR}/.PLIST.objdump; \
3535 if \
3536 ! ${AWK} -v audit="$${PORTS_AUDIT}" -f ${SCRIPTSDIR}/security-check.awk \
3537 ${WRKDIR}/.PLIST.flattened ${WRKDIR}/.PLIST.objdump ${WRKDIR}/.PLIST.setuid ${WRKDIR}/.PLIST.writable; \
3538 then \
3539 www_site=$$(cd ${.CURDIR} && ${MAKE} www-site); \
3540 if [ ! -z "$${www_site}" ]; then \
3541 ${ECHO_MSG}; \
3542 ${ECHO_MSG} " For more information, and contact details about the security"; \
3543 ${ECHO_MSG} " status of this software, see the following webpage: "; \
3544 ${ECHO_MSG} "$${www_site}"; \
3545 fi; \
3546 fi
3547 .endif
3548 .else # i.e. defined(DISABLE_SECURITY_CHECK)
3549 security-check:
3550 @${ECHO_MSG} " WARNING: Security check has been disabled."
3551 .endif # !defined(DISABLE_SECURITY_CHECK)
3552
3553 ################################################################
3554 # Skeleton targets start here
3555 #
3556 # You shouldn't have to change these. Either add the pre-* or
3557 # post-* targets/scripts or redefine the do-* targets. These
3558 # targets don't do anything other than checking for cookies and
3559 # call the necessary targets/scripts.
3560 ################################################################
3561
3562 extract-message:
3563 @${ECHO_MSG} "===> Extracting for ${PKGNAME}"
3564 patch-message:
3565 @${ECHO_MSG} "===> Patching for ${PKGNAME}"
3566 configure-message:
3567 @${ECHO_MSG} "===> Configuring for ${PKGNAME}"
3568 build-message:
3569 @${ECHO_MSG} "===> Building for ${PKGNAME}"
3570 stage-message:
3571 @${ECHO_MSG} "===> Staging for ${PKGNAME}"
3572 install-message:
3573 @${ECHO_MSG} "===> Installing for ${PKGNAME}"
3574 test-message:
3575 @${ECHO_MSG} "===> Testing for ${PKGNAME}"
3576 package-message:
3577 @${ECHO_MSG} "===> Building package for ${PKGNAME}"
3578
3579 # Empty pre-* and post-* targets
3580
3581 .for stage in pre post
3582 .for name in pkg check-sanity fetch extract patch configure build stage install package
3583
3584 .if exists(${SCRIPTDIR}/${stage}-${name})
3585 .if !target(${stage}-${name}-script)
3586 ${stage}-${name}-script:
3587 @ cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \
3588 ${SCRIPTDIR}/${.TARGET:S/-script$//}
3589 .endif
3590 .endif
3591
3592 .endfor
3593 .endfor
3594
3595 .if !target(pretty-print-www-site)
3596 pretty-print-www-site:
3597 @www_site=$$(cd ${.CURDIR} && ${MAKE} www-site); \
3598 if [ -n "$${www_site}" ]; then \
3599 ${ECHO_MSG} -n " and/or visit the "; \
3600 ${ECHO_MSG} -n "<a href=\"$${www_site}\">web site</a>"; \
3601 ${ECHO_MSG} " for further information"; \
3602 fi
3603 .endif
3604
3605 ################################################################
3606 # Some more targets supplied for users' convenience
3607 ################################################################
3608
3609 # Checkpatch
3610 #
3611 # Special target to verify patches
3612
3613 .if !target(checkpatch)
3614 checkpatch:
3615 @cd ${.CURDIR} && ${MAKE} ${PATCH_SILENT} PATCH_CHECK_ONLY=yes ${_PATCH_DEP} ${_PATCH_REAL_SEQ}
3616 .endif
3617
3618 # Reinstall
3619 #
3620 # Special target to re-run install
3621
3622 .if !target(reinstall)
3623 reinstall:
3624 @${RM} -f ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
3625 @cd ${.CURDIR} && DEPENDS_TARGET="${DEPENDS_TARGET}" ${MAKE} -DFORCE_PKG_REGISTER install
3626 .endif
3627
3628 .if !target(restage)
3629 restage:
3630 @${RM} -rf ${STAGEDIR} ${STAGE_COOKIE} ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
3631 @cd ${.CURDIR} && ${MAKE} stage
3632 .endif
3633
3634 # Deinstall
3635 #
3636 # Special target to remove installation
3637
3638 .if !target(deinstall)
3639 deinstall:
3640 .if defined(UID) && ${UID} != 0 && !defined(INSTALL_AS_USER)
3641 @${ECHO_MSG} "===> Switching to root credentials for '${.TARGET}' target"
3642 @cd ${.CURDIR} && \
3643 ${SU_CMD} "${MAKE} ${.TARGET}"
3644 @${ECHO_MSG} "===> Returning to user credentials"
3645 .else
3646 @${ECHO_MSG} "===> Deinstalling for ${PKGBASE}"
3647 @if ${PKG_INFO} -e ${PKGBASE}; then \
3648 p=`${PKG_INFO} -q -O ${PKGBASE}`; \
3649 ${ECHO_MSG} "===> Deinstalling $${p}"; \
3650 ${PKG_DELETE} -f ${PKGBASE} ; \
3651 else \
3652 ${ECHO_MSG} "===> ${PKGBASE} not installed, skipping"; \
3653 fi
3654 @${RM} -f ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
3655 .endif
3656 .endif
3657
3658 # Deinstall-all
3659 #
3660 # Special target to remove installation of all ports of the same origin
3661
3662 .if !target(deinstall-all)
3663 deinstall-all:
3664 .if ${UID} != 0 && !defined(INSTALL_AS_USER)
3665 @${ECHO_MSG} "===> Switching to root credentials for '${.TARGET}' target"
3666 @cd ${.CURDIR} && \
3667 ${SU_CMD} "${MAKE} ${.TARGET}"
3668 @${ECHO_MSG} "===> Returning to user credentials"
3669 .else
3670 @${ECHO_MSG} "===> Deinstalling for ${PKGORIGIN}"
3671 @deinstall_names=`${PKG_INFO} -q -O ${PKGORIGIN}`; \
3672 for oldpkgorigin in $$(${GREP} "|${PKGORIGIN}|" ${PORTSDIR}/MOVED | ${CUT} -f 1 -d '|' | ${SORT} -u); do \
3673 deinstall_names="$${deinstall_names} $$(${PKG_INFO} -q -O $${oldpkgorigin})"; \
3674 done; \
3675 if [ -n "$${deinstall_names}" ]; then \
3676 for d in $${deinstall_names}; do \
3677 ${ECHO_MSG} "===> Deinstalling $${d}"; \
3678 ${PKG_DELETE} -f $${d}; \
3679 done; \
3680 else \
3681 ${ECHO_MSG} "===> ${PKGORIGIN} not installed, skipping"; \
3682 fi; \
3683 ${RM} -f ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
3684 .endif
3685 .endif
3686
3687 # Cleaning up
3688
3689 .if !target(do-clean)
3690 do-clean:
3691 @if [ -d ${WRKDIR} ]; then \
3692 if [ -w ${WRKDIR} ]; then \
3693 ${RM} -rf ${WRKDIR}; \
3694 else \
3695 ${ECHO_MSG} "===> ${WRKDIR} not writable, skipping"; \
3696 fi; \
3697 fi
3698 .endif
3699
3700 .if !target(clean)
3701 clean:
3702 .if !defined(NOCLEANDEPENDS)
3703 @cd ${.CURDIR} && ${MAKE} limited-clean-depends
3704 .endif
3705 @${ECHO_MSG} "===> Cleaning for ${PKGNAME}"
3706 .if target(pre-clean)
3707 @cd ${.CURDIR} && ${MAKE} pre-clean
3708 .endif
3709 @cd ${.CURDIR} && ${MAKE} do-clean
3710 .if target(post-clean)
3711 @cd ${.CURDIR} && ${MAKE} post-clean
3712 .endif
3713 .endif
3714
3715 .if !target(pre-distclean)
3716 pre-distclean:
3717 @${DO_NADA}
3718 .endif
3719
3720 .if !target(distclean)
3721 distclean: pre-distclean clean
3722 @cd ${.CURDIR} && ${MAKE} delete-distfiles RESTRICTED_FILES="${_DISTFILES:Q} ${_PATCHFILES:Q}"
3723 .endif
3724
3725 .if !target(delete-distfiles)
3726 delete-distfiles:
3727 @${ECHO_MSG} "===> Deleting distfiles for ${PKGNAME}"
3728 @(if [ "X${RESTRICTED_FILES}" != "X" -a -d ${_DISTDIR} ]; then \
3729 cd ${_DISTDIR}; \
3730 for file in ${RESTRICTED_FILES}; do \
3731 ${RM} -f $${file}; \
3732 dir=$${file%/*}; \
3733 if [ "$${dir}" != "$${file}" ]; then \
3734 ${RMDIR} -p $${dir} >/dev/null 2>&1 || :; \
3735 fi; \
3736 done; \
3737 fi)
3738 .if defined(DIST_SUBDIR)
3739 -@${RMDIR} ${_DISTDIR} >/dev/null 2>&1 || ${TRUE}
3740 .endif
3741 .endif
3742
3743 .if !target(delete-distfiles-list)
3744 delete-distfiles-list:
3745 @${ECHO_CMD} "# ${PKGNAME}"
3746 @if [ "X${RESTRICTED_FILES}" != "X" ]; then \
3747 for file in ${RESTRICTED_FILES}; do \
3748 ${ECHO_CMD} "[ -f ${_DISTDIR}/$$file ] && (${ECHO_CMD} deleting ${_DISTDIR}/$$file; ${RM} -f ${_DISTDIR}/$$file)"; \
3749 dir=$${file%/*}; \
3750 if [ "$${dir}" != "$${file}" ]; then \
3751 ${ECHO_CMD} "(cd ${_DISTDIR} && ${RMDIR} -p $${dir} 2>/dev/null)"; \
3752 fi; \
3753 done; \
3754 fi
3755 .if defined(DIST_SUBDIR)
3756 @${ECHO_CMD} "${RMDIR} ${_DISTDIR} 2>/dev/null || ${TRUE}"
3757 .endif
3758 .endif
3759
3760 # Generates patches.
3761
3762 update-patches:
3763 @toedit=`PATCH_WRKSRC=${PATCH_WRKSRC} \
3764 PATCHDIR=${PATCHDIR} \
3765 PATCH_LIST=${PATCHDIR}/patch-* \
3766 DIFF_ARGS=${DIFF_ARGS} \
3767 DISTORIG=${DISTORIG} \
3768 ${SH} ${PORTSDIR}/Tools/scripts/update-patches`; \
3769 case $$toedit in "");; \
3770 *) ${ECHO_CMD} -n 'edit patches: '; read i; \
3771 cd ${PATCHDIR} && $${VISUAL:-$${EDIT:-/usr/bin/vi}} $$toedit;; esac
3772
3773 # Checksumming utilities
3774
3775 # List all algorithms here, all the variables name must begin with dp_
3776 _CHECKSUM_INIT_ENV= \
3777 dp_SHA256=${SHA256}
3778
3779 .if !target(makesum)
3780 # Some port change the options with OPTIONS_*_FORCE when make(makesum) to be
3781 # able to add all distfiles in one go.
3782 # For this to work, we need to call the do-fetch script directly here so that
3783 # the options consistent when fetching and when makesum'ing.
3784 # As we're fetching new distfiles, that are not in the distinfo file, disable
3785 # checksum and sizes checks.
3786 makesum:
3787 .if !empty(DISTFILES)
3788 @${SETENV} \
3789 ${_DO_FETCH_ENV} ${_MASTER_SITES_ENV} \
3790 dp_NO_CHECKSUM=yes dp_DISABLE_SIZE=yes \
3791 dp_SITE_FLAVOR=MASTER \
3792 ${SH} ${SCRIPTSDIR}/do-fetch.sh ${DISTFILES:C/.*/'&'/}
3793 .endif
3794 .if defined(PATCHFILES) && !empty(PATCHFILES)
3795 @${SETENV} \
3796 ${_DO_FETCH_ENV} ${_PATCH_SITES_ENV} \
3797 dp_NO_CHECKSUM=yes dp_DISABLE_SIZE=yes \
3798 dp_SITE_FLAVOR=PATCH \
3799 ${SH} ${SCRIPTSDIR}/do-fetch.sh ${PATCHFILES:C/:-p[0-9]//:C/.*/'&'/}
3800 .endif
3801 @${SETENV} \
3802 ${_CHECKSUM_INIT_ENV} \
3803 dp_CHECKSUM_ALGORITHMS='${CHECKSUM_ALGORITHMS:tu}' \
3804 dp_CKSUMFILES='${_CKSUMFILES}' \
3805 dp_DISTDIR='${DISTDIR}' \
3806 dp_DISTINFO_FILE='${DISTINFO_FILE}' \
3807 dp_ECHO_MSG='${ECHO_MSG}' \
3808 dp_SCRIPTSDIR='${SCRIPTSDIR}' \
3809 ${SH} ${SCRIPTSDIR}/makesum.sh ${DISTFILES:C/.*/'&'/}
3810 .endif
3811
3812 .if !target(checksum)
3813 checksum: fetch
3814 .if !empty(_CKSUMFILES)
3815 @${SETENV} \
3816 ${_CHECKSUM_INIT_ENV} \
3817 dp_CHECKSUM_ALGORITHMS='${CHECKSUM_ALGORITHMS:tu}' \
3818 dp_CURDIR='${.CURDIR}' \
3819 dp_DISTDIR='${DISTDIR}' \
3820 dp_DISTINFO_FILE='${DISTINFO_FILE}' \
3821 dp_DIST_SUBDIR='${DIST_SUBDIR}' \
3822 dp_ECHO_MSG='${ECHO_MSG}' \
3823 dp_FETCH_REGET='${FETCH_REGET}' \
3824 dp_MAKE='${MAKE}' \
3825 dp_MAKEFLAGS='${.MAKEFLAGS}' \
3826 dp_SCRIPTSDIR='${SCRIPTSDIR}' \
3827 dp_DISABLE_SIZE='${DISABLE_SIZE}' \
3828 dp_NO_CHECKSUM='${NO_CHECKSUM}' \
3829 ${SH} ${SCRIPTSDIR}/checksum.sh ${_CKSUMFILES:C/.*/'&'/}
3830 .endif
3831 .endif
3832
3833 ################################################################
3834 # The special package-building targets
3835 # You probably won't need to touch these
3836 ################################################################
3837
3838 # Nobody should want to override this unless PKGNAME is simply bogus.
3839
3840 .if !target(package-name)
3841 package-name:
3842 @${ECHO_CMD} ${PKGNAME}
3843 .endif
3844
3845 # Build a package but don't check the package cookie
3846
3847 .if !target(repackage)
3848 repackage: pre-repackage package
3849
3850 pre-repackage:
3851 @${RM} -f ${PACKAGE_COOKIE}
3852 .endif
3853
3854 # Build a package but don't check the cookie for installation, also don't
3855 # install package cookie
3856
3857 .if !target(package-noinstall)
3858 package-noinstall: package
3859 .endif
3860
3861 ################################################################
3862 # Dependency checking
3863 ################################################################
3864
3865 .if !target(depends)
3866 depends: pkg-depends extract-depends patch-depends lib-depends fetch-depends build-depends run-depends
3867
3868 .for deptype in PKG EXTRACT PATCH FETCH BUILD LIB RUN TEST
3869 ${deptype:tl}-depends:
3870 .if defined(${deptype}_DEPENDS) && !defined(NO_DEPENDS)
3871 @${SETENV} \
3872 dp_RAWDEPENDS="${${deptype}_DEPENDS}" \
3873 dp_DEPTYPE="${deptype}_DEPENDS" \
3874 dp_DEPENDS_TARGET="${DEPENDS_TARGET}" \
3875 dp_DEPENDS_PRECLEAN="${DEPENDS_PRECLEAN}" \
3876 dp_DEPENDS_CLEAN="${DEPENDS_CLEAN}" \
3877 dp_DEPENDS_ARGS="${DEPENDS_ARGS}" \
3878 dp_USE_PACKAGE_DEPENDS="${USE_PACKAGE_DEPENDS}" \
3879 dp_USE_PACKAGE_DEPENDS_ONLY="${USE_PACKAGE_DEPENDS_ONLY}" \
3880 dp_PKG_ADD="${PKG_ADD}" \
3881 dp_PKG_INFO="${PKG_INFO}" \
3882 dp_WRKDIR="${WRKDIR}" \
3883 dp_PKGNAME="${PKGNAME}" \
3884 dp_STRICT_DEPENDS="${STRICT_DEPENDS}" \
3885 dp_LOCALBASE="${LOCALBASE}" \
3886 dp_LIB_DIRS="${LIB_DIRS}" \
3887 dp_SH="${SH}" \
3888 dp_SCRIPTSDIR="${SCRIPTSDIR}" \
3889 PORTSDIR="${PORTSDIR}" \
3890 dp_MAKE="${MAKE}" \
3891 ${SH} ${SCRIPTSDIR}/do-depends.sh
3892 .endif
3893 .endfor
3894
3895 .endif
3896
3897 # Dependency lists: both build and runtime, recursive. Print out directory names.
3898
3899 _UNIFIED_DEPENDS=${PKG_DEPENDS} ${EXTRACT_DEPENDS} ${PATCH_DEPENDS} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS} ${RUN_DEPENDS} ${TEST_DEPENDS}
3900 _DEPEND_SPECIALS= ${_UNIFIED_DEPENDS:M*\:*\:*:C,^[^:]*:([^:]*):.*$,\1,}
3901
3902 .for d in ${_UNIFIED_DEPENDS:M*\:/*}
3903 # Fight .for variable interpolation differently for each version of make...
3904 .if defined(.PARSEDIR)
3905 _PORTSDIR_STR= $${PORTSDIR}/
3906 DEV_WARNING+= "It looks like the ${d} depends line has an absolute port origin, make sure to remove \$${_PORTSDIR_STR} from it."
3907 .else
3908 _PORTSDIR_STR= $$$${PORTSDIR}/
3909 DEV_WARNING+= "It looks like the ${d} depends line has an absolute port origin, make sure to remove \$${_PORTSDIR_STR} from it."
3910 .endif
3911 .endfor
3912
3913 all-depends-list:
3914 @${ALL-DEPENDS-LIST}
3915
3916 # This script is shared among several dependency list variables. See file for
3917 # usage.
3918 DEPENDS-LIST= \
3919 ${SETENV} \
3920 PORTSDIR="${PORTSDIR}" \
3921 dp_MAKE="${MAKE}" \
3922 dp_PKGNAME="${PKGNAME}" \
3923 dp_PKG_INFO="${PKG_INFO}" \
3924 dp_SCRIPTSDIR="${SCRIPTSDIR}" \
3925 ${SH} ${SCRIPTSDIR}/depends-list.sh
3926
3927 ALL-DEPENDS-LIST= ${DEPENDS-LIST} -r ${_UNIFIED_DEPENDS:Q}
3928 MISSING-DEPENDS-LIST= ${DEPENDS-LIST} -m ${_UNIFIED_DEPENDS:Q}
3929 TEST-DEPENDS-LIST= ${DEPENDS-LIST} ${TEST_DEPENDS:Q}
3930 CLEAN-DEPENDS-LIST= ${DEPENDS-LIST} -wr ${_UNIFIED_DEPENDS:Q}
3931 CLEAN-DEPENDS-LIMITED-LIST= ${DEPENDS-LIST} -w ${_UNIFIED_DEPENDS:Q}
3932
3933 .if !target(clean-depends)
3934 clean-depends:
3935 @for dir in $$(${CLEAN-DEPENDS-LIST}); do \
3936 (cd $$dir; ${MAKE} NOCLEANDEPENDS=yes clean); \
3937 done
3938 .endif
3939
3940 .if !target(limited-clean-depends)
3941 limited-clean-depends:
3942 @for dir in $$(${CLEAN-DEPENDS-LIMITED-LIST}); do \
3943 (cd $$dir; ${MAKE} NOCLEANDEPENDS=yes clean); \
3944 done
3945 .endif
3946
3947 .if !target(deinstall-depends)
3948 deinstall-depends:
3949 @for dir in $$(${ALL-DEPENDS-LIST}); do \
3950 (cd $$dir; ${MAKE} deinstall); \
3951 done
3952 .endif
3953
3954 .if !target(fetch-specials)
3955 fetch-specials:
3956 @${ECHO_MSG} "===> Fetching all distfiles required by ${PKGNAME} for building"
3957 @for dir in ${_DEPEND_SPECIALS}; do \
3958 case $$dir in \
3959 /*) ;; \
3960 *) dir=${PORTSDIR}/$$dir ;; \
3961 esac; \
3962 (cd $$dir; ${MAKE} fetch); \
3963 done
3964 .endif
3965
3966 .if !target(fetch-recursive)
3967 fetch-recursive:
3968 @${ECHO_MSG} "===> Fetching all distfiles for ${PKGNAME} and dependencies"
3969 @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \
3970 (cd $$dir; ${MAKE} fetch); \
3971 done
3972 .endif
3973
3974 .if !target(fetch-recursive-list)
3975 fetch-recursive-list:
3976 @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \
3977 (cd $$dir; ${MAKE} fetch-list); \
3978 done
3979 .endif
3980
3981 # Used by fetch-required and fetch-required list, this script looks
3982 # at each of the dependencies. If 3 items are specified in the tuple,
3983 # such as foo:graphics/foo:extract, the first item (foo)
3984 # is examined. Only if it begins with a / and does not exist on the
3985 # file-system will ``make targ'' proceed.
3986 # For more usual (dual-item) dependency tuples, the ``make targ''
3987 # proceeds, if the exact package, which the directory WOULD'VE installed,
3988 # is not yet installed.
3989 # This is the exact behaviour of the old code, and it may need
3990 # revisiting. For example, the entire first case seems dubious, and in
3991 # the second case we, probably, should be satisfied with _any_ (earlier)
3992 # package, with the same origin as that of the dir.
3993 #
3994 # -mi
3995 FETCH_LIST?= for i in $$deps; do \
3996 prog=$${i%%:*}; dir=$${i\#*:}; \
3997 case $$dir in \
3998 /*) ;; \
3999 *) dir=${PORTSDIR}/$$dir ;; \
4000 esac; \
4001 case $$dir in \
4002 *:*) if [ $$prog != $${prog\#/} -o ! -e $$prog ]; then \
4003 dir=$${dir%%:*}; \
4004 else \
4005 continue; \
4006 fi;; \
4007 *) if [ -d ${PKG_DBDIR}/$$(cd $$dir; ${MAKE} -V PKGNAME) ]; then \
4008 continue; \
4009 fi;; \
4010 esac; \
4011 echo cd $$dir; cd $$dir; ${MAKE} $$targ; \
4012 done
4013
4014 .if !target(fetch-required)
4015 fetch-required: fetch
4016 .if defined(NO_DEPENDS)
4017 @${ECHO_MSG} "===> NO_DEPENDS is set, not fetching any other distfiles for ${PKGNAME}"
4018 .else
4019 @${ECHO_MSG} "===> Fetching all required distfiles for ${PKGNAME} and dependencies"
4020 .for deptype in PKG EXTRACT PATCH FETCH BUILD RUN
4021 .if defined(${deptype}_DEPENDS)
4022 @targ=fetch; deps="${${deptype}_DEPENDS}"; ${FETCH_LIST}
4023 .endif
4024 .endfor
4025 .endif
4026
4027 .endif
4028
4029 .if !target(fetch-required-list)
4030 fetch-required-list: fetch-list
4031 .if !defined(NO_DEPENDS)
4032 .for deptype in PKG EXTRACT PATCH FETCH BUILD RUN
4033 .if defined(${deptype}_DEPENDS)
4034 @targ=fetch-list; deps="${${deptype}_DEPENDS}"; ${FETCH_LIST}
4035 .endif
4036 .endfor
4037 .endif
4038 .endif
4039
4040 .if !target(checksum-recursive)
4041 checksum-recursive:
4042 @${ECHO_MSG} "===> Fetching and checking checksums for ${PKGNAME} and dependencies"
4043 @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \
4044 (cd $$dir; ${MAKE} checksum); \
4045 done
4046 .endif
4047
4048 # Dependency lists: build and runtime. Print out directory names.
4049
4050 build-depends-list:
4051 .if defined(PKG_DEPENDS) || defined(EXTRACT_DEPENDS) || defined(PATCH_DEPENDS) || defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || defined(LIB_DEPENDS)
4052 @${BUILD-DEPENDS-LIST}
4053 .endif
4054
4055 BUILD-DEPENDS-LIST= \
4056 for dir in $$(${ECHO_CMD} "${PKG_DEPENDS} ${EXTRACT_DEPENDS} ${PATCH_DEPENDS} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS}" | ${SED} -E -e 's,([^: ]*):([^: ]*)(:[^ ]*)?,\2,g' -e 'y/ /\n/'| ${SORT} -u); do \
4057 case $$dir in \
4058 /*) pdir=$$dir ;; \
4059 *) pdir=${PORTSDIR}/$$dir ;; \
4060 esac ; \
4061 if [ -d $$pdir ]; then \
4062 ${ECHO_CMD} $$pdir; \
4063 else \
4064 ${ECHO_MSG} "${PKGNAME}: \"$$pdir\" non-existent -- dependency list incomplete" >&2; \
4065 fi; \
4066 done | ${SORT} -u
4067
4068 run-depends-list:
4069 .if defined(LIB_DEPENDS) || defined(RUN_DEPENDS)
4070 @${RUN-DEPENDS-LIST}
4071 .endif
4072
4073 RUN-DEPENDS-LIST= \
4074 for dir in $$(${ECHO_CMD} "${_LIB_RUN_DEPENDS:C,.*:([^:]*).*,\1,}" | ${SED} -e 'y/ /\n/' | ${SORT} -u); do \
4075 case $$dir in \
4076 /*) pdir=$$dir ;; \
4077 *) pdir=${PORTSDIR}/$$dir ;; \
4078 esac ; \
4079 if [ -d $$pdir ]; then \
4080 ${ECHO_CMD} $$pdir; \
4081 else \
4082 ${ECHO_MSG} "${PKGNAME}: \"$$pdir\" non-existent -- dependency list incomplete" >&2; \
4083 fi; \
4084 done | ${SORT} -u
4085
4086 test-depends-list:
4087 .if defined(TEST_DEPENDS)
4088 @${TEST-DEPENDS-LIST}
4089 .endif
4090
4091 # Package (recursive runtime) dependency list. Print out both directory names
4092 # and package names.
4093
4094 package-depends-list:
4095 .if defined(CHILD_DEPENDS) || defined(LIB_DEPENDS) || defined(RUN_DEPENDS)
4096 @${PACKAGE-DEPENDS-LIST}
4097 .endif
4098
4099 _LIB_RUN_DEPENDS= ${LIB_DEPENDS} ${RUN_DEPENDS}
4100 PACKAGE-DEPENDS-LIST?= \
4101 if [ "${CHILD_DEPENDS}" ]; then \
4102 installed=$$(${PKG_INFO} -qO ${PKGORIGIN} 2>/dev/null || \
4103 ${TRUE}); \
4104 if [ "$$installed" ]; then \
4105 break; \
4106 fi; \
4107 if [ -z "$$installed" ]; then \
4108 installed="${PKGNAME}"; \
4109 fi; \
4110 for pkgname in $$installed; do \
4111 ${ECHO_CMD} "$$pkgname ${.CURDIR} ${PKGORIGIN}"; \
4112 done; \
4113 fi; \
4114 checked="${PARENT_CHECKED}"; \
4115 for dir in ${_LIB_RUN_DEPENDS:C,[^:]*:([^:]*):?.*,\1,}; do \
4116 case "$$dir" in \
4117 /*) ;; \
4118 *) dir=${PORTSDIR}/$$dir ;; \
4119 esac ; \
4120 dir=$$(${REALPATH} $$dir); \
4121 if [ -d $$dir ]; then \
4122 case $$checked in \
4123 $$dir|$$dir\ *|*\ $$dir|*\ $$dir\ *) continue;; \
4124 esac; \
4125 childout=$$(cd $$dir; ${MAKE} CHILD_DEPENDS=yes PARENT_CHECKED="$$checked" package-depends-list); \
4126 set -- $$childout; \
4127 childdir=""; \
4128 while [ $$\# != 0 ]; do \
4129 childdir="$$childdir $$2"; \
4130 ${ECHO_CMD} "$$1 $$2 $$3"; \
4131 shift 3; \
4132 done; \
4133 checked="$$dir $$childdir $$checked"; \
4134 else \
4135 ${ECHO_MSG} "${PKGNAME}: \"$$dir\" non-existent -- dependency list incomplete" >&2; \
4136 fi; \
4137 done
4138
4139 ACTUAL-PACKAGE-DEPENDS?= \
4140 depfiles="" ; \
4141 for lib in ${LIB_DEPENDS:C/\:.*//}; do \
4142 depfiles="$$depfiles `${SETENV} LIB_DIRS="${LIB_DIRS}" LOCALBASE="${LOCALBASE}" ${SH} ${SCRIPTSDIR}/find-lib.sh $${lib}`" ; \
4143 done ; \
4144 ${SETENV} PKG_BIN="${PKG_BIN}" ${SH} ${SCRIPTSDIR}/actual-package-depends.sh $${depfiles} ${RUN_DEPENDS:C/(.*)\:.*/"\1"/}
4145
4146 PKG_NOTES_ENV?=
4147 .for note in ${PKG_NOTES}
4148 PKG_NOTES_ENV+= dp_PKG_NOTE_${note}=${PKG_NOTE_${note}:Q}
4149 .endfor
4150
4151 create-manifest:
4152 @${SETENV} \
4153 dp_SCRIPTSDIR='${SCRIPTSDIR}' \
4154 dp_ACTUAL_PACKAGE_DEPENDS='${ACTUAL-PACKAGE-DEPENDS}' \
4155 dp_CATEGORIES='${CATEGORIES:u:S/$/,/}' \
4156 dp_COMMENT=${COMMENT:Q} \
4157 dp_COMPLETE_OPTIONS_LIST='${COMPLETE_OPTIONS_LIST}' \
4158 dp_DEPRECATED=${DEPRECATED:Q} \
4159 dp_DESCR='${DESCR}' \
4160 dp_EXPIRATION_DATE='${EXPIRATION_DATE}' \
4161 dp_GROUPS='${GROUPS:u:S/$/,/}' \
4162 dp_LICENSE='${LICENSE:u:S/$/,/}' \
4163 dp_LICENSE_COMB='${LICENSE_COMB}' \
4164 dp_MAINTAINER='${MAINTAINER}' \
4165 dp_METADIR='${METADIR}' \
4166 dp_NO_ARCH='${NO_ARCH}' \
4167 dp_PKGBASE='${PKGBASE}' \
4168 dp_PKGDEINSTALL='${PKGDEINSTALL}' \
4169 dp_PKGINSTALL='${PKGINSTALL}' \
4170 dp_PKGMESSAGES='${_PKGMESSAGES}' \
4171 dp_PKGORIGIN='${PKGORIGIN}' \
4172 dp_PKGPOSTDEINSTALL='${PKGPOSTDEINSTALL}' \
4173 dp_PKGPOSTINSTALL='${PKGPOSTINSTALL}' \
4174 dp_PKGPOSTUPGRADE='${PKGPOSTUPGRADE}' \
4175 dp_PKGPREDEINSTALL='${PKGPREDEINSTALL}' \
4176 dp_PKGPREINSTALL='${PKGPREINSTALL}' \
4177 dp_PKGPREUPGRADE='${PKGPREUPGRADE}' \
4178 dp_PKGUPGRADE='${PKGUPGRADE}' \
4179 dp_PKGVERSION='${PKGVERSION}' \
4180 dp_PKG_BIN='${PKG_BIN}' \
4181 dp_PKG_IGNORE_DEPENDS='${PKG_IGNORE_DEPENDS}' \
4182 dp_PKG_NOTES='${PKG_NOTES}' \
4183 dp_PORT_OPTIONS='${PORT_OPTIONS}' \
4184 dp_PREFIX='${PREFIX}' \
4185 dp_USERS='${USERS:u:S/$/,/}' \
4186 dp_WWW='${WWW}' \
4187 ${PKG_NOTES_ENV} \
4188 ${SH} ${SCRIPTSDIR}/create-manifest.sh
4189
4190
4191 # Print out package names.
4192
4193 package-depends:
4194 @${PACKAGE-DEPENDS-LIST} | ${AWK} '{print $$1":"$$3}'
4195
4196 actual-package-depends:
4197 @${ACTUAL-PACKAGE-DEPENDS}
4198
4199 # Build packages for port and dependencies
4200
4201 package-recursive: package
4202 @for dir in $$(${ALL-DEPENDS-LIST}); do \
4203 (cd $$dir; ${MAKE} package-noinstall); \
4204 done
4205
4206 # Show missing dependencies
4207 missing:
4208 @for dir in $$(${MISSING-DEPENDS-LIST}); do \
4209 echo $${dir#${PORTSDIR}/}; \
4210 done
4211
4212 # Show missing dependencies by name
4213 missing-packages:
4214 @_packages=$$(${PKG_INFO} -aq); \
4215 for dir in $$(${ALL-DEPENDS-LIST}); do \
4216 _p=$$(cd $$dir; ${MAKE} -VPKGNAME); \
4217 if ! $$(${ECHO_CMD} $${_packages} | ${GREP} -q $${_p}); then \
4218 ${ECHO_CMD} $${_p}; \
4219 fi; \
4220 done
4221
4222 ################################################################
4223 # Everything after here are internal targets and really
4224 # shouldn't be touched by anybody but the release engineers.
4225 ################################################################
4226
4227 # This target generates an index entry suitable for aggregation into
4228 # a large index. Format is:
4229 #
4230 # distribution-name|port-path|installation-prefix|comment| \
4231 # description-file|maintainer|categories|extract-depends| \
4232 # patch-depends|fetch-depends|build-depends|run-depends|www site
4233 #
4234 # If this ever changes, portmgr should contact the portsnap maintainer
4235 # first to avoid gratuitous breakage.
4236
4237 . if !target(describe)
4238 _EXTRACT_DEPENDS=${EXTRACT_DEPENDS:C/^[^ :]+:([^ :]+)(:[^ :]+)?/\1/:O:u:C,(^[^/]),${PORTSDIR}/\1,}
4239 _PATCH_DEPENDS=${PATCH_DEPENDS:C/^[^ :]+:([^ :]+)(:[^ :]+)?/\1/:O:u:C,(^[^/]),${PORTSDIR}/\1,}
4240 _FETCH_DEPENDS=${FETCH_DEPENDS:C/^[^ :]+:([^ :]+)(:[^ :]+)?/\1/:O:u:C,(^[^/]),${PORTSDIR}/\1,}
4241 _LIB_DEPENDS=${LIB_DEPENDS:C/^[^ :]+:([^ :]+)(:[^ :]+)?/\1/:O:u:C,(^[^/]),${PORTSDIR}/\1,}
4242 _BUILD_DEPENDS=${BUILD_DEPENDS:C/^[^ :]+:([^ :]+)(:[^ :]+)?/\1/:O:u:C,(^[^/]),${PORTSDIR}/\1,} ${_LIB_DEPENDS}
4243 _RUN_DEPENDS=${RUN_DEPENDS:C/^[^ :]+:([^ :]+)(:[^ :]+)?/\1/:O:u:C,(^[^/]),${PORTSDIR}/\1,} ${_LIB_DEPENDS}
4244 . if exists(${DESCR})
4245 _DESCR=${DESCR}
4246 . else
4247 _DESCR=/dev/null
4248 . endif
4249
4250 . if defined(BUILDING_INDEX) && defined(INDEX_PORTS)
4251 INDEX_OUT=${INDEX_TMPDIR}/${INDEXFILE}.desc.aggr
4252 . else
4253 INDEX_OUT=/dev/stdout
4254 . endif
4255
4256 describe:
4257 @(${ECHO_CMD} -n "${PKGNAME}|${.CURDIR}|${PREFIX}|"; \
4258 ${ECHO_CMD} -n ${COMMENT:Q}; \
4259 ${ECHO_CMD} -n "|${_DESCR}|${MAINTAINER}|${CATEGORIES}|${_EXTRACT_DEPENDS}|${_PATCH_DEPENDS}|${_FETCH_DEPENDS}|${_BUILD_DEPENDS:O:u}|${_RUN_DEPENDS:O:u}|"; \
4260 while read one two discard; do \
4261 case "$$one" in \
4262 WWW:) case "$$two" in \
4263 https://*|http://*|ftp://*) ${ECHO_CMD} -n "$$two" ;; \
4264 *) ${ECHO_CMD} -n "http://$$two" ;; \
4265 esac; \
4266 break; \
4267 ;; \
4268 esac; \
4269 done < ${DESCR}; ${ECHO_CMD}) >>${INDEX_OUT}
4270 . endif
4271
4272 www-site:
4273 .if exists(${DESCR})
4274 @${AWK} '$$1 ~ /^WWW:/ {print $$2}' ${DESCR} | ${HEAD} -1
4275 .else
4276 @${ECHO_CMD}
4277 .endif
4278
4279 .if !target(readmes)
4280 readmes: readme
4281 .endif
4282
4283 .if !target(readme)
4284 readme:
4285 @${RM} -f ${.CURDIR}/README.html
4286 @cd ${.CURDIR} && ${MAKE} ${.CURDIR}/README.html
4287 .endif
4288
4289 ${.CURDIR}/README.html:
4290 @${ECHO_MSG} "===> Creating README.html for ${PKGNAME}"
4291 @${SED} -e 's|%%PORT%%|'$$(${ECHO_CMD} ${.CURDIR} | \
4292 ${SED} -e 's|.*/\([^/]*/[^/]*\)$$|\1|')'|g' \
4293 -e 's|%%PKG%%|${PKGNAME}|g' \
4294 -e 's|%%COMMENT%%|'"$$(${ECHO_CMD} ${COMMENT:Q})"'|' \
4295 -e '/%%COMMENT%%/d' \
4296 -e 's|%%DESCR%%|'"$$(${ECHO_CMD} ${DESCR} | \
4297 ${SED} -e 's|${.CURDIR}/||')"'|' \
4298 -e 's|%%EMAIL%%|'"$$(${ECHO_CMD} "${MAINTAINER}" | \
4299 ${SED} -e 's/([^)]*)//;s/.*<//;s/>.*//')"'|g' \
4300 -e 's|%%MAINTAINER%%|${MAINTAINER}|g' \
4301 -e 's|%%WEBSITE%%|'"$$(cd ${.CURDIR} && eval ${MAKE} pretty-print-www-site)"'|' \
4302 -e 's|%%BUILD_DEPENDS%%|'"$$(cd ${.CURDIR} && eval ${MAKE} pretty-print-build-depends-list)"'|' \
4303 -e 's|%%RUN_DEPENDS%%|'"$$(cd ${.CURDIR} && eval ${MAKE} pretty-print-run-depends-list)"'|' \
4304 -e 's|%%TOP%%|'"$$(${ECHO_CMD} ${CATEGORIES} | \
4305 ${SED} -e 's| .*||' -e 's|[^/]*|..|g')"'/..|' \
4306 ${TEMPLATES}/README.port >> ${.TARGET}
4307
4308 # The following two targets require an up-to-date INDEX in ${PORTSDIR}
4309
4310 _PRETTY_PRINT_DEPENDS_LIST=\
4311 if [ ! -r ${INDEXDIR}/${INDEXFILE} ] ; then \
4312 ${ECHO_MSG} "${.TARGET} requires an INDEX file (${INDEXFILE}). Please run make index or make fetchindex."; \
4313 else \
4314 target=${.TARGET:C/pretty-print-(.*)-depends-list/\1/} ; \
4315 if [ "$$target" = "build" ] ; then fldnum=8 ; else fldnum=9 ; fi; \
4316 ${ECHO_MSG} -n 'This port requires package(s) "' ; \
4317 ${ECHO_MSG} -n `${AWK} -F\| "\\$$1 ~ /^${PKGNAME}/ {print \\$$$${fldnum};}" ${INDEXDIR}/${INDEXFILE}` ; \
4318 ${ECHO_MSG} "\" to $$target."; \
4319 fi;
4320
4321
4322 .if !target(pretty-print-build-depends-list)
4323 pretty-print-build-depends-list:
4324 .if defined(PKG_DEPENDS) || defined(EXTRACT_DEPENDS) || defined(PATCH_DEPENDS) || \
4325 defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || defined(LIB_DEPENDS)
4326 @${_PRETTY_PRINT_DEPENDS_LIST}
4327 .endif
4328 .endif
4329
4330 .if !target(pretty-print-run-depends-list)
4331 pretty-print-run-depends-list:
4332 .if defined(RUN_DEPENDS) || defined(LIB_DEPENDS)
4333 @${_PRETTY_PRINT_DEPENDS_LIST}
4334 .endif
4335 .endif
4336
4337 _SUB_LIST_TEMP= ${SUB_LIST:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/}
4338 .if !target(apply-slist)
4339 apply-slist:
4340 .if defined(SUB_FILES)
4341 .for file in ${SUB_FILES}
4342 .if !exists(${FILESDIR}/${file}.in)
4343 @${ECHO_MSG} "** Missing ${FILESDIR}/${file}.in for ${PKGNAME}."; exit 1
4344 .else
4345 @${SED} ${_SUB_LIST_TEMP} -e '/^@comment /d' ${FILESDIR}/${file}.in > ${WRKDIR}/${file}
4346 .endif
4347 .endfor
4348 .for i in pkg-message pkg-install pkg-deinstall pkg-req
4349 .if ${SUB_FILES:M${i}*}!=""
4350 ${i:S/-//:tu}= ${WRKDIR}/${SUB_FILES:M${i}*}
4351 .endif
4352 .endfor
4353 .endif
4354 .endif
4355
4356 # Generate packing list. Also tests to make sure all required package
4357 # files exist.
4358
4359 .if !target(generate-plist)
4360 generate-plist: ${WRKDIR}
4361 @${ECHO_MSG} "===> Generating temporary packing list"
4362 @${MKDIR} ${TMPPLIST:H}
4363 @if [ ! -f ${DESCR} ]; then ${ECHO_MSG} "** Missing pkg-descr for ${PKGNAME}."; exit 1; fi
4364 @>${TMPPLIST}
4365 @for file in ${PLIST_FILES}; do \
4366 ${ECHO_CMD} $${file} | ${SED} ${PLIST_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} >> ${TMPPLIST}; \
4367 done
4368 @if [ -f ${PLIST} ]; then \
4369 ${SED} ${PLIST_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} ${PLIST} >> ${TMPPLIST}; \
4370 fi
4371
4372 .for dir in ${PLIST_DIRS}
4373 @${ECHO_CMD} ${dir} | ${SED} ${PLIST_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} -e 's,^,@dir ,' >> ${TMPPLIST}
4374 .endfor
4375
4376 .if defined(USE_LINUX_PREFIX)
4377 .if defined(USE_LDCONFIG)
4378 @${ECHO_CMD} '@preexec [ -n "`/sbin/sysctl -q compat.linux.osrelease`" ] || ( echo "Cannot install package: kernel missing Linux support"; exit 1 )' >> ${TMPPLIST}
4379 @${ECHO_CMD} "@postexec ${LINUXBASE}/sbin/ldconfig" >> ${TMPPLIST}
4380 @${ECHO_CMD} "@postunexec ${LINUXBASE}/sbin/ldconfig" >> ${TMPPLIST}
4381 .endif
4382 .else
4383 .if defined(USE_LDCONFIG)
4384 .if !defined(INSTALL_AS_USER)
4385 @${ECHO_CMD} "@postexec ${LDCONFIG} -m ${USE_LDCONFIG}" >> ${TMPPLIST}
4386 @${ECHO_CMD} "@postunexec ${LDCONFIG} -R" >> ${TMPPLIST}
4387 .else
4388 @${ECHO_CMD} "@postexec ${LDCONFIG} -m ${USE_LDCONFIG} || ${TRUE}" >> ${TMPPLIST}
4389 @${ECHO_CMD} "@postunexec ${LDCONFIG} -R || ${TRUE}" >> ${TMPPLIST}
4390 .endif
4391 .endif
4392 .if defined(USE_LDCONFIG32)
4393 .if !defined(INSTALL_AS_USER)
4394 @${ECHO_CMD} "@postexec ${LDCONFIG} -32 -m ${USE_LDCONFIG32}" >> ${TMPPLIST}
4395 @${ECHO_CMD} "@postunexec ${LDCONFIG} -32 -R" >> ${TMPPLIST}
4396 .else
4397 @${ECHO_CMD} "@postexec ${LDCONFIG} -32 -m ${USE_LDCONFIG32} || ${TRUE}" >> ${TMPPLIST}
4398 @${ECHO_CMD} "@postunexec ${LDCONFIG} -32 -R || ${TRUE}" >> ${TMPPLIST}
4399 .endif
4400 .endif
4401 .endif
4402 .endif
4403
4404 ${TMPPLIST}:
4405 @cd ${.CURDIR} && ${MAKE} generate-plist
4406
4407 ${TMPPLIST_SORT}: ${TMPPLIST}
4408 @${SORT} -u ${TMPPLIST} >${TMPPLIST_SORT}
4409
4410 .for _type in EXAMPLES DOCS
4411 .if !target(add-plist-${_type:tl})
4412 .if defined(PORT${_type}) && !defined(NOPORT${_type})
4413 add-plist-${_type:tl}:
4414 .for x in ${PORT${_type}}
4415 @if ${ECHO_CMD} "${x}"| ${AWK} '$$1 ~ /(\*|\||\[|\]|\?|\{|\}|\$$)/ { exit 1};'; then \
4416 if [ ! -e ${STAGEDIR}${${_type}DIR}/${x} ]; then \
4417 ${ECHO_CMD} ${${_type}DIR}/${x} >> ${TMPPLIST}; \
4418 fi;fi
4419 .endfor
4420 @${FIND} -P ${PORT${_type}:S/^/${STAGEDIR}${${_type}DIR}\//} ! -type d 2>/dev/null | \
4421 ${SED} -ne 's,^${STAGEDIR},,p' >> ${TMPPLIST}
4422 .endif
4423 .endif
4424 .endfor
4425
4426 .if !target(add-plist-data)
4427 .if defined(PORTDATA)
4428 add-plist-data:
4429 .for x in ${PORTDATA}
4430 @if ${ECHO_CMD} "${x}"| ${AWK} '$$1 ~ /(\*|\||\[|\]|\?|\{|\}|\$$)/ { exit 1};'; then \
4431 if [ ! -e ${STAGEDIR}${DATADIR}/${x} ]; then \
4432 ${ECHO_CMD} ${DATADIR}/${x} >> ${TMPPLIST}; \
4433 fi;fi
4434 .endfor
4435 @${FIND} -P ${PORTDATA:S/^/${STAGEDIR}${DATADIR}\//} ! -type d 2>/dev/null | \
4436 ${SED} -ne 's,^${STAGEDIR},,p' >> ${TMPPLIST}
4437 .endif
4438 .endif
4439
4440 .if !target(add-plist-info)
4441 .if defined(INFO)
4442 add-plist-info:
4443 .for i in ${INFO}
4444 @${LS} ${STAGEDIR}${PREFIX}/${INFO_PATH}/$i.info* | ${SED} -e s:${STAGEDIR}:@info\ :g >> ${TMPPLIST}
4445 .endfor
4446 .endif
4447 .endif
4448
4449 # If we're installing into a non-standard PREFIX, we need to remove that directory at
4450 # deinstall-time
4451 .if !target(add-plist-post)
4452 .if (${PREFIX} != ${LOCALBASE} && ${PREFIX} != ${LINUXBASE} && \
4453 ${PREFIX} != "/usr" && ${PREFIX} != "/" && !defined(NO_PREFIX_RMDIR))
4454 add-plist-post:
4455 @${ECHO_CMD} "@dir ${PREFIX}" >> ${TMPPLIST}
4456 .endif
4457 .endif
4458
4459 .if !target(install-rc-script)
4460 .if defined(USE_RC_SUBR)
4461 install-rc-script:
4462 @${ECHO_MSG} "===> Staging rc.d startup script(s)"
4463 @for i in ${USE_RC_SUBR}; do \
4464 _prefix=${PREFIX}; \
4465 [ "${PREFIX}" = "/usr" ] && _prefix="" ; \
4466 ${INSTALL_SCRIPT} ${WRKDIR}/$${i} ${STAGEDIR}$${_prefix}/etc/rc.d/$${i%.sh}; \
4467 ${ECHO_CMD} "$${_prefix}/etc/rc.d/$${i%.sh}" >> ${TMPPLIST}; \
4468 done
4469 .endif
4470 .endif
4471
4472 .if !target(check-man)
4473 check-man: stage
4474 @${ECHO_MSG} "====> Checking man pages (check-man)"
4475 @mdirs= ; \
4476 for dir in ${MANDIRS:S/^/${STAGEDIR}/} ; do \
4477 [ -d $$dir ] && mdirs="$$mdirs $$dir" ;\
4478 done ; \
4479 err=0 ; \
4480 for dir in $$mdirs; do \
4481 for f in $$(find $$dir -name "*.gz"); do \
4482 ${ECHO_CMD} "===> Checking $${f##*/}" ; \
4483 gunzip -c $$f | mandoc -Tlint -Werror && continue ; \
4484 err=1 ; \
4485 done ; \
4486 done ; \
4487 exit $$err
4488 .endif
4489
4490 # Compress all manpage not already compressed which are not hardlinks
4491 # Find all manpages which are not compressed and are hadlinks, and only get the list of inodes concerned, for each of them compress the first one found and recreate the hardlinks for the others
4492 # Fixes all dead symlinks left by the previous round
4493 .if !target(compress-man)
4494 compress-man:
4495 @${ECHO_MSG} "====> Compressing man pages (compress-man)"
4496 @mdirs= ; \
4497 for dir in ${MANDIRS:S/^/${STAGEDIR}/} ; do \
4498 [ -d $$dir ] && mdirs="$$mdirs $$dir" ;\
4499 done ; \
4500 for dir in $$mdirs; do \
4501 ${FIND} $$dir -type f \! -name "*.gz" -links 1 -exec ${GZIP_CMD} {} \; ; \
4502 ${FIND} $$dir -type f \! -name "*.gz" \! -links 1 -exec ${STAT} -f '%i' {} \; | \
4503 ${SORT} -u | while read inode ; do \
4504 unset ref ; \
4505 for f in $$(${FIND} $$dir -type f -inum $${inode} -print); do \
4506 if [ -z $$ref ]; then \
4507 ref=$${f}.gz ; \
4508 ${GZIP_CMD} $${f} ; \
4509 continue ; \
4510 fi ; \
4511 ${RM} -f $${f} ; \
4512 (cd $${f%/*}; ${LN} -f $${ref##*/} $${f##*/}.gz) ; \
4513 done ; \
4514 done ; \
4515 ${FIND} $$dir -type l \! -name "*.gz" | while read link ; do \
4516 ${LN} -sf $$(readlink $$link).gz $$link.gz ;\
4517 ${RM} -f $$link ; \
4518 done; \
4519 done
4520 .endif
4521
4522 .if !target(stage-dir)
4523 stage-dir:
4524 @${MKDIR} ${STAGEDIR}${PREFIX}
4525 .if !defined(NO_MTREE)
4526 @${MTREE_CMD} ${MTREE_ARGS} ${STAGEDIR}${PREFIX} > /dev/null
4527 .endif
4528 .endif
4529
4530 .if !target(makeplist)
4531 makeplist: stage
4532 @${SETENV} ${CO_ENV} ${SH} ${SCRIPTSDIR}/check-stagedir.sh makeplist
4533 .endif
4534
4535 .if !target(check-plist)
4536 check-plist: stage
4537 @${ECHO_MSG} "====> Checking for pkg-plist issues (check-plist)"
4538 @${SETENV} ${CO_ENV} ${SH} ${SCRIPTSDIR}/check-stagedir.sh checkplist
4539 @${ECHO_MSG} "===> No pkg-plist issues found (check-plist)"
4540 .endif
4541
4542 .if !target(check-orphans)
4543 check-orphans: check-plist
4544 .endif
4545
4546 .if !target(stage-qa)
4547 stage-qa:
4548 @${ECHO_MSG} "====> Running Q/A tests (stage-qa)"
4549 @${SETENV} ${QA_ENV} ${SH} ${SCRIPTSDIR}/qa.sh
4550 .if !defined(DEVELOPER)
4551 @${ECHO_MSG} "/!\\ To run stage-qa automatically add DEVELOPER=yes to your environment /!\\"
4552 .endif
4553 .endif
4554
4555 # Fake installation of package so that user can pkg delete it later.
4556 .if !target(fake-pkg)
4557 STAGE_ARGS= -i ${STAGEDIR}
4558
4559 .if !defined(NO_PKG_REGISTER)
4560 fake-pkg: create-manifest
4561 .if defined(INSTALLS_DEPENDS)
4562 @${ECHO_MSG} "===> Registering installation for ${PKGNAME} as automatic"
4563 .else
4564 @${ECHO_MSG} "===> Registering installation for ${PKGNAME}"
4565 .endif
4566 .if defined(INSTALLS_DEPENDS)
4567 @${SETENV} ${PKG_ENV} FORCE_POST="${_FORCE_POST_PATTERNS}" ${PKG_CMD} -d ${STAGE_ARGS} -m ${METADIR} -f ${TMPPLIST}
4568 .else
4569 @${SETENV} ${PKG_ENV} FORCE_POST="${_FORCE_POST_PATTERNS}" ${PKG_CMD} ${STAGE_ARGS} -m ${METADIR} -f ${TMPPLIST}
4570 .endif
4571 @${RM} -rf ${METADIR}
4572 .endif
4573 .endif
4574
4575 # Depend is generally meaningless for arbitrary ports, but if someone wants
4576 # one they can override this. This is just to catch people who've gotten into
4577 # the habit of typing `make depend all install' as a matter of course.
4578 # Same goes for tags
4579 .for _t in depend tags
4580 .if !target(${_t})
4581 ${_t}:
4582 .endif
4583 .endfor
4584
4585 .if !defined(NOPRECIOUSMAKEVARS)
4586 # These won't change, so we can pass them through the environment
4587 .for var in ${_EXPORTED_VARS}
4588 .if empty(.MAKEFLAGS:M${var}=*) && !empty(${var})
4589 .MAKEFLAGS: ${var}=${${var}:Q}
4590 .endif
4591 .endfor
4592 .endif
4593
4594 .if !target(pre-check-config)
4595 pre-check-config:
4596 .for single in ${OPTIONS_SINGLE}
4597 . for opt in ${OPTIONS_SINGLE_${single}}
4598 . if empty(ALL_OPTIONS:M${single}) || !empty(PORT_OPTIONS:M${single})
4599 . if !empty(PORT_OPTIONS:M${opt})
4600 . if defined(OPTFOUND)
4601 OPTIONS_WRONG_SINGLE+= ${single}
4602 . else
4603 OPTFOUND= true
4604 . endif
4605 . endif
4606 . else
4607 # if conditional and if the condition is unchecked, remove opt from the list of
4608 # set options
4609 PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}}
4610 OPTNOCHECK= true
4611 . endif
4612 . endfor
4613 . if !defined(OPTFOUND) && !defined(OPTNOCHECK)
4614 OPTIONS_WRONG_SINGLE+= ${single}
4615 . endif
4616 . undef OPTFOUND
4617 . undef OPTNOCHECK
4618 .endfor
4619 .undef single
4620
4621 .for radio in ${OPTIONS_RADIO}
4622 . for opt in ${OPTIONS_RADIO_${radio}}
4623 . if !empty(PORT_OPTIONS:M${opt})
4624 . if defined(OPTFOUND)
4625 OPTIONS_WRONG_RADIO+= ${radio}
4626 . else
4627 OPTFOUND= true
4628 . endif
4629 . endif
4630 . endfor
4631 . undef OPTFOUND
4632 .endfor
4633
4634 .for multi in ${OPTIONS_MULTI}
4635 . for opt in ${OPTIONS_MULTI_${multi}}
4636 . if empty(ALL_OPTIONS:M${multi}) || !empty(PORT_OPTIONS:M${multi})
4637 . if !empty(PORT_OPTIONS:M${opt})
4638 OPTFOUND= true
4639 . endif
4640 . else
4641 # if conditional and if the condition is unchecked, remove opt from the list of
4642 # set options
4643 PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}}
4644 OPTNOCHECK= true
4645 . endif
4646 . endfor
4647 . if !defined(OPTFOUND) && !defined(OPTNOCHECK)
4648 OPTIONS_WRONG_MULTI+= ${multi}
4649 . endif
4650 . undef OPTFOUND
4651 . undef OPTNOCHECK
4652 .endfor
4653 .undef multi
4654
4655 .for opt in ${PORT_OPTIONS}
4656 . for conflict in ${${opt}_PREVENTS}
4657 . if ${PORT_OPTIONS:M${conflict}}
4658 . if empty(OPTIONS_WRONG_PREVENTS:M${opt})
4659 OPTIONS_WRONG_PREVENTS+= ${opt}
4660 . endif
4661 OPTIONS_WRONG_PREVENTS_${opt}+= ${conflict}
4662 . endif
4663 . endfor
4664 .endfor
4665 .undef conflict
4666 .undef opt
4667 .endif #pre-check-config
4668
4669 .if !target(_check-config)
4670 _check-config: pre-check-config
4671 .for multi in ${OPTIONS_WRONG_MULTI}
4672 @${ECHO_MSG} "====> You must check at least one option in the ${multi} multi"
4673 .endfor
4674 .for single in ${OPTIONS_WRONG_SINGLE}
4675 @${ECHO_MSG} "====> You must select one and only one option from the ${single} single"
4676 .endfor
4677 .for radio in ${OPTIONS_WRONG_RADIO}
4678 @${ECHO_MSG} "====> You cannot select multiple options from the ${radio} radio"
4679 .endfor
4680 .if defined(OPTIONS_WRONG_PREVENTS)
4681 @${ECHO_MSG} "====> Two or more enabled options conflict with each other"
4682 . for prevents in ${OPTIONS_WRONG_PREVENTS}
4683 @${ECHO_MSG} "=====> Option ${prevents} conflicts with ${OPTIONS_WRONG_PREVENTS_${prevents}} (select only one)"
4684 . if defined(${prevents}_PREVENTS_MSG)
4685 @${ECHO_MSG} "======> ${${prevents}_PREVENTS_MSG}"
4686 . endif
4687 . endfor
4688 .endif
4689 .if !empty(OPTIONS_WRONG_MULTI) || !empty(OPTIONS_WRONG_SINGLE) || !empty(OPTIONS_WRONG_RADIO) || !empty(OPTIONS_WRONG_PREVENTS)
4690 _CHECK_CONFIG_ERROR= true
4691 .endif
4692 .endif # _check-config
4693
4694 .if !target(check-config)
4695 check-config: _check-config
4696 .if !empty(_CHECK_CONFIG_ERROR)
4697 @${FALSE}
4698 .endif
4699 .endif # check-config
4700
4701 .if !target(sanity-config)
4702 sanity-config: _check-config
4703 .if !empty(_CHECK_CONFIG_ERROR)
4704 @echo -n "Config is invalid. Re-edit? [Y/n] "; \
4705 read answer; \
4706 case $$answer in \
4707 [Nn]|[Nn][Oo]) \
4708 exit 0; \
4709 esac; \
4710 cd ${.CURDIR} && ${MAKE} config
4711 .endif
4712 .endif # sanity-config
4713
4714 .if !target(pre-config)
4715 pre-config:
4716 D4P_ENV= PKGNAME="${PKGNAME}" \
4717 PORT_OPTIONS="${PORT_OPTIONS}" \
4718 ALL_OPTIONS="${ALL_OPTIONS}" \
4719 OPTIONS_MULTI="${OPTIONS_MULTI}" \
4720 OPTIONS_SINGLE="${OPTIONS_SINGLE}" \
4721 OPTIONS_RADIO="${OPTIONS_RADIO}" \
4722 OPTIONS_GROUP="${OPTIONS_GROUP}" \
4723 NEW_OPTIONS="${NEW_OPTIONS}" \
4724 DIALOG4PORTS="${DIALOG4PORTS}" \
4725 PREFIX="${PREFIX}" \
4726 LOCALBASE="${LOCALBASE}" \
4727 PORTSDIR="${PORTSDIR}" \
4728 MAKE="${MAKE}" \
4729 D4PHEIGHT="${D4PHEIGHT}" \
4730 D4PWIDTH="${D4PWIDTH}" \
4731 D4PFULLSCREEN="${D4PFULLSCREEN}"
4732 .if exists(${PKGHELP})
4733 D4P_ENV+= PKGHELP="${PKGHELP}"
4734 .endif
4735 .for opt in ${ALL_OPTIONS}
4736 D4P_ENV+= ${opt}_DESC=""${${opt}_DESC:Q}""
4737 .endfor
4738 .for otype in MULTI GROUP SINGLE RADIO
4739 . for m in ${OPTIONS_${otype}}
4740 D4P_ENV+= OPTIONS_${otype}_${m}="${OPTIONS_${otype}_${m}}" \
4741 ${m}_DESC=""${${m}_DESC:Q}""
4742 . for opt in ${OPTIONS_${otype}_${m}}
4743 D4P_ENV+= ${opt}_DESC=""${${opt}_DESC:Q}""
4744 . endfor
4745 . endfor
4746 .endfor
4747 .undef m
4748 .undef otype
4749 .undef opt
4750 .endif # pre-config
4751
4752 .if !target(do-config)
4753 do-config:
4754 .if empty(ALL_OPTIONS) && empty(OPTIONS_SINGLE) && empty(OPTIONS_MULTI) && empty(OPTIONS_RADIO) && empty(OPTIONS_GROUP)
4755 @${ECHO_MSG} "===> No options to configure"
4756 .else
4757 @optionsdir=${OPTIONS_FILE:H}; \
4758 if [ ! -w "${PORT_DBDIR}" -a "`stat -f %u ${PORT_DBDIR:H}`" = 0 ]; \
4759 then \
4760 ${ECHO_MSG} "===> Switching to root credentials to create $${optionsdir}"; \
4761 (${SU_CMD} "${SH} -c \"${MKDIR} $${optionsdir} 2> /dev/null\"") || \
4762 (${ECHO_MSG} "===> Cannot create $${optionsdir}, check permissions"; exit 1); \
4763 ${ECHO_MSG} "===> Returning to user credentials" ; \
4764 else \
4765 ${MKDIR} $${optionsdir} 2> /dev/null || \
4766 (${ECHO_MSG} "===> Cannot create $${optionsdir}, check permissions"; exit 1) ; \
4767 fi
4768 @TMPOPTIONSFILE=$$(mktemp -t portoptions); \
4769 trap "${RM} -f $${TMPOPTIONSFILE}; exit 1" 1 2 3 5 10 13 15; \
4770 ${SETENV} ${D4P_ENV} ${SH} ${SCRIPTSDIR}/dialog4ports.sh $${TMPOPTIONSFILE} || { \
4771 ${RM} -f $${TMPOPTIONSFILE}; \
4772 ${ECHO_MSG} "===> Options unchanged"; \
4773 exit 0; \
4774 }; \
4775 ${ECHO_CMD}; \
4776 if [ ! -e $${TMPOPTIONSFILE} ]; then \
4777 ${ECHO_MSG} "===> No user-specified options to save for ${PKGNAME}"; \
4778 exit 0; \
4779 fi; \
4780 SELOPTIONS=$$(${CAT} $${TMPOPTIONSFILE}); \
4781 ${RM} -f $${TMPOPTIONSFILE}; \
4782 TMPOPTIONSFILE=$$(mktemp -t portoptions); \
4783 trap "${RM} -f $${TMPOPTIONSFILE}; exit 1" 1 2 3 5 10 13 15; \
4784 ${ECHO_CMD} "# This file is auto-generated by 'make config'." > $${TMPOPTIONSFILE}; \
4785 ${ECHO_CMD} "# Options for ${PKGNAME}" >> $${TMPOPTIONSFILE}; \
4786 ${ECHO_CMD} "_OPTIONS_READ=${PKGNAME}" >> $${TMPOPTIONSFILE}; \
4787 ${ECHO_CMD} "_FILE_COMPLETE_OPTIONS_LIST=${COMPLETE_OPTIONS_LIST}" >> $${TMPOPTIONSFILE}; \
4788 for i in ${COMPLETE_OPTIONS_LIST}; do \
4789 if ${ECHO_CMD} $${SELOPTIONS} | ${GREP} -qw $${i}; then \
4790 ${ECHO_CMD} "OPTIONS_FILE_SET+=$${i}" >> $${TMPOPTIONSFILE}; \
4791 else \
4792 ${ECHO_CMD} "OPTIONS_FILE_UNSET+=$${i}" >> $${TMPOPTIONSFILE}; \
4793 fi; \
4794 done; \
4795 if [ ! -w "${OPTIONS_FILE:H}" -a "`stat -f %u ${OPTIONS_FILE:H}`" != ${UID} ]; \
4796 then \
4797 ${ECHO_MSG} "===> Switching to root credentials to write ${OPTIONS_FILE}"; \
4798 ${SU_CMD} "${CAT} $${TMPOPTIONSFILE} > ${OPTIONS_FILE}"; \
4799 ${ECHO_MSG} "===> Returning to user credentials"; \
4800 else \
4801 ${CAT} $${TMPOPTIONSFILE} > ${OPTIONS_FILE}; \
4802 fi; \
4803 ${RM} -f $${TMPOPTIONSFILE}
4804 @cd ${.CURDIR} && ${MAKE} sanity-config
4805 .endif
4806 .endif # do-config
4807
4808 .if !target(config)
4809 .if !defined(NO_DIALOG)
4810 config: pre-config do-config
4811 .else
4812 config:
4813 @${ECHO_MSG} "===> Skipping 'config' as NO_DIALOG is defined"
4814 .endif
4815 .endif # config
4816
4817 .if !target(config-recursive)
4818 config-recursive:
4819 @${ECHO_MSG} "===> Setting user-specified options for ${PKGNAME} and dependencies";
4820 @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \
4821 (cd $$dir; ${MAKE} config-conditional); \
4822 done
4823 .endif # config-recursive
4824
4825 .if !target(config-conditional)
4826 config-conditional:
4827 .if !empty(NEW_OPTIONS)
4828 @cd ${.CURDIR} && ${MAKE} config;
4829 .endif
4830 .endif # config-conditional
4831
4832 .if !target(showconfig) && (make(*config*) || (!empty(.MAKEFLAGS:M-V) && !empty(.MAKEFLAGS:M*_DESC)))
4833 .include "${PORTSDIR}/Mk/bsd.options.desc.mk"
4834 MULTI_EOL= : you have to choose at least one of them
4835 SINGLE_EOL= : you have to select exactly one of them
4836 RADIO_EOL= : you can only select none or one of them
4837 showconfig: check-config
4838 .if !empty(COMPLETE_OPTIONS_LIST)
4839 @${ECHO_MSG} "===> The following configuration options are available for ${PKGNAME}":
4840 .for opt in ${ALL_OPTIONS}
4841 @[ -z "${PORT_OPTIONS:M${opt}}" ] || match="on" ; ${ECHO_MSG} -n " ${opt}=$${match:-off}"
4842 . if !empty(${opt}_DESC)
4843 @${ECHO_MSG} -n ": "${${opt}_DESC:Q}
4844 . endif
4845 @${ECHO_MSG} ""
4846 .endfor
4847
4848 #multi and conditional multis
4849 .for otype in MULTI GROUP SINGLE RADIO
4850 . for m in ${OPTIONS_${otype}}
4851 . if empty(${m}_DESC)
4852 @${ECHO_MSG} "====> Options available for the ${otype:tl} ${m}${${otype}_EOL}"
4853 . else
4854 @${ECHO_MSG} "====> ${${m}_DESC}${${otype}_EOL}"
4855 . endif
4856 . for opt in ${OPTIONS_${otype}_${m}}
4857 @[ -z "${PORT_OPTIONS:M${opt}}" ] || match="on" ; ${ECHO_MSG} -n " ${opt}=$${match:-off}"
4858 . if !empty(${opt}_DESC)
4859 @${ECHO_MSG} -n ": "${${opt}_DESC:Q}
4860 . endif
4861 @${ECHO_MSG} ""
4862 . endfor
4863 . endfor
4864 .endfor
4865
4866 .undef otype
4867 .undef m
4868 .undef opt
4869 @${ECHO_MSG} "===> Use 'make config' to modify these settings"
4870 .endif
4871 .endif # showconfig
4872
4873 .if !target(showconfig-recursive)
4874 showconfig-recursive:
4875 @${ECHO_MSG} "===> The following configuration options are available for ${PKGNAME} and dependencies";
4876 @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \
4877 (cd $$dir; ${MAKE} showconfig); \
4878 done
4879 .endif # showconfig-recursive
4880
4881 .if !target(rmconfig)
4882 rmconfig:
4883 .if exists(${OPTIONS_FILE})
4884 -@${ECHO_MSG} "===> Removing user-configured options for ${PKGNAME}"; \
4885 optionsdir=${OPTIONS_FILE:H}; \
4886 if [ ${UID} != 0 -a "x${INSTALL_AS_USER}" = "x" -a ! -w "${OPTIONS_FILE}" ]; then \
4887 ${ECHO_MSG} "===> Switching to root credentials to remove ${OPTIONS_FILE} and $${optionsdir}"; \
4888 ${SU_CMD} "${RM} -f ${OPTIONS_FILE} ; \
4889 ${RMDIR} $${optionsdir}"; \
4890 ${ECHO_MSG} "===> Returning to user credentials"; \
4891 else \
4892 ${RM} -f ${OPTIONS_FILE}; \
4893 ${RMDIR} $${optionsdir} 2>/dev/null || return 0; \
4894 fi
4895 .else
4896 @${ECHO_MSG} "===> No user-specified options configured for ${PKGNAME}"
4897 .endif
4898 .endif # rmconfig
4899
4900 .if !target(rmconfig-recursive)
4901 rmconfig-recursive:
4902 @${ECHO_MSG} "===> Removing user-specified options for ${PKGNAME} and dependencies";
4903 @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \
4904 (cd $$dir; ${MAKE} rmconfig); \
4905 done
4906 .endif # rmconfig-recursive
4907
4908 .if !target(pretty-print-config)
4909 MULTI_START= [
4910 MULTI_END= ]
4911 GROUP_START= [
4912 GROUP_END= ]
4913 SINGLE_START= (
4914 SINGLE_END= )
4915 RADIO_START= (
4916 RADIO_END= )
4917 pretty-print-config:
4918 .for opt in ${ALL_OPTIONS}
4919 @[ -z "${PORT_OPTIONS:M${opt}}" ] || match="+" ; ${ECHO_MSG} -n "$${match:--}${opt} "
4920 .endfor
4921 .for otype in MULTI GROUP SINGLE RADIO
4922 . for m in ${OPTIONS_${otype}}
4923 @${ECHO_MSG} -n "${m}${${otype}_START} "
4924 . for opt in ${OPTIONS_${otype}_${m}}
4925 @[ -z "${PORT_OPTIONS:M${opt}}" ] || match="+" ; ${ECHO_MSG} -n "$${match:--}${opt} "
4926 . endfor
4927 @${ECHO_MSG} -n "${${otype}_END} "
4928 . endfor
4929 .endfor
4930 .undef otype
4931 .undef m
4932 .undef opt
4933 @${ECHO_MSG} ""
4934 .endif # pretty-print-config
4935
4936 desktop-categories:
4937 @categories=""; \
4938 for native_category in ${CATEGORIES}; do \
4939 c=""; \
4940 case $$native_category in \
4941 accessibility) c="Utility Accessibility" ;; \
4942 archivers) c="Utility Archiving" ;; \
4943 astro) c="Education Science Astronomy" ;; \
4944 audio) c="AudioVideo Audio" ;; \
4945 benchmarks) c="System" ;; \
4946 biology) c="Education Science Biology" ;; \
4947 cad) c="Graphics Engineering" ;; \
4948 comms) c="Utility" ;; \
4949 converters) c="Utility" ;; \
4950 databases) c="Office Database" ;; \
4951 deskutils) c="Utility" ;; \
4952 devel) c="Development" ;; \
4953 dns) c="Network" ;; \
4954 elisp) c="Development" ;; \
4955 editors) c="Utility" ;; \
4956 emulators) c="System Emulator" ;; \
4957 finance) c="Office Finance" ;; \
4958 ftp) c="Network FileTransfer" ;; \
4959 games) c="Game" ;; \
4960 geography) c="Education Science Geography" ;; \
4961 gnome) c="GNOME GTK" ;; \
4962 graphics) c="Graphics" ;; \
4963 hamradio) c="HamRadio" ;; \
4964 haskell) c="Development" ;; \
4965 irc) c="Network IRCClient" ;; \
4966 java) c="Development Java" ;; \
4967 kde) c="KDE Qt" ;; \
4968 lang) c="Development" ;; \
4969 lisp) c="Development" ;; \
4970 mail) c="Office Email" ;; \
4971 mate) c="MATE GTK" ;; \
4972 math) c="Education Science Math" ;; \
4973 mbone) c="Network AudioVideo" ;; \
4974 multimedia) c="AudioVideo" ;; \
4975 net) c="Network" ;; \
4976 net-im) c="Network InstantMessaging" ;; \
4977 net-mgmt) c="Network" ;; \
4978 net-p2p) c="Network P2P" ;; \
4979 news) c="Network News" ;; \
4980 palm) c="Office PDA" ;; \
4981 parallel) c="ParallelComputing" ;; \
4982 pear) c="Development WebDevelopment" ;; \
4983 perl5) c="Development" ;; \
4984 python) c="Development" ;; \
4985 ruby) c="Development" ;; \
4986 rubygems) c="Development" ;; \
4987 scheme) c="Development" ;; \
4988 science) c="Science Education" ;; \
4989 security) c="System Security" ;; \
4990 shells) c="System Shell" ;; \
4991 sysutils) c="System" ;; \
4992 tcl*|tk*) c="Development" ;; \
4993 textproc) c="Utility TextTools" ;; \
4994 www) c="Network" ;; \
4995 x11-clocks) c="Utility Clock" ;; \
4996 x11-fm) c="System FileManager" ;; \
4997 xfce) c="GTK XFCE" ;; \
4998 zope) c="Development WebDevelopment" ;; \
4999 esac; \
5000 if [ -n "$$c" ]; then \
5001 categories="$$categories $$c"; \
5002 fi; \
5003 done; \
5004 if [ -n "$$categories" ]; then \
5005 for c in $$categories; do ${ECHO_MSG} "$$c"; done \
5006 | ${SORT} -u | ${TR} '\n' ';'; \
5007 ${ECHO_MSG}; \
5008 fi
5009
5010 # http://standards.freedesktop.org/menu-spec/menu-spec-latest.html
5011 DESKTOP_CATEGORIES_MAIN= AudioVideo Audio Video Development Education \
5012 Game Graphics Network Office Science Settings System Utility
5013 DESKTOP_CATEGORIES_ADDITIONAL= Building Debugger IDE GUIDesigner Profiling \
5014 RevisionControl Translation Calendar ContactManagement Database \
5015 Dictionary Chart Email Finance FlowChart PDA ProjectManagement \
5016 Presentation Spreadsheet WordProcessor 2DGraphics VectorGraphics \
5017 RasterGraphics 3DGraphics Scanning OCR Photography Publishing Viewer \
5018 TextTools DesktopSettings HardwareSettings Printing PackageManager \
5019 Dialup InstantMessaging Chat IRCClient Feed FileTransfer HamRadio News \
5020 P2P RemoteAccess Telephony TelephonyTools VideoConference WebBrowser \
5021 WebDevelopment Midi Mixer Sequencer Tuner TV AudioVideoEditing Player \
5022 Recorder DiscBurning ActionGame AdventureGame ArcadeGame BoardGame \
5023 BlocksGame CardGame KidsGame LogicGame RolePlaying Shooter Simulation \
5024 SportsGame StrategyGame Art Construction Music Languages \
5025 ArtificialIntelligence Astronomy Biology Chemistry ComputerScience \
5026 DataVisualization Economy Electricity Geography Geology Geoscience \
5027 History Humanities ImageProcessing Literature Maps Math \
5028 NumericalAnalysis MedicalSoftware Physics Robotics Spirituality Sports \
5029 ParallelComputing Amusement Archiving Compression Electronics Emulator \
5030 Engineering FileTools FileManager TerminalEmulator Filesystem Monitor \
5031 Security Accessibility Calculator Clock TextEditor Documentation Adult \
5032 Core KDE GNOME MATE XFCE GTK Qt Motif Java ConsoleOnly
5033 DESKTOP_CATEGORIES_RESERVED= Screensaver TrayIcon Applet Shell
5034
5035 VALID_DESKTOP_CATEGORIES+= ${DESKTOP_CATEGORIES_MAIN} \
5036 ${DESKTOP_CATEGORIES_ADDITIONAL} \
5037 ${DESKTOP_CATEGORIES_RESERVED}
5038
5039 .if defined(DESKTOP_ENTRIES)
5040 check-desktop-entries:
5041 @set -- ${DESKTOP_ENTRIES} XXX; \
5042 if [ `${EXPR} \( $$# - 1 \) % 6` -ne 0 ]; then \
5043 ${ECHO_MSG} "${PKGNAME}: Makefile error: the DESKTOP_ENTRIES list must contain one or more groups of 6 elements"; \
5044 exit 1; \
5045 fi; \
5046 num=1; \
5047 while [ $$# -gt 6 ]; do \
5048 entry="#$$num"; \
5049 if [ -n "$$4" ]; then \
5050 entry="$$entry ($$4)"; \
5051 elif [ -n "$$1" ]; then \
5052 entry="$$entry ($$1)"; \
5053 fi; \
5054 if [ -z "$$1" ]; then \
5055 ${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 1 (Name) is empty"; \
5056 exit 1; \
5057 fi; \
5058 if ${ECHO_CMD} "$$3" | ${GREP} -iq '.\(png\|svg\|xpm\)$$'; then \
5059 if ! ${ECHO_CMD} "$$3" | ${GREP} -iq '^/'; then \
5060 ${ECHO_MSG} "${PKGNAME}: Makefile warning: in desktop entry $$entry: field 3 (Icon) should be either absolute path or icon name without extension if installed icons follow Icon Theme Specification"; \
5061 fi; \
5062 fi; \
5063 if [ -z "$$4" ]; then \
5064 ${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 4 (Exec) is empty"; \
5065 exit 1; \
5066 fi; \
5067 if [ -n "$$5" ]; then \
5068 for c in `${ECHO_CMD} "$$5" | ${TR} ';' ' '`; do \
5069 if ! ${ECHO_CMD} ${VALID_DESKTOP_CATEGORIES} | ${GREP} -wq $$c; then \
5070 ${ECHO_CMD} "${PKGNAME}: Makefile warning: in desktop entry $$entry: category $$c is not a valid desktop category"; \
5071 fi; \
5072 done; \
5073 if ! ${ECHO_CMD} "$$5" | ${GREP} -q "`${ECHO_CMD} ${DESKTOP_CATEGORIES_MAIN} | ${SED} -E 's,[[:blank:]]+,\\\|,g'`"; then \
5074 ${ECHO_CMD} "${PKGNAME}: Makefile warning: in desktop entry $$entry: field 5 (Categories) must contain at least one main desktop category (make -VDESKTOP_CATEGORIES_MAIN)"; \
5075 fi; \
5076 if ! ${ECHO_CMD} "$$5" | ${GREP} -q ';$$'; then \
5077 ${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 5 (Categories) does not end with a semicolon"; \
5078 exit 1; \
5079 fi; \
5080 else \
5081 if [ -z "`cd ${.CURDIR} && ${MAKE} desktop-categories`" ]; then \
5082 ${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 5 (Categories) is empty and could not be deduced from the CATEGORIES variable"; \
5083 exit 1; \
5084 fi; \
5085 fi; \
5086 if [ "x$$6" != "xtrue" ] && [ "x$$6" != "xfalse" ] && [ "x$$6" != "x" ]; then \
5087 ${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 6 (StartupNotify) is not \"true\", \"false\" or \"\"(empty)"; \
5088 exit 1; \
5089 fi; \
5090 shift 6; \
5091 num=`${EXPR} $$num + 1`; \
5092 done
5093 .endif
5094
5095 .if !target(install-desktop-entries)
5096 .if defined(DESKTOP_ENTRIES)
5097 install-desktop-entries:
5098 @set -- ${DESKTOP_ENTRIES} XXX; \
5099 while [ $$# -gt 6 ]; do \
5100 filename="`${ECHO_CMD} "$$4" | ${SED} -e 's,^/,,g;s,[/ ],_,g;s,[^_[:alnum:]],,g'`.desktop"; \
5101 pathname="${STAGEDIR}${DESKTOPDIR}/$$filename"; \
5102 categories="$$5"; \
5103 if [ -z "$$categories" ]; then \
5104 categories="`cd ${.CURDIR} && ${MAKE} desktop-categories`"; \
5105 fi; \
5106 ${ECHO_CMD} "${DESKTOPDIR}/$$filename" >> ${TMPPLIST}; \
5107 ${ECHO_CMD} "[Desktop Entry]" > $$pathname; \
5108 ${ECHO_CMD} "Type=Application" >> $$pathname; \
5109 ${ECHO_CMD} "Version=1.0" >> $$pathname; \
5110 ${ECHO_CMD} "Name=$$1" >> $$pathname; \
5111 comment="$$2"; \
5112 if [ -z "$$2" ]; then \
5113 comment="`cd ${.CURDIR} && ${MAKE} -VCOMMENT`"; \
5114 fi; \
5115 ${ECHO_CMD} "GenericName=$$comment" >> $$pathname; \
5116 ${ECHO_CMD} "Comment=$$comment" >> $$pathname; \
5117 if [ -n "$$3" ]; then \
5118 ${ECHO_CMD} "Icon=$$3" >> $$pathname; \
5119 fi; \
5120 ${ECHO_CMD} "Exec=$$4" >> $$pathname; \
5121 ${ECHO_CMD} "Categories=$$categories" >> $$pathname; \
5122 if [ -n "$$6" ]; then \
5123 ${ECHO_CMD} "StartupNotify=$$6" >> $$pathname; \
5124 fi; \
5125 shift 6; \
5126 done
5127 .endif
5128 .endif
5129
5130 .if defined(WARNING)
5131 WARNING_WAIT?= 10
5132 show-warnings:
5133 @${ECHO_MSG} "/!\\ WARNING /!\\"
5134 .for m in ${WARNING}
5135 @${ECHO_MSG} "${m}"
5136 .endfor
5137 @${ECHO_MSG}
5138 @sleep ${WARNING_WAIT}
5139 .endif
5140
5141 .if defined(DEVELOPER)
5142 .if defined(DEV_WARNING)
5143 DEV_WARNING_WAIT?= 10
5144 show-dev-warnings:
5145 @${ECHO_MSG} "/!\\ ${PKGNAME}: Makefile warnings, please consider fixing /!\\"
5146 @${ECHO_MSG}
5147 .for m in ${DEV_WARNING}
5148 @${ECHO_MSG} ${m}
5149 .endfor
5150 @${ECHO_MSG}
5151 .if defined(DEV_WARNING_FATAL)
5152 @${FALSE}
5153 .else
5154 @sleep ${DEV_WARNING_WAIT}
5155 .endif
5156 .endif
5157
5158 .if defined(DEV_ERROR)
5159 show-dev-errors:
5160 @${ECHO_MSG} "/!\\ ${PKGNAME}: Makefile errors /!\\"
5161 @${ECHO_MSG}
5162 .for m in ${DEV_ERROR}
5163 @${ECHO_MSG} "${m}"
5164 .endfor
5165 @${ECHO_MSG}
5166 @${FALSE}
5167 .endif
5168 .endif #DEVELOPER
5169
5170 # Please note that the order of the following targets is important, and
5171 # should not be modified.
5172
5173 _TARGETS_STAGES= SANITY PKG FETCH EXTRACT PATCH CONFIGURE BUILD INSTALL TEST PACKAGE STAGE
5174
5175 # Define the SEQ of actions to take when each target is ran, and which targets
5176 # it depends on before running its SEQ.
5177 #
5178 # Main target has a priority of 500, pre-target 300, post-target 700,
5179 # target-depends 150. Other targets are spaced in between those
5180 #
5181 # If you change the pre-foo and post-foo values here, go and keep them in sync
5182 # in _OPTIONS_TARGETS in bsd.options.mk
5183
5184 _SANITY_SEQ= 050:post-chroot 100:pre-everything 150:check-makefile \
5185 200:show-warnings 210:show-dev-warnings 220:show-dev-errors \
5186 250:check-categories 300:check-makevars \
5187 350:check-desktop-entries 400:check-depends \
5188 450:identify-install-conflicts 500:check-deprecated \
5189 550:check-vulnerable 600:check-license 650:check-config \
5190 700:buildanyway-message 750:options-message ${_USES_sanity}
5191
5192 _PKG_DEP= check-sanity
5193 _PKG_SEQ= 500:pkg-depends
5194 _FETCH_DEP= pkg
5195 _FETCH_SEQ= 150:fetch-depends 300:pre-fetch 450:pre-fetch-script \
5196 500:do-fetch 550:fetch-specials 700:post-fetch \
5197 850:post-fetch-script \
5198 ${_OPTIONS_fetch} ${_USES_fetch}
5199 _EXTRACT_DEP= fetch
5200 _EXTRACT_SEQ= 010:check-build-conflicts 050:extract-message 100:checksum \
5201 150:extract-depends 190:clean-wrkdir 200:${EXTRACT_WRKDIR} \
5202 300:pre-extract 450:pre-extract-script 500:do-extract \
5203 700:post-extract 850:post-extract-script \
5204 ${_OPTIONS_extract} ${_USES_extract} ${_SITES_extract}
5205 _PATCH_DEP= extract
5206 _PATCH_SEQ= 050:ask-license 100:patch-message 150:patch-depends \
5207 300:pre-patch 450:pre-patch-script 500:do-patch \
5208 700:post-patch 850:post-patch-script \
5209 ${_OPTIONS_patch} ${_USES_patch}
5210 _CONFIGURE_DEP= patch
5211 _CONFIGURE_SEQ= 150:build-depends 151:lib-depends 200:configure-message \
5212 300:pre-configure 450:pre-configure-script \
5213 490:run-autotools-fixup 500:do-configure 700:post-configure \
5214 850:post-configure-script \
5215 ${_OPTIONS_configure} ${_USES_configure}
5216 _BUILD_DEP= configure
5217 _BUILD_SEQ= 100:build-message 300:pre-build 450:pre-build-script \
5218 500:do-build 700:post-build 850:post-build-script \
5219 ${_OPTIONS_build} ${_USES_build}
5220 _STAGE_DEP= build
5221 # STAGE is special in its numbering as it has install and stage, so install is
5222 # the main, and stage goes after.
5223 _STAGE_SEQ= 050:stage-message 100:stage-dir 150:run-depends \
5224 151:lib-depends 200:apply-slist 300:pre-install \
5225 400:generate-plist 450:pre-su-install 475:create-users-groups \
5226 500:do-install 550:kmod-post-install 700:post-install \
5227 750:post-install-script 800:post-stage 850:compress-man \
5228 860:install-rc-script 870:install-ldconfig-file \
5229 880:install-license 890:install-desktop-entries \
5230 900:add-plist-info 910:add-plist-docs 920:add-plist-examples \
5231 930:add-plist-data 940:add-plist-post ${POST_PLIST:C/^/990:/} \
5232 ${_OPTIONS_install} ${_USES_install} \
5233 ${_OPTIONS_stage} ${_USES_stage}
5234 .if defined(DEVELOPER)
5235 _STAGE_SEQ+= 995:stage-qa
5236 .else
5237 stage-qa: stage
5238 .endif
5239 _TEST_DEP= stage
5240 _TEST_SEQ= 100:test-message 150:test-depends 300:pre-test 500:do-test \
5241 800:post-test \
5242 ${_OPTIONS_test} ${_USES_test}
5243 _INSTALL_DEP= stage
5244 _INSTALL_SEQ= 100:install-message 150:run-depends 151:lib-depends \
5245 200:check-already-installed
5246 _INSTALL_SUSEQ= 300:fake-pkg 500:security-check
5247
5248 _PACKAGE_DEP= stage
5249 _PACKAGE_SEQ= 100:package-message 300:pre-package 450:pre-package-script \
5250 500:do-package 850:post-package-script \
5251 ${_OPTIONS_package} ${_USES_package}
5252
5253 # Enforce order for -jN builds
5254 .for _t in ${_TARGETS_STAGES}
5255 # Check if the port need to change the default order of some targets...
5256 . if defined(TARGET_ORDER_OVERRIDE)
5257 _tmp_seq:=
5258 . for _entry in ${_${_t}_SEQ}
5259 # for _target because :M${_target} does not work with fmake
5260 . for _target in ${_entry:C/^[0-9]+://}
5261 . if ${TARGET_ORDER_OVERRIDE:M*\:${_target}}
5262 _tmp_seq:= ${_tmp_seq} ${TARGET_ORDER_OVERRIDE:M*\:${_target}}
5263 . else
5264 _tmp_seq:= ${_tmp_seq} ${_entry}
5265 . endif
5266 . endfor
5267 . endfor
5268 _${_t}_SEQ:= ${_tmp_seq}
5269 . endif
5270 . for s in ${_${_t}_SEQ:O:C/^[0-9]+://}
5271 . if target(${s})
5272 . if ! ${NOTPHONY:M${s}}
5273 _PHONY_TARGETS+= ${s}
5274 . endif
5275 _${_t}_REAL_SEQ+= ${s}
5276 . endif
5277 . endfor
5278 . for s in ${_${_t}_SUSEQ:O:C/^[0-9]+://}
5279 . if target(${s})
5280 . if ! ${NOTPHONY:M${s}}
5281 _PHONY_TARGETS+= ${s}
5282 . endif
5283 _${_t}_REAL_SUSEQ+= ${s}
5284 . endif
5285 . endfor
5286 .ORDER: ${_${_t}_DEP} ${_${_t}_REAL_SEQ}
5287 .endfor
5288
5289 # Define all of the main targets which depend on a sequence of other targets.
5290 # See above *_SEQ and *_DEP. The _DEP will run before this defined target is
5291 # ran. The _SEQ will run as this target once _DEP is satisfied.
5292
5293 .for target in extract patch configure build stage install package
5294
5295 # Check if config dialog needs to show and execute it if needed. If is it not
5296 # needed (_OPTIONS_OK), then just depend on the cookie which is defined later
5297 # to depend on the *_DEP and execute the *_SEQ.
5298 # If options are required, execute config-conditional and then re-execute the
5299 # target noting that config is no longer needed.
5300 .if !target(${target}) && defined(_OPTIONS_OK)
5301 _PHONY_TARGETS+= ${target}
5302 ${target}: ${${target:tu}_COOKIE}
5303 .elif !target(${target})
5304 ${target}: config-conditional
5305 @cd ${.CURDIR} && ${MAKE} CONFIG_DONE_${PKGBASE:tu}=1 ${${target:tu}_COOKIE}
5306 .elif target(${target}) && defined(IGNORE)
5307 .endif
5308
5309 .if !exists(${${target:tu}_COOKIE})
5310
5311 # Define the real target behavior. Depend on the target's *_DEP. Execute
5312 # the target's *_SEQ. Also handle su and USE_SUBMAKE needs.
5313 .if ${UID} != 0 && defined(_${target:tu}_REAL_SUSEQ) && !defined(INSTALL_AS_USER)
5314 . if defined(USE_SUBMAKE)
5315 ${${target:tu}_COOKIE}: ${_${target:tu}_DEP}
5316 @cd ${.CURDIR} && ${MAKE} ${_${target:tu}_REAL_SEQ}
5317 . else # !USE_SUBMAKE
5318 ${${target:tu}_COOKIE}: ${_${target:tu}_DEP} ${_${target:tu}_REAL_SEQ}
5319 . endif # USE_SUBMAKE
5320 @${ECHO_MSG} "===> Switching to root credentials for '${target}' target"
5321 @cd ${.CURDIR} && \
5322 ${SU_CMD} "${MAKE} ${_${target:tu}_REAL_SUSEQ}"
5323 @${ECHO_MSG} "===> Returning to user credentials"
5324 @${TOUCH} ${TOUCH_FLAGS} ${.TARGET}
5325 .else # No SU needed
5326 . if defined(USE_SUBMAKE)
5327 ${${target:tu}_COOKIE}: ${_${target:tu}_DEP}
5328 @cd ${.CURDIR} && \
5329 ${MAKE} ${_${target:tu}_REAL_SEQ} ${_${target:tu}_REAL_SUSEQ}
5330 @${TOUCH} ${TOUCH_FLAGS} ${.TARGET}
5331 . else # !USE_SUBMAKE
5332 ${${target:tu}_COOKIE}: ${_${target:tu}_DEP} ${_${target:tu}_REAL_SEQ} ${_${target:tu}_REAL_SUSEQ}
5333 @${TOUCH} ${TOUCH_FLAGS} ${.TARGET}
5334 . endif # USE_SUBMAKE
5335 .endif # SU needed
5336
5337 .else # exists(cookie)
5338 ${${target:tu}_COOKIE}::
5339 @if [ -e ${.TARGET} ]; then \
5340 ${DO_NADA}; \
5341 else \
5342 cd ${.CURDIR} && ${MAKE} ${.TARGET}; \
5343 fi
5344 .endif # !exists(cookie)
5345
5346 .endfor # foreach(targets)
5347
5348 .PHONY: ${_PHONY_TARGETS} check-sanity fetch pkg
5349
5350 .if !target(check-sanity)
5351 check-sanity: ${_SANITY_REAL_SEQ}
5352 .endif
5353
5354 .if !target(fetch)
5355 fetch: ${_FETCH_DEP} ${_FETCH_REAL_SEQ}
5356 .endif
5357
5358 .if !target(pkg)
5359 pkg: ${_PKG_DEP} ${_PKG_REAL_SEQ}
5360 .endif
5361
5362 .if !target(test)
5363 test: ${_TEST_DEP} ${_TEST_REAL_SEQ}
5364 .endif
5365
5366 .endif
5367 # End of post-makefile section.
5368
5369 .endif
5370 # End of the DESTDIR if statement

Properties

Name Value
svn:eol-style native
svn:keywords FreeBSD=%H
svn:mime-type text/plain

  ViewVC Help
Powered by ViewVC 1.1.27