7 # bsd.port.mk - 940820 Jordan K. Hubbard.
8 # This file is in the public domain.
10 # Please view me with 4 column tabs!
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.
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.
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!
25 FreeBSD_MAINTAINER= portmgr@FreeBSD.org
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.
33 # MAINTAINER - The e-mail address of the contact person for this port.
34 # Default: ports@FreeBSD.org
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.
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 - 9999999 - try to ignore FreeBSD version check
47 # DFLYVERSION - The value of __DragonFly_version.
49 # This is the beginning of the list of all variables that need to be
50 # defined in a port, listed in order that they should be included
51 # to fit in with existing conventions. (Exception: MAINTAINER actually
52 # should appear after EXTRACT_ONLY and before MASTER_SITE_BACKUP).
54 # These variables are used to identify your port.
56 # PORTNAME - Name of software. Mandatory.
57 # PORTVERSION - Version of software. Mandatory when no DISTVERSION is given.
58 # PORTREVISION - Version of port. Optional. Commonly used to indicate
59 # that an update has happened that affects the port
60 # framework itself, but not the distributed software
61 # (e.g., local patches or Makefile changes).
62 # PORTEPOCH - Optional. In certain odd cases, the PORTREVISION logic
63 # can be fooled by ports that appear to go backwards
64 # numerically (e.g. if port-0.3 is newer than port-1998).
65 # In this case, incrementing PORTEPOCH forces the revision.
66 # Default: 0 (no effect).
67 # PKGNAME - Always defined as
68 # ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}-${PORTVERSION}.
69 # Do not define this in your Makefile.
70 # PKGNAMEPREFIX - Prefix to specify that port is language-specific, etc.
72 # PKGNAMESUFFIX - Suffix to specify compilation options or a version
73 # designator (in case there are different versions of
74 # one port as is the case for Tcl).
76 # PKGVERSION - Always defined as ${PORTVERSION}.
77 # Do not define this in your Makefile.
78 # DISTVERSION - Vendor version of the distribution.
79 # Default: ${PORTVERSION}
80 # DISTNAME - Name of port or distribution used in generating
81 # WRKSRC and DISTFILES below.
83 # ${PORTNAME}-${DISTVERSIONPREFIX}${DISTVERSION}${DISTVERSIONSUFFIX}
84 # CATEGORIES - A list of descriptive categories into which this port falls.
87 # These variable describe how to fetch files required for building the port.
89 # DISTFILES - Name(s) of archive file(s) containing distribution.
90 # Set this to an empty string if the port doesn't require it.
91 # Default: ${DISTNAME}${EXTRACT_SUFX}
92 # EXTRACT_SUFX - Suffix for archive names
93 # You never have to set both DISTFILES and EXTRACT_SUFX.
94 # Default: .tar.bz2 if USES=tar:bzip2 is set, .tar.xz if
95 # USES=tar:xz USE_XZ is set, .tar.gz otherwise).
96 # MASTER_SITES - Primary location(s) for distribution files if not found
97 # locally. See bsd.sites.mk for common choices for
100 # - Subdirectory of MASTER_SITES. Will sometimes need to be
101 # set to ${PORTNAME} for (e.g.) MASTER_SITE_SOURCEFORGE.
102 # Only guaranteed to work for choices of ${MASTER_SITES}
103 # defined in bsd.sites.mk.
105 # PATCHFILES - Name(s) of additional files that contain distribution
106 # patches. Make will look for them at PATCH_SITES (see below).
107 # They will automatically be uncompressed before patching if
108 # the names end with ".gz", ".bz2" or ".Z".
109 # For each file you can optionally specify a strip
110 # flag of patch(1) after a colon if it has a different
111 # base directory, e.g. "file1 file2:-p1 file3".
112 # You can also use a :group at the end for matching up to
113 # dist file groups. See Porters Handbook for more information.
114 # Syntax: PATCHFILES= patch[:-pX][:group]
116 # PATCH_SITES - Primary location(s) for distribution patch files
117 # if not found locally.
118 # DIST_SUBDIR - Suffix to ${DISTDIR}. If set, all ${DISTFILES} and
119 # ${PATCHFILES} will be put in this subdirectory of
120 # ${DISTDIR} (see below). Also they will be fetched in this
121 # subdirectory from FreeBSD mirror sites.
122 # ALLFILES - All of ${DISTFILES} and ${PATCHFILES}.
123 # NOFETCHFILES - If set, don't download these files from the ${MASTER_SITES}
124 # or ${MASTER_SITE_BACKUP} (but do from
125 # ${MASTER_SITE_OVERRIDE})
126 # EXTRACT_ONLY - If set, a subset of ${DISTFILES} you want to
129 # (NOTE: by convention, the MAINTAINER entry (see above) should go here.)
131 # These variables are typically set in /etc/make.conf to indicate
132 # the user's preferred location to fetch files from. You should
133 # rarely need to set these.
136 # - Backup location(s) for distribution files and patch
137 # files if not found locally and ${MASTER_SITES}/${PATCH_SITES}.
138 # This should *not* be changed.
140 # http://distcache.FreeBSD.org/ports-distfiles/${DIST_SUBDIR}/
141 # MASTER_SITE_OVERRIDE
142 # - If set, prepend the MASTER_SITES setting with this value.
143 # MASTER_SITE_FREEBSD
144 # - If set, prepend ${MASTER_SITE_BACKUP} in MASTER_SITES.
146 # Set these if your port should not be built under certain circumstances.
147 # These are string variables; you should set them to the reason why
148 # they are necessary.
150 # RESTRICTED - Prevent the distribution of distfiles and packages to
151 # the FTP sites or on CDROM (e.g. forbidden by license
153 # NO_CDROM - Packages and distfiles may not go on CDROM (e.g. must
154 # not be re-sold) but can go on FTP sites.
155 # NO_PACKAGE - Port should not be packaged for ftp sites or CDROMs,
156 # but distfiles can be put on ftp sites and CDROMs.
157 # FORBIDDEN - Package build should not be attempted because of
158 # security vulnerabilities.
159 # LEGAL_TEXT - Port has legal issues (e.g., special permission to distribute, lacks a license).
160 # LEGAL_PACKAGE - Port has no legal issues but defines NO_PACKAGE
161 # IGNORE - Package build should be skipped entirely (e.g.
162 # because of serious unfixable problems in the build,
163 # because it cannot be manually fetched, etc). Error
164 # logs will not appear on pointyhat, so this should be
166 # IGNORE_${ARCH} - Port should be ignored on ${ARCH}.
167 # IGNORE_${OPSYS} - Port should be ignored on ${OPSYS}.
168 # IGNORE_${OPSYS}_${OSREL:R} - Port should be ignored on a single
169 # release of ${OPSYS}, e.g IGNORE_FreeBSD_8
170 # would affect all point releases of FreeBSD 8.
171 # IGNORE_${OPSYS}_${OSREL:R}_${ARCH} - Port should be ignored on a
172 # single release of ${OPSYS} and specific architecture,
173 # e.g IGNORE_FreeBSD_8_i386 would affect all point
174 # releases of FreeBSD 8 in i386.
175 # BROKEN - Port is believed to be broken. Package builds can
176 # still be attempted using TRYBROKEN to test this
178 # BROKEN_${ARCH} - Port is believed to be broken on ${ARCH}. Package builds
179 # can still be attempted using TRYBROKEN to
180 # test this assumption.
181 # BROKEN_${OPSYS} - Port is believed to be broken on ${OPSYS}. Package builds
182 # can still be attempted using TRYBROKEN to
183 # test this assumption.
184 # BROKEN_${OPSYS}_${OSREL:R} - Port is believed to be broken on a single
185 # release of ${OPSYS}, e.g BROKEN_FreeBSD_8
186 # would affect all point releases of FreeBSD 8
187 # unless TRYBROKEN is also set.
188 # BROKEN_${OPSYS}_${OSREL:R}_${ARCH} - Port is believed to be broken on a
189 # single release of ${OPSYS} and specific architecture,
190 # e.g BROKEN_FreeBSD_8_i386 would affect all point
191 # releases of FreeBSD 8 in i386
192 # unless TRYBROKEN is also set.
193 # DEPRECATED - Port is deprecated to install. Advisory only.
195 # - If DEPRECATED is set, determines a date when
196 # the port is planed to remove. The date format is
197 # ISO 8601 (YYYY-MM-DD).
199 # DISABLE_VULNERABILITIES
200 # - If set, do not check if the port is listed in the
201 # vulnerabilities database.
203 # In addition to RESTRICTED or NO_CDROM, if only a subset of distfiles
204 # or patchfiles have redistribution restrictions, set the following
205 # to the list of such files.
208 # - List of files that cannot be redistributed.
209 # Default: "${DISTFILES} ${PATCHFILES}" if RESTRICTED
210 # or NO_CDROM is set, empty otherwise.
212 # These variables are booleans, so you don't need to set them to the reason.
215 # - Set this if your port needs to interact with the user
216 # during any step in a package build. User can then decide
217 # to skip this port by setting ${BATCH}, or compiling only
218 # the interactive ports by setting ${INTERACTIVE}.
220 # USE_SUBMAKE - Set this if you want that each of the port's main 7 targets
221 # (extract, patch, configure, build, stage, install and
222 # package) to be executed in a separate make(1) process.
223 # Useful when one of the stages needs to influence make(1)
224 # variables of the later stages using ${WRKDIR}/Makefile.inc
225 # generated on the fly.
228 # NO_ARCH - Set this if port is architecture neutral.
230 # NO_ARCH_IGNORE - Set this to a list files to ignore when NO_ARCH is checked
231 # in stage-qa (i.e. architecture specific files that are
232 # 'bundled' with the port).
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.)
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
248 # - Set this instead of ONLY_FOR_ARCHS if the given port
249 # fetches and installs compiled i386 binaries.
251 # Dependency checking. Use these if your port requires another port
252 # not in the list below. (Default: empty.)
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.
318 # - The default target to execute when a port is calling a
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.
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).
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.
341 # WITH_DEBUG_PORTS - A list of origins for which WITH_DEBUG will be set
343 # WITHOUT_SSP - Disable SSP.
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
352 # USE_LOCALE - LANG and LC_ALL are set to the value of this variable in
353 # CONFIGURE_ENV and MAKE_ENV. Example: USE_LOCALE=en_US.UTF-8
355 # USE_GCC - If set, this port requires this version of gcc, either in
356 # the system or installed from a port.
357 # USE_CSTD - Override the default C language standard (gnu89, gnu99)
358 # USE_CXXSTD Override the default C++ language standard
359 # USE_BINUTILS - Use binutils suite from port instead of the version in base.
360 # CFLAGS_${ARCH} Append the cflags to CFLAGS only on the specified architecture
362 # Append the cxxflags to CXXFLAGS only on the specified architecture
364 # USE_GL - A list of Mesa or GL related dependencies needed by the port.
365 # Supported components are: egl, glesv2, glut, glu, glw, and gl.
366 # If set to "yes", this is equivalent to "glu". Note that
367 # glew and glut depend on glu, glw and glu depend on gl.
369 # USE_SDL - If set, this port uses the sdl libraries.
370 # See bsd.sdl.mk for more information.
372 # USE_OPENLDAP - If set, this port uses the OpenLDAP libraries.
373 # Implies: WANT_OPENLDAP_VER?=24
375 # - Legal values are: 23, 24
376 # If set to an unknown value, the port is marked BROKEN.
378 # - If set, the system should use OpenLDAP libraries
381 # USE_AUTOTOOLS - If set, this port uses various GNU autotools
382 # (libtool, autoconf, autoheader, automake et al.)
383 # See bsd.autotools.mk for more details.
385 # USE_FPC - If set, this port relies on the Free Pascal language.
386 # Implies inclusion of bsd.fpc.mk. (Also see
387 # that file for more information on WANT_FPC_*).
388 # USE_JAVA - If set, this port relies on the Java language.
389 # Implies inclusion of bsd.java.mk. (Also see
390 # that file for more information on USE_JAVA_*).
391 # USE_OCAML - If set, this port relies on the OCaml language.
392 # Implies inclusion of bsd.ocaml.mk. (Also see
393 # that file for more information on USE_OCAML*).
394 # USE_RUBY - If set, this port relies on the Ruby language.
395 # Implies inclusion of bsd.ruby.mk. (Also see
396 # that file for more information on USE_RUBY_*).
398 # USE_GECKO - If set, this port uses the Gecko/Mozilla product.
399 # See bsd.gecko.mk for more details.
401 # USE_WX - If set, this port uses the WxWidgets library and related
402 # components. See bsd.wx.mk for more details.
405 # USE_QT4 - A list of the Qt 4 dependencies the port has (e.g,
406 # corelib, webkit). Implies that the port needs Qt.
407 # Implies the inclusion of bsd.qt.mk. See bsd.qt.mk
410 # USE_QT5 - A list of the Qt 5 dependencies the port has (e.g,
411 # core, webkit). Implies that the port needs Qt.
412 # Implies the inclusion of bsd.qt.mk. See bsd.qt.mk
416 # - Controls the action of PREFIX (see above). Only use this
417 # if the port is a Linux infrastructure port (e.g. contains libs
418 # or a sound server which supports the FreeBSD native one),
419 # use the default prefix if it's a leaf port (e.g. a game or
421 # Implies NO_LICENSES_INSTALL=yes, NO_MTREE=yes, and causes
422 # Linux ldconfig to be used when USE_LDCONFIG is defined.
424 # USE_XORG - Set to a list of X.org module dependencies.
425 # Implies inclusion of bsd.xorg.mk.
427 # USE_TEX - A list of the TeX dependencies the port has.
430 # USE_RC_SUBR - If set, the ports startup/shutdown script uses the common
431 # routines found in /etc/rc.subr.
432 # If this is set to a list of files, these files will be
433 # automatically added to ${SUB_FILES}, some %%VAR%%'s will
434 # automatically be expanded, they will be installed in
435 # ${PREFIX}/etc/rc.d if ${PREFIX} is not /usr, otherwise they
436 # will be installed in /etc/rc.d/ and added to the packing list.
438 # USE_APACHE - If set, this port relies on an apache webserver.
440 # Conflict checking. Use if your port cannot be installed at the same time as
443 # CONFLICTS - A list of package name patterns that the port conflicts
444 # with, separated by blanks. The names may include shell
445 # pattern meta-characters "*", "?", "[", "]", and "!".
446 # Example: apache*-1.2* apache*-1.3.[012345] apache-*+ssl_*
449 # - Check conflict prior to the build.
452 # - Check conflict prior to the installation stage.
454 # Various directory definitions and variables to control them.
455 # You rarely need to redefine any of these except WRKSRC and NO_WRKSUBDIR.
457 # LOCALBASE - Where ports install things.
458 # Default: /usr/local
459 # LINUXBASE - Where Linux ports install things.
460 # Default: /compat/linux
461 # PREFIX - Where *this* port installs its files.
462 # Default: ${LINUXBASE} if USE_LINUX_PREFIX is set,
463 # otherwise ${LOCALBASE}
466 # - There are some sanity checks against PREFIX.
467 # You can disable these checks with defining
468 # this variable, but this is not recommended!
469 # Only do this if you really know what you are
470 # doing. These sanity checks are the following:
471 # - PREFIX has to be an absolute path.
472 # - PREFIX can't have a trailing slash.
474 # BUNDLE_LIBS Teach pkg(8) to not automatically add all shared libraries
475 # installed by a port as shared libraries "provided" for
476 # other packages (i.e., do not expose them in the solver).
477 # This has to be used for ports that bundle third party
478 # libraries for internal usage.
479 # MASTERDIR - Where the port finds patches, package files, etc. Define
480 # this is you have two or more ports that share most of the
482 # Default: ${.CURDIR}
483 # PORTSDIR - The root of the ports tree.
484 # Default: /usr/ports
485 # DISTDIR - Where to search for and store copies of original sources
486 # Default: ${PORTSDIR}/distfiles
487 # PACKAGES - A top level directory where all packages go (rather than
488 # going locally to each port).
489 # Default: ${PORTSDIR}/packages
490 # WRKDIRPREFIX - The place to root the temporary working directory
491 # hierarchy. This path must *not* end in '/'.
493 # WRKDIR - A temporary working directory that gets *clobbered* on clean
494 # Default: ${WRKDIRPREFIX}${.CURDIR}/work
495 # WRKSRC - A subdirectory of ${WRKDIR} where the distribution actually
497 # Default: ${WRKDIR}/${DISTNAME}
498 # WRKSRC_SUBDIR - A subdirectory of ${WRKSRC} where the distribution actually
501 # NO_WRKSUBDIR - Assume port unpacks without a subdirectory, and extract it in
502 # ${WRKSRC} instead of ${WRKDIR}.
503 # PATCHDIR - A directory containing any additional patches you made
504 # to port this software to FreeBSD.
505 # Default: ${MASTERDIR}/files
506 # SCRIPTDIR - A directory containing any auxiliary scripts
507 # Default: ${MASTERDIR}/scripts
508 # FILESDIR - A directory containing any miscellaneous additional files.
509 # Default: ${MASTERDIR}/files
510 # DFLY_PATCHDIR= - A directory containing additional patches required
511 # to build port on DragonFly
512 # Default: ${MASTERDIR}/dragonfly
513 # DFLY_FILESDIR - A directory containing any miscellaneous files
514 # needed to build port on DragonFly
515 # Default: ${MASTERDIR}/dragonfly
516 # PKGDIR - A directory containing any package creation files.
517 # Default: ${MASTERDIR}
518 # SRC_BASE - The root of the src tree. (Some ports require this to get
519 # kernel sources). Default: /usr/src
520 # UID_FILES - A list of files containing information about registered UIDs.
521 # Note that files have decreasing priority.
522 # GID_FILES - A list of files containing information about registered GIDs.
523 # Note that files have decreasing priority.
525 # Variables that serve as convenient "aliases" for your *-install targets.
526 # Use these like: "${INSTALL_PROGRAM} ${WRKSRC}/prog ${PREFIX}/bin".
529 # - A command to install binary executables. (By
530 # default, also strips them, unless ${STRIP} is
531 # overridden to be the empty string).
532 # INSTALL_KLD - As INSTALL_PROGRAM, but without the STRIP.
533 # INSTALL_LIB - As INSTALL_DATA, but also strips the file.
535 # - A command to install executable scripts.
536 # INSTALL_DATA - A command to install sharable data and static libs.
537 # INSTALL_MAN - A command to install manpages and documentation.
540 # - Similiar to INSTALL_PROGRAM and INSTALL_DATA commands but
541 # working on whole trees of directories, takes 3 arguments,
542 # last one is find(1) arguments and optional.
544 # cd ${WRKSRC}/doc && ${COPYTREE_SHARE} . ${DOCSDIR} "! -name *\.bak"
546 # Installs all directories and files from ${WRKSRC}/doc
547 # to ${DOCSDIR} except sed(1) backup files.
549 # MANPREFIX - The directory prefix for ${MAN<sect>} and ${MLINKS}.
552 # - If manual pages of some sections install in different
553 # locations than others, use these.
554 # Default: ${MANPREFIX}
556 # Set the following to specify all .info files your port installs.
558 # INFO - A list of .info files (omitting the trailing ".info");
559 # only one entry per document! These files are listed in
560 # the path relative to ${INFO_PATH}.
561 # INFO_PATH - Path, where all .info files will be installed by your
562 # port, relative to ${PREFIX}
563 # Default: "share/info" if ${PREFIX} is equal to /usr
564 # and "info" otherwise.
566 # Set the following to specify all documentation your port installs into
569 # PORTDOCS - A list of files and directories relative to DOCSDIR.
570 # Shell glob patterns can be used, directories include
571 # the entire subtree of contained files and directories.
572 # Should not be set when no documentation files are
574 # Useful for dynamically generated documentation.
576 # Set the following to specify all documentation your port installs into
579 # PORTEXAMPLES - A list of files and directories relative to EXAMPLESDIR.
580 # Shell glob patterns can be used, directories include
581 # the entire subtree of contained files and directories.
582 # Should not be set when no examples files are
584 # Useful for dynamically generated examples.
586 # Set the following to specify all files and directories your port installs into
589 # PORTDATA - A list of files and directories relative to DATADIR.
590 # Shell glob patterns can be used, directories include
591 # the entire subtree of contained files and directories.
592 # Should not be set when no data files are
594 # Useful for dynamically generated data files.
596 # Default targets and their behaviors:
598 # fetch - Retrieves missing ${DISTFILES} and ${PATCHFILES} for this
600 # fetch-list - Show list of commands to retrieve missing ${DISTFILES} and
601 # ${PATCHFILES} for this port.
603 # - Retrieves missing ${DISTFILES} and ${PATCHFILES} for this
604 # port and dependencies.
605 # fetch-recursive-list
606 # - Show list of commands to retrieve missing ${DISTFILES} and
607 # ${PATCHFILES} for this port and dependencies.
609 # - Retrieves missing ${DISTFILES} and ${PATCHFILES} for this
610 # port and dependencies.
611 # fetch-required-list
612 # - Show list of commands to retrieve missing ${DISTFILES} and
613 # ${PATCHFILES} for this port and dependencies.
615 # - Show list of URLS to retrieve missing ${DISTFILES} and
616 # ${PATCHFILES} for this port.
618 # - Show list of URLS to retrieve ${DISTFILES} and
619 # ${PATCHFILES} for this port.
622 # - Show all directories which are dependencies
625 # - Show all directories which are build-dependencies
627 # package-depends-list
628 # - Show all directories which are package-dependencies
629 # for this port. This is based upon the dependency
630 # tree as recorded in the Makefiles of the ports
631 # collection, not as recorded in the currently
633 # actual-package-depends
634 # - Like package-depends-list but with the difference
635 # that the dependencies of the currently installed
636 # ports are used instead of the dependencies as
637 # recorded in the ports collection.
639 # - Show all directories which are run-dependencies
642 # - Show all directories which are test-dependencies
645 # extract - Unpacks ${DISTFILES} into ${WRKDIR}.
646 # patch - Apply any provided patches to the source.
647 # configure - Runs either GNU configure, one or more local configure
648 # scripts or nothing, depending on what's available.
649 # build - Actually compile the sources.
650 # install - Install the results of a build.
651 # reinstall - Install the results of a build, ignoring "already installed"
653 # deinstall - Remove the installation.
654 # deinstall-all - Remove all installations with the same PKGORIGIN.
655 # test - Run tests for the port.
656 # package - Create a package from an _installed_ port.
658 # - Create a package for a port and _all_ of its dependencies.
659 # describe - Try to generate a one-line description for each port for
660 # use in INDEX files and the like.
661 # check-plist - Checks for files missing from the plist, and files in the plist
662 # that are not installed by the port.
663 # check-sanity - Perform some basic checks of the port layout.
664 # checkpatch - Do a "patch -C" instead of a "patch". Note that it may
665 # give incorrect results if multiple patches deal with
667 # checksum - Use distinfo to ensure that your distfiles are valid.
669 # - Run checksum in this port and all dependencies.
670 # makesum - Generate distinfo (only do this for your own ports!).
671 # clean - Remove ${WRKDIR} and other temporary files used for building.
672 # clean-depends - Do a "make clean" for all dependencies.
673 # config - Configure options for this port (using ${DIALOG}).
674 # Automatically run prior to extract, patch, configure, build,
675 # install, and package.
677 # - Configure options for this port for a port and all its
679 # showconfig - Display options config for this port.
680 # showconfig-recursive
681 # - Display options config for this port and all its
683 # rmconfig - Remove the options config for this port.
685 # - Remove the options config for this port and all its
688 # Default sequence for "all" is:
690 # check-sanity fetch checksum extract patch configure build
692 # Please read the comments in the targets section below; you
693 # should be able to use the pre-* or post-* targets/scripts
694 # (which are available for every stage except checksum) or
695 # override the do-* targets to do pretty much anything you want.
697 # The TARGET_ORDER_OVERRIDE variable can be set to multiple <priority>:<target>
698 # to change the ordering of targets, have a look at the _SEQ variables at the
699 # end of this file for the default order and priorities.
701 # NEVER override the "regular" targets unless you want to open
702 # a major can of worms.
704 # Set these variables if your port doesn't need some of the steps.
705 # Note that there are no NO_PATCH or NO_CONFIGURE variables because
706 # those steps are empty by default. NO_EXTRACT is not allowed anymore
707 # since we need to at least create ${WRKDIR}. Also, NO_CHECKSUM is a user
708 # variable and is not to be set in a port's Makefile. See above for NO_PACKAGE.
710 # NO_BUILD - Use a dummy (do-nothing) build target.
711 # NO_INSTALL - Use a dummy (do-nothing) install target.
712 # NO_TEST - Use a dummy (do-nothing) test target.
714 # Here are some variables used in various stages.
716 # For options see bsd.options.mk
720 # FETCH_BINARY - Path to ftp/http fetch command if not in $PATH.
721 # Default: "/usr/bin/fetch"
722 # FETCH_ARGS - Arguments to ftp/http fetch command.
724 # FETCH_CMD - ftp/http fetch command.
725 # Default: ${FETCH_BINARY} ${FETCH_ARGS}
727 # - Arguments to ${FETCH_CMD} before filename.
730 # - Arguments to ${FETCH_CMD} following filename.
732 # FETCH_ENV - Environment to pass to ${FETCH_CMD}.
734 # FETCH_REGET - Times to retry fetching of files on checksum errors.
737 # - Disable package dependency in fetch target for mass
738 # fetching. User settable.
742 # EXTRACT_CMD - Command for extracting archive
744 # EXTRACT_BEFORE_ARGS
745 # - Arguments to ${EXTRACT_CMD} before filename.
748 # - Arguments to ${EXTRACT_CMD} following filename.
749 # Default: "--no-same-owner --no-same-permissions"
752 # EXTRA_PATCHES - Define this variable if you have patches not in
753 # ${PATCHDIR}. This usually happens when you need to
754 # do some pre-processing before some distribution
755 # patches can be applied. In that case, fetch them as
756 # extra distfiles, put the processed results in
757 # ${WRKDIR}, then point EXTRA_PATCHES to them.
758 # The patches specified by this variable will be
759 # applied after the normal distribution patches but
760 # before those in ${PATCHDIR}.
761 # EXTRA_PATCH_TREE - where to find extra 'out-of-tree' patches
762 # Points to a directory hierarchy with the same layout
763 # as the ports tree, where local patches can be found.
764 # This allows a third party to keep their patches in
765 # some other source control system if needed.
766 # PATCH_WRKSRC - Directory to apply patches in.
771 # HAS_CONFIGURE - If set, this port has its own configure script. The
772 # configure stage will not do anything if this is not set.
773 # GNU_CONFIGURE - If set, you are using GNU configure (optional). Implies
775 # CONFIGURE_OUTSOURCE - If set, this port builds in an empty ${CONFIGURE_WRKSRC}
776 # not being under ${WRKSRC}.
778 # - Directory to run configure in.
781 # - Name of configure script, relative to ${CONFIGURE_WRKSRC}.
782 # Default: "Makefile.PL" if USES=perl5 and USE_PERL5=configure
783 # are set, "configure" otherwise.
785 # - The name of target to call when GNU_CONFIGURE is
787 # Default: ${ARCH}-portbld-${OPSYS:tl}${OSREL}
788 # GNU_CONFIGURE_PREFIX
789 # - The directory passed as prefix to the configure script if
790 # GNU_CONFIGURE is set.
793 # - Pass these args to configure if ${HAS_CONFIGURE} is set.
794 # Default: "--prefix=${GNU_CONFIGURE_PREFIX}
795 # --infodir=${PREFIX}/${INFO_PATH} --localstatedir=/var
796 # --mandir=${MANPREFIX}/man --build=${CONFIGURE_TARGET}" if
797 # GNU_CONFIGURE is set, "CC=${CC} CFLAGS=${CFLAGS}
798 # PREFIX=${PREFIX} INSTALLPRIVLIB=${PREFIX}/lib
799 # INSTALLARCHLIB=${PREFIX}/lib" if USES=perl5 and
800 # USE_PERL5=configure are set, empty otherwise.
801 # CONFIGURE_ENV - Pass these env (shell-like) to configure if
802 # ${HAS_CONFIGURE} is set.
803 # CONFIGURE_LOG - The name of configure log file. It will be printed to
804 # the screen if configure fails.
805 # Default: config.log
806 # CONFIGURE_FAIL_MESSAGE
807 # - A message displayed to users when configure
808 # fails (note: this assumes the do-configure
809 # target has not been overwritten). This message
810 # will be passed through /usr/bin/fmt before
811 # being shown to the user.
813 # WITHOUT_FBSD10_FIX Disable FreeBSD 10.0 autotools workaround.
815 # For build and install:
817 # MAKEFILE - Name of the makefile.
819 # ALL_TARGET - Default target for sub-make in build stage.
821 # BUILD_WRKSRC - Directory to do build in (default: ${WRKSRC}).
822 # MAKE_ENV - Additional environment vars passed to sub-make in build
823 # and install stages.
825 # MAKE_ARGS - Any extra arguments to sub-make in build and install stages.
829 # - Disallow multiple jobs even when user set a global override.
830 # To be used with known bad ports.
832 # - Set to disable the multiple jobs feature. User settable.
834 # - Override the number of make jobs to be used. User settable.
835 # MAKE_JOBS_NUMBER_LIMIT
836 # - Set a limit for maximum number of make jobs allowed to be
841 # - Enable CCACHE support (devel/ccache). User settable.
843 # - Which directory to use for ccache (default: $HOME/.ccache)
845 # - Disable CCACHE support for example for certain ports if
846 # CCACHE is enabled. User settable.
850 # TEST_TARGET - Target for sub-make in test stage. If not defined,
851 # no default test target is provided.
853 # TEST_WRKSRC - Directory to do test in (default: ${WRKSRC}).
854 # TEST_ENV - Additional environment vars passed to sub-make in test
856 # Default: ${MAKE_ENV}
857 # TEST_ARGS - Any extra arguments to sub-make in test stage
858 # Default: ${MAKE_ARGS}
863 # - Default target for sub-make in install stage.
866 # - Directory to install from
868 # NO_MTREE - If set, will not invoke mtree from bsd.port.mk from
869 # the "install" target.
870 # MTREE_FILE - The name of the mtree file.
871 # Default: ${PORTSDIR}/Templates/BSD.local.dist or
872 # /etc/mtree/BSD.usr.dist if ${PREFIX} == "/usr".
873 # PLIST_DIRS - Directories to be added to packing list
874 # PLIST_FILES - Files and symbolic links to be added to packing list
876 # PLIST - Name of the `packing list' file.
877 # Change this to ${WRKDIR}/PLIST or something if you
878 # need to write to it. (It is not a good idea for a port
879 # to write to any file outside ${WRKDIR} during a normal
881 # Default: ${PKGDIR}/pkg-plist
882 # TMPPLIST - Name of the `packing list' file after processing
883 # Default: ${WRKDIR}/.PLIST.mktmp
884 # PLIST_SUB - List of "variable=value" pair for substitution in ${PLIST}
887 # SUB_FILES - Files that should be passed through sed(1) and redirected to
889 # - For each file specified in SUB_FILES, there must be a
890 # corresponding file in ${FILESDIR} whose suffix is ".in". For
891 # instance, if the Makefile specifies "SUB_FILES= pkg-message"
892 # then there must be a file called pkg-message.in in
894 # - The substitution process is the same as PLIST_FILES, as
895 # described below except that any line beginning with @comment
897 # SUB_LIST - List of "variable=value" pair for substitution in ${SUB_FILES}
898 # Some pairs are added by default: eg. PREFIX=${PREFIX}
900 # USE_LDCONFIG - If set to "yes", this adds ${PREFIX}/lib to the list of
901 # directories to be searched for shared libraries.
902 # Otherwise, this is a list of directories to be added to that
903 # list. The directory names are written to
904 # ${LOCALBASE}/libdata/ldconfig/${PKGBASE} which is then
905 # used by the ldconfig startup script.
906 # This mechanism replaces ldconfig scripts installed by some
907 # ports, often under such names as 000.${UNQUENAME}.sh.
908 # If USE_LINUX_PREFIX is defined, the Linux version of
909 # ldconfig will be used instead of the native FreeBSD
910 # version, and the directory list given will be ignored.
912 # - Same as USE_LDCONFIG but the target file is
913 # ${LOCALBASE}/libdata/ldconfig32/${PKGBASE} instead.
914 # Note: that should only be used on 64-bit architectures.
916 # DOCSDIR - Name of the directory to install the packages docs in.
917 # Default: ${PREFIX}/share/doc/${PORTNAME}
918 # DOCSDIR_REL - The DOCSDIR relative to ${PREFIX}
919 # EXAMPLESDIR - Name of the directory to install the packages examples in.
920 # Default: ${PREFIX}/share/examples/${PORTNAME}
922 # - The EXAMPLESDIR relative to ${PREFIX}
923 # DATADIR - Name of the directory to install the packages shared data in.
924 # Default: ${PREFIX}/share/${PORTNAME}
925 # DATADIR_REL - The DATADIR relative to ${PREFIX}
927 # WWWDIR - Name of the directory to install the packages www data in.
928 # Default: ${PREFIX}/www/${PORTNAME}
929 # WWWDIR_REL - The WWWDIR relative to ${PREFIX}
931 # USERS - List of users to create at install time. Each login must
932 # have a corresponding entry in ${UID_FILES}.
933 # GROUPS - List of groups to create at install time. Each group must
934 # have a corresponding entry in ${GID_FILES}.
936 # DESKTOPDIR - Name of the directory to install ${DESKTOP_ENTRIES} in.
937 # Default: ${PREFIX}/share/applications
939 # - List of desktop entry files to generate and install in
940 # ${DESKTOPDIR}. The format is
941 # "Name" "Comment" "Icon" "Exec" "Categories" StartupNotify
943 # * Only add desktop entries for applications which do not
944 # require a terminal (ie. X applications).
945 # * If the upstream distribution already installs .desktop
946 # files, you do not need to use this.
947 # * If you require a more elaborate .desktop file than this
948 # variable permits, write it yourself and install it
951 # * Comment, Icon and StartupNotify may be empty
952 # strings (""). Categories may be an empty string in some
953 # cases (see below). The other fields are mandatory.
954 # * If Comment is an empty string, port ${COMMENT} will be
956 # * If set, Icon must be either absolute path (usually
957 # ${PREFIX}/share/pixmaps/${PORTNAME}.png) or icon name
958 # without extension if installed icons follow Icon Theme
960 # * If Categories is an empty string, bsd.port.mk will try
961 # to deduce a default value using the CATEGORIES variable.
962 # If the deduction fails, you will have to set Categories
963 # manually. You should check the generated value using
964 # "make desktop-categories", and override it if necessary.
965 # * Exec will also be used to name the .desktop file.
966 # * StartupNotify may be true, false or empty (see Desktop
967 # Entry Specification for details).
968 # * The files will be automatically added to ${PLIST}.
970 # "X Window Information" \
971 # "Get information about X windows" \
972 # "${PREFIX}/share/pixmaps/wininfo.png" \
973 # "${PREFIX}/bin/wininfo" \
976 # See http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html
977 # for an explanation of the fields. If you need to create more
978 # than one file, just chain them into a single variable.
980 # Note that the install target will automatically add manpages (see
981 # above) and also substitute special sequences of characters (delimited
982 # by "%%") as defined in PLIST_SUB to generate ${TMPPLIST}. For
983 # instance, "OSREL=${OSREL}" in PLIST_SUB causes all occurrences of
984 # "%%OSREL%%" in ${PLIST} to be substituted by the value of OSREL.
985 # ${TMPPLIST} is generated before the do-install stage. If you are
986 # generating the packing list on-the-fly, make sure it's generated before
987 # do-install is called!
989 # This is used in all stages:
991 # SCRIPTS_ENV - Additional environment vars passed to scripts in
992 # ${SCRIPTDIR} executed by bsd.port.mk.
995 # Finally, variables to change if you want a special behavior. These
996 # are for debugging purposes. Don't set them in your Makefile.
998 # ECHO_MSG - Used to print all the '===>' style prompts - override this
1000 # Default: ${ECHO_CMD}
1001 # PATCH_DEBUG - If set, print out more information about the patches as
1002 # it attempts to apply them.
1003 # PKG_DBDIR - Where package installation is recorded; this directory
1004 # must not contain anything else.
1005 # Default: /var/db/pkg
1006 # PORT_DBDIR - Where port configuration options are recorded.
1007 # Default: /var/db/ports
1009 # - Don't register a port installation as a package.
1010 # FORCE_PKG_REGISTER
1011 # - If set, it will overwrite any existing package
1012 # registration information in ${PKG_DBDIR}/${PKGNAME}.
1013 # NO_DEPENDS - Don't verify build of dependencies.
1015 # - Verify dependencies but consider missing dependencies as
1017 # CHECKSUM_ALGORITHMS
1018 # - Different checksum algorithms to check for verifying the
1019 # integrity of the distfiles. The absence of the algorithm
1020 # in distinfo doesn't make it fail.
1022 # NO_CHECKSUM - Don't verify the checksum. Typically used when
1023 # when you noticed the distfile you just fetched has
1024 # a different checksum and you intend to verify if
1025 # the port still works with it.
1026 # USE_PACKAGE_DEPENDS
1027 # - Try to install dependencies from existing packages instead
1028 # of building the port from scratch. Fallback on source
1029 # if an existing package is not present.
1030 # USE_PACKAGE_DEPENDS_ONLY
1031 # - Like USE_PACKAGE_DEPENDS, but do not fallback on source.
1033 # - Define this to install as the current user, intended
1034 # for systems where you have no root access.
1035 # DISABLE_SIZE - Do not check the size of a distfile even if the SIZE field
1036 # has been specified in distinfo. This is useful
1037 # when using an alternate FETCH_CMD.
1039 # PKG_CREATE_VERBOSE - If set, pass the -v option to pkg create which
1040 # ensures periodic output during packaging and
1041 # will help prevent timeouts by build monitors
1043 # End of the list of all variables that need to be defined in a port.
1044 # Most port authors should not need to understand anything after this point.
1051 # These need to be absolute since we don't know how deep in the ports
1052 # tree we are and thus can't go relative. They can, of course, be overridden
1053 # by individual Makefiles or local system make configuration.
1056 WITHOUT_FBSD10_FIX?= yes
1057 DFLY_PATCHDIR?= ${MASTERDIR}/dragonfly
1058 DFLY_FILESDIR?= ${MASTERDIR}/dragonfly
1059 PORTSDIR?= /usr/dports
1060 LOCALBASE?= /usr/local
1061 LINUXBASE?= /compat/linux
1062 DISTDIR?= /usr/distfiles
1063 WRKDIRPREFIX?= /usr/obj/dports
1064 _DISTDIR?= ${DISTDIR}/${DIST_SUBDIR}
1065 INDEXDIR?= ${PORTSDIR}
1067 USESDIR?= ${PORTSDIR}/Mk/Uses
1068 SCRIPTSDIR?= ${PORTSDIR}/Mk/Scripts
1069 LIB_DIRS?= /lib /usr/lib ${LOCALBASE}/lib
1070 STAGEDIR?= ${WRKDIR}/stage
1074 # XXX: We have no real FLAVORS support in ports or tools yet.
1075 #PORTS_FEATURES+= FLAVORS
1076 MINIMAL_PKG_VERSION= 1.6.0
1078 _PORTS_DIRECTORIES+= ${PKG_DBDIR} ${PREFIX} ${WRKDIR} ${EXTRACT_WRKDIR} \
1079 ${STAGEDIR}${PREFIX} ${WRKDIR}/pkg
1081 # Ensure .CURDIR contains an absolute path without a trailing slash. Failed
1082 # builds can occur when PORTSDIR is a symbolic link, or with something like
1083 # make -C /usr/ports/category/port/.
1084 .CURDIR:= ${.CURDIR:tA}
1086 # make sure bmake treats -V as expected
1087 .MAKE.EXPAND_VARIABLES= yes
1089 .include "${PORTSDIR}/Mk/bsd.commands.mk"
1093 IGNORE= FLAVOR is defined while this port does not have FLAVORS.
1094 . elif ! ${FLAVORS:M${FLAVOR}}
1095 IGNORE= Unknown flavor '${FLAVOR}', possible flavors: ${FLAVORS}.
1099 .if !empty(FLAVORS) && empty(FLAVOR)
1100 FLAVOR= ${FLAVORS:[1]}
1103 # Do not leak flavors to childs make
1104 .MAKEOVERRIDES:= ${MAKEOVERRIDES:NFLAVOR=*}
1106 .if defined(CROSS_TOOLCHAIN)
1107 .if !defined(CROSS_SYSROOT)
1108 IGNORE= CROSS_SYSROOT should be defined
1110 .include "${LOCALBASE}/share/toolchains/${CROSS_TOOLCHAIN}.mk"
1111 # Do not define CPP on purpose
1112 .if !defined(HOSTCC)
1118 CFLAGS+= --sysroot=${CROSS_SYSROOT} -isystem ${CROSS_SYSROOT}/usr/include
1119 CXXFLAGS+= --sysroot=${CROSS_SYSROOT} -isystem ${CROSS_SYSROOT}/usr/include/c++/v1 -nostdinc++
1120 LDFLAGS+= --sysroot=${CROSS_SYSROOT}
1121 .for _tool in AS AR LD NM OBJCOPY RANLIB SIZE STRINGS
1122 ${_tool}= ${CROSS_BINUTILS_PREFIX}${tool:tl}
1124 STRIP_CMD= ${CROSS_BINUTILS_PREFIX}strip
1125 # only bmake support the below
1126 STRIPBIN= ${STRIP_CMD}
1127 .export.env STRIPBIN
1131 # DESTDIR section to start a chrooted process if invoked with DESTDIR set
1134 .if defined(DESTDIR) && !empty(DESTDIR) && !defined(CHROOTED) && \
1135 !defined(BEFOREPORTMK) && !defined(INOPTIONSMK)
1137 .include "${PORTSDIR}/Mk/bsd.destdir.mk"
1141 .if !target(makepatch)
1143 @${SETENV} WRKDIR=${WRKDIR} PATCHDIR=${PATCHDIR} \
1144 PATCH_WRKSRC=${PATCH_WRKSRC} \
1145 STRIP_COMPONENTS="${PATCH_STRIP:S/-p//}" \
1146 ${SH} ${SCRIPTSDIR}/smart_makepatch.sh
1150 # Start of options section
1151 .if defined(INOPTIONSMK) || ( !defined(USEOPTIONSMK) && !defined(AFTERPORTMK) )
1154 # Get the default maintainer
1155 MAINTAINER?= ports@FreeBSD.org
1157 # Get the architecture
1161 _EXPORTED_VARS+= ARCH
1163 # Get the operating system type
1167 _EXPORTED_VARS+= OPSYS
1169 .if !defined(_OSRELEASE)
1170 . if defined(.MAKE.DF.OSREL)
1171 _OSRELEASE= ${.MAKE.DF.OSREL}-DPORTS
1173 _OSRELEASE!= ${UNAME} -r
1176 _EXPORTED_VARS+= _OSRELEASE
1178 # Get __FreeBSD_version
1179 .if !defined(OSVERSION)
1183 .if !defined(DFLYVERSION)
1184 . if defined(.MAKE.DF.OSREL)
1185 DFLYVERSION= ${.MAKE.DF.VERSION}
1186 OSREL= ${.MAKE.DF.OSREL}
1188 DFLYVERSION!= ${AWK} '/^\#define[[:blank:]]__DragonFly_version/ {print $$3}' < /usr/include/sys/param.h
1189 OSREL!= ${ECHO} ${DFLYVERSION} | ${AWK} '{a=int($$1/100000); b=int(($$1-(a*100000))/100); print a "." b}'
1192 _EXPORTED_VARS+= OSVERSION DFLYVERSION OSREL
1195 .if (${OPSYS} == FreeBSD && (${OSVERSION} < 1003000 || (${OSVERSION} >= 1100000 && ${OSVERSION} < 1100122))) || \
1196 (${OPSYS} == DragonFly && ${DFLYVERSION} < 400400)
1197 _UNSUPPORTED_SYSTEM_MESSAGE= Ports Collection support for your ${OPSYS} version has ended, and no ports\
1198 are guaranteed to build on this system. Please upgrade to a supported release.
1199 . if defined(ALLOW_UNSUPPORTED_SYSTEM)
1200 WARNING+= "${_UNSUPPORTED_SYSTEM_MESSAGE}"
1202 show-unsupported-system-error:
1203 @${ECHO_MSG} "/!\\ ERROR: /!\\"
1205 @${ECHO_MSG} "${_UNSUPPORTED_SYSTEM_MESSAGE}" | ${FMT_80}
1207 @${ECHO_MSG} "No support will be provided if you silence this message by defining ALLOW_UNSUPPORTED_SYSTEM." | ${FMT_80}
1213 # Only define tools here (for transition period with between pkg tools)
1214 .include "${PORTSDIR}/Mk/bsd.commands.mk"
1216 .if !defined(_PKG_CHECKED) && !defined(PACKAGE_BUILDING) && exists(${PKG_BIN})
1217 .if !defined(_PKG_VERSION)
1218 _PKG_VERSION!= ${PKG_BIN} -v
1220 _PKG_STATUS!= ${PKG_BIN} version -t ${_PKG_VERSION:C/-.*//g} ${MINIMAL_PKG_VERSION}
1221 .if ${_PKG_STATUS} == "<"
1222 IGNORE= pkg(8) must be version ${MINIMAL_PKG_VERSION} or greater, but you have ${_PKG_VERSION}. You must upgrade the ${PKG_ORIGIN} port first
1226 _EXPORTED_VARS+= _PKG_CHECKED
1228 MASTERDIR?= ${.CURDIR}
1230 .if ${MASTERDIR} != ${.CURDIR}
1232 MASTER_PORT?=${MASTERDIR:C/[^\/]+\/\.\.\///:C/[^\/]+\/\.\.\///:C/^.*\/([^\/]+\/[^\/]+)$/\\1/}
1238 # If they exist, include Makefile.inc, then architecture/operating
1239 # system specific Makefiles, then local Makefile.local.
1241 .if ${MASTERDIR} != ${.CURDIR} && exists(${.CURDIR}/../Makefile.inc)
1242 .include "${.CURDIR}/../Makefile.inc"
1246 .if exists(${MASTERDIR}/../Makefile.inc)
1247 .include "${MASTERDIR}/../Makefile.inc"
1251 .if exists(${MASTERDIR}/Makefile.${ARCH}-${OPSYS})
1252 .include "${MASTERDIR}/Makefile.${ARCH}-${OPSYS}"
1254 .elif exists(${MASTERDIR}/Makefile.${OPSYS})
1255 .include "${MASTERDIR}/Makefile.${OPSYS}"
1257 .elif exists(${MASTERDIR}/Makefile.${ARCH})
1258 .include "${MASTERDIR}/Makefile.${ARCH}"
1262 .if exists(${MASTERDIR}/Makefile.local)
1263 .include "${MASTERDIR}/Makefile.local"
1265 .elif ${MASTERDIR} != ${.CURDIR} && exists(${.CURDIR}/Makefile.local)
1266 .include "${.CURDIR}/Makefile.local"
1270 .for _CATEGORY in ${CATEGORIES}
1271 PKGCATEGORY?= ${_CATEGORY}
1273 _PORTDIRNAME= ${.CURDIR:T}
1274 PORTDIRNAME?= ${_PORTDIRNAME}
1275 PKGORIGIN?= ${PKGCATEGORY}/${PORTDIRNAME}
1277 # where 'make config' records user configuration options
1278 PORT_DBDIR?= /var/db/ports
1280 UID_FILES?= ${PORTSDIR}/UIDs
1281 GID_FILES?= ${PORTSDIR}/GIDs
1285 # predefined accounts from src/etc/master.passwd
1286 # alpha numeric sort order
1287 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
1289 # predefined accounts from src/etc/group
1290 # alpha numeric sort order
1291 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
1293 LDCONFIG_DIR= libdata/ldconfig
1294 LDCONFIG32_DIR= libdata/ldconfig32
1296 # At least KDE needs TMPDIR for the package building,
1297 # so we're setting it to the known default value.
1298 .if defined(PACKAGE_BUILDING)
1300 .endif # defined(PACKAGE_BUILDING)
1302 .if defined(WITH_DEBUG_PORTS)
1303 .if ${WITH_DEBUG_PORTS:M${PKGORIGIN}}
1308 .include "${PORTSDIR}/Mk/bsd.default-versions.mk"
1309 .include "${PORTSDIR}/Mk/bsd.options.mk"
1312 # End of options section.
1314 # Start of pre-makefile section.
1315 .if !defined(AFTERPORTMK) && !defined(INOPTIONSMK)
1317 .if defined(PORTNAME)
1318 .include "${PORTSDIR}/Mk/bsd.sanity.mk"
1323 .if defined(PORTVERSION)
1324 .if ${PORTVERSION:M*[-_,]*}x != x
1325 IGNORE= PORTVERSION ${PORTVERSION} may not contain '-' '_' or ','
1327 .if defined(DISTVERSION)
1328 DEV_ERROR+= "Defining both PORTVERSION and DISTVERSION is wrong, only set one, if necessary, set DISTNAME"
1330 DISTVERSION?= ${PORTVERSION:S/:/::/g}
1331 .elif defined(DISTVERSION)
1332 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}
1336 .if ${PORTREVISION} != 0
1337 _SUF1= _${PORTREVISION}
1341 .if ${PORTEPOCH} != 0
1342 _SUF2= ,${PORTEPOCH}
1345 PKGVERSION= ${PORTVERSION:C/[-_,]/./g}${_SUF1}${_SUF2}
1346 PKGNAME= ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}-${PKGVERSION}
1347 DISTVERSIONFULL= ${DISTVERSIONPREFIX}${DISTVERSION:C/:(.)/\1/g}${DISTVERSIONSUFFIX}
1348 .if defined(USE_GITHUB) && empty(MASTER_SITES:MGHC) && empty(DISTNAME) && empty(USE_GITHUB:Mnodefault)
1349 _GITHUB_MUST_SET_DISTNAME= yes
1351 DISTNAME?= ${PORTNAME}-${DISTVERSIONFULL}
1356 .if defined(USE_XORG) || defined(XORG_CAT)
1357 .include "${PORTSDIR}/Mk/bsd.xorg.mk"
1360 PACKAGES?= /usr/packages
1361 TEMPLATES?= ${PORTSDIR}/Templates
1362 KEYWORDS?= ${PORTSDIR}/Keywords
1364 PATCHDIR?= ${MASTERDIR}/files
1365 FILESDIR?= ${MASTERDIR}/files
1366 SCRIPTDIR?= ${MASTERDIR}/scripts
1367 PKGDIR?= ${MASTERDIR}
1369 PREFIX?= ${LOCALBASE}
1371 PKGCOMPATDIR?= ${LOCALBASE}/lib/compat/pkg
1373 .if defined(USE_LOCAL_MK)
1374 .include "${PORTSDIR}/Mk/bsd.local.mk"
1377 .if defined(USE_EMACS)
1378 .include "${PORTSDIR}/Mk/bsd.emacs.mk"
1381 .if defined(USE_PHP) && (!defined(USES) || ( defined(USES) && !${USES:Mphp*} ))
1382 DEV_WARNING+= "Using USE_PHP alone is deprecated, please use USES=php"
1386 .if defined(USE_FPC) || defined(WANT_FPC_BASE) || defined(WANT_FPC_ALL)
1387 .include "${PORTSDIR}/Mk/bsd.fpc.mk"
1390 .if defined(USE_JAVA)
1391 .include "${PORTSDIR}/Mk/bsd.java.mk"
1394 .if defined(USE_RUBY) || defined(USE_LIBRUBY)
1395 .include "${PORTSDIR}/Mk/bsd.ruby.mk"
1398 .if defined(USE_OCAML)
1399 .include "${PORTSDIR}/Mk/bsd.ocaml.mk"
1402 .if defined(USE_APACHE) || defined(USE_APACHE_BUILD) || defined(USE_APACHE_RUN)
1403 .include "${PORTSDIR}/Mk/bsd.apache.mk"
1406 .if defined(USE_QT4) || defined(USE_QT5)
1407 .include "${PORTSDIR}/Mk/bsd.qt.mk"
1410 .if defined(USE_TEX)
1411 .include "${PORTSDIR}/Mk/bsd.tex.mk"
1414 .if defined(USE_GECKO)
1415 .include "${PORTSDIR}/Mk/bsd.gecko.mk"
1418 .if defined(WANT_GNOME) || defined(USE_GNOME) || defined(INSTALLS_ICONS)
1422 .if defined(USE_MATE)
1426 .if defined(USE_MYSQL)
1427 USE_MYSQL:= ${USE_MYSQL:N[yY][eE][sS]:Nclient}
1428 .if defined(WANT_MYSQL_VER)
1429 .if empty(USE_MYSQL)
1430 USE_MYSQL:=${WANT_MYSQL_VER}
1432 USE_MYSQL:=${USE_MYSQL},${WANT_MYSQL_VER}
1435 USES+=mysql:${USE_MYSQL}
1438 .if defined(WANT_WX) || defined(USE_WX) || defined(USE_WX_NOT)
1439 .include "${PORTSDIR}/Mk/bsd.wx.mk"
1442 .if defined(WANT_GSTREAMER) || defined(USE_GSTREAMER) || defined(USE_GSTREAMER1)
1443 .include "${PORTSDIR}/Mk/bsd.gstreamer.mk"
1446 .if defined(USE_SDL)
1447 .include "${PORTSDIR}/Mk/bsd.sdl.mk"
1454 DESTDIRNAME?= DESTDIR
1456 # setup empty variables for USES targets
1457 .for target in sanity fetch extract patch configure build install test package stage
1464 .if !defined(${_f}_ARGS)
1465 ${_f}_ARGS:= ${f:C/^[^\:]*(\:|\$)//:S/,/ /g}
1469 .include "${USESDIR}/${f:C/\:.*//}.mk"
1472 EXTRACT_SUFX?= .tar.gz
1474 .if defined(USE_LINUX_PREFIX)
1475 PREFIX= ${LINUXBASE}
1476 DATADIR?= ${PREFIX}/usr/share/${PORTNAME}
1477 DOCSDIR?= ${PREFIX}/usr/share/doc/${PORTNAME}-${PORTVERSION}
1478 NO_LICENSES_INSTALL= yes
1482 # You can force skipping these test by defining IGNORE_PATH_CHECKS
1483 .if !defined(IGNORE_PATH_CHECKS)
1486 @${ECHO_MSG} "PREFIX must be defined as an absolute path so that when 'make'"
1487 @${ECHO_MSG} "is invoked in the work area PREFIX points to the right place."
1492 DATADIR?= ${PREFIX}/share/${PORTNAME}
1493 DOCSDIR?= ${PREFIX}/share/doc/${PORTNAME}
1494 ETCDIR?= ${PREFIX}/etc/${PORTNAME}
1495 EXAMPLESDIR?= ${PREFIX}/share/examples/${PORTNAME}
1496 WWWDIR?= ${PREFIX}/www/${PORTNAME}
1498 # Owner and group of the WWW user
1502 # Keep PKGNG_ORIGIN/WITH_PKGNG for compat with scripts which are looking for it
1503 PKG_ORIGIN?= ports-mgmt/pkg
1504 PKGNG_ORIGIN= ${PKG_ORIGIN}
1506 WITH_PKG?= ${WITH_PKGNG}
1509 # End of pre-makefile section.
1511 # Start of post-makefile section.
1512 .if !defined(BEFOREPORTMK) && !defined(INOPTIONSMK)
1514 .if defined(_POSTMKINCLUDED)
1515 DEV_ERROR+= "${PKGNAME}: Makefile error: you cannot include bsd.port[.post].mk twice"
1519 _POSTMKINCLUDED= yes
1521 .if defined(BUNDLE_LIBS)
1522 PKG_NOTES+= no_provide_shlib
1523 PKG_NOTE_no_provide_shlib= yes
1526 .if defined(DEPRECATED)
1527 PKG_NOTES+= deprecated
1528 PKG_NOTE_deprecated=${DEPRECATED}
1531 .if defined(EXPIRATION_DATE)
1532 PKG_NOTES+= expiration_date
1533 PKG_NOTE_expiration_date= ${EXPIRATION_DATE}
1538 PKG_NOTE_flavor= ${FLAVOR}
1541 TEST_ARGS?= ${MAKE_ARGS}
1542 TEST_ENV?= ${MAKE_ENV}
1544 PKG_ENV+= PORTSDIR=${PORTSDIR}
1545 CONFIGURE_ENV+= XDG_DATA_HOME=${WRKDIR} \
1546 XDG_CONFIG_HOME=${WRKDIR} \
1548 MAKE_ENV+= XDG_DATA_HOME=${WRKDIR} \
1549 XDG_CONFIG_HOME=${WRKDIR} \
1551 # Respect TMPDIR passed via make.conf or similar and pass it down
1552 # to configure and make.
1554 MAKE_ENV+= TMPDIR="${TMPDIR}"
1555 CONFIGURE_ENV+= TMPDIR="${TMPDIR}"
1556 .endif # defined(TMPDIR)
1558 QA_ENV+= STAGEDIR=${STAGEDIR} \
1560 LINUXBASE=${LINUXBASE} \
1561 LOCALBASE=${LOCALBASE} \
1563 TMPPLIST=${TMPPLIST} \
1564 BUNDLE_LIBS=${BUNDLE_LIBS} \
1565 LDCONFIG_DIR="${LDCONFIG_DIR}" \
1566 PKGORIGIN=${PKGORIGIN} \
1567 LIB_RUN_DEPENDS='${_LIB_RUN_DEPENDS:C,[^:]*:([^:]*):?.*,\1,}' \
1568 UNIFIED_DEPENDS=${_UNIFIED_DEPENDS:C,([^:]*:[^:]*):?.*,\1,:O:u:Q} \
1569 PKGBASE=${PKGBASE} \
1570 PORTNAME=${PORTNAME} \
1571 NO_ARCH=${NO_ARCH} \
1572 "NO_ARCH_IGNORE=${NO_ARCH_IGNORE}"
1573 .if !empty(USES:Mssl)
1574 QA_ENV+= USESSSL=yes
1576 .if !empty(USES:Mdesktop-file-utils)
1577 QA_ENV+= USESDESKTOPFILEUTILS=yes
1579 .if !empty(USES:Mlibtool*)
1580 QA_ENV+= USESLIBTOOL=yes
1582 .if !empty(USES:Mshared-mime-info)
1583 QA_ENV+= USESSHAREDMIMEINFO=yes
1585 .if !empty(USES:Mterminfo)
1586 QA_ENV+= USESTERMINFO=yes
1589 CO_ENV+= STAGEDIR=${STAGEDIR} \
1591 LOCALBASE=${LOCALBASE} \
1594 MTREE_FILE=${MTREE_FILE} \
1595 TMPPLIST=${TMPPLIST} \
1596 SCRIPTSDIR=${SCRIPTSDIR} \
1597 PLIST_SUB_SED="${PLIST_SUB_SED}" \
1598 PORT_OPTIONS="${PORT_OPTIONS}" \
1599 PORTSDIR="${PORTSDIR}"
1601 .if defined(CROSS_SYSROOT)
1602 PKG_ENV+= ABI_FILE=${CROSS_SYSROOT}/bin/sh
1603 MAKE_ENV+= NM=${NM} \
1604 STRIPBIN=${STRIPBIN} \
1605 PKG_CONFIG_SYSROOT_DIR="${CROSS_SYSROOT}"
1606 CONFIGURE_ENV+= PKG_CONFIG_SYSROOT_DIR="${CROSS_SYSROOT}"
1612 _WRKDIR= work-${FLAVOR}
1615 WRKDIR= ${WRKDIRPREFIX}/${.CURDIR:H:T}/${.CURDIR:T}
1616 .if !defined(IGNORE_MASTER_SITE_GITHUB) && defined(USE_GITHUB) && empty(USE_GITHUB:Mnodefault)
1617 WRKSRC?= ${WRKDIR}/${GH_PROJECT}-${GH_TAGNAME_EXTRACT}
1619 # If the distname is not extracting into a specific subdirectory, have the
1620 # ports framework force extract into a subdirectory so that metadata files
1621 # do not get in the way of the build, and vice-versa.
1622 .if defined(NO_WRKSUBDIR)
1623 # Some ports have DISTNAME=PORTNAME, and USE_RC_SUBR=PORTNAME, in those case,
1624 # the rc file will conflict with WRKSRC, as WRKSRC is artificial, make it the
1625 # most unlikely to conflict as we can.
1626 WRKSRC?= ${WRKDIR}/${PKGNAME}
1627 EXTRACT_WRKDIR:= ${WRKSRC}
1629 WRKSRC?= ${WRKDIR}/${DISTNAME}
1630 EXTRACT_WRKDIR:= ${WRKDIR}
1632 .if defined(WRKSRC_SUBDIR)
1633 WRKSRC:= ${WRKSRC}/${WRKSRC_SUBDIR}
1636 .if defined(CONFIGURE_OUTSOURCE)
1637 CONFIGURE_CMD?= ${WRKSRC}/${CONFIGURE_SCRIPT}
1638 CONFIGURE_WRKSRC?= ${WRKDIR}/.build
1639 BUILD_WRKSRC?= ${CONFIGURE_WRKSRC}
1640 INSTALL_WRKSRC?= ${CONFIGURE_WRKSRC}
1641 TEST_WRKSRC?= ${CONFIGURE_WRKSRC}
1644 PATCH_WRKSRC?= ${WRKSRC}
1645 CONFIGURE_WRKSRC?= ${WRKSRC}
1646 BUILD_WRKSRC?= ${WRKSRC}
1647 INSTALL_WRKSRC?=${WRKSRC}
1648 TEST_WRKSRC?= ${WRKSRC}
1650 PLIST_SUB+= OSREL=${OSREL} PREFIX=%D LOCALBASE=${LOCALBASE} \
1651 RESETPREFIX=${PREFIX}
1652 SUB_LIST+= PREFIX=${PREFIX} LOCALBASE=${LOCALBASE} \
1653 DATADIR=${DATADIR} DOCSDIR=${DOCSDIR} EXAMPLESDIR=${EXAMPLESDIR} \
1654 WWWDIR=${WWWDIR} ETCDIR=${ETCDIR}
1655 # This is used for check-stagedir.sh and check_leftover.sh to replace
1656 # directories/files with PLIST_SUB %%KEYS%%.
1657 # Remove VARS which values are PLIST_SUB_SED_MIN long or shorter
1658 PLIST_SUB_SED_MIN?= 2
1659 PLIST_SUB_SED_tmp1= ${PLIST_SUB:C/.*=.{1,${PLIST_SUB_SED_MIN}}$//g}
1660 # Remove VARS that are too generic
1661 # Remove empty values
1662 # Remove @comment values
1663 PLIST_SUB_SED_tmp2= ${PLIST_SUB_SED_tmp1:NEXTRACT_SUFX=*:NOSREL=*:NLIB32DIR=*:NPREFIX=*:NLOCALBASE=*:NRESETPREFIX=*:N*="":N*="@comment*}
1664 # Handle VARS for which there is a _regex entry
1665 PLIST_SUB_SED_tmp3?= ${PLIST_SUB_SED_tmp2:C/(${PLIST_SUB:M*_regex=*:C/_regex=.*/=.*/:Q:S/\\ /|/g:S/\\//g})//:C/(.*)_regex=(.*)/\1=\2/}
1667 # Replace . with \. for later sed(1) usage
1668 PLIST_SUB_SED?= ${PLIST_SUB_SED_tmp3:C/([^=]*)="?([^"]*)"?/s!\2!%%\1%%!g;/g:C/\./\\./g}
1670 # kludge to strip trailing whitespace from CFLAGS;
1671 # sub-configure will not # survive double space
1672 # remove -O from /usr/share/mk/sys.mk and replace with -O2
1673 # null out WORLD_CFLAGS coming from /etc/make.conf
1676 CFLAGS:= ${CFLAGS:C/ $//:N-O}
1681 .if defined(WITHOUT_CPU_CFLAGS)
1682 .if defined(_CPUCFLAGS)
1683 .if !empty(_CPUCFLAGS)
1684 CFLAGS:= ${CFLAGS:C/${_CPUCFLAGS}//}
1689 # Reset value from bsd.own.mk.
1690 .if defined(WITH_DEBUG) && !defined(WITHOUT_DEBUG)
1691 .if !defined(INSTALL_STRIPPED)
1693 MAKE_ENV+= DONTSTRIP=yes
1697 CFLAGS:= ${CFLAGS:N-O*:N-fno-strict*} ${DEBUG_FLAGS}
1698 .if defined(INSTALL_TARGET)
1699 INSTALL_TARGET:= ${INSTALL_TARGET:S/^install-strip$/install/g}
1703 .if !defined(WITHOUT_SSP)
1704 .include "${PORTSDIR}/Mk/bsd.ssp.mk"
1707 # XXX PIE support to be added here
1708 MAKE_ENV+= NO_PIE=yes
1709 # We prefer to pass MK_*=no but it was only supported after a certain
1710 # revision. Passing WITHOUT_* may conflict with a make.conf or src.conf's
1711 # WITH_* value. Note that ports *do* pull in src.conf.
1712 .if ${OSVERSION} >= 1003503
1713 # We will control debug files. Don't let builds that use /usr/share/mk
1714 # split out debug symbols since the plist won't know to expect it.
1715 MAKE_ENV+= MK_DEBUG_FILES=no
1716 MAKE_ENV+= MK_KERNEL_SYMBOLS=no
1718 MAKE_ENV+= WITHOUT_DEBUG_FILES=yes
1719 MAKE_ENV+= WITHOUT_KERNEL_SYMBOLS=yes
1722 .if defined(NOPORTDOCS)
1723 PLIST_SUB+= PORTDOCS="@comment "
1725 PLIST_SUB+= PORTDOCS=""
1728 .if defined(NOPORTEXAMPLES)
1729 PLIST_SUB+= PORTEXAMPLES="@comment "
1731 PLIST_SUB+= PORTEXAMPLES=""
1734 CONFIGURE_SHELL?= ${SH}
1737 CONFIGURE_ENV+= SHELL=${CONFIGURE_SHELL} CONFIG_SHELL=${CONFIGURE_SHELL}
1738 MAKE_ENV+= SHELL=${MAKE_SHELL} NO_LINT=YES
1740 .if defined(PATCHFILES) && ${PATCHFILES:M*.zip}
1741 PATCH_DEPENDS+= ${LOCALBASE}/bin/unzip:archivers/unzip
1744 # Check the compatibility layer for amd64/ia64
1746 .if defined(IA32_BINARY_PORT) && ${ARCH} != "i386"
1747 .if ${ARCH} == "amd64" || ${ARCH} == "ia64"
1748 .if !defined(HAVE_COMPAT_IA32_KERN)
1749 IGNORE= requires a kernel with compiled-in IA32 compatibility
1750 .elif !defined(HAVE_COMPAT_IA32_LIBS)
1751 IGNORE= requires 32-bit libraries installed under /usr/lib32
1756 IGNORE= requires i386 (or compatible) platform to run
1761 PLIST_SUB+= LIB32DIR=${LIB32DIR}
1763 .if ${WITH_PKG} == devel
1764 PKG_ORIGIN= ports-mgmt/pkg-devel
1767 .if !defined(PKG_DEPENDS) && !defined(CLEAN_FETCH_ENV)
1768 PKG_DEPENDS+= ${LOCALBASE}/sbin/pkg:${PKG_ORIGIN}
1771 .if defined(USE_GCC)
1772 .include "${PORTSDIR}/Mk/bsd.df.gcc.mk"
1774 . if !defined(USE_GNUSTEP)
1775 CONFIGURE_ENV+= CCVER=gcc50
1776 MAKE_ENV+= CCVER=gcc50
1780 _TEST_LD=/usr/bin/ld
1781 .if defined(LLD_UNSAFE) && ${_TEST_LD:tA} == "/usr/bin/ld.lld"
1782 LDFLAGS+= -fuse-ld=bfd
1783 . if !defined(USE_BINUTILS)
1784 . if exists(/usr/bin/ld.bfd)
1786 CONFIGURE_ENV+= LD=${LD}
1794 .if defined(USE_BINUTILS) && !defined(DISABLE_BINUTILS)
1795 BUILD_DEPENDS+= ${LOCALBASE}/bin/as:devel/binutils
1796 BINUTILS?= ADDR2LINE AR AS CPPFILT GPROF LD NM OBJCOPY OBJDUMP RANLIB \
1797 READELF SIZE STRINGS
1798 BINUTILS_NO_MAKE_ENV?=
1799 . for b in ${BINUTILS}
1800 ${b}= ${LOCALBASE}/bin/${b:C/PP/++/:tl}
1801 . if defined(GNU_CONFIGURE) || defined(BINUTILS_CONFIGURE)
1802 CONFIGURE_ENV+= ${b}="${${b}}"
1804 . if ${BINUTILS_NO_MAKE_ENV:M${b}} == ""
1805 MAKE_ENV+= ${b}="${${b}}"
1810 .if defined(USE_OPENLDAP) || defined(WANT_OPENLDAP_VER)
1811 .include "${PORTSDIR}/Mk/bsd.ldap.mk"
1814 .if defined(USE_RC_SUBR)
1815 SUB_FILES+= ${USE_RC_SUBR}
1818 .if defined(USE_LDCONFIG) && ${USE_LDCONFIG:tl} == "yes"
1819 USE_LDCONFIG= ${PREFIX}/lib
1821 .if defined(USE_LDCONFIG32) && ${USE_LDCONFIG32:tl} == "yes"
1822 IGNORE= has USE_LDCONFIG32 set to yes, which is not correct
1825 PKG_IGNORE_DEPENDS?= 'this_port_does_not_exist'
1827 _GL_gbm_LIB_DEPENDS= libgbm.so:graphics/mesa-libs
1828 _GL_glesv2_BUILD_DEPENDS= ${LOCALBASE}/lib/libGLESv2.so:graphics/mesa-libs
1829 _GL_glesv2_RUN_DEPENDS= ${LOCALBASE}/lib/libGLESv2.so:graphics/mesa-libs
1830 _GL_egl_BUILD_DEPENDS= ${LOCALBASE}/lib/libEGL.so:graphics/mesa-libs
1831 _GL_egl_RUN_DEPENDS= ${LOCALBASE}/lib/libEGL.so:graphics/mesa-libs
1832 _GL_gl_BUILD_DEPENDS= ${LOCALBASE}/lib/libGL.so:graphics/mesa-libs
1833 _GL_gl_RUN_DEPENDS= ${LOCALBASE}/lib/libGL.so:graphics/mesa-libs
1834 _GL_gl_USE_XORG= glproto dri2proto dri3proto
1835 _GL_glew_LIB_DEPENDS= libGLEW.so:graphics/glew
1836 _GL_glu_LIB_DEPENDS= libGLU.so:graphics/libGLU
1837 _GL_glu_USE_XORG= glproto dri2proto dri3proto
1838 _GL_glw_LIB_DEPENDS= libGLw.so:graphics/libGLw
1839 _GL_glut_LIB_DEPENDS= libglut.so:graphics/freeglut
1841 . if ${USE_GL:tl} == "yes"
1844 . for _component in ${USE_GL}
1845 . if !defined(_GL_${_component}_LIB_DEPENDS) && \
1846 !defined(_GL_${_component}_RUN_DEPENDS)
1847 IGNORE= uses unknown GL component
1849 USE_XORG+= ${_GL_${_component}_USE_XORG}
1850 BUILD_DEPENDS+= ${_GL_${_component}_BUILD_DEPENDS}
1851 LIB_DEPENDS+= ${_GL_${_component}_LIB_DEPENDS}
1852 RUN_DEPENDS+= ${_GL_${_component}_RUN_DEPENDS}
1857 .if defined(_DESTDIR_VIA_ENV)
1858 MAKE_ENV+= ${DESTDIRNAME}=${STAGEDIR}
1860 MAKE_ARGS+= ${DESTDIRNAME}=${STAGEDIR}
1863 .if defined(NO_PREFIX_RMDIR)
1864 CO_ENV+= NO_PREFIX_RMDIR=1
1866 CO_ENV+= NO_PREFIX_RMDIR=0
1870 METADIR= ${WRKDIR}/.metadir
1872 PKGPREINSTALL?= ${PKGDIR}/pkg-pre-install
1873 PKGPOSTINSTALL?= ${PKGDIR}/pkg-post-install
1874 PKGPREDEINSTALL?= ${PKGDIR}/pkg-pre-deinstall
1875 PKGPOSTDEINSTALL?= ${PKGDIR}/pkg-post-deinstall
1876 PKGPREUPGRADE?= ${PKGDIR}/pkg-pre-upgrade
1877 PKGPOSTUPGRADE?= ${PKGDIR}/pkg-post-upgrade
1878 PKGUPGRADE?= ${PKGDIR}/pkg-upgrade
1880 _FORCE_POST_PATTERNS= rmdir kldxref mkfontscale mkfontdir fc-cache \
1881 fonts.dir fonts.scale gtk-update-icon-cache \
1883 gtk-query-immodules \
1887 update-desktop-database update-mime-database \
1888 gdk-pixbuf-query-loaders catalog.ports \
1889 glib-compile-schemas \
1892 .if defined(USE_LOCAL_MK)
1893 .include "${PORTSDIR}/Mk/bsd.local.mk"
1896 .if defined(USE_XORG) || defined(XORG_CAT)
1897 .include "${PORTSDIR}/Mk/bsd.xorg.mk"
1900 .if defined(WANT_GSTREAMER) || defined(USE_GSTREAMER) || defined(USE_GSTREAMER1)
1901 .include "${PORTSDIR}/Mk/bsd.gstreamer.mk"
1904 .if defined(USE_JAVA)
1905 .include "${PORTSDIR}/Mk/bsd.java.mk"
1908 .if defined(USE_OCAML)
1909 .include "${PORTSDIR}/Mk/bsd.ocaml.mk"
1912 .if defined(USE_QT4) || defined(USE_QT5)
1913 .include "${PORTSDIR}/Mk/bsd.qt.mk"
1916 .if defined(USE_SDL)
1917 .include "${PORTSDIR}/Mk/bsd.sdl.mk"
1920 .if defined(USE_PHP) && (!defined(USES) || ( defined(USES) && !${USES:Mphp*} ))
1921 DEV_WARNING+= "Using USE_PHP alone is deprecated, please use USES=php"
1925 .if defined(USE_WX) || defined(USE_WX_NOT)
1926 .include "${PORTSDIR}/Mk/bsd.wx.mk"
1929 .if defined(USE_APACHE) || defined(USE_APACHE_BUILD) || defined(USE_APACHE_RUN)
1930 .include "${PORTSDIR}/Mk/bsd.apache.mk"
1933 .if defined(USE_AUTOTOOLS)
1934 .include "${PORTSDIR}/Mk/bsd.autotools.mk"
1937 .if defined(USE_FPC) || defined(WANT_FPC_BASE) || defined(WANT_FPC_ALL)
1938 .include "${PORTSDIR}/Mk/bsd.fpc.mk"
1941 .if defined(USE_GECKO)
1942 .include "${PORTSDIR}/Mk/bsd.gecko.mk"
1945 .if exists(${PORTSDIR}/Makefile.inc)
1946 .include "${PORTSDIR}/Makefile.inc"
1951 .for f in ${_USES_POST}
1953 .if !defined(${_f}_ARGS)
1954 ${_f}_ARGS:= ${f:C/^[^\:]*(\:|\$)//:S/,/ /g}
1957 .for f in ${_USES_POST}
1958 .include "${USESDIR}/${f:C/\:.*//}.mk"
1961 .if defined(USE_LOCALE)
1962 CONFIGURE_ENV+= LANG=${USE_LOCALE} LC_ALL=${USE_LOCALE}
1963 MAKE_ENV+= LANG=${USE_LOCALE} LC_ALL=${USE_LOCALE}
1966 .if defined(USE_XORG)
1967 # Add explicit X options to avoid problems with false positives in configure
1968 .if defined(GNU_CONFIGURE)
1969 CONFIGURE_ARGS+=--x-libraries=${LOCALBASE}/lib --x-includes=${LOCALBASE}/include
1973 # Macro for doing in-place file editing using regexps
1974 REINPLACE_ARGS?= -i.bak
1975 REINPLACE_CMD?= ${SED} ${REINPLACE_ARGS}
1977 # Names of cookies used to skip already completed stages
1978 EXTRACT_COOKIE?= ${WRKDIR}/.extract_done.${PORTNAME}.${PREFIX:S/\//_/g}
1979 CONFIGURE_COOKIE?= ${WRKDIR}/.configure_done.${PORTNAME}.${PREFIX:S/\//_/g}
1980 INSTALL_COOKIE?= ${WRKDIR}/.install_done.${PORTNAME}.${PREFIX:S/\//_/g}
1981 BUILD_COOKIE?= ${WRKDIR}/.build_done.${PORTNAME}.${PREFIX:S/\//_/g}
1982 PATCH_COOKIE?= ${WRKDIR}/.patch_done.${PORTNAME}.${PREFIX:S/\//_/g}
1983 PACKAGE_COOKIE?= ${WRKDIR}/.package_done.${PORTNAME}.${PREFIX:S/\//_/g}
1984 STAGE_COOKIE?= ${WRKDIR}/.stage_done.${PORTNAME}.${PREFIX:S/\//_/g}
1986 # How to do nothing. Override if you, for some strange reason, would rather
1990 # Use this as the first operand to always build dependency.
1991 NONEXISTENT?= /nonexistent
1993 CHECKSUM_ALGORITHMS?= sha256
1995 DISTINFO_FILE?= ${MASTERDIR}/distinfo
1999 MAKE_CMD?= ${BSDMAKE}
2000 PLIST_SUB:= ${PLIST_SUB:NPROFILE=*} PROFILE="@comment "
2001 MAKE_ENV+= PREFIX=${PREFIX} \
2002 LOCALBASE=${LOCALBASE} \
2003 LIBDIR="${LIBDIR}" \
2005 CC="${CC}" CFLAGS="${CFLAGS}" \
2006 CPP="${CPP}" CPPFLAGS="${CPPFLAGS}" \
2007 LDFLAGS="${LDFLAGS}" LIBS="${LIBS}" \
2008 CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" \
2009 MANPREFIX="${MANPREFIX}"
2011 # Add -fno-strict-aliasing to CFLAGS with optimization level -O2 or higher.
2012 # gcc 4.x enable strict aliasing optimization with -O2 which is known to break
2014 .if !defined(WITHOUT_NO_STRICT_ALIASING)
2016 .if empty(CFLAGS:M-fno-strict-aliasing)
2017 CFLAGS+= -fno-strict-aliasing
2023 .if defined(USE_${lang}STD)
2024 ${lang}FLAGS:= ${${lang}FLAGS:N-std=*} -std=${USE_${lang}STD}
2027 .if defined(${lang}FLAGS_${ARCH})
2028 ${lang}FLAGS+= ${${lang}FLAGS_${ARCH}}
2032 # Multiple make jobs support
2033 .if defined(DISABLE_MAKE_JOBS) || defined(MAKE_JOBS_UNSAFE)
2037 .if defined(MAKE_JOBS_NUMBER)
2038 _MAKE_JOBS_NUMBER:= ${MAKE_JOBS_NUMBER}
2040 .if !defined(_SMP_CPUS)
2041 _SMP_CPUS!= ${SYSCTL} -n hw.ncpu
2043 _EXPORTED_VARS+= _SMP_CPUS
2044 _MAKE_JOBS_NUMBER= ${_SMP_CPUS}
2046 .if defined(MAKE_JOBS_NUMBER_LIMIT) && ( ${MAKE_JOBS_NUMBER_LIMIT} < ${_MAKE_JOBS_NUMBER} )
2047 MAKE_JOBS_NUMBER= ${MAKE_JOBS_NUMBER_LIMIT}
2049 MAKE_JOBS_NUMBER= ${_MAKE_JOBS_NUMBER}
2051 _MAKE_JOBS?= -j${MAKE_JOBS_NUMBER}
2052 BUILD_FAIL_MESSAGE+= Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to the maintainer.
2055 .include "${PORTSDIR}/Mk/bsd.ccache.mk"
2058 FETCH_ENV?= SSL_NO_VERIFY_PEER=1 SSL_NO_VERIFY_HOSTNAME=1
2060 FETCH_BINARY?= /usr/bin/fetch
2063 FETCH_CMD?= ${FETCH_BINARY} ${FETCH_ARGS}
2065 .if defined(RANDOMIZE_MASTER_SITES)
2066 .if exists(/usr/games/random)
2067 RANDOM_CMD?= /usr/games/random
2068 RANDOM_ARGS?= -w -f -
2069 _RANDOMIZE_SITES= |${RANDOM_CMD} ${RANDOM_ARGS}
2073 TOUCH?= /usr/bin/touch
2076 DISTORIG?= .bak.orig
2077 PATCH?= /usr/bin/patch
2079 PATCH_DIST_STRIP?= -p0
2080 .if defined(PATCH_DEBUG)
2081 PATCH_DEBUG_TMP= yes
2082 PATCH_ARGS?= -E ${PATCH_STRIP}
2083 PATCH_DIST_ARGS?= --suffix ${DISTORIG} -E ${PATCH_DIST_STRIP}
2085 PATCH_ARGS?= --forward --quiet -E ${PATCH_STRIP}
2086 PATCH_DIST_ARGS?= --suffix ${DISTORIG} --forward --quiet -E ${PATCH_DIST_STRIP}
2089 PATCH_SILENT= PATCH_SILENT=yes
2092 PATCH_ARGS+= --batch
2093 PATCH_DIST_ARGS+= --batch
2096 # Prevent breakage with VERSION_CONTROL=numbered
2097 PATCH_ARGS+= -V simple
2098 PATCH_DIST_ARGS+= -V simple
2100 .if defined(PATCH_CHECK_ONLY)
2102 PATCH_DIST_ARGS+= -C
2105 .if ${PATCH} == "/usr/bin/patch"
2106 PATCH_ARGS+= --suffix .orig
2107 PATCH_DIST_ARGS+= --suffix .orig
2112 # EXTRACT_SUFX is defined in .pre.mk section
2113 EXTRACT_CMD?= ${TAR}
2114 EXTRACT_BEFORE_ARGS?= -xf
2115 EXTRACT_AFTER_ARGS?= --no-same-owner --no-same-permissions
2117 # Figure out where the local mtree file is
2118 .if !defined(MTREE_FILE) && !defined(NO_MTREE)
2119 .if ${PREFIX} == /usr
2120 MTREE_FILE= /etc/mtree/BSD.usr.dist
2122 MTREE_FILE= ${PORTSDIR}/Templates/BSD.local.dist
2125 MTREE_CMD?= /usr/sbin/mtree
2126 MTREE_ARGS?= -U ${MTREE_FOLLOWS_SYMLINKS} -f ${MTREE_FILE} -d -e -p
2130 # A few aliases for *-install targets
2131 INSTALL_PROGRAM= ${INSTALL} ${COPY} ${STRIP} -m ${BINMODE}
2132 INSTALL_KLD= ${INSTALL} ${COPY} -m ${BINMODE}
2133 INSTALL_LIB= ${INSTALL} ${COPY} ${STRIP} -m ${_SHAREMODE}
2134 INSTALL_SCRIPT= ${INSTALL} ${COPY} -m ${BINMODE}
2135 INSTALL_DATA= ${INSTALL} ${COPY} -m ${_SHAREMODE}
2136 INSTALL_MAN= ${INSTALL} ${COPY} -m ${MANMODE}
2138 INSTALL_MACROS= BSD_INSTALL_PROGRAM="${INSTALL_PROGRAM}" \
2139 BSD_INSTALL_LIB="${INSTALL_LIB}" \
2140 BSD_INSTALL_SCRIPT="${INSTALL_SCRIPT}" \
2141 BSD_INSTALL_DATA="${INSTALL_DATA}" \
2142 BSD_INSTALL_MAN="${INSTALL_MAN}"
2143 MAKE_ENV+= ${INSTALL_MACROS}
2144 SCRIPTS_ENV+= ${INSTALL_MACROS}
2146 # Macro for copying entire directory tree with correct permissions
2147 # In the -exec shell commands, we add add a . as the first argument, it would
2148 # end up being $0 aka the script name, which is not part of $@, so we force it
2149 # to be able to use $@ directly.
2150 COPYTREE_BIN= ${SH} -c '(${FIND} -Ed $$0 $$2 | ${CPIO} -dumpl $$1 >/dev/null 2>&1) && \
2151 ${FIND} -Ed $$0 $$2 \( -type d -exec ${SH} -c '\''cd '\''$$1'\'' && chmod 755 "$$@"'\'' -- . {} + \
2152 -o -type f -exec ${SH} -c '\''cd '\''$$1'\'' && chmod ${BINMODE} "$$@"'\'' -- . {} + \)' --
2153 COPYTREE_SHARE= ${SH} -c '(${FIND} -Ed $$0 $$2 | ${CPIO} -dumpl $$1 >/dev/null 2>&1) && \
2154 ${FIND} -Ed $$0 $$2 \( -type d -exec ${SH} -c '\''cd '\''$$1'\'' && chmod 755 "$$@"'\'' -- . {} + \
2155 -o -type f -exec ${SH} -c '\''cd '\''$$1'\'' && chmod ${_SHAREMODE} "$$@"'\'' -- . {} + \)' --
2157 # The user can override the NO_PACKAGE by specifying this from
2158 # the make command line
2159 .if defined(FORCE_PACKAGE)
2163 DESCR?= ${PKGDIR}/pkg-descr
2164 PLIST?= ${PKGDIR}/pkg-plist
2165 PKGHELP?= ${PKGDIR}/pkg-help
2166 PKGINSTALL?= ${PKGDIR}/pkg-install
2167 PKGDEINSTALL?= ${PKGDIR}/pkg-deinstall
2168 PKGREQ?= ${PKGDIR}/pkg-req
2169 PKGMESSAGE?= ${PKGDIR}/pkg-message
2170 _PKGMESSAGES+= ${PKGMESSAGE}
2172 TMPPLIST?= ${WRKDIR}/.PLIST.mktmp
2174 .if defined(PKG_NOCOMPRESS)
2179 # where pkg_add records its dirty deeds.
2180 PKG_DBDIR?= /var/db/pkg
2183 INSTALL_TARGET?= install
2184 INSTALL_TARGET+= ${LATE_INSTALL_ARGS}
2186 # Integrate with the license auditing framework
2187 .if !defined (DISABLE_LICENSES)
2188 .include "${PORTSDIR}/Mk/bsd.licenses.mk"
2191 # Popular master sites
2192 .include "${PORTSDIR}/Mk/bsd.sites.mk"
2194 # Empty declaration to avoid "variable MASTER_SITES recursive" error
2197 _MASTER_SITES_DEFAULT?=
2198 _PATCH_SITES_DEFAULT?=
2200 # Feed internal _{MASTER,PATCH}_SITES_n where n is a group designation
2201 # as per grouping rules (:something)
2202 # Organize _{MASTER,PATCH}_SITES_{DEFAULT,[^/:]+} according to grouping
2203 # rules (:something)
2204 .for _S in ${MASTER_SITES}
2205 _S_TEMP= ${_S:S/^${_S:C@/?:[^/:]+$@/@}//:S/^://}
2206 . if !empty(_S_TEMP)
2207 . for _group in ${_S_TEMP:S/,/ /g}
2209 . if ${_G_TEMP:C/[a-zA-Z0-9_]//g}
2211 @${ECHO_MSG} "The ${_S} MASTER_SITES line has"
2212 @${ECHO_MSG} "a group with invalid characters, only use [a-zA-Z0-9_]"
2215 . if ${_G_TEMP} == all || ${_G_TEMP} == ALL || ${_G_TEMP} == default
2217 @${ECHO_MSG} "Makefile error: the words all, ALL and default are reserved and cannot be"
2218 @${ECHO_MSG} "used in group definitions. Please fix your MASTER_SITES"
2221 _MASTER_SITES_${_group}+= ${_S:C@^(.*/):[^/:]+$@\1@}
2224 _MASTER_SITES_DEFAULT+= ${_S:C@^(.*/):[^/:]+$@\1@}
2227 .for _S in ${PATCH_SITES}
2228 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://}
2229 . if !empty(_S_TEMP)
2230 . for _group in ${_S_TEMP:S/,/ /g}
2232 . if ${_G_TEMP:C/[a-zA-Z0-9_]//g}
2234 @${ECHO_MSG} "The ${_S} PATCH_SITES line has"
2235 @${ECHO_MSG} "a group with invalid characters, only use [a-zA-Z0-9_]"
2238 . if ${_G_TEMP} == all || ${_G_TEMP} == ALL || ${_G_TEMP} == default
2240 @${ECHO_MSG} "The words all, ALL and default are reserved and cannot be"
2241 @${ECHO_MSG} "used in group definitions. Please fix your PATCH_SITES"
2244 _PATCH_SITES_${_group}+= ${_S:C@^(.*/):[^/:]+$@\1@}
2247 _PATCH_SITES_DEFAULT+= ${_S:C@^(.*/):[^/:]+$@\1@}
2251 # Feed internal _{MASTER,PATCH}_SITE_SUBDIR_n where n is a group designation
2252 # as per grouping rules (:something)
2253 # Organize _{MASTER,PATCH}_SITE_SUBDIR_{DEFAULT,[^/:]+} according to grouping
2254 # rules (:something)
2255 .for _S in ${MASTER_SITE_SUBDIR}
2256 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://}
2257 . if !empty(_S_TEMP)
2258 . for _group in ${_S_TEMP:S/,/ /g}
2260 . if ${_G_TEMP} == all || ${_G_TEMP} == ALL || ${_G_TEMP} == default
2262 @${ECHO_MSG} "Makefile error: the words all, ALL and default are reserved and cannot be"
2263 @${ECHO_MSG} "used in group definitions. Please fix your MASTER_SITE_SUBDIR"
2266 . if defined(_MASTER_SITES_${_group})
2267 _MASTER_SITE_SUBDIR_${_group}+= ${_S:C@^(.*)/:[^/:]+$@\1@}
2271 . if defined(_MASTER_SITES_DEFAULT)
2272 _MASTER_SITE_SUBDIR_DEFAULT+= ${_S:C@^(.*)/:[^/:]+$@\1@}
2276 .for _S in ${PATCH_SITE_SUBDIR}
2277 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://}
2278 . if !empty(_S_TEMP)
2279 . for _group in ${_S_TEMP:S/,/ /g}
2281 . if ${_G_TEMP} == all || ${_G_TEMP} == ALL || ${_G_TEMP} == default
2283 @${ECHO_MSG} "Makefile error: the words all, ALL and default are reserved and cannot be"
2284 @${ECHO_MSG} "used in group definitions. Please fix your PATCH_SITE_SUBDIR"
2287 . if defined(_PATCH_SITES_${_group})
2288 _PATCH_SITE_SUBDIR_${_group}+= ${_S:C@^(.*)/:[^/:]+$@\1@}
2292 . if defined(_PATCH_SITES_DEFAULT)
2293 _PATCH_SITE_SUBDIR_DEFAULT+= ${_S:C@^(.*)/:[^/:]+$@\1@}
2298 # Substitute subdirectory names
2299 # XXX simpler/faster solution but not the best space wise, suggestions please
2300 .for _S in ${MASTER_SITES}
2301 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://}
2302 . if !empty(_S_TEMP)
2303 . for _group in ${_S_TEMP:S/,/ /g}
2304 . if !defined(_MASTER_SITE_SUBDIR_${_group})
2305 MASTER_SITES_TMP= ${_MASTER_SITES_${_group}:S^%SUBDIR%/^^}
2307 _S_TEMP_TEMP= ${_MASTER_SITES_${_group}:M*%SUBDIR%/*}
2308 . if empty(_S_TEMP_TEMP)
2309 MASTER_SITES_TMP= ${_MASTER_SITES_${_group}}
2312 . for site in ${_MASTER_SITES_${_group}}
2313 _S_TEMP_TEMP= ${site:M*%SUBDIR%/*}
2314 . if empty(_S_TEMP_TEMP)
2315 MASTER_SITES_TMP+= ${site}
2317 . for dir in ${_MASTER_SITE_SUBDIR_${_group}}
2318 MASTER_SITES_TMP+= ${site:S^%SUBDIR%^\${dir}^}
2324 _MASTER_SITES_${_group}:= ${MASTER_SITES_TMP}
2328 .if defined(_MASTER_SITE_SUBDIR_DEFAULT)
2329 _S_TEMP= ${_MASTER_SITES_DEFAULT:M*%SUBDIR%/*}
2331 MASTER_SITES_TMP= ${_MASTER_SITES_DEFAULT}
2334 . for site in ${_MASTER_SITES_DEFAULT}
2335 _S_TEMP_TEMP= ${site:M*%SUBDIR%/*}
2336 . if empty(_S_TEMP_TEMP)
2337 MASTER_SITES_TMP+= ${site}
2339 . for dir in ${_MASTER_SITE_SUBDIR_DEFAULT}
2340 MASTER_SITES_TMP+= ${site:S^%SUBDIR%^\${dir}^}
2346 MASTER_SITES_TMP= ${_MASTER_SITES_DEFAULT:S^%SUBDIR%/^^}
2348 _MASTER_SITES_DEFAULT:= ${MASTER_SITES_TMP}
2350 .for _S in ${PATCH_SITES}
2351 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://}
2352 . if !empty(_S_TEMP)
2353 . for _group in ${_S_TEMP:S/,/ /g}
2354 . if !defined(_PATCH_SITE_SUBDIR_${_group})
2355 PATCH_SITES_TMP= ${_PATCH_SITES_${_group}:S^%SUBDIR%/^^}
2357 _S_TEMP_TEMP= ${_PATCH_SITES_${_group}:M*%SUBDIR%/*}
2358 . if empty(_S_TEMP_TEMP)
2359 PATCH_SITES_TMP= ${_PATCH_SITES_${_group}}
2362 . for site in ${_PATCH_SITES_${_group}}
2363 _S_TEMP_TEMP= ${site:M*%SUBDIR%/*}
2364 . if empty(_S_TEMP_TEMP)
2365 PATCH_SITES_TMP+= ${site}
2367 . for dir in ${_PATCH_SITE_SUBDIR_${_group}}
2368 PATCH_SITES_TMP+= ${site:S^%SUBDIR%^\${dir}^}
2374 _PATCH_SITES_${_group}:= ${PATCH_SITES_TMP}
2378 .if defined(_PATCH_SITE_SUBDIR_DEFAULT)
2379 _S_TEMP= ${_PATCH_SITES_DEFAULT:M*%SUBDIR%/*}
2381 PATCH_SITES_TMP= ${_PATCH_SITES_DEFAULT}
2384 . for site in ${_PATCH_SITES_DEFAULT}
2385 _S_TEMP_TEMP= ${site:M*%SUBDIR%/*}
2386 . if empty(_S_TEMP_TEMP)
2387 PATCH_SITES_TMP+= ${site}
2389 . for dir in ${_PATCH_SITE_SUBDIR_DEFAULT}
2390 PATCH_SITES_TMP+= ${site:S^%SUBDIR%^\${dir}^}
2396 PATCH_SITES_TMP= ${_PATCH_SITES_DEFAULT:S^%SUBDIR%/^^}
2398 _PATCH_SITES_DEFAULT:= ${PATCH_SITES_TMP}
2401 # The primary backup site.
2402 MASTER_SITE_BACKUP?= \
2403 http://distcache.FreeBSD.org/ports-distfiles/${DIST_SUBDIR}/
2404 MASTER_SITE_BACKUP:= ${MASTER_SITE_BACKUP:S^\${DIST_SUBDIR}/^^}
2406 # If the user has MASTER_SITE_FREEBSD set, go to the FreeBSD repository
2407 # for everything, but don't search it twice by appending it to the end.
2408 .if defined(MASTER_SITE_FREEBSD)
2409 _MASTER_SITE_OVERRIDE:= ${MASTER_SITE_BACKUP}
2410 _MASTER_SITE_BACKUP:= # empty
2412 _MASTER_SITE_OVERRIDE= ${MASTER_SITE_OVERRIDE}
2413 _MASTER_SITE_BACKUP= ${MASTER_SITE_BACKUP}
2418 # Organize DISTFILES, PATCHFILES, _MASTER_SITES_ALL, _PATCH_SITES_ALL
2419 # according to grouping rules (:something)
2420 DISTFILES?= ${DISTNAME}${EXTRACT_SUFX}
2421 _MASTER_SITES_ALL= ${_MASTER_SITES_DEFAULT}
2422 _PATCH_SITES_ALL= ${_PATCH_SITES_DEFAULT}
2424 .for _D in ${DISTFILES}
2425 _D_TEMP= ${_D:S/^${_D:C/:[^:]+$//}//}
2426 . if !empty(_D_TEMP)
2427 . for _group in ${_D_TEMP:S/^://:S/,/ /g}
2428 . if !defined(_MASTER_SITES_${_group})
2429 _G_TEMP_TEMP= ${_G_TEMP:M/${_group}/}
2430 . if empty(_G_TEMP_TEMP)
2432 _MASTER_SITES_ALL+= ${_MASTER_SITES_${_group}}
2436 _DISTFILES+= ${_D:C/:[^:]+$//}
2442 .for _P in ${PATCHFILES}
2443 _P_TEMP= ${_P:C/:[^-:][^:]*$//}
2444 _P_groups= ${_P:S/^${_P:C/:[^:]+$//}//:S/^://}
2445 _P_file= ${_P_TEMP:C/:-[^:]+$//}
2446 _P_strip= ${_P_TEMP:S/^${_P_TEMP:C/:-[^:]*$//}//:S/^://}
2447 . if !empty(_P_groups)
2448 . for _group in ${_P_groups:S/,/ /g}
2449 . if !defined(_PATCH_SITES_${_group})
2450 _G_TEMP_TEMP= ${_G_TEMP:M/${_group}/}
2451 . if empty(_G_TEMP_TEMP)
2453 _PATCH_SITES_ALL+= ${_PATCH_SITES_${_group}}
2458 _PATCHFILES:= ${_PATCHFILES} ${_P_file}
2459 . if empty(_P_strip)
2460 _PATCHFILES2:= ${_PATCHFILES2} ${_P_file}
2462 _PATCHFILES2:= ${_PATCHFILES2} ${_P_file}:${_P_strip}
2470 ALLFILES?= ${_DISTFILES} ${_PATCHFILES}
2473 # Sort the master site list according to the patterns in MASTER_SORT
2477 MASTER_SORT_REGEX+= ${MASTER_SORT:S|.|\\.|g:S|^|://[^/]*|:S|$|/|}
2479 MASTER_SORT_AWK= BEGIN { RS = " "; ORS = " "; IGNORECASE = 1 ; gl = "${MASTER_SORT_REGEX:S|\\|\\\\|g}"; }
2480 .for srt in ${MASTER_SORT_REGEX}
2481 MASTER_SORT_AWK+= /${srt:S|/|\\/|g}/ { good["${srt:S|\\|\\\\|g}"] = good["${srt:S|\\|\\\\|g}"] " " $$0 ; next; }
2483 MASTER_SORT_AWK+= { rest = rest " " $$0; } END { n=split(gl, gla); for(i=1;i<=n;i++) { print good[gla[i]]; } print rest; }
2486 # Hackery to enable simple fetch targets with several dynamic MASTER_SITES
2488 _MASTER_SITES_ENV= _MASTER_SITES_DEFAULT=${_MASTER_SITES_DEFAULT:Q}
2489 .for _F in ${DISTFILES}
2490 _F_TEMP= ${_F:S/^${_F:C/:[^:]+$//}//:S/^://}
2491 . if !empty(_F_TEMP)
2492 . for _group in ${_F_TEMP:S/,/ /g}
2493 . if defined(_MASTER_SITES_${_group})
2494 _MASTER_SITES_ENV+= _MASTER_SITES_${_group}=${_MASTER_SITES_${_group}:Q}
2499 _PATCH_SITES_ENV= _PATCH_SITES_DEFAULT=${_PATCH_SITES_DEFAULT:Q}
2500 .for _F in ${PATCHFILES}
2501 _F_TEMP= ${_F:S/^${_F:C/:[^-:][^:]*$//}//:S/^://}
2502 . if !empty(_F_TEMP)
2503 . for _group in ${_F_TEMP:S/,/ /g}
2504 . if defined(_PATCH_SITES_${_group})
2505 _PATCH_SITES_ENV+= _PATCH_SITES_${_group}=${_PATCH_SITES_${_group}:Q}
2511 CKSUMFILES= ${ALLFILES}
2513 # List of all files, with ${DIST_SUBDIR} in front. Used for checksum.
2514 .if defined(DIST_SUBDIR)
2515 .if defined(CKSUMFILES) && ${CKSUMFILES}!=""
2516 _CKSUMFILES?= ${CKSUMFILES:S/^/${DIST_SUBDIR}\//}
2519 _CKSUMFILES?= ${CKSUMFILES}
2522 # This is what is actually going to be extracted, and is overridable
2524 EXTRACT_ONLY?= ${_DISTFILES}
2526 .if !target(maintainer)
2528 @${ECHO_CMD} "${MAINTAINER}"
2531 .if !defined(CATEGORIES)
2533 @${ECHO_MSG} "${PKGNAME}: Makefile error: CATEGORIES is mandatory."
2537 VALID_CATEGORIES+= accessibility afterstep arabic archivers astro audio \
2538 benchmarks biology cad chinese comms converters databases \
2539 deskutils devel docs dns editors elisp emulators enlightenment finance french ftp \
2540 games geography german gnome gnustep graphics hamradio haskell hebrew hungarian \
2541 ipv6 irc japanese java kde ${_KDE_CATEGORIES_SUPPORTED} kld korean lang linux lisp \
2542 mail mate math mbone misc multimedia net net-im net-mgmt net-p2p news \
2543 palm parallel pear perl5 plan9 polish portuguese ports-mgmt \
2544 print python ruby rubygems russian \
2545 scheme science security shells spanish sysutils \
2547 ukrainian vietnamese windowmaker wayland www \
2548 x11 x11-clocks x11-drivers x11-fm x11-fonts x11-servers x11-themes \
2549 x11-toolkits x11-wm xfce zope
2552 .for cat in ${CATEGORIES}
2553 . if empty(VALID_CATEGORIES:M${cat})
2554 @${ECHO_MSG} "${PKGNAME}: Makefile error: category ${cat} not in list of valid categories."; \
2560 PKGREPOSITORYSUBDIR?= All
2561 PKGREPOSITORY?= ${PACKAGES}/${PKGREPOSITORYSUBDIR}
2562 .if exists(${PACKAGES})
2563 PACKAGES:= ${PACKAGES:S/:/\:/g}
2565 PKGFILE?= ${PKGREPOSITORY}/${PKGNAME}${PKG_SUFX}
2567 PKGFILE?= ${.CURDIR}/${PKGNAME}${PKG_SUFX}
2569 WRKDIR_PKGFILE= ${WRKDIR}/pkg/${PKGNAME}${PKG_SUFX}
2571 # The "latest version" link -- ${PKGNAME} minus everthing after the last '-'
2572 PKGLATESTREPOSITORY?= ${PACKAGES}/Latest
2573 PKGBASE?= ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}
2574 PKGLATESTFILE= ${PKGLATESTREPOSITORY}/${PKGBASE}${PKG_SUFX}
2576 CONFIGURE_SCRIPT?= configure
2577 CONFIGURE_CMD?= ./${CONFIGURE_SCRIPT}
2578 CONFIGURE_TARGET?= ${ARCH}-portbld-${OPSYS:tl}${OSREL}
2579 CONFIGURE_TARGET:= ${CONFIGURE_TARGET:S/--build=//}
2580 CONFIGURE_LOG?= config.log
2582 # A default message to print if do-configure fails.
2583 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)."
2585 .if defined(GNU_CONFIGURE)
2586 # Maximum command line length
2587 .if !defined(CONFIGURE_MAX_CMD_LEN)
2588 CONFIGURE_MAX_CMD_LEN= 262144
2590 _EXPORTED_VARS+= CONFIGURE_MAX_CMD_LEN
2591 GNU_CONFIGURE_PREFIX?= ${PREFIX}
2592 GNU_CONFIGURE_MANPREFIX?= ${MANPREFIX}
2593 CONFIG_SITE?= ${PORTSDIR}/Templates/config.site
2594 CONFIGURE_ARGS+= --prefix=${GNU_CONFIGURE_PREFIX} $${_LATE_CONFIGURE_ARGS}
2595 .if defined(CROSS_TOOLCHAIN)
2596 CROSS_HOST= ${CROSS_TOOLCHAIN:C,-.*$,,}-${OPSYS:tl}
2597 CONFIGURE_ARGS+= --host=${CROSS_HOST}
2599 CONFIGURE_ENV+= CONFIG_SITE=${CONFIG_SITE} lt_cv_sys_max_cmd_len=${CONFIGURE_MAX_CMD_LEN}
2602 SET_LATE_CONFIGURE_ARGS= \
2603 _LATE_CONFIGURE_ARGS="" ; \
2604 if [ -z "${CONFIGURE_ARGS:M--localstatedir=*:Q}" ] && \
2605 ${CONFIGURE_CMD} --help 2>&1 | ${GREP} -- --localstatedir > /dev/null; then \
2606 _LATE_CONFIGURE_ARGS="$${_LATE_CONFIGURE_ARGS} --localstatedir=/var" ; \
2608 if [ ! -z "`${CONFIGURE_CMD} --help 2>&1 | ${GREP} -- '--mandir'`" ]; then \
2609 _LATE_CONFIGURE_ARGS="$${_LATE_CONFIGURE_ARGS} --mandir=${GNU_CONFIGURE_MANPREFIX}/man" ; \
2611 if [ ! -z "`${CONFIGURE_CMD} --help 2>&1 | ${GREP} -- '--disable-silent-rules'`" ]; then \
2612 _LATE_CONFIGURE_ARGS="$${_LATE_CONFIGURE_ARGS} --disable-silent-rules" ; \
2614 if [ ! -z "`${CONFIGURE_CMD} --help 2>&1 | ${GREP} -- '--enable-jobserver\[.*\#\]'`" ]; then \
2615 _LATE_CONFIGURE_ARGS="$${_LATE_CONFIGURE_ARGS} --enable-jobserver=${MAKE_JOBS_NUMBER}" ; \
2617 if [ ! -z "`${CONFIGURE_CMD} --help 2>&1 | ${GREP} -- '--infodir'`" ]; then \
2618 _LATE_CONFIGURE_ARGS="$${_LATE_CONFIGURE_ARGS} --infodir=${GNU_CONFIGURE_PREFIX}/${INFO_PATH}/${INFO_SUBDIR}" ; \
2620 if [ -z "`${CONFIGURE_CMD} --version 2>&1 | ${EGREP} -i '(autoconf.*2\.13|Unrecognized option)'`" ]; then \
2621 _LATE_CONFIGURE_ARGS="$${_LATE_CONFIGURE_ARGS} --build=${CONFIGURE_TARGET}" ; \
2623 _LATE_CONFIGURE_ARGS="$${_LATE_CONFIGURE_ARGS} ${CONFIGURE_TARGET}" ; \
2627 # Passed to most of script invocations
2628 SCRIPTS_ENV+= CURDIR=${MASTERDIR} DISTDIR=${DISTDIR} \
2629 WRKDIR=${WRKDIR} WRKSRC=${WRKSRC} PATCHDIR=${PATCHDIR} \
2630 SCRIPTDIR=${SCRIPTDIR} FILESDIR=${FILESDIR} \
2631 DFLY_PATCHDIR=${DFLY_PATCHDIR} \
2632 DFLY_FILESDIR=${DFLY_FILESDIR} \
2633 PORTSDIR=${PORTSDIR} PREFIX=${PREFIX} LOCALBASE=${LOCALBASE}
2636 SCRIPTS_ENV+= BATCH=yes
2639 .if ${PREFIX} == /usr
2640 MANPREFIX?= /usr/share
2642 MANPREFIX?= ${PREFIX}
2645 MANDIRS+= ${MANPREFIX}/man
2646 .for sect in 1 2 3 4 5 6 7 8 9
2647 MAN${sect}PREFIX?= ${MANPREFIX}
2649 MANLPREFIX?= ${MANPREFIX}
2650 MANNPREFIX?= ${MANPREFIX}
2652 .if ${PREFIX} == /usr
2653 INFO_PATH?= share/info
2659 RUN_DEPENDS+= indexinfo:print/indexinfo
2661 . for D in ${INFO:H}
2664 . if !defined(INFO_SUBDIR)
2666 . elif ${INFO_SUBDIR} != ${RD}
2667 BROKEN= only one subdirectory in INFO is allowed
2674 DOCSDIR_REL?= ${DOCSDIR:S,^${PREFIX}/,,}
2675 EXAMPLESDIR_REL?= ${EXAMPLESDIR:S,^${PREFIX}/,,}
2676 DATADIR_REL?= ${DATADIR:S,^${PREFIX}/,,}
2677 WWWDIR_REL?= ${WWWDIR:S,^${PREFIX}/,,}
2678 ETCDIR_REL?= ${ETCDIR:S,^${PREFIX}/,,}
2680 PLIST_SUB+= DOCSDIR="${DOCSDIR_REL}" \
2681 EXAMPLESDIR="${EXAMPLESDIR_REL}" \
2682 DATADIR="${DATADIR_REL}" \
2683 WWWDIR="${WWWDIR_REL}" \
2684 ETCDIR="${ETCDIR_REL}"
2686 DESKTOPDIR?= ${PREFIX}/share/applications
2690 ################################################################
2691 # Many ways to disable a port.
2693 # If we're in BATCH mode and the port is interactive, or we're
2694 # in interactive mode and the port is non-interactive, skip all
2695 # the important targets. The reason we have two modes is that
2696 # one might want to leave a build in BATCH mode running
2697 # overnight, then come back in the morning and do _only_ the
2698 # interactive ones that required your intervention.
2700 # Ignore ports that can't be resold if building for a CDROM.
2702 # Don't build a port if it's restricted and we don't want to get
2705 # Don't build a port if it's broken, unless we're running a parallel
2706 # build (in case it's fixed).
2708 # Don't build a port if it's forbidden for whatever reason.
2710 # Don't build a port if the system is too old.
2711 ################################################################
2713 # Check the machine architectures
2714 .if defined(ONLY_FOR_ARCHS)
2715 .for __ARCH in ${ONLY_FOR_ARCHS:S/amd64/x86_64/}
2716 .if ${ARCH:M${__ARCH}} != ""
2724 .if defined(NOT_FOR_ARCHS)
2725 .for __NARCH in ${NOT_FOR_ARCHS:S/amd64/x86_64/}
2726 .if ${ARCH:M${__NARCH}} != ""
2732 .if !defined(__ARCH_OK)
2733 .if defined(ONLY_FOR_ARCHS)
2734 IGNORE= is only for ${ONLY_FOR_ARCHS:S/amd64/x86_64/},
2735 .else # defined(NOT_FOR_ARCHS)
2736 IGNORE= does not run on ${NOT_FOR_ARCHS:S/amd64/x86_64/},
2738 IGNORE+= while you are running ${ARCH}
2740 .if defined(ONLY_FOR_ARCHS_REASON_${ARCH})
2741 IGNORE+= (reason: ${ONLY_FOR_ARCHS_REASON_${ARCH}})
2742 .elif defined(ONLY_FOR_ARCHS_REASON)
2743 IGNORE+= (reason: ${ONLY_FOR_ARCHS_REASON})
2746 .if defined(NOT_FOR_ARCHS_REASON_${ARCH})
2747 IGNORE+= (reason: ${NOT_FOR_ARCHS_REASON_${ARCH}})
2748 .elif defined(NOT_FOR_ARCHS_REASON)
2749 IGNORE+= (reason: ${NOT_FOR_ARCHS_REASON})
2754 # Check the user interaction and legal issues
2755 .if !defined(NO_IGNORE)
2756 .if (defined(IS_INTERACTIVE) && defined(BATCH))
2757 IGNORE= is an interactive port
2758 .elif (!defined(IS_INTERACTIVE) && defined(INTERACTIVE))
2759 IGNORE= is not an interactive port
2760 .elif (defined(NO_CDROM) && defined(FOR_CDROM))
2761 IGNORE= may not be placed on a CDROM: ${NO_CDROM}
2762 .elif (defined(RESTRICTED) && defined(NO_RESTRICTED))
2763 IGNORE= is restricted: ${RESTRICTED}
2764 .elif (defined(NO_PACKAGE) && defined(PACKAGE_BUILDING))
2765 IGNORE= may not be packaged: ${NO_PACKAGE}
2766 .elif defined(IGNORE_${ARCH})
2767 IGNORE= ${IGNORE_${ARCH}}
2768 .elif defined(IGNORE_${OPSYS}_${OSREL:R}_${ARCH})
2769 IGNORE= ${IGNORE_${OPSYS}_${OSREL:R}_${ARCH}}
2770 .elif defined(IGNORE_${OPSYS}_${OSREL:R})
2771 IGNORE= ${IGNORE_${OPSYS}_${OSREL:R}}
2772 .elif defined(IGNORE_${OPSYS})
2773 IGNORE= ${IGNORE_${OPSYS}}
2774 .elif defined(BROKEN)
2775 .if !defined(TRYBROKEN)
2776 IGNORE= is marked as broken: ${BROKEN}
2778 .elif defined(BROKEN_${ARCH})
2779 .if !defined(TRYBROKEN)
2780 IGNORE= is marked as broken on ${ARCH}: ${BROKEN_${ARCH}}
2782 .elif defined(BROKEN_${OPSYS}_${OSREL:R}_${ARCH})
2783 .if !defined(TRYBROKEN)
2784 IGNORE= is marked as broken on ${OPSYS} ${OSREL} ${ARCH}: ${BROKEN_${OPSYS}_${OSREL:R}_${ARCH}}
2786 .elif defined(BROKEN_${OPSYS}_${OSREL:R})
2787 .if !defined(TRYBROKEN)
2788 IGNORE= is marked as broken on ${OPSYS} ${OSREL}: ${BROKEN_${OPSYS}_${OSREL:R}}
2790 .elif defined(BROKEN_${OPSYS})
2791 .if !defined(TRYBROKEN)
2792 IGNORE= is marked as broken on ${OPSYS}: ${BROKEN_${OPSYS}}
2794 .elif defined(FORBIDDEN)
2795 IGNORE= is forbidden: ${FORBIDDEN}
2798 # Define the text to be output to LEGAL
2799 .if defined(LEGAL_TEXT)
2800 LEGAL= ${LEGAL_TEXT}
2801 .elif defined(RESTRICTED)
2802 LEGAL= ${RESTRICTED}
2803 .elif defined(NO_CDROM)
2805 .elif defined(NO_PACKAGE) && ! defined(LEGAL_PACKAGE)
2806 LEGAL= ${NO_PACKAGE}
2809 .if (defined(MANUAL_PACKAGE_BUILD) && defined(PACKAGE_BUILDING))
2810 IGNORE= has to be built manually: ${MANUAL_PACKAGE_BUILD}
2816 .if defined(IGNORE_SILENT)
2817 IGNORECMD= ${DO_NADA}
2819 IGNORECMD= ${ECHO_MSG} "===> ${PKGNAME} "${IGNORE:Q}. | ${FMT_80} ; exit 1
2822 _TARGETS= check-sanity fetch checksum extract patch configure all build \
2823 install reinstall test package stage restage
2825 .for target in ${_TARGETS}
2826 .if !target(${target})
2829 .if defined(INSTALLS_DEPENDS)
2837 .endif # !defined(NO_IGNORE)
2840 .if defined(IGNORE) || defined(NO_PACKAGE)
2841 ignorelist: package-name
2846 @${ECHO_CMD} "${PKGNAME}|IGNORE: "${IGNORE:Q}
2847 .elif defined(NO_PACKAGE)
2848 @${ECHO_CMD} "${PKGNAME}|NO_PACKAGE: "${NO_PACKAGE:Q}
2851 ################################################################
2852 # Clean directories for ftp or CDROM.
2853 ################################################################
2855 .if !defined(LICENSE)
2857 .if defined(RESTRICTED)
2858 clean-restricted: delete-distfiles delete-package
2859 clean-restricted-list: delete-distfiles-list delete-package-list
2860 RESTRICTED_FILES?= ${_DISTFILES} ${_PATCHFILES}
2863 clean-restricted-list:
2866 .if defined(NO_CDROM)
2867 clean-for-cdrom: delete-distfiles delete-package
2868 clean-for-cdrom-list: delete-distfiles-list delete-package-list
2869 RESTRICTED_FILES?= ${_DISTFILES} ${_PATCHFILES}
2872 clean-for-cdrom-list:
2875 .endif # !defined(LICENSE)
2877 .if defined(ALL_HOOK)
2879 @cd ${.CURDIR} && ${SETENV} CURDIR=${.CURDIR} DISTNAME=${DISTNAME} \
2880 DISTDIR=${DISTDIR} WRKDIR=${WRKDIR} WRKSRC=${WRKSRC} \
2881 PATCHDIR=${PATCHDIR} SCRIPTDIR=${SCRIPTDIR} \
2882 FILESDIR=${FILESDIR} PORTSDIR=${PORTSDIR} PREFIX=${PREFIX} \
2883 DFLY_PATCHDIR=${DFLY_PATCHDIR} DFLY_FILESDIR=${DFLY_FILESDIR} \
2884 BUILD_DEPENDS="${BUILD_DEPENDS}" RUN_DEPENDS="${RUN_DEPENDS}" \
2885 CONFLICTS="${CONFLICTS}" \
2893 .if !defined(DEPENDS_TARGET)
2894 .if defined(DEPENDS_PRECLEAN)
2895 DEPENDS_TARGET= clean
2896 DEPENDS_ARGS= NOCLEANDEPENDS=yes
2899 DEPENDS_TARGET+= reinstall
2901 DEPENDS_TARGET+= install
2903 .if defined(DEPENDS_CLEAN)
2904 DEPENDS_TARGET+= clean
2905 DEPENDS_ARGS+= NOCLEANDEPENDS=yes
2909 ################################################################
2911 # Do preliminary work to detect if we need to run the config
2914 ################################################################
2915 .if ((!defined(OPTIONS_DEFINE) && !defined(OPTIONS_SINGLE) && !defined(OPTIONS_MULTI)) \
2916 && !defined(OPTIONS_GROUP) && !defined(OPTIONS_RADIO) \
2917 || defined(CONFIG_DONE_${PKGBASE:tu}) || \
2918 defined(PACKAGE_BUILDING) || defined(BATCH))
2922 ################################################################
2923 # The following are used to create easy dummy targets for
2924 # disabling some bit of default target behavior you don't want.
2925 # They still check to see if the target exists, and if so don't
2926 # do anything, since you might want to set this globally for a
2927 # group of ports in a Makefile.inc, but still be able to
2928 # override from an individual Makefile.
2929 ################################################################
2932 .if defined(NO_BUILD) && !target(build)
2934 @${TOUCH} ${TOUCH_FLAGS} ${BUILD_COOKIE}
2938 .if defined(NO_PACKAGE) && !target(package)
2940 .if !defined(IGNORE_SILENT)
2941 @${ECHO_MSG} "===> ${PKGNAME} may not be packaged: "${NO_PACKAGE:Q}.
2945 ################################################################
2946 # More standard targets start here.
2948 # These are the body of the build/install framework. If you are
2949 # not happy with the default actions, and you can't solve it by
2950 # adding pre-* or post-* targets/scripts, override these.
2951 ################################################################
2953 .if defined(TRYBROKEN) && defined(BROKEN)
2954 buildanyway-message:
2955 @${ECHO_MSG} "Trying build of ${PKGNAME} even though it is marked BROKEN."
2958 # Warn user about deprecated packages. Advisory only.
2960 .if !target(check-deprecated)
2961 # Try and keep these messages in sync with the ones in Mk/Scripts/create-manifest.sh
2963 .if ${MAINTAINER} == "ports@FreeBSD.org"
2964 @${ECHO_MSG} "===> NOTICE:"
2966 @${ECHO_MSG} "The ${PORTNAME} port currently does not have a maintainer. As a result, it is"
2967 @${ECHO_MSG} "more likely to have unresolved issues, not be up-to-date, or even be removed in"
2968 @${ECHO_MSG} "the future. To volunteer to maintain this port, please create an issue at:"
2970 @${ECHO_MSG} "https://bugs.freebsd.org/bugzilla"
2972 @${ECHO_MSG} "More information about port maintainership is available at:"
2974 @${ECHO_MSG} "https://www.freebsd.org/doc/en/articles/contributing/ports-contributing.html#maintain-port"
2977 .if defined(DEPRECATED)
2978 @${ECHO_MSG} "===> NOTICE:"
2980 @${ECHO_MSG} "This port is deprecated; you may wish to reconsider installing it:"
2982 @${ECHO_MSG} ${DEPRECATED:Q}.
2984 .if defined(EXPIRATION_DATE)
2985 @${ECHO_MSG} "It is scheduled to be removed on or after ${EXPIRATION_DATE}."
2991 # Check if the port is listed in the vulnerability database
2993 AUDITFILE?= ${PKG_DBDIR}/vuln.xml
2996 .if !defined(DISABLE_VULNERABILITIES) && !defined(PACKAGE_BUILDING) \
2997 && exists(${AUDITFILE})
2999 dp_ECHO_MSG="${ECHO_MSG}" \
3000 dp_PKG_BIN="${PKG_BIN}" \
3001 dp_PORTNAME="${PORTNAME}" \
3002 dp_PKGNAME="${PKGNAME}" \
3003 dp_SCRIPTSDIR="${SCRIPTSDIR}" \
3004 ${SH} ${SCRIPTSDIR}/check-vulnerable.sh
3007 # Quote simply quote all variables, except FETCH_ENV, some ports are creative
3008 # with it, and it needs to be quoted twice to pass through the echo/eval in
3011 dp_DISABLE_SIZE='${DISABLE_SIZE}' \
3012 dp_DISTDIR='${_DISTDIR}' \
3013 dp_DISTINFO_FILE='${DISTINFO_FILE}' \
3014 dp_DIST_SUBDIR='${DIST_SUBDIR}' \
3015 dp_ECHO_MSG='${ECHO_MSG}' \
3016 dp_FETCH_AFTER_ARGS='${FETCH_AFTER_ARGS}' \
3017 dp_FETCH_BEFORE_ARGS='${FETCH_BEFORE_ARGS}' \
3018 dp_FETCH_CMD='${FETCH_CMD}' \
3019 dp_FETCH_ENV=${FETCH_ENV:Q} \
3020 dp_FORCE_FETCH_ALL='${FORCE_FETCH_ALL}' \
3021 dp_FORCE_FETCH_LIST='${FORCE_FETCH_LIST}' \
3022 dp_MASTER_SITE_BACKUP='${_MASTER_SITE_BACKUP}' \
3023 dp_MASTER_SITE_OVERRIDE='${_MASTER_SITE_OVERRIDE}' \
3024 dp_MASTER_SORT_AWK='${MASTER_SORT_AWK}' \
3025 dp_NO_CHECKSUM='${NO_CHECKSUM}' \
3026 dp_RANDOMIZE_SITES='${_RANDOMIZE_SITES}' \
3027 dp_SCRIPTSDIR='${SCRIPTSDIR}' \
3028 dp_TARGET='${.TARGET}'
3029 .if defined(DEVELOPER)
3030 _DO_FETCH_ENV+= dp_DEVELOPER=yes
3032 _DO_FETCH_ENV+= dp_DEVELOPER=
3037 .if !target(do-fetch)
3039 .if !empty(DISTFILES)
3041 ${_DO_FETCH_ENV} ${_MASTER_SITES_ENV} \
3042 dp_SITE_FLAVOR=MASTER \
3043 ${SH} ${SCRIPTSDIR}/do-fetch.sh ${DISTFILES:C/.*/'&'/}
3045 .if defined(PATCHFILES) && !empty(PATCHFILES)
3047 ${_DO_FETCH_ENV} ${_PATCH_SITES_ENV} \
3048 dp_SITE_FLAVOR=PATCH \
3049 ${SH} ${SCRIPTSDIR}/do-fetch.sh ${PATCHFILES:C/:-p[0-9]//:C/.*/'&'/}
3053 # Prints out a list of files to fetch (useful to do a batch fetch)
3055 .if !target(fetch-list)
3057 .if !empty(DISTFILES)
3059 ${_DO_FETCH_ENV} ${_MASTER_SITES_ENV} \
3060 dp_SITE_FLAVOR=MASTER \
3061 ${SH} ${SCRIPTSDIR}/do-fetch.sh ${DISTFILES:C/.*/'&'/}
3063 .if defined(PATCHFILES) && !empty(PATCHFILES)
3065 ${_DO_FETCH_ENV} ${_PATCH_SITES_ENV} \
3066 dp_SITE_FLAVOR=PATCH \
3067 ${SH} ${SCRIPTSDIR}/do-fetch.sh ${PATCHFILES:C/:-p[0-9]//:C/.*/'&'/}
3071 # Used by fetch-urlall-list and fetch-url-list
3073 .if !target(fetch-url-list-int)
3075 .if !empty(DISTFILES)
3077 ${_DO_FETCH_ENV} ${_MASTER_SITES_ENV} \
3078 dp_SITE_FLAVOR=MASTER \
3079 ${SH} ${SCRIPTSDIR}/do-fetch.sh ${DISTFILES:C/.*/'&'/}
3081 .if defined(PATCHFILES) && !empty(PATCHFILES)
3083 ${_DO_FETCH_ENV} ${_PATCH_SITES_ENV} \
3084 dp_SITE_FLAVOR=PATCH \
3085 ${SH} ${SCRIPTSDIR}/do-fetch.sh ${PATCHFILES:C/:-p[0-9]//:C/.*/'&'/}
3089 # Prints out all the URL for all the DISTFILES and PATCHFILES.
3091 .if !target(fetch-urlall-list)
3093 @cd ${.CURDIR} && ${SETENV} FORCE_FETCH_ALL=yes ${MAKE} fetch-url-list-int
3096 # Prints the URL for all the DISTFILES and PATCHFILES that are not here
3098 .if !target(fetch-url-list)
3099 fetch-url-list: fetch-url-list-int
3108 .if !target(do-extract)
3109 do-extract: ${EXTRACT_WRKDIR}
3110 @for file in ${EXTRACT_ONLY}; do \
3111 if ! (cd ${EXTRACT_WRKDIR} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/$$file ${EXTRACT_AFTER_ARGS});\
3116 @if [ ${UID} = 0 ]; then \
3117 ${CHMOD} -R ug-s ${WRKDIR}; \
3118 ${CHOWN} -R 0:0 ${WRKDIR}; \
3124 .if !target(do-patch)
3127 dp_BZCAT="${BZCAT}" \
3129 dp_DISTDIR="${_DISTDIR}" \
3130 dp_ECHO_MSG="${ECHO_MSG}" \
3131 dp_EXTRA_PATCHES="${EXTRA_PATCHES}" \
3132 dp_EXTRA_PATCH_TREE="${EXTRA_PATCH_TREE}" \
3133 dp_GZCAT="${GZCAT}" \
3134 dp_OPSYS="${OPSYS}" \
3135 dp_PATCH="${PATCH}" \
3136 dp_PATCHDIR="${PATCHDIR}" \
3137 dp_DFLY_PATCHDIR="${DFLY_PATCHDIR}" \
3138 dp_PATCHFILES="${_PATCHFILES2}" \
3139 dp_PATCH_ARGS=${PATCH_ARGS:Q} \
3140 dp_PATCH_DEBUG_TMP="${PATCH_DEBUG_TMP}" \
3141 dp_PATCH_DIST_ARGS="${PATCH_DIST_ARGS}" \
3142 dp_PATCH_SILENT="${PATCH_SILENT}" \
3143 dp_PATCH_WRKSRC=${PATCH_WRKSRC} \
3144 dp_PKGNAME="${PKGNAME}" \
3145 dp_PKGORIGIN="${PKGORIGIN}" \
3146 dp_SCRIPTSDIR="${SCRIPTSDIR}" \
3147 dp_UNZIP_NATIVE_CMD="${UNZIP_NATIVE_CMD}" \
3148 dp_XZCAT="${XZCAT}" \
3149 ${SH} ${SCRIPTSDIR}/do-patch.sh
3152 .if !target(run-autotools-fixup)
3153 run-autotools-fixup:
3154 # Work around an issue where FreeBSD 10.0 is detected as FreeBSD 1.x.
3155 .if !defined(WITHOUT_FBSD10_FIX)
3156 -@for f in `${FIND} ${WRKDIR} -type f \( -name config.libpath -o \
3157 -name config.rpath -o -name configure -o -name libtool.m4 -o \
3158 -name ltconfig -o -name libtool -o -name aclocal.m4 -o \
3159 -name acinclude.m4 \)` ; do \
3160 ${SED} -i.fbsd10bak \
3161 -e 's|freebsd1\*)|freebsd1.\*)|g' \
3162 -e 's|freebsd\[12\]\*)|freebsd[12].*)|g' \
3163 -e 's|freebsd\[123\]\*)|freebsd[123].*)|g' \
3164 -e 's|freebsd\[\[12\]\]\*)|freebsd[[12]].*)|g' \
3165 -e 's|freebsd\[\[123\]\]\*)|freebsd[[123]].*)|g' \
3167 cmp -s $${f}.fbsd10bak $${f} || \
3168 ${ECHO_MSG} "===> FreeBSD 10 autotools fix applied to $${f}"; \
3169 ${TOUCH} ${TOUCH_FLAGS} -mr $${f}.fbsd10bak $${f} ; \
3170 ${RM} $${f}.fbsd10bak ; \
3177 .if !target(do-configure)
3179 @if [ -f ${SCRIPTDIR}/configure ]; then \
3180 cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \
3181 ${SCRIPTDIR}/configure; \
3183 .if defined(GNU_CONFIGURE)
3184 @CONFIG_GUESS_DIRS=$$(${FIND} ${WRKDIR} -name config.guess -o -name config.sub \
3185 | ${XARGS} -n 1 ${DIRNAME}); \
3186 for _D in $${CONFIG_GUESS_DIRS}; do \
3187 ${RM} $${_D}/config.guess; \
3188 ${CP} ${TEMPLATES}/config.guess $${_D}/config.guess; \
3189 ${CHMOD} a+rx $${_D}/config.guess; \
3190 ${RM} $${_D}/config.sub; \
3191 ${CP} ${TEMPLATES}/config.sub $${_D}/config.sub; \
3192 ${CHMOD} a+rx $${_D}/config.sub; \
3195 .if defined(HAS_CONFIGURE)
3196 @${MKDIR} ${CONFIGURE_WRKSRC}
3197 @(cd ${CONFIGURE_WRKSRC} && \
3198 ${SET_LATE_CONFIGURE_ARGS} \
3199 if ! ${SETENV} CC="${CC}" CPP="${CPP}" CXX="${CXX}" \
3200 CFLAGS="${CFLAGS}" CPPFLAGS="${CPPFLAGS}" CXXFLAGS="${CXXFLAGS}" \
3201 LDFLAGS="${LDFLAGS}" LIBS="${LIBS}" \
3202 INSTALL="/usr/bin/install -c" \
3203 INSTALL_DATA="${INSTALL_DATA}" \
3204 INSTALL_LIB="${INSTALL_LIB}" \
3205 INSTALL_PROGRAM="${INSTALL_PROGRAM}" \
3206 INSTALL_SCRIPT="${INSTALL_SCRIPT}" \
3207 ${CONFIGURE_ENV} ${CONFIGURE_CMD} ${CONFIGURE_ARGS}; then \
3208 ${ECHO_MSG} "===> Script \"${CONFIGURE_SCRIPT}\" failed unexpectedly."; \
3209 (${ECHO_CMD} ${CONFIGURE_FAIL_MESSAGE}) | ${FMT_80} ; \
3216 # XXX: ${MAKE_ARGS:N${DESTDIRNAME}=*} would be easier but it is not valid with the old fmake
3217 DO_MAKE_BUILD?= ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_FLAGS} ${MAKEFILE} ${_MAKE_JOBS} ${MAKE_ARGS:C,^${DESTDIRNAME}=.*,,g}
3218 .if !target(do-build)
3220 @(cd ${BUILD_WRKSRC}; if ! ${DO_MAKE_BUILD} ${ALL_TARGET}; then \
3221 if [ -n "${BUILD_FAIL_MESSAGE}" ] ; then \
3222 ${ECHO_MSG} "===> Compilation failed unexpectedly."; \
3223 (${ECHO_CMD} "${BUILD_FAIL_MESSAGE}") | ${FMT_80} ; \
3231 .if !target(check-conflicts)
3232 check-conflicts: check-build-conflicts check-install-conflicts
3235 .if !target(check-build-conflicts)
3236 check-build-conflicts:
3237 .if ( defined(CONFLICTS) || defined(CONFLICTS_BUILD) ) && !defined(DISABLE_CONFLICTS) && !defined(DEFER_CONFLICTS_CHECK)
3238 @conflicts_with=$$( \
3239 { ${PKG_QUERY} -g "%n-%v %p %o" ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_BUILD:C/.+/'&'/} 2>/dev/null || : ; } \
3240 | while read pkgname prfx orgn; do \
3241 if [ "/${PREFIX}" = "/$${prfx}" -a "/${PKGORIGIN}" != "/$${orgn}" ]; then \
3242 ${ECHO_CMD} -n " $${pkgname}"; \
3245 if [ -n "$${conflicts_with}" ]; then \
3247 ${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \
3248 for entry in $${conflicts_with}; do \
3249 ${ECHO_MSG} " $${entry}"; \
3252 ${ECHO_MSG} " They will not build together."; \
3253 ${ECHO_MSG} " Please remove them first with pkg delete."; \
3259 .if !target(identify-install-conflicts)
3260 identify-install-conflicts:
3261 .if ( defined(CONFLICTS) || defined(CONFLICTS_INSTALL) ) && !defined(DISABLE_CONFLICTS)
3262 @conflicts_with=$$( \
3263 { ${PKG_QUERY} -g "%n-%v %p %o" ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_INSTALL:C/.+/'&'/} 2>/dev/null || : ; } \
3264 | while read pkgname prfx orgn; do \
3265 if [ "/${PREFIX}" = "/$${prfx}" -a "/${PKGORIGIN}" != "/$${orgn}" ]; then \
3266 ${ECHO_CMD} -n " $${pkgname}"; \
3269 if [ -n "$${conflicts_with}" ]; then \
3271 ${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \
3272 for entry in $${conflicts_with}; do \
3273 ${ECHO_MSG} " $${entry}"; \
3276 ${ECHO_MSG} " They install files into the same place."; \
3277 ${ECHO_MSG} " You may want to stop build with Ctrl + C."; \
3283 .if !target(check-install-conflicts)
3284 check-install-conflicts:
3285 .if ( defined(CONFLICTS) || defined(CONFLICTS_INSTALL) || ( defined(CONFLICTS_BUILD) && defined(DEFER_CONFLICTS_CHECK) ) ) && !defined(DISABLE_CONFLICTS)
3286 .if defined(DEFER_CONFLICTS_CHECK)
3287 @conflicts_with=$$( \
3288 { ${PKG_QUERY} -g "%n-%v %p %o" ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_BUILD:C/.+/'&'/} ${CONFLICTS_INSTALL:C/.+/'&'/} 2>/dev/null || : ; } \
3289 | while read pkgname prfx orgn; do \
3290 if [ "/${PREFIX}" = "/$${prfx}" -a "/${PKGORIGIN}" != "/$${orgn}" ]; then \
3291 ${ECHO_CMD} -n " $${pkgname}"; \
3294 if [ -n "$${conflicts_with}" ]; then \
3296 ${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \
3297 for entry in $${conflicts_with}; do \
3298 ${ECHO_MSG} " $${entry}"; \
3301 ${ECHO_MSG} " Please remove them first with pkg delete."; \
3305 @conflicts_with=$$( \
3306 { ${PKG_QUERY} -g "%n-%v %p %o" ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_INSTALL:C/.+/'&'/} 2>/dev/null || : ; } \
3307 | while read pkgname prfx orgn; do \
3308 if [ "/${PREFIX}" = "/$${prfx}" -a "/${PKGORIGIN}" != "/$${orgn}" ]; then \
3309 ${ECHO_CMD} -n " $${pkgname}"; \
3312 if [ -n "$${conflicts_with}" ]; then \
3314 ${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \
3315 for entry in $${conflicts_with}; do \
3316 ${ECHO_MSG} " $${entry}"; \
3319 ${ECHO_MSG} " They install files into the same place."; \
3320 ${ECHO_MSG} " Please remove them first with pkg delete."; \
3323 .endif # defined(DEFER_CONFLICTS_CHECK)
3329 .if !target(do-install) && !defined(NO_INSTALL)
3331 @(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${FAKEROOT} ${MAKE_CMD} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET})
3336 .if !target(do-test) && defined(TEST_TARGET)
3337 DO_MAKE_TEST?= ${SETENV} ${TEST_ENV} ${MAKE_CMD} ${MAKE_FLAGS} ${MAKEFILE} ${TEST_ARGS:C,^${DESTDIRNAME}=.*,,g}
3339 @(cd ${TEST_WRKSRC}; if ! ${DO_MAKE_TEST} ${TEST_TARGET}; then \
3340 if [ -n "${TEST_FAIL_MESSAGE}" ] ; then \
3341 ${ECHO_MSG} "===> Tests failed unexpectedly."; \
3342 (${ECHO_CMD} "${TEST_FAIL_MESSAGE}") | ${FMT_80} ; \
3350 .if defined(_HAVE_PACKAGES)
3351 _EXTRA_PACKAGE_TARGET_DEP+= ${PKGFILE}
3352 _PORTS_DIRECTORIES+= ${PKGREPOSITORY}
3354 ${PKGFILE}: ${WRKDIR_PKGFILE} ${PKGREPOSITORY}
3355 @${LN} -f ${WRKDIR_PKGFILE} ${PKGFILE} 2>/dev/null \
3356 || ${CP} -f ${WRKDIR_PKGFILE} ${PKGFILE}
3358 . if ${PKGORIGIN} == "ports-mgmt/pkg" || ${PKGORIGIN} == "ports-mgmt/pkg-devel"
3359 _EXTRA_PACKAGE_TARGET_DEP+= ${PKGLATESTREPOSITORY}
3360 _PORTS_DIRECTORIES+= ${PKGLATESTREPOSITORY}
3361 _EXTRA_PACKAGE_TARGET_DEP+= ${PKGLATESTFILE}
3363 ${PKGLATESTFILE}: ${PKGFILE} ${PKGLATESTREPOSITORY}
3364 ${SH} ${SCRIPTSDIR}/relative_link.sh ${PKGFILE} ${PKGLATESTFILE}
3369 # from here this will become a loop for subpackages
3370 ${WRKDIR_PKGFILE}: ${TMPPLIST} create-manifest ${WRKDIR}/pkg
3371 @if ! ${SETENV} ${PKG_ENV} FORCE_POST="${_FORCE_POST_PATTERNS}" ${PKG_CREATE} ${PKG_CREATE_ARGS} -m ${METADIR} -p ${TMPPLIST} -f ${PKG_SUFX:S/.//} -o ${WRKDIR}/pkg ${PKGNAME}; then \
3372 cd ${.CURDIR} && eval ${MAKE} delete-package >/dev/null; \
3376 # Temporary will be later dynamically added per subpackages
3377 _EXTRA_PACKAGE_TARGET_DEP+= ${WRKDIR_PKGFILE}
3378 # This will be the end of the loop
3380 .if !target(do-package)
3381 PKG_CREATE_ARGS= -r ${STAGEDIR}
3382 . if defined(PKG_CREATE_VERBOSE)
3383 PKG_CREATE_ARGS+= -v
3385 do-package: ${_EXTRA_PACKAGE_TARGET_DEP} ${WRKDIR}/pkg
3388 .if !target(delete-package)
3390 @${ECHO_MSG} "===> Deleting package for ${PKGNAME}"
3391 # When staging, the package may only be in the workdir if not root
3392 @${RM} ${PKGFILE} ${WRKDIR_PKGFILE} 2>/dev/null || :
3395 .if !target(delete-package-list)
3396 delete-package-list:
3397 @${ECHO_CMD} "[ -f ${PKGFILE} ] && (${ECHO_CMD} deleting ${PKGFILE}; ${RM} ${PKGFILE})"
3400 # Used by scripts and users to install a package from local repository.
3401 # Poudriere -i uses this, please keep.
3402 .if !target(install-package)
3403 .if defined(FORCE_PKG_REGISTER)
3404 _INSTALL_PKG_ARGS= -f
3406 .if defined(INSTALLS_DEPENDS)
3407 _INSTALL_PKG_ARGS+= -A
3410 @if [ -f "${WRKDIR}/pkg/${PKGNAME}${PKG_SUFX}" ]; then \
3411 _pkgfile="${WRKDIR_PKGFILE}"; \
3413 _pkgfile="${PKGFILE}"; \
3415 ${PKG_ADD} ${_INSTALL_PKG_ARGS} $${_pkgfile}
3419 # Utility targets follow
3421 .if !target(check-already-installed)
3422 .if !defined(NO_PKG_REGISTER) && !defined(FORCE_PKG_REGISTER)
3423 check-already-installed:
3424 @${ECHO_MSG} "===> Checking if ${PKGBASE} already installed"; \
3425 pkgname=`${PKG_INFO} -q -O ${PKGBASE}`; \
3426 if [ -n "$${pkgname}" ]; then \
3427 v=`${PKG_VERSION} -t $${pkgname} ${PKGNAME}`; \
3428 if [ "$${v}" = "<" ]; then \
3429 ${ECHO_CMD} "===> An older version of ${PKGBASE} is already installed ($${pkgname})"; \
3431 ${ECHO_CMD} "===> ${PKGNAME} is already installed"; \
3433 ${ECHO_MSG} " You may wish to \`\`make deinstall'' and install this port again"; \
3434 ${ECHO_MSG} " by \`\`make reinstall'' to upgrade it properly."; \
3435 ${ECHO_MSG} " If you really wish to overwrite the old port of ${PKGBASE}"; \
3436 ${ECHO_MSG} " without deleting it first, set the variable \"FORCE_PKG_REGISTER\""; \
3437 ${ECHO_MSG} " in your environment or the \"make install\" command line."; \
3443 .if !target(check-umask)
3445 @if [ `${SH} -c umask` != 0022 ]; then \
3446 ${ECHO_MSG} "===> Warning: your umask is \"`${SH} -c umask`"\".; \
3447 ${ECHO_MSG} " If this is not desired, set it to an appropriate value"; \
3448 ${ECHO_MSG} " and install this port again by \`\`make reinstall''."; \
3452 # Needed for poudriere wait for at least a year before removing
3454 .if !target(install-mtree)
3458 .if !target(install-ldconfig-file)
3459 install-ldconfig-file:
3460 . if defined(USE_LDCONFIG) || defined(USE_LDCONFIG32)
3461 . if defined(USE_LDCONFIG)
3462 . if !defined(USE_LINUX_PREFIX)
3463 . if ${USE_LDCONFIG} != "${LOCALBASE}/lib" && !defined(INSTALL_AS_USER)
3464 @${ECHO_MSG} "===> Installing ldconfig configuration file"
3465 . if defined(NO_MTREE) || ${PREFIX} != ${LOCALBASE}
3466 @${MKDIR} ${STAGEDIR}${LOCALBASE}/${LDCONFIG_DIR}
3468 @${ECHO_CMD} ${USE_LDCONFIG} | ${TR} ' ' '\n' \
3469 > ${STAGEDIR}${LOCALBASE}/${LDCONFIG_DIR}/${PKGBASE}
3470 @${ECHO_CMD} ${LOCALBASE}/${LDCONFIG_DIR}/${PKGBASE} >> ${TMPPLIST}
3471 . if ${PREFIX} != ${LOCALBASE}
3472 @${ECHO_CMD} "@dir ${LOCALBASE}/${LDCONFIG_DIR}" >> ${TMPPLIST}
3477 . if defined(USE_LDCONFIG32)
3478 . if !defined(INSTALL_AS_USER)
3479 @${ECHO_MSG} "===> Installing 32-bit ldconfig configuration file"
3480 . if defined(NO_MTREE) || ${PREFIX} != ${LOCALBASE}
3481 @${MKDIR} ${STAGEDIR}${LOCALBASE}/${LDCONFIG32_DIR}
3483 @${ECHO_CMD} ${USE_LDCONFIG32} | ${TR} ' ' '\n' \
3484 > ${STAGEDIR}${LOCALBASE}/${LDCONFIG32_DIR}/${PKGBASE}
3485 @${ECHO_CMD} ${LOCALBASE}/${LDCONFIG32_DIR}/${PKGBASE} >> ${TMPPLIST}
3486 . if ${PREFIX} != ${LOCALBASE}
3487 @${ECHO_CMD} "@dir ${LOCALBASE}/${LDCONFIG32_DIR}" >> ${TMPPLIST}
3494 .if !defined(USE_LINUX_PREFIX)
3495 . if !target(fixup-lib-pkgconfig)
3496 fixup-lib-pkgconfig:
3497 @if [ -d ${STAGEDIR}${PREFIX}/lib/pkgconfig ]; then \
3498 if [ -z "$$(${FIND} ${STAGEDIR}${PREFIX}/lib/pkgconfig -maxdepth 0 -empty)" ]; then \
3499 ${MKDIR} ${STAGEDIR}${PREFIX}/libdata/pkgconfig; \
3500 ${MV} ${STAGEDIR}${PREFIX}/lib/pkgconfig/* ${STAGEDIR}${PREFIX}/libdata/pkgconfig; \
3502 ${RMDIR} ${STAGEDIR}${PREFIX}/lib/pkgconfig; \
3507 .if !target(create-users-groups)
3508 .if defined(GROUPS) || defined(USERS)
3509 _UG_INSTALL= ${WRKDIR}/users-groups-install.sh
3510 _UG_DEINSTALL= ${WRKDIR}/users-groups-deinstall.sh
3511 PKGPREINSTALL+= ${_UG_INSTALL}
3512 PKGPOSTDEINSTALL+= ${_UG_DEINSTALL}
3513 create-users-groups:
3515 dp_ECHO_MSG="${ECHO_MSG}" \
3516 dp_GID_FILES="${GID_FILES}" \
3517 dp_GID_OFFSET="${GID_OFFSET}" \
3518 dp_GROUPS_BLACKLIST="${GROUPS_BLACKLIST}" \
3519 dp_INSTALL="${INSTALL}" \
3520 dp_OPSYS="${OPSYS}" \
3521 dp_OSVERSION="${OSVERSION}" \
3522 dp_PREFIX="${PREFIX}" \
3524 dp_SCRIPTSDIR="${SCRIPTSDIR}" \
3525 dp_UG_DEINSTALL="${_UG_DEINSTALL}" \
3526 dp_UG_INSTALL="${_UG_INSTALL}" \
3527 dp_UID_FILES="${UID_FILES}" \
3528 dp_UID_OFFSET="${UID_OFFSET}" \
3529 dp_USERS_BLACKLIST="${USERS_BLACKLIST}" \
3530 ${SH} ${SCRIPTSDIR}/do-users-groups.sh "${USERS}" "${GROUPS}"
3534 .if !defined(DISABLE_SECURITY_CHECK)
3535 .if !target(security-check)
3536 security-check: ${TMPPLIST}
3539 # 2. accept()/recvfrom() which indicates network listening capability
3540 # 3. insecure functions (gets/mktemp/tempnam/[XXX])
3541 # 4. startup scripts, in conjunction with 2.
3542 # 5. world-writable files/dirs
3544 -@${RM} ${WRKDIR}/.PLIST.setuid ${WRKDIR}/.PLIST.writable ${WRKDIR}/.PLIST.objdump; \
3545 ${AWK} -v prefix='${PREFIX}' ' \
3546 match($$0, /^@cwd /) { prefix = substr($$0, RSTART + RLENGTH); if (prefix == "/") prefix=""; next; } \
3548 /^\// { print; next; } \
3549 { print prefix "/" $$0; } \
3550 ' ${TMPPLIST} > ${WRKDIR}/.PLIST.flattened; \
3551 ${TR} '\n' '\0' < ${WRKDIR}/.PLIST.flattened \
3552 | ${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; \
3553 ${TR} '\n' '\0' < ${WRKDIR}/.PLIST.flattened \
3554 | ${XARGS} -0 -J % ${FIND} % -prune -perm -0002 \! -type l 2> /dev/null > ${WRKDIR}/.PLIST.writable; \
3555 ${TR} '\n' '\0' < ${WRKDIR}/.PLIST.flattened \
3556 | ${XARGS} -0 -J % ${FIND} % -prune ! -type l -type f -print0 2> /dev/null \
3557 | ${XARGS} -0 -n 1 ${OBJDUMP} -R 2> /dev/null > ${WRKDIR}/.PLIST.objdump; \
3559 ! ${AWK} -v audit="$${PORTS_AUDIT}" -f ${SCRIPTSDIR}/security-check.awk \
3560 ${WRKDIR}/.PLIST.flattened ${WRKDIR}/.PLIST.objdump ${WRKDIR}/.PLIST.setuid ${WRKDIR}/.PLIST.writable; \
3562 www_site=$$(cd ${.CURDIR} && ${MAKE} www-site); \
3563 if [ ! -z "$${www_site}" ]; then \
3565 ${ECHO_MSG} " For more information, and contact details about the security"; \
3566 ${ECHO_MSG} " status of this software, see the following webpage: "; \
3567 ${ECHO_MSG} "$${www_site}"; \
3571 .else # i.e. defined(DISABLE_SECURITY_CHECK)
3573 @${ECHO_MSG} " WARNING: Security check has been disabled."
3574 .endif # !defined(DISABLE_SECURITY_CHECK)
3576 ################################################################
3577 # Skeleton targets start here
3579 # You shouldn't have to change these. Either add the pre-* or
3580 # post-* targets/scripts or redefine the do-* targets. These
3581 # targets don't do anything other than checking for cookies and
3582 # call the necessary targets/scripts.
3583 ################################################################
3586 @${ECHO_MSG} "===> Extracting for ${PKGNAME}"
3588 @${ECHO_MSG} "===> Patching for ${PKGNAME}"
3590 @${ECHO_MSG} "===> Configuring for ${PKGNAME}"
3592 @${ECHO_MSG} "===> Building for ${PKGNAME}"
3594 @${ECHO_MSG} "===> Staging for ${PKGNAME}"
3596 @${ECHO_MSG} "===> Installing for ${PKGNAME}"
3598 @${ECHO_MSG} "===> Testing for ${PKGNAME}"
3600 @${ECHO_MSG} "===> Building package for ${PKGNAME}"
3602 # Empty pre-* and post-* targets
3604 .for stage in pre post
3605 .for name in pkg check-sanity fetch extract patch configure build stage install package
3607 .if exists(${SCRIPTDIR}/${stage}-${name})
3608 .if !target(${stage}-${name}-script)
3609 ${stage}-${name}-script:
3610 @ cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \
3611 ${SCRIPTDIR}/${.TARGET:S/-script$//}
3618 .if !target(pretty-print-www-site)
3619 pretty-print-www-site:
3620 @www_site=$$(cd ${.CURDIR} && ${MAKE} www-site); \
3621 if [ -n "$${www_site}" ]; then \
3622 ${ECHO_MSG} -n " and/or visit the "; \
3623 ${ECHO_MSG} -n "<a href=\"$${www_site}\">web site</a>"; \
3624 ${ECHO_MSG} " for further information"; \
3628 ################################################################
3629 # Some more targets supplied for users' convenience
3630 ################################################################
3634 # Special target to verify patches
3636 .if !target(checkpatch)
3638 @cd ${.CURDIR} && ${MAKE} ${PATCH_SILENT} PATCH_CHECK_ONLY=yes ${_PATCH_DEP} ${_PATCH_REAL_SEQ}
3643 # Special target to re-run install
3645 .if !target(reinstall)
3647 @${RM} ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
3648 @cd ${.CURDIR} && DEPENDS_TARGET="${DEPENDS_TARGET}" ${MAKE} -DFORCE_PKG_REGISTER install
3651 .if !target(restage)
3653 @${RM} -r ${STAGEDIR} ${STAGE_COOKIE} ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
3654 @cd ${.CURDIR} && ${MAKE} stage
3659 # Special target to remove installation
3661 .if !target(deinstall)
3663 .if defined(UID) && ${UID} != 0 && !defined(INSTALL_AS_USER)
3664 @${ECHO_MSG} "===> Switching to root credentials for '${.TARGET}' target"
3666 ${SU_CMD} "${MAKE} ${.TARGET}"
3667 @${ECHO_MSG} "===> Returning to user credentials"
3669 @${ECHO_MSG} "===> Deinstalling for ${PKGBASE}"
3670 @if ${PKG_INFO} -e ${PKGBASE}; then \
3671 p=`${PKG_INFO} -q -O ${PKGBASE}`; \
3672 ${ECHO_MSG} "===> Deinstalling $${p}"; \
3673 ${PKG_DELETE} -f ${PKGBASE} ; \
3675 ${ECHO_MSG} "===> ${PKGBASE} not installed, skipping"; \
3677 @${RM} ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
3683 # Special target to remove installation of all ports of the same origin
3685 .if !target(deinstall-all)
3687 .if ${UID} != 0 && !defined(INSTALL_AS_USER)
3688 @${ECHO_MSG} "===> Switching to root credentials for '${.TARGET}' target"
3690 ${SU_CMD} "${MAKE} ${.TARGET}"
3691 @${ECHO_MSG} "===> Returning to user credentials"
3693 @${ECHO_MSG} "===> Deinstalling for ${PKGORIGIN}"
3694 @deinstall_names=`${PKG_INFO} -q -O ${PKGORIGIN}`; \
3695 for oldpkgorigin in $$(${GREP} "|${PKGORIGIN}|" ${PORTSDIR}/MOVED | ${CUT} -f 1 -d '|' | ${SORT} -u); do \
3696 deinstall_names="$${deinstall_names} $$(${PKG_INFO} -q -O $${oldpkgorigin})"; \
3698 if [ -n "$${deinstall_names}" ]; then \
3699 for d in $${deinstall_names}; do \
3700 ${ECHO_MSG} "===> Deinstalling $${d}"; \
3701 ${PKG_DELETE} -f $${d}; \
3704 ${ECHO_MSG} "===> ${PKGORIGIN} not installed, skipping"; \
3706 ${RM} ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
3712 .if !target(do-clean)
3714 @if [ -d ${WRKDIR} ]; then \
3715 if [ -w ${WRKDIR} ]; then \
3716 ${RM} -r ${WRKDIR}; \
3717 ${FIND} ${WRKDIR:H} -type d -maxdepth 1 -empty -delete; \
3719 ${ECHO_MSG} "===> ${WRKDIR} not writable, skipping"; \
3725 pre-clean: clean-msg
3727 @${ECHO_MSG} "===> Cleaning for ${PKGNAME}"
3731 .if !defined(NOCLEANDEPENDS)
3732 CLEAN_DEPENDENCIES+= limited-clean-depends-noflavor
3733 limited-clean-depends-noflavor:
3734 @cd ${.CURDIR} && ${MAKE} limited-clean-depends
3736 .if target(pre-clean)
3737 CLEAN_DEPENDENCIES+= pre-clean-noflavor
3739 @cd ${.CURDIR} && ${SETENV} ${MAKE} pre-clean
3741 CLEAN_DEPENDENCIES+= do-clean-noflavor
3743 @cd ${.CURDIR} && ${SETENV} ${MAKE} do-clean
3744 .if target(post-clean)
3745 CLEAN_DEPENDENCIES+= post-clean-noflavor
3746 post-clean-noflavor:
3747 @cd ${.CURDIR} && ${SETENV} ${MAKE} post-clean
3749 .ORDER: ${CLEAN_DEPENDENCIES}
3750 clean: ${CLEAN_DEPENDENCIES}
3753 .for _f in ${FLAVORS}
3755 .if !defined(NOCLEANDEPENDS)
3756 CLEAN_DEPENDENCIES+= limited-clean-depends-${_f}
3757 limited-clean-depends-${_f}:
3758 @cd ${.CURDIR} && ${MAKE} FLAVOR=${_f} limited-clean-depends
3760 .if target(pre-clean)
3761 CLEAN_DEPENDENCIES+= pre-clean-${_f}
3763 @cd ${.CURDIR} && ${SETENV} FLAVOR=${_f} ${MAKE} pre-clean
3765 CLEAN_DEPENDENCIES+= do-clean-${_f}
3767 @cd ${.CURDIR} && ${SETENV} FLAVOR=${_f} ${MAKE} do-clean
3768 .if target(post-clean)
3769 CLEAN_DEPENDENCIES+= post-clean-${_f}
3771 @cd ${.CURDIR} && ${SETENV} FLAVOR=${_f} ${MAKE} post-clean
3773 .ORDER: ${CLEAN_DEPENDENCIES}
3774 clean: ${CLEAN_DEPENDENCIES}
3778 .if !target(distclean)
3780 @cd ${.CURDIR} && ${MAKE} delete-distfiles RESTRICTED_FILES="${_DISTFILES:Q} ${_PATCHFILES:Q}"
3783 .if !target(delete-distfiles)
3785 @${ECHO_MSG} "===> Deleting distfiles for ${PKGNAME}"
3786 @(if [ "X${RESTRICTED_FILES}" != "X" -a -d ${_DISTDIR} ]; then \
3788 for file in ${RESTRICTED_FILES}; do \
3791 if [ "$${dir}" != "$${file}" ]; then \
3792 ${RMDIR} -p $${dir} >/dev/null 2>&1 || :; \
3796 .if defined(DIST_SUBDIR)
3797 -@${RMDIR} ${_DISTDIR} >/dev/null 2>&1 || ${TRUE}
3801 .if !target(delete-distfiles-list)
3802 delete-distfiles-list:
3803 @${ECHO_CMD} "# ${PKGNAME}"
3804 @if [ "X${RESTRICTED_FILES}" != "X" ]; then \
3805 for file in ${RESTRICTED_FILES}; do \
3806 ${ECHO_CMD} "[ -f ${_DISTDIR}/$$file ] && (${ECHO_CMD} deleting ${_DISTDIR}/$$file; ${RM} ${_DISTDIR}/$$file)"; \
3808 if [ "$${dir}" != "$${file}" ]; then \
3809 ${ECHO_CMD} "(cd ${_DISTDIR} && ${RMDIR} -p $${dir} 2>/dev/null)"; \
3813 .if defined(DIST_SUBDIR)
3814 @${ECHO_CMD} "${RMDIR} ${_DISTDIR} 2>/dev/null || ${TRUE}"
3818 # Generates patches.
3821 @toedit=`PATCH_WRKSRC=${PATCH_WRKSRC} \
3822 PATCHDIR=${PATCHDIR} \
3823 PATCH_LIST=${PATCHDIR}/patch-* \
3824 DIFF_ARGS=${DIFF_ARGS} \
3825 DISTORIG=${DISTORIG} \
3826 ${SH} ${PORTSDIR}/Tools/scripts/update-patches`; \
3827 case $$toedit in "");; \
3828 *) ${ECHO_CMD} -n 'edit patches: '; read i; \
3829 cd ${PATCHDIR} && $${VISUAL:-$${EDIT:-/usr/bin/vi}} $$toedit;; esac
3831 # Checksumming utilities
3833 # List all algorithms here, all the variables name must begin with dp_
3834 _CHECKSUM_INIT_ENV= \
3837 .if !target(makesum)
3838 # Some port change the options with OPTIONS_*_FORCE when make(makesum) to be
3839 # able to add all distfiles in one go.
3840 # For this to work, we need to call the do-fetch script directly here so that
3841 # the options consistent when fetching and when makesum'ing.
3842 # As we're fetching new distfiles, that are not in the distinfo file, disable
3843 # checksum and sizes checks.
3845 .if !empty(DISTFILES)
3847 ${_DO_FETCH_ENV} ${_MASTER_SITES_ENV} \
3848 dp_NO_CHECKSUM=yes dp_DISABLE_SIZE=yes \
3849 dp_SITE_FLAVOR=MASTER \
3850 ${SH} ${SCRIPTSDIR}/do-fetch.sh ${DISTFILES:C/.*/'&'/}
3852 .if defined(PATCHFILES) && !empty(PATCHFILES)
3854 ${_DO_FETCH_ENV} ${_PATCH_SITES_ENV} \
3855 dp_NO_CHECKSUM=yes dp_DISABLE_SIZE=yes \
3856 dp_SITE_FLAVOR=PATCH \
3857 ${SH} ${SCRIPTSDIR}/do-fetch.sh ${PATCHFILES:C/:-p[0-9]//:C/.*/'&'/}
3860 ${_CHECKSUM_INIT_ENV} \
3861 dp_CHECKSUM_ALGORITHMS='${CHECKSUM_ALGORITHMS:tu}' \
3862 dp_CKSUMFILES='${_CKSUMFILES}' \
3863 dp_DISTDIR='${DISTDIR}' \
3864 dp_DISTINFO_FILE='${DISTINFO_FILE}' \
3865 dp_ECHO_MSG='${ECHO_MSG}' \
3866 dp_SCRIPTSDIR='${SCRIPTSDIR}' \
3867 ${SH} ${SCRIPTSDIR}/makesum.sh ${DISTFILES:C/.*/'&'/}
3870 .if !target(checksum)
3872 .if !empty(_CKSUMFILES) && !defined(NO_CHECKSUM)
3874 ${_CHECKSUM_INIT_ENV} \
3875 dp_CHECKSUM_ALGORITHMS='${CHECKSUM_ALGORITHMS:tu}' \
3876 dp_CURDIR='${.CURDIR}' \
3877 dp_DISTDIR='${DISTDIR}' \
3878 dp_DISTINFO_FILE='${DISTINFO_FILE}' \
3879 dp_DIST_SUBDIR='${DIST_SUBDIR}' \
3880 dp_ECHO_MSG='${ECHO_MSG}' \
3881 dp_FETCH_REGET='${FETCH_REGET}' \
3883 dp_MAKEFLAGS='${.MAKEFLAGS}' \
3884 dp_SCRIPTSDIR='${SCRIPTSDIR}' \
3885 dp_DISABLE_SIZE='${DISABLE_SIZE}' \
3886 dp_NO_CHECKSUM='${NO_CHECKSUM}' \
3887 ${SH} ${SCRIPTSDIR}/checksum.sh ${_CKSUMFILES:C/.*/'&'/}
3891 # Some port's archives contains files modes that are a bit too restrictive for
3892 # some usage. For example:
3893 # BUILD_DEPENDS= ${NONEXISTENT}:foo/bar:configure
3894 # When building as a regular user, dependencies are installed/built as root, so
3895 # if the archive contains files that have a mode of, say, 600, they will not be
3896 # readable by the port requesting the dependency.
3897 # This will also fix broken distribution files where directories don't have the
3898 # executable bit on.
3899 extract-fixup-modes:
3900 @${CHMOD} -R u+w,a+rX ${WRKDIR}
3902 ################################################################
3903 # The special package-building targets
3904 # You probably won't need to touch these
3905 ################################################################
3907 # Nobody should want to override this unless PKGNAME is simply bogus.
3909 .if !target(package-name)
3911 @${ECHO_CMD} ${PKGNAME}
3914 # Build a package but don't check the package cookie
3916 .if !target(repackage)
3917 repackage: pre-repackage package
3920 @${RM} ${PACKAGE_COOKIE}
3923 # Build a package but don't check the cookie for installation, also don't
3924 # install package cookie
3926 .if !target(package-noinstall)
3927 package-noinstall: package
3930 ################################################################
3931 # Dependency checking
3932 ################################################################
3934 .if !target(depends)
3935 depends: pkg-depends extract-depends patch-depends lib-depends fetch-depends build-depends run-depends
3937 .for deptype in PKG EXTRACT PATCH FETCH BUILD LIB RUN TEST
3938 ${deptype:tl}-depends:
3939 .if defined(${deptype}_DEPENDS) && !defined(NO_DEPENDS)
3941 dp_RAWDEPENDS="${${deptype}_DEPENDS}" \
3942 dp_DEPTYPE="${deptype}_DEPENDS" \
3943 dp_DEPENDS_TARGET="${DEPENDS_TARGET}" \
3944 dp_DEPENDS_PRECLEAN="${DEPENDS_PRECLEAN}" \
3945 dp_DEPENDS_CLEAN="${DEPENDS_CLEAN}" \
3946 dp_DEPENDS_ARGS="${DEPENDS_ARGS}" \
3947 dp_USE_PACKAGE_DEPENDS="${USE_PACKAGE_DEPENDS}" \
3948 dp_USE_PACKAGE_DEPENDS_ONLY="${USE_PACKAGE_DEPENDS_ONLY}" \
3949 dp_PKG_ADD="${PKG_ADD}" \
3950 dp_PKG_INFO="${PKG_INFO}" \
3951 dp_WRKDIR="${WRKDIR}" \
3952 dp_PKGNAME="${PKGNAME}" \
3953 dp_STRICT_DEPENDS="${STRICT_DEPENDS}" \
3954 dp_LOCALBASE="${LOCALBASE}" \
3955 dp_LIB_DIRS="${LIB_DIRS}" \
3957 dp_SCRIPTSDIR="${SCRIPTSDIR}" \
3958 PORTSDIR="${PORTSDIR}" \
3960 ${SH} ${SCRIPTSDIR}/do-depends.sh
3966 # Dependency lists: both build and runtime, recursive. Print out directory names.
3968 _UNIFIED_DEPENDS=${PKG_DEPENDS} ${EXTRACT_DEPENDS} ${PATCH_DEPENDS} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS} ${RUN_DEPENDS} ${TEST_DEPENDS}
3969 _DEPEND_SPECIALS= ${_UNIFIED_DEPENDS:M*\:*\:*:C,^[^:]*:([^:]*):.*$,\1,}
3971 .for d in ${_UNIFIED_DEPENDS:M*\:/*}
3972 _PORTSDIR_STR= $${PORTSDIR}/
3973 DEV_WARNING+= "It looks like the ${d} depends line has an absolute port origin, make sure to remove \$${_PORTSDIR_STR} from it."
3977 @${ALL-DEPENDS-LIST}
3979 # This script is shared among several dependency list variables. See file for
3983 PORTSDIR="${PORTSDIR}" \
3985 dp_PKGNAME="${PKGNAME}" \
3986 dp_PKG_INFO="${PKG_INFO}" \
3987 dp_SCRIPTSDIR="${SCRIPTSDIR}" \
3988 ${SH} ${SCRIPTSDIR}/depends-list.sh
3990 ALL-DEPENDS-LIST= ${DEPENDS-LIST} -r ${_UNIFIED_DEPENDS:Q}
3991 MISSING-DEPENDS-LIST= ${DEPENDS-LIST} -m ${_UNIFIED_DEPENDS:Q}
3992 TEST-DEPENDS-LIST= ${DEPENDS-LIST} ${TEST_DEPENDS:Q}
3993 CLEAN-DEPENDS-LIST= ${DEPENDS-LIST} -wr ${_UNIFIED_DEPENDS:Q}
3994 CLEAN-DEPENDS-LIMITED-LIST= ${DEPENDS-LIST} -w ${_UNIFIED_DEPENDS:Q}
3996 .if !target(clean-depends)
3998 @for dir in $$(${CLEAN-DEPENDS-LIST}); do \
3999 (cd $$dir; ${MAKE} NOCLEANDEPENDS=yes clean); \
4003 .if !target(limited-clean-depends)
4004 limited-clean-depends:
4005 @for dir in $$(${CLEAN-DEPENDS-LIMITED-LIST}); do \
4006 (cd $$dir; ${MAKE} NOCLEANDEPENDS=yes clean); \
4010 .if !target(deinstall-depends)
4012 @for dir in $$(${ALL-DEPENDS-LIST}); do \
4013 (cd $$dir; ${MAKE} deinstall); \
4017 .if !target(fetch-specials)
4019 @${ECHO_MSG} "===> Fetching all distfiles required by ${PKGNAME} for building"
4020 @for dir in ${_DEPEND_SPECIALS}; do \
4023 *) dir=${PORTSDIR}/$$dir ;; \
4025 (cd $$dir; ${MAKE} fetch); \
4029 .if !target(fetch-recursive)
4031 @${ECHO_MSG} "===> Fetching all distfiles for ${PKGNAME} and dependencies"
4032 @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \
4033 (cd $$dir; ${MAKE} fetch); \
4037 .if !target(fetch-recursive-list)
4038 fetch-recursive-list:
4039 @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \
4040 (cd $$dir; ${MAKE} fetch-list); \
4044 # Used by fetch-required and fetch-required list, this script looks
4045 # at each of the dependencies. If 3 items are specified in the tuple,
4046 # such as foo:graphics/foo:extract, the first item (foo)
4047 # is examined. Only if it begins with a / and does not exist on the
4048 # file-system will ``make targ'' proceed.
4049 # For more usual (dual-item) dependency tuples, the ``make targ''
4050 # proceeds, if the exact package, which the directory WOULD'VE installed,
4051 # is not yet installed.
4052 # This is the exact behaviour of the old code, and it may need
4053 # revisiting. For example, the entire first case seems dubious, and in
4054 # the second case we, probably, should be satisfied with _any_ (earlier)
4055 # package, with the same origin as that of the dir.
4058 FETCH_LIST?= for i in $$deps; do \
4059 prog=$${i%%:*}; dir=$${i\#*:}; \
4062 *) dir=${PORTSDIR}/$$dir ;; \
4065 *:*) if [ $$prog != $${prog\#/} -o ! -e $$prog ]; then \
4070 *) if [ -d ${PKG_DBDIR}/$$(cd $$dir; ${MAKE} -V '$${PKGNAME}') ]; then \
4074 echo cd $$dir; cd $$dir; ${MAKE} $$targ; \
4077 .if !target(fetch-required)
4078 fetch-required: fetch
4079 .if defined(NO_DEPENDS)
4080 @${ECHO_MSG} "===> NO_DEPENDS is set, not fetching any other distfiles for ${PKGNAME}"
4082 @${ECHO_MSG} "===> Fetching all required distfiles for ${PKGNAME} and dependencies"
4083 .for deptype in PKG EXTRACT PATCH FETCH BUILD RUN
4084 .if defined(${deptype}_DEPENDS)
4085 @targ=fetch; deps="${${deptype}_DEPENDS}"; ${FETCH_LIST}
4092 .if !target(fetch-required-list)
4093 fetch-required-list: fetch-list
4094 .if !defined(NO_DEPENDS)
4095 .for deptype in PKG EXTRACT PATCH FETCH BUILD RUN
4096 .if defined(${deptype}_DEPENDS)
4097 @targ=fetch-list; deps="${${deptype}_DEPENDS}"; ${FETCH_LIST}
4103 .if !target(checksum-recursive)
4105 @${ECHO_MSG} "===> Fetching and checking checksums for ${PKGNAME} and dependencies"
4106 @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \
4107 (cd $$dir; ${MAKE} checksum); \
4111 # Dependency lists: build and runtime. Print out directory names.
4114 .if defined(PKG_DEPENDS) || defined(EXTRACT_DEPENDS) || defined(PATCH_DEPENDS) || defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || defined(LIB_DEPENDS)
4115 @${BUILD-DEPENDS-LIST}
4118 BUILD-DEPENDS-LIST= \
4119 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 \
4122 *) pdir=${PORTSDIR}/$$dir ;; \
4124 if [ -d $$pdir ]; then \
4125 ${ECHO_CMD} $$pdir; \
4127 ${ECHO_MSG} "${PKGNAME}: \"$$pdir\" non-existent -- dependency list incomplete" >&2; \
4132 .if defined(LIB_DEPENDS) || defined(RUN_DEPENDS)
4133 @${RUN-DEPENDS-LIST}
4137 for dir in $$(${ECHO_CMD} "${_LIB_RUN_DEPENDS:C,.*:([^:]*).*,\1,}" | ${SED} -e 'y/ /\n/' | ${SORT} -u); do \
4140 *) pdir=${PORTSDIR}/$$dir ;; \
4142 if [ -d $$pdir ]; then \
4143 ${ECHO_CMD} $$pdir; \
4145 ${ECHO_MSG} "${PKGNAME}: \"$$pdir\" non-existent -- dependency list incomplete" >&2; \
4150 .if defined(TEST_DEPENDS)
4151 @${TEST-DEPENDS-LIST}
4154 # Package (recursive runtime) dependency list. Print out both directory names
4155 # and package names.
4157 package-depends-list:
4158 .if defined(CHILD_DEPENDS) || defined(LIB_DEPENDS) || defined(RUN_DEPENDS)
4159 @${PACKAGE-DEPENDS-LIST}
4162 _LIB_RUN_DEPENDS= ${LIB_DEPENDS} ${RUN_DEPENDS}
4163 PACKAGE-DEPENDS-LIST?= \
4164 if [ "${CHILD_DEPENDS}" ]; then \
4165 installed=$$(${PKG_INFO} -qO ${PKGORIGIN} 2>/dev/null || \
4167 if [ "$$installed" ]; then \
4170 if [ -z "$$installed" ]; then \
4171 installed="${PKGNAME}"; \
4173 for pkgname in $$installed; do \
4174 ${ECHO_CMD} "$$pkgname ${.CURDIR} ${PKGORIGIN}"; \
4177 checked="${PARENT_CHECKED}"; \
4178 for dir in ${_LIB_RUN_DEPENDS:C,[^:]*:([^:]*):?.*,\1,}; do \
4181 *) dir=${PORTSDIR}/$$dir ;; \
4183 dir=$$(${REALPATH} $$dir); \
4184 if [ -d $$dir ]; then \
4186 $$dir|$$dir\ *|*\ $$dir|*\ $$dir\ *) continue;; \
4188 childout=$$(cd $$dir; ${MAKE} CHILD_DEPENDS=yes PARENT_CHECKED="$$checked" package-depends-list); \
4189 set -- $$childout; \
4191 while [ $$\# != 0 ]; do \
4192 childdir="$$childdir $$2"; \
4193 ${ECHO_CMD} "$$1 $$2 $$3"; \
4196 checked="$$dir $$childdir $$checked"; \
4198 ${ECHO_MSG} "${PKGNAME}: \"$$dir\" non-existent -- dependency list incomplete" >&2; \
4202 ACTUAL-PACKAGE-DEPENDS?= \
4204 for lib in ${LIB_DEPENDS:C/\:.*//}; do \
4205 depfiles="$$depfiles `${SETENV} LIB_DIRS="${LIB_DIRS}" LOCALBASE="${LOCALBASE}" ${SH} ${SCRIPTSDIR}/find-lib.sh $${lib}`" ; \
4207 ${SETENV} PKG_BIN="${PKG_BIN}" ${SH} ${SCRIPTSDIR}/actual-package-depends.sh $${depfiles} ${RUN_DEPENDS:C/(.*)\:.*/"\1"/}
4210 .for note in ${PKG_NOTES}
4211 PKG_NOTES_ENV+= dp_PKG_NOTE_${note}=${PKG_NOTE_${note}:Q}
4216 dp_SCRIPTSDIR='${SCRIPTSDIR}' \
4217 dp_ACTUAL_PACKAGE_DEPENDS='${ACTUAL-PACKAGE-DEPENDS}' \
4218 dp_CATEGORIES='${CATEGORIES:u:S/$/,/}' \
4219 dp_COMMENT=${COMMENT:Q} \
4220 dp_COMPLETE_OPTIONS_LIST='${COMPLETE_OPTIONS_LIST}' \
4221 dp_DEPRECATED=${DEPRECATED:Q} \
4222 dp_DESCR='${DESCR}' \
4223 dp_EXPIRATION_DATE='${EXPIRATION_DATE}' \
4224 dp_GROUPS='${GROUPS:u:S/$/,/}' \
4225 dp_LICENSE='${LICENSE:u:S/$/,/}' \
4226 dp_LICENSE_COMB='${LICENSE_COMB}' \
4227 dp_MAINTAINER='${MAINTAINER}' \
4228 dp_METADIR='${METADIR}' \
4229 dp_NO_ARCH='${NO_ARCH}' \
4230 dp_PKGBASE='${PKGBASE}' \
4231 dp_PKGDEINSTALL='${PKGDEINSTALL}' \
4232 dp_PKGINSTALL='${PKGINSTALL}' \
4233 dp_PKGMESSAGES='${_PKGMESSAGES}' \
4234 dp_PKGORIGIN='${PKGORIGIN}' \
4235 dp_PKGPOSTDEINSTALL='${PKGPOSTDEINSTALL}' \
4236 dp_PKGPOSTINSTALL='${PKGPOSTINSTALL}' \
4237 dp_PKGPOSTUPGRADE='${PKGPOSTUPGRADE}' \
4238 dp_PKGPREDEINSTALL='${PKGPREDEINSTALL}' \
4239 dp_PKGPREINSTALL='${PKGPREINSTALL}' \
4240 dp_PKGPREUPGRADE='${PKGPREUPGRADE}' \
4241 dp_PKGUPGRADE='${PKGUPGRADE}' \
4242 dp_PKGVERSION='${PKGVERSION}' \
4243 dp_PKG_BIN='${PKG_BIN}' \
4244 dp_PKG_IGNORE_DEPENDS='${PKG_IGNORE_DEPENDS}' \
4245 dp_PKG_NOTES='${PKG_NOTES}' \
4246 dp_PORT_OPTIONS='${PORT_OPTIONS}' \
4247 dp_PREFIX='${PREFIX}' \
4248 dp_USERS='${USERS:u:S/$/,/}' \
4251 ${SH} ${SCRIPTSDIR}/create-manifest.sh
4254 # Print out package names.
4257 @${PACKAGE-DEPENDS-LIST} | ${AWK} '{print $$1":"$$3}'
4259 actual-package-depends:
4260 @${ACTUAL-PACKAGE-DEPENDS}
4262 # Build packages for port and dependencies
4264 package-recursive: package
4265 @for dir in $$(${ALL-DEPENDS-LIST}); do \
4266 (cd $$dir; ${MAKE} package-noinstall); \
4269 # Show missing dependencies
4271 @for dir in $$(${MISSING-DEPENDS-LIST}); do \
4272 echo $${dir#${PORTSDIR}/}; \
4275 # Show missing dependencies by name
4277 @_packages=$$(${PKG_INFO} -aq); \
4278 for dir in $$(${ALL-DEPENDS-LIST}); do \
4279 _p=$$(cd $$dir; ${MAKE} -VPKGNAME); \
4280 if ! $$(${ECHO_CMD} $${_packages} | ${GREP} -q $${_p}); then \
4281 ${ECHO_CMD} $${_p}; \
4285 ################################################################
4286 # Everything after here are internal targets and really
4287 # shouldn't be touched by anybody but the release engineers.
4288 ################################################################
4290 # This target generates an index entry suitable for aggregation into
4291 # a large index. Format is:
4293 # distribution-name|port-path|installation-prefix|comment| \
4294 # description-file|maintainer|categories|extract-depends| \
4295 # patch-depends|fetch-depends|build-depends|run-depends|www site
4297 # If this ever changes, portmgr should contact the portsnap maintainer
4298 # first to avoid gratuitous breakage.
4300 . if !target(describe)
4301 _EXTRACT_DEPENDS=${EXTRACT_DEPENDS:C/^[^ :]+:([^ :@]+)(@[^ :]+)?(:[^ :]+)?/\1/:O:u:C,(^[^/]),${PORTSDIR}/\1,}
4302 _PATCH_DEPENDS=${PATCH_DEPENDS:C/^[^ :]+:([^ :@]+)(@[^ :]+)?(:[^ :]+)?/\1/:O:u:C,(^[^/]),${PORTSDIR}/\1,}
4303 _FETCH_DEPENDS=${FETCH_DEPENDS:C/^[^ :]+:([^ :@]+)(@[^ :]+)?(:[^ :]+)?/\1/:O:u:C,(^[^/]),${PORTSDIR}/\1,}
4304 _LIB_DEPENDS=${LIB_DEPENDS:C/^[^ :]+:([^ :@]+)(@[^ :]+)?(:[^ :]+)?/\1/:O:u:C,(^[^/]),${PORTSDIR}/\1,}
4305 _BUILD_DEPENDS=${BUILD_DEPENDS:C/^[^ :]+:([^ :@]+)(@[^ :]+)?(:[^ :]+)?/\1/:O:u:C,(^[^/]),${PORTSDIR}/\1,} ${_LIB_DEPENDS}
4306 _RUN_DEPENDS=${RUN_DEPENDS:C/^[^ :]+:([^ :@]+)(@[^ :]+)?(:[^ :]+)?/\1/:O:u:C,(^[^/]),${PORTSDIR}/\1,} ${_LIB_DEPENDS}
4307 . if exists(${DESCR})
4313 . if defined(BUILDING_INDEX) && defined(INDEX_PORTS)
4314 INDEX_OUT=${INDEX_TMPDIR}/${INDEXFILE}.desc.aggr
4316 INDEX_OUT=/dev/stdout
4320 @(${ECHO_CMD} -n "${PKGNAME}|${.CURDIR}|${PREFIX}|"; \
4321 ${ECHO_CMD} -n ${COMMENT:Q}; \
4322 ${ECHO_CMD} -n "|${_DESCR}|${MAINTAINER}|${CATEGORIES}|${_EXTRACT_DEPENDS}|${_PATCH_DEPENDS}|${_FETCH_DEPENDS}|${_BUILD_DEPENDS:O:u}|${_RUN_DEPENDS:O:u}|"; \
4323 while read one two discard; do \
4325 WWW:) case "$$two" in \
4326 https://*|http://*|ftp://*) ${ECHO_CMD} -n "$$two" ;; \
4327 *) ${ECHO_CMD} -n "http://$$two" ;; \
4332 done < ${DESCR}; ${ECHO_CMD}) >>${INDEX_OUT}
4336 .if exists(${DESCR})
4337 @${AWK} '$$1 ~ /^WWW:/ {print $$2}' ${DESCR} | ${HEAD} -1
4342 .if !target(readmes)
4348 @${RM} ${.CURDIR}/README.html
4349 @cd ${.CURDIR} && ${MAKE} ${.CURDIR}/README.html
4352 ${.CURDIR}/README.html:
4353 @${ECHO_MSG} "===> Creating README.html for ${PKGNAME}"
4354 @${SED} -e 's|%%PORT%%|'$$(${ECHO_CMD} ${.CURDIR} | \
4355 ${SED} -e 's|.*/\([^/]*/[^/]*\)$$|\1|')'|g' \
4356 -e 's|%%PKG%%|${PKGNAME}|g' \
4357 -e 's|%%COMMENT%%|'"$$(${ECHO_CMD} ${COMMENT:Q})"'|' \
4358 -e '/%%COMMENT%%/d' \
4359 -e 's|%%DESCR%%|'"$$(${ECHO_CMD} ${DESCR} | \
4360 ${SED} -e 's|${.CURDIR}/||')"'|' \
4361 -e 's|%%EMAIL%%|'"$$(${ECHO_CMD} "${MAINTAINER}" | \
4362 ${SED} -e 's/([^)]*)//;s/.*<//;s/>.*//')"'|g' \
4363 -e 's|%%MAINTAINER%%|${MAINTAINER}|g' \
4364 -e 's|%%WEBSITE%%|'"$$(cd ${.CURDIR} && eval ${MAKE} pretty-print-www-site)"'|' \
4365 -e 's|%%BUILD_DEPENDS%%|'"$$(cd ${.CURDIR} && eval ${MAKE} pretty-print-build-depends-list)"'|' \
4366 -e 's|%%RUN_DEPENDS%%|'"$$(cd ${.CURDIR} && eval ${MAKE} pretty-print-run-depends-list)"'|' \
4367 -e 's|%%TOP%%|'"$$(${ECHO_CMD} ${CATEGORIES} | \
4368 ${SED} -e 's| .*||' -e 's|[^/]*|..|g')"'/..|' \
4369 ${TEMPLATES}/README.port >> ${.TARGET}
4371 # The following two targets require an up-to-date INDEX in ${PORTSDIR}
4373 _PRETTY_PRINT_DEPENDS_LIST=\
4374 if [ ! -r ${INDEXDIR}/${INDEXFILE} ] ; then \
4375 ${ECHO_MSG} "${.TARGET} requires an INDEX file (${INDEXFILE}). Please run make index or make fetchindex."; \
4377 target=${.TARGET:C/pretty-print-(.*)-depends-list/\1/} ; \
4378 if [ "$$target" = "build" ] ; then fldnum=8 ; else fldnum=9 ; fi; \
4379 ${ECHO_MSG} -n 'This port requires package(s) "' ; \
4380 ${ECHO_MSG} -n `${AWK} -F\| "\\$$1 ~ /^${PKGNAME}/ {print \\$$$${fldnum};}" ${INDEXDIR}/${INDEXFILE}` ; \
4381 ${ECHO_MSG} "\" to $$target."; \
4385 .if !target(pretty-print-build-depends-list)
4386 pretty-print-build-depends-list:
4387 .if defined(PKG_DEPENDS) || defined(EXTRACT_DEPENDS) || defined(PATCH_DEPENDS) || \
4388 defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || defined(LIB_DEPENDS)
4389 @${_PRETTY_PRINT_DEPENDS_LIST}
4393 .if !target(pretty-print-run-depends-list)
4394 pretty-print-run-depends-list:
4395 .if defined(RUN_DEPENDS) || defined(LIB_DEPENDS)
4396 @${_PRETTY_PRINT_DEPENDS_LIST}
4400 _SUB_LIST_TEMP= ${SUB_LIST:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/}
4401 .if !target(apply-slist)
4403 .if defined(SUB_FILES)
4404 .for file in ${SUB_FILES}
4405 .if exists(${FILESDIR}/${file}.in)
4406 @${SED} ${_SUB_LIST_TEMP} -e '/^@comment /d' ${FILESDIR}/${file}.in > ${WRKDIR}/${file}
4407 .elif exists(${DFLY_FILESDIR}/${file}.in)
4408 @${SED} ${_SUB_LIST_TEMP} -e '/^@comment /d' ${DFLY_FILESDIR}/${file}.in > ${WRKDIR}/${file}
4410 @${ECHO_MSG} "** Checked ${FILESDIR}:"; \
4411 @${ECHO_MSG} "** Checked ${DFLY_FILESDIR}:"; \
4412 @${ECHO_MSG} "** Missing ${file}.in for ${PKGNAME}."; \
4416 .for i in pkg-message pkg-install pkg-deinstall pkg-req
4417 .if ${SUB_FILES:M${i}*}!=""
4418 ${i:S/-//:tu}= ${WRKDIR}/${SUB_FILES:M${i}*}
4424 # Generate packing list. Also tests to make sure all required package
4427 .if !target(generate-plist)
4428 generate-plist: ${WRKDIR}
4429 @${ECHO_MSG} "===> Generating temporary packing list"
4430 @${MKDIR} ${TMPPLIST:H}
4431 @if [ ! -f ${DESCR} ]; then ${ECHO_MSG} "** Missing pkg-descr for ${PKGNAME}."; exit 1; fi
4433 @for file in ${PLIST_FILES}; do \
4434 ${ECHO_CMD} $${file} | ${SED} ${PLIST_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} >> ${TMPPLIST}; \
4436 @if [ -f ${PLIST} ]; then \
4437 ${SED} ${PLIST_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} ${PLIST} >> ${TMPPLIST}; \
4440 .for dir in ${PLIST_DIRS}
4441 @${ECHO_CMD} ${dir} | ${SED} ${PLIST_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} -e 's,^,@dir ,' >> ${TMPPLIST}
4444 .if defined(USE_LINUX_PREFIX)
4445 .if defined(USE_LDCONFIG)
4446 @${ECHO_CMD} '@preexec [ -n "`/sbin/sysctl -q compat.linux.osrelease`" ] || ( echo "Cannot install package: kernel missing Linux support"; exit 1 )' >> ${TMPPLIST}
4447 @${ECHO_CMD} "@postexec ${LINUXBASE}/sbin/ldconfig" >> ${TMPPLIST}
4448 @${ECHO_CMD} "@postunexec ${LINUXBASE}/sbin/ldconfig" >> ${TMPPLIST}
4451 .if defined(USE_LDCONFIG)
4452 .if !defined(INSTALL_AS_USER)
4453 @${ECHO_CMD} "@postexec ${LDCONFIG} -m ${USE_LDCONFIG}" >> ${TMPPLIST}
4454 @${ECHO_CMD} "@postunexec ${LDCONFIG} -R" >> ${TMPPLIST}
4456 @${ECHO_CMD} "@postexec ${LDCONFIG} -m ${USE_LDCONFIG} || ${TRUE}" >> ${TMPPLIST}
4457 @${ECHO_CMD} "@postunexec ${LDCONFIG} -R || ${TRUE}" >> ${TMPPLIST}
4460 .if defined(USE_LDCONFIG32)
4461 .if !defined(INSTALL_AS_USER)
4462 @${ECHO_CMD} "@postexec ${LDCONFIG} -32 -m ${USE_LDCONFIG32}" >> ${TMPPLIST}
4463 @${ECHO_CMD} "@postunexec ${LDCONFIG} -32 -R" >> ${TMPPLIST}
4465 @${ECHO_CMD} "@postexec ${LDCONFIG} -32 -m ${USE_LDCONFIG32} || ${TRUE}" >> ${TMPPLIST}
4466 @${ECHO_CMD} "@postunexec ${LDCONFIG} -32 -R || ${TRUE}" >> ${TMPPLIST}
4473 @cd ${.CURDIR} && ${MAKE} generate-plist
4475 .for _type in EXAMPLES DOCS
4476 .if !target(add-plist-${_type:tl})
4477 .if defined(PORT${_type}) && !defined(NOPORT${_type})
4478 add-plist-${_type:tl}:
4479 .for x in ${PORT${_type}}
4480 @if ${ECHO_CMD} "${x}"| ${AWK} '$$1 ~ /(\*|\||\[|\]|\?|\{|\}|\$$)/ { exit 1};'; then \
4481 if [ ! -e ${STAGEDIR}${${_type}DIR}/${x} ]; then \
4482 ${ECHO_CMD} ${${_type}DIR}/${x} >> ${TMPPLIST}; \
4485 @${FIND} -P ${PORT${_type}:S/^/${STAGEDIR}${${_type}DIR}\//} ! -type d 2>/dev/null | \
4486 ${SED} -ne 's,^${STAGEDIR},,p' >> ${TMPPLIST}
4491 .if !target(add-plist-data)
4492 .if defined(PORTDATA)
4494 .for x in ${PORTDATA}
4495 @if ${ECHO_CMD} "${x}"| ${AWK} '$$1 ~ /(\*|\||\[|\]|\?|\{|\}|\$$)/ { exit 1};'; then \
4496 if [ ! -e ${STAGEDIR}${DATADIR}/${x} ]; then \
4497 ${ECHO_CMD} ${DATADIR}/${x} >> ${TMPPLIST}; \
4500 @${FIND} -P ${PORTDATA:S/^/${STAGEDIR}${DATADIR}\//} ! -type d 2>/dev/null | \
4501 ${SED} -ne 's,^${STAGEDIR},,p' >> ${TMPPLIST}
4505 .if !target(add-plist-info)
4509 @${LS} ${STAGEDIR}${PREFIX}/${INFO_PATH}/$i.info* | ${SED} -e s:${STAGEDIR}:@info\ :g >> ${TMPPLIST}
4514 # If we're installing into a non-standard PREFIX, we need to remove that directory at
4516 .if !target(add-plist-post)
4517 .if (${PREFIX} != ${LOCALBASE} && ${PREFIX} != ${LINUXBASE} && \
4518 ${PREFIX} != "/usr" && ${PREFIX} != "/" && !defined(NO_PREFIX_RMDIR))
4520 @${ECHO_CMD} "@dir ${PREFIX}" >> ${TMPPLIST}
4524 .if !target(install-rc-script)
4525 .if defined(USE_RC_SUBR)
4527 @${ECHO_MSG} "===> Staging rc.d startup script(s)"
4528 @for i in ${USE_RC_SUBR}; do \
4529 _prefix=${PREFIX}; \
4530 [ "${PREFIX}" = "/usr" ] && _prefix="" ; \
4531 ${INSTALL_SCRIPT} ${WRKDIR}/$${i} ${STAGEDIR}$${_prefix}/etc/rc.d/$${i%.sh}; \
4532 ${ECHO_CMD} "$${_prefix}/etc/rc.d/$${i%.sh}" >> ${TMPPLIST}; \
4537 .if !target(check-man)
4539 @${ECHO_MSG} "====> Checking man pages (check-man)"
4541 for dir in ${MANDIRS:S/^/${STAGEDIR}/} ; do \
4542 [ -d $$dir ] && mdirs="$$mdirs $$dir" ;\
4545 for dir in $$mdirs; do \
4546 for f in $$(find $$dir -name "*.gz"); do \
4547 ${ECHO_CMD} "===> Checking $${f##*/}" ; \
4548 gunzip -c $$f | mandoc -Tlint -Werror && continue ; \
4555 # Compress all manpage not already compressed which are not hardlinks
4556 # 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
4557 # Fixes all dead symlinks left by the previous round
4558 .if !target(compress-man)
4560 @${ECHO_MSG} "====> Compressing man pages (compress-man)"
4562 for dir in ${MANDIRS:S/^/${STAGEDIR}/} ; do \
4563 [ -d $$dir ] && mdirs="$$mdirs $$dir" ;\
4565 for dir in $$mdirs; do \
4566 ${FIND} $$dir -type f \! -name "*.gz" -links 1 -exec ${GZIP_CMD} {} \; ; \
4567 ${FIND} $$dir -type f \! -name "*.gz" \! -links 1 -exec ${STAT} -f '%i' {} \; | \
4568 ${SORT} -u | while read inode ; do \
4570 for f in $$(${FIND} $$dir -type f -inum $${inode} -print); do \
4571 if [ -z $$ref ]; then \
4573 ${GZIP_CMD} $${f} ; \
4577 (cd $${f%/*}; ${LN} -f $${ref##*/} $${f##*/}.gz) ; \
4580 ${FIND} $$dir -type l \! -name "*.gz" | while read link ; do \
4581 ${LN} -sf $$(readlink $$link).gz $$link.gz ;\
4587 .if !target(stage-dir)
4588 stage-dir: ${STAGEDIR}${PREFIX}
4589 .if !defined(NO_MTREE)
4590 @${MTREE_CMD} ${MTREE_ARGS} ${STAGEDIR}${PREFIX} > /dev/null
4594 .if !target(makeplist)
4596 @${SETENV} ${CO_ENV} ${SH} ${SCRIPTSDIR}/check-stagedir.sh makeplist
4599 .if !target(check-plist)
4601 @${ECHO_MSG} "====> Checking for pkg-plist issues (check-plist)"
4602 @${SETENV} ${CO_ENV} ${SH} ${SCRIPTSDIR}/check-stagedir.sh checkplist
4603 @${ECHO_MSG} "===> No pkg-plist issues found (check-plist)"
4606 .if !target(check-orphans)
4607 check-orphans: check-plist
4610 .if !target(stage-qa)
4612 @${ECHO_MSG} "====> Running Q/A tests (stage-qa)"
4613 @${SETENV} ${QA_ENV} ${SH} ${SCRIPTSDIR}/qa.sh
4614 .if !defined(DEVELOPER)
4615 @${ECHO_MSG} "/!\\ To run stage-qa automatically add DEVELOPER=yes to your environment /!\\"
4619 # Fake installation of package so that user can pkg delete it later.
4620 .if !target(fake-pkg)
4621 STAGE_ARGS= -i ${STAGEDIR}
4623 .if !defined(NO_PKG_REGISTER)
4624 fake-pkg: create-manifest
4625 .if defined(INSTALLS_DEPENDS)
4626 @${ECHO_MSG} "===> Registering installation for ${PKGNAME} as automatic"
4628 @${ECHO_MSG} "===> Registering installation for ${PKGNAME}"
4630 .if defined(INSTALLS_DEPENDS)
4631 @${SETENV} ${PKG_ENV} FORCE_POST="${_FORCE_POST_PATTERNS}" ${PKG_REGISTER} -d ${STAGE_ARGS} -m ${METADIR} -f ${TMPPLIST}
4633 @${SETENV} ${PKG_ENV} FORCE_POST="${_FORCE_POST_PATTERNS}" ${PKG_REGISTER} ${STAGE_ARGS} -m ${METADIR} -f ${TMPPLIST}
4635 @${RM} -r ${METADIR}
4639 # Depend is generally meaningless for arbitrary ports, but if someone wants
4640 # one they can override this. This is just to catch people who've gotten into
4641 # the habit of typing `make depend all install' as a matter of course.
4642 # Same goes for tags
4643 .for _t in depend tags
4649 .if !defined(NOPRECIOUSMAKEVARS)
4650 # These won't change, so we can pass them through the environment
4651 .for var in ${_EXPORTED_VARS}
4652 .if empty(.MAKEFLAGS:M${var}=*) && !empty(${var})
4653 .MAKEFLAGS: ${var}=${${var}:Q}
4658 .if !target(pre-check-config)
4660 .for single in ${OPTIONS_SINGLE}
4661 . for opt in ${OPTIONS_SINGLE_${single}}
4662 . if empty(ALL_OPTIONS:M${single}) || !empty(PORT_OPTIONS:M${single})
4663 . if !empty(PORT_OPTIONS:M${opt})
4664 OPTIONS_WRONG_SINGLE_${single}+= ${opt}
4665 . if defined(OPTFOUND)
4666 OPTIONS_WRONG_SINGLE+= ${single}
4672 # if conditional and if the condition is unchecked, remove opt from the list of
4674 PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}}
4678 . if !defined(OPTFOUND) && !defined(OPTNOCHECK)
4679 OPTIONS_WRONG_SINGLE+= ${single}
4686 .for radio in ${OPTIONS_RADIO}
4687 . for opt in ${OPTIONS_RADIO_${radio}}
4688 . if !empty(PORT_OPTIONS:M${opt})
4689 OPTIONS_WRONG_RADIO_${radio}+= ${opt}
4690 . if defined(OPTFOUND)
4691 OPTIONS_WRONG_RADIO+= ${radio}
4700 .for multi in ${OPTIONS_MULTI}
4701 . for opt in ${OPTIONS_MULTI_${multi}}
4702 . if empty(ALL_OPTIONS:M${multi}) || !empty(PORT_OPTIONS:M${multi})
4703 . if !empty(PORT_OPTIONS:M${opt})
4707 # if conditional and if the condition is unchecked, remove opt from the list of
4709 PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}}
4713 . if !defined(OPTFOUND) && !defined(OPTNOCHECK)
4714 OPTIONS_WRONG_MULTI+= ${multi}
4721 .for opt in ${PORT_OPTIONS}
4722 . for conflict in ${${opt}_PREVENTS}
4723 . if ${PORT_OPTIONS:M${conflict}}
4724 . if empty(OPTIONS_WRONG_PREVENTS:M${opt})
4725 OPTIONS_WRONG_PREVENTS+= ${opt}
4727 OPTIONS_WRONG_PREVENTS_${opt}+= ${conflict}
4733 .endif #pre-check-config
4735 .if !target(_check-config)
4736 _check-config: pre-check-config
4737 .for multi in ${OPTIONS_WRONG_MULTI}
4738 @${ECHO_MSG} "====> You must check at least one option in the ${multi} multi"
4740 .for single in ${OPTIONS_WRONG_SINGLE}
4741 @${ECHO_MSG} "====> You must select one and only one option from the ${single} single"
4742 .if defined(OPTIONS_WRONG_SINGLE_${single})
4743 @${ECHO_MSG} "=====> Only one of these must be defined: ${OPTIONS_WRONG_SINGLE_${single}}"
4745 @${ECHO_MSG} "=====> No option was selected (and one must be)"
4748 .for radio in ${OPTIONS_WRONG_RADIO}
4749 @${ECHO_MSG} "====> You cannot select multiple options from the ${radio} radio"
4750 @${ECHO_MSG} "=====> Only one of these must be defined: ${OPTIONS_WRONG_RADIO_${radio}}"
4752 .if defined(OPTIONS_WRONG_PREVENTS)
4753 @${ECHO_MSG} "====> Two or more enabled options conflict with each other"
4754 . for prevents in ${OPTIONS_WRONG_PREVENTS}
4755 @${ECHO_MSG} "=====> Option ${prevents} conflicts with ${OPTIONS_WRONG_PREVENTS_${prevents}} (select only one)"
4756 . if defined(${prevents}_PREVENTS_MSG)
4757 @${ECHO_MSG} "======> ${${prevents}_PREVENTS_MSG}"
4761 .if !empty(OPTIONS_WRONG_MULTI) || !empty(OPTIONS_WRONG_SINGLE) || !empty(OPTIONS_WRONG_RADIO) || !empty(OPTIONS_WRONG_PREVENTS)
4762 _CHECK_CONFIG_ERROR= true
4764 .endif # _check-config
4766 .if !target(check-config)
4767 check-config: _check-config
4768 .if !empty(_CHECK_CONFIG_ERROR)
4771 .endif # check-config
4773 .if !target(sanity-config)
4774 sanity-config: _check-config
4775 .if !empty(_CHECK_CONFIG_ERROR)
4776 @echo -n "Config is invalid. Re-edit? [Y/n] "; \
4782 cd ${.CURDIR} && ${MAKE} config
4784 .endif # sanity-config
4786 .if !target(pre-config)
4788 D4P_ENV= PKGNAME="${PKGNAME}" \
4789 PORT_OPTIONS="${PORT_OPTIONS}" \
4790 ALL_OPTIONS="${ALL_OPTIONS}" \
4791 OPTIONS_MULTI="${OPTIONS_MULTI}" \
4792 OPTIONS_SINGLE="${OPTIONS_SINGLE}" \
4793 OPTIONS_RADIO="${OPTIONS_RADIO}" \
4794 OPTIONS_GROUP="${OPTIONS_GROUP}" \
4795 NEW_OPTIONS="${NEW_OPTIONS}" \
4796 DIALOG4PORTS="${DIALOG4PORTS}" \
4797 PREFIX="${PREFIX}" \
4798 LOCALBASE="${LOCALBASE}" \
4799 PORTSDIR="${PORTSDIR}" \
4801 D4PHEIGHT="${D4PHEIGHT}" \
4802 D4PWIDTH="${D4PWIDTH}" \
4803 D4PFULLSCREEN="${D4PFULLSCREEN}"
4804 .if exists(${PKGHELP})
4805 D4P_ENV+= PKGHELP="${PKGHELP}"
4807 .for opt in ${ALL_OPTIONS}
4808 D4P_ENV+= ${opt}_DESC=""${${opt}_DESC:Q}""
4810 .for otype in MULTI GROUP SINGLE RADIO
4811 . for m in ${OPTIONS_${otype}}
4812 D4P_ENV+= OPTIONS_${otype}_${m}="${OPTIONS_${otype}_${m}}" \
4813 ${m}_DESC=""${${m}_DESC:Q}""
4814 . for opt in ${OPTIONS_${otype}_${m}}
4815 D4P_ENV+= ${opt}_DESC=""${${opt}_DESC:Q}""
4824 .if !target(do-config)
4826 .if empty(ALL_OPTIONS) && empty(OPTIONS_SINGLE) && empty(OPTIONS_MULTI) && empty(OPTIONS_RADIO) && empty(OPTIONS_GROUP)
4827 @${ECHO_MSG} "===> No options to configure"
4829 @optionsdir=${OPTIONS_FILE:H}; \
4830 if [ ! -w "${PORT_DBDIR}" -a "`stat -f %u ${PORT_DBDIR:H}`" = 0 ]; \
4832 ${ECHO_MSG} "===> Switching to root credentials to create $${optionsdir}"; \
4833 (${SU_CMD} "${SH} -c \"${MKDIR} $${optionsdir} 2> /dev/null\"") || \
4834 (${ECHO_MSG} "===> Cannot create $${optionsdir}, check permissions"; exit 1); \
4835 ${ECHO_MSG} "===> Returning to user credentials" ; \
4837 ${MKDIR} $${optionsdir} 2> /dev/null || \
4838 (${ECHO_MSG} "===> Cannot create $${optionsdir}, check permissions"; exit 1) ; \
4840 @TMPOPTIONSFILE=$$(mktemp -t portoptions); \
4841 trap "${RM} $${TMPOPTIONSFILE}; exit 1" 1 2 3 5 10 13 15; \
4842 ${SETENV} ${D4P_ENV} ${SH} ${SCRIPTSDIR}/dialog4ports.sh $${TMPOPTIONSFILE} || { \
4843 ${RM} $${TMPOPTIONSFILE}; \
4844 ${ECHO_MSG} "===> Options unchanged"; \
4848 if [ ! -e $${TMPOPTIONSFILE} ]; then \
4849 ${ECHO_MSG} "===> No user-specified options to save for ${PKGNAME}"; \
4852 SELOPTIONS=$$(${CAT} $${TMPOPTIONSFILE}); \
4853 ${RM} $${TMPOPTIONSFILE}; \
4854 TMPOPTIONSFILE=$$(mktemp -t portoptions); \
4855 trap "${RM} $${TMPOPTIONSFILE}; exit 1" 1 2 3 5 10 13 15; \
4856 ${ECHO_CMD} "# This file is auto-generated by 'make config'." > $${TMPOPTIONSFILE}; \
4857 ${ECHO_CMD} "# Options for ${PKGNAME}" >> $${TMPOPTIONSFILE}; \
4858 ${ECHO_CMD} "_OPTIONS_READ=${PKGNAME}" >> $${TMPOPTIONSFILE}; \
4859 ${ECHO_CMD} "_FILE_COMPLETE_OPTIONS_LIST=${COMPLETE_OPTIONS_LIST}" >> $${TMPOPTIONSFILE}; \
4860 for i in ${COMPLETE_OPTIONS_LIST}; do \
4861 if ${ECHO_CMD} $${SELOPTIONS} | ${GREP} -qw $${i}; then \
4862 ${ECHO_CMD} "OPTIONS_FILE_SET+=$${i}" >> $${TMPOPTIONSFILE}; \
4864 ${ECHO_CMD} "OPTIONS_FILE_UNSET+=$${i}" >> $${TMPOPTIONSFILE}; \
4867 if [ ! -w "${OPTIONS_FILE:H}" -a "`stat -f %u ${OPTIONS_FILE:H}`" != ${UID} ]; \
4869 ${ECHO_MSG} "===> Switching to root credentials to write ${OPTIONS_FILE}"; \
4870 ${SU_CMD} "${CAT} $${TMPOPTIONSFILE} > ${OPTIONS_FILE}"; \
4871 ${ECHO_MSG} "===> Returning to user credentials"; \
4873 ${CAT} $${TMPOPTIONSFILE} > ${OPTIONS_FILE}; \
4875 ${RM} $${TMPOPTIONSFILE}
4876 @cd ${.CURDIR} && ${MAKE} sanity-config
4881 .if !defined(NO_DIALOG)
4882 config: pre-config do-config
4885 @${ECHO_MSG} "===> Skipping 'config' as NO_DIALOG is defined"
4889 .if !target(config-recursive)
4891 @${ECHO_MSG} "===> Setting user-specified options for ${PKGNAME} and dependencies";
4892 @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \
4893 (cd $$dir; ${MAKE} config-conditional); \
4895 .endif # config-recursive
4897 .if !target(config-conditional)
4899 .if !empty(NEW_OPTIONS)
4900 @cd ${.CURDIR} && ${MAKE} config;
4902 .endif # config-conditional
4904 .if !target(showconfig) && (make(*config*) || (!empty(.MAKEFLAGS:M-V) && !empty(.MAKEFLAGS:M*_DESC)))
4905 .include "${PORTSDIR}/Mk/bsd.options.desc.mk"
4906 MULTI_EOL= : you have to choose at least one of them
4907 SINGLE_EOL= : you have to select exactly one of them
4908 RADIO_EOL= : you can only select none or one of them
4909 showconfig: check-config
4910 .if !empty(COMPLETE_OPTIONS_LIST)
4911 @${ECHO_MSG} "===> The following configuration options are available for ${PKGNAME}":
4912 .for opt in ${ALL_OPTIONS}
4913 @[ -z "${PORT_OPTIONS:M${opt}}" ] || match="on" ; ${ECHO_MSG} -n " ${opt}=$${match:-off}"
4914 . if !empty(${opt}_DESC)
4915 @${ECHO_MSG} -n ": "${${opt}_DESC:Q}
4920 #multi and conditional multis
4921 .for otype in MULTI GROUP SINGLE RADIO
4922 . for m in ${OPTIONS_${otype}}
4923 . if empty(${m}_DESC)
4924 @${ECHO_MSG} "====> Options available for the ${otype:tl} ${m}${${otype}_EOL}"
4926 @${ECHO_MSG} "====> ${${m}_DESC}${${otype}_EOL}"
4928 . for opt in ${OPTIONS_${otype}_${m}}
4929 @[ -z "${PORT_OPTIONS:M${opt}}" ] || match="on" ; ${ECHO_MSG} -n " ${opt}=$${match:-off}"
4930 . if !empty(${opt}_DESC)
4931 @${ECHO_MSG} -n ": "${${opt}_DESC:Q}
4941 @${ECHO_MSG} "===> Use 'make config' to modify these settings"
4945 .if !target(showconfig-recursive)
4946 showconfig-recursive:
4947 @${ECHO_MSG} "===> The following configuration options are available for ${PKGNAME} and dependencies";
4948 @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \
4949 (cd $$dir; ${MAKE} showconfig); \
4951 .endif # showconfig-recursive
4953 .if !target(rmconfig)
4955 .if exists(${OPTIONS_FILE})
4956 -@${ECHO_MSG} "===> Removing user-configured options for ${PKGNAME}"; \
4957 optionsdir=${OPTIONS_FILE:H}; \
4958 if [ ${UID} != 0 -a "x${INSTALL_AS_USER}" = "x" -a ! -w "${OPTIONS_FILE}" ]; then \
4959 ${ECHO_MSG} "===> Switching to root credentials to remove ${OPTIONS_FILE} and $${optionsdir}"; \
4960 ${SU_CMD} "${RM} ${OPTIONS_FILE} ; \
4961 ${RMDIR} $${optionsdir}"; \
4962 ${ECHO_MSG} "===> Returning to user credentials"; \
4964 ${RM} ${OPTIONS_FILE}; \
4965 ${RMDIR} $${optionsdir} 2>/dev/null || return 0; \
4968 @${ECHO_MSG} "===> No user-specified options configured for ${PKGNAME}"
4972 .if !target(rmconfig-recursive)
4974 @${ECHO_MSG} "===> Removing user-specified options for ${PKGNAME} and dependencies";
4975 @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \
4976 (cd $$dir; ${MAKE} rmconfig); \
4978 .endif # rmconfig-recursive
4980 .if !target(pretty-print-config)
4989 pretty-print-config:
4990 .for opt in ${ALL_OPTIONS}
4991 @[ -z "${PORT_OPTIONS:M${opt}}" ] || match="+" ; ${ECHO_MSG} -n "$${match:--}${opt} "
4993 .for otype in MULTI GROUP SINGLE RADIO
4994 . for m in ${OPTIONS_${otype}}
4995 @${ECHO_MSG} -n "${m}${${otype}_START} "
4996 . for opt in ${OPTIONS_${otype}_${m}}
4997 @[ -z "${PORT_OPTIONS:M${opt}}" ] || match="+" ; ${ECHO_MSG} -n "$${match:--}${opt} "
4999 @${ECHO_MSG} -n "${${otype}_END} "
5006 .endif # pretty-print-config
5010 for native_category in ${CATEGORIES}; do \
5012 case $$native_category in \
5013 accessibility) c="Utility Accessibility" ;; \
5014 archivers) c="Utility Archiving" ;; \
5015 astro) c="Education Science Astronomy" ;; \
5016 audio) c="AudioVideo Audio" ;; \
5017 benchmarks) c="System" ;; \
5018 biology) c="Education Science Biology" ;; \
5019 cad) c="Graphics Engineering" ;; \
5020 comms) c="Utility" ;; \
5021 converters) c="Utility" ;; \
5022 databases) c="Office Database" ;; \
5023 deskutils) c="Utility" ;; \
5024 devel) c="Development" ;; \
5025 dns) c="Network" ;; \
5026 elisp) c="Development" ;; \
5027 editors) c="Utility" ;; \
5028 emulators) c="System Emulator" ;; \
5029 finance) c="Office Finance" ;; \
5030 ftp) c="Network FileTransfer" ;; \
5031 games) c="Game" ;; \
5032 geography) c="Education Science Geography" ;; \
5033 gnome) c="GNOME GTK" ;; \
5034 graphics) c="Graphics" ;; \
5035 hamradio) c="HamRadio" ;; \
5036 haskell) c="Development" ;; \
5037 irc) c="Network IRCClient" ;; \
5038 java) c="Development Java" ;; \
5039 kde) c="KDE Qt" ;; \
5040 lang) c="Development" ;; \
5041 lisp) c="Development" ;; \
5042 mail) c="Office Email" ;; \
5043 mate) c="MATE GTK" ;; \
5044 math) c="Education Science Math" ;; \
5045 mbone) c="Network AudioVideo" ;; \
5046 multimedia) c="AudioVideo" ;; \
5047 net) c="Network" ;; \
5048 net-im) c="Network InstantMessaging" ;; \
5049 net-mgmt) c="Network" ;; \
5050 net-p2p) c="Network P2P" ;; \
5051 news) c="Network News" ;; \
5052 palm) c="Office PDA" ;; \
5053 parallel) c="ParallelComputing" ;; \
5054 pear) c="Development WebDevelopment" ;; \
5055 perl5) c="Development" ;; \
5056 python) c="Development" ;; \
5057 ruby) c="Development" ;; \
5058 rubygems) c="Development" ;; \
5059 scheme) c="Development" ;; \
5060 science) c="Science Education" ;; \
5061 security) c="System Security" ;; \
5062 shells) c="System Shell" ;; \
5063 sysutils) c="System" ;; \
5064 tcl*|tk*) c="Development" ;; \
5065 textproc) c="Utility TextTools" ;; \
5066 www) c="Network" ;; \
5067 x11-clocks) c="Utility Clock" ;; \
5068 x11-fm) c="System FileManager" ;; \
5069 xfce) c="GTK XFCE" ;; \
5070 zope) c="Development WebDevelopment" ;; \
5072 if [ -n "$$c" ]; then \
5073 categories="$$categories $$c"; \
5076 if [ -n "$$categories" ]; then \
5077 for c in $$categories; do ${ECHO_MSG} "$$c"; done \
5078 | ${SORT} -u | ${TR} '\n' ';'; \
5082 # http://standards.freedesktop.org/menu-spec/menu-spec-latest.html
5083 DESKTOP_CATEGORIES_MAIN= AudioVideo Audio Video Development Education \
5084 Game Graphics Network Office Science Settings System Utility
5085 DESKTOP_CATEGORIES_ADDITIONAL= Building Debugger IDE GUIDesigner Profiling \
5086 RevisionControl Translation Calendar ContactManagement Database \
5087 Dictionary Chart Email Finance FlowChart PDA ProjectManagement \
5088 Presentation Spreadsheet WordProcessor 2DGraphics VectorGraphics \
5089 RasterGraphics 3DGraphics Scanning OCR Photography Publishing Viewer \
5090 TextTools DesktopSettings HardwareSettings Printing PackageManager \
5091 Dialup InstantMessaging Chat IRCClient Feed FileTransfer HamRadio News \
5092 P2P RemoteAccess Telephony TelephonyTools VideoConference WebBrowser \
5093 WebDevelopment Midi Mixer Sequencer Tuner TV AudioVideoEditing Player \
5094 Recorder DiscBurning ActionGame AdventureGame ArcadeGame BoardGame \
5095 BlocksGame CardGame KidsGame LogicGame RolePlaying Shooter Simulation \
5096 SportsGame StrategyGame Art Construction Music Languages \
5097 ArtificialIntelligence Astronomy Biology Chemistry ComputerScience \
5098 DataVisualization Economy Electricity Geography Geology Geoscience \
5099 History Humanities ImageProcessing Literature Maps Math \
5100 NumericalAnalysis MedicalSoftware Physics Robotics Spirituality Sports \
5101 ParallelComputing Amusement Archiving Compression Electronics Emulator \
5102 Engineering FileTools FileManager TerminalEmulator Filesystem Monitor \
5103 Security Accessibility Calculator Clock TextEditor Documentation Adult \
5104 Core KDE GNOME MATE XFCE GTK Qt Motif Java ConsoleOnly
5105 DESKTOP_CATEGORIES_RESERVED= Screensaver TrayIcon Applet Shell
5107 VALID_DESKTOP_CATEGORIES+= ${DESKTOP_CATEGORIES_MAIN} \
5108 ${DESKTOP_CATEGORIES_ADDITIONAL} \
5109 ${DESKTOP_CATEGORIES_RESERVED}
5111 .if defined(DESKTOP_ENTRIES)
5112 check-desktop-entries:
5113 @set -- ${DESKTOP_ENTRIES} XXX; \
5114 if [ `${EXPR} \( $$# - 1 \) % 6` -ne 0 ]; then \
5115 ${ECHO_MSG} "${PKGNAME}: Makefile error: the DESKTOP_ENTRIES list must contain one or more groups of 6 elements"; \
5119 while [ $$# -gt 6 ]; do \
5121 if [ -n "$$4" ]; then \
5122 entry="$$entry ($$4)"; \
5123 elif [ -n "$$1" ]; then \
5124 entry="$$entry ($$1)"; \
5126 if [ -z "$$1" ]; then \
5127 ${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 1 (Name) is empty"; \
5130 if ${ECHO_CMD} "$$3" | ${EGREP} -iq '.(png|svg|xpm)$$'; then \
5131 if ! ${ECHO_CMD} "$$3" | ${GREP} -iq '^/'; then \
5132 ${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"; \
5135 if [ -z "$$4" ]; then \
5136 ${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 4 (Exec) is empty"; \
5139 if [ -n "$$5" ]; then \
5140 for c in `${ECHO_CMD} "$$5" | ${TR} ';' ' '`; do \
5141 if ! ${ECHO_CMD} ${VALID_DESKTOP_CATEGORIES} | ${GREP} -wq $$c; then \
5142 ${ECHO_CMD} "${PKGNAME}: Makefile warning: in desktop entry $$entry: category $$c is not a valid desktop category"; \
5145 if ! ${ECHO_CMD} "$$5" | ${GREP} -q "`${ECHO_CMD} ${DESKTOP_CATEGORIES_MAIN} | ${SED} -E 's,[[:blank:]]+,\\\|,g'`"; then \
5146 ${ECHO_CMD} "${PKGNAME}: Makefile warning: in desktop entry $$entry: field 5 (Categories) must contain at least one main desktop category (make -VDESKTOP_CATEGORIES_MAIN)"; \
5148 if ! ${ECHO_CMD} "$$5" | ${GREP} -q ';$$'; then \
5149 ${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 5 (Categories) does not end with a semicolon"; \
5153 if [ -z "`cd ${.CURDIR} && ${MAKE} desktop-categories`" ]; then \
5154 ${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 5 (Categories) is empty and could not be deduced from the CATEGORIES variable"; \
5158 if [ "x$$6" != "xtrue" ] && [ "x$$6" != "xfalse" ] && [ "x$$6" != "x" ]; then \
5159 ${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 6 (StartupNotify) is not \"true\", \"false\" or \"\"(empty)"; \
5163 num=`${EXPR} $$num + 1`; \
5167 .if !target(install-desktop-entries)
5168 .if defined(DESKTOP_ENTRIES)
5169 install-desktop-entries:
5170 @set -- ${DESKTOP_ENTRIES} XXX; \
5171 while [ $$# -gt 6 ]; do \
5172 filename="`${ECHO_CMD} "$$4" | ${SED} -e 's,^/,,g;s,[/ ],_,g;s,[^_[:alnum:]],,g'`.desktop"; \
5173 pathname="${STAGEDIR}${DESKTOPDIR}/$$filename"; \
5175 if [ -z "$$categories" ]; then \
5176 categories="`cd ${.CURDIR} && ${MAKE} desktop-categories`"; \
5178 ${ECHO_CMD} "${DESKTOPDIR}/$$filename" >> ${TMPPLIST}; \
5179 ${ECHO_CMD} "[Desktop Entry]" > $$pathname; \
5180 ${ECHO_CMD} "Type=Application" >> $$pathname; \
5181 ${ECHO_CMD} "Version=1.0" >> $$pathname; \
5182 ${ECHO_CMD} "Name=$$1" >> $$pathname; \
5184 if [ -z "$$2" ]; then \
5185 comment="`cd ${.CURDIR} && ${MAKE} -VCOMMENT`"; \
5187 ${ECHO_CMD} "GenericName=$$comment" >> $$pathname; \
5188 ${ECHO_CMD} "Comment=$$comment" >> $$pathname; \
5189 if [ -n "$$3" ]; then \
5190 ${ECHO_CMD} "Icon=$$3" >> $$pathname; \
5192 ${ECHO_CMD} "Exec=$$4" >> $$pathname; \
5193 ${ECHO_CMD} "Categories=$$categories" >> $$pathname; \
5194 if [ -n "$$6" ]; then \
5195 ${ECHO_CMD} "StartupNotify=$$6" >> $$pathname; \
5202 .if defined(WARNING)
5205 @${ECHO_MSG} "/!\\ WARNING /!\\"
5207 .for m in ${WARNING}
5208 @${ECHO_MSG} "${m}" | ${FMT_80}
5211 @sleep ${WARNING_WAIT}
5214 .if defined(DEVELOPER)
5215 .if defined(DEV_WARNING)
5216 DEV_WARNING_WAIT?= 10
5218 @${ECHO_MSG} "/!\\ ${PKGNAME}: Makefile warnings, please consider fixing /!\\"
5220 .for m in ${DEV_WARNING}
5221 @${ECHO_MSG} ${m} | ${FMT_80}
5224 .if defined(DEV_WARNING_FATAL)
5227 @sleep ${DEV_WARNING_WAIT}
5231 .if defined(DEV_ERROR)
5233 @${ECHO_MSG} "/!\\ ${PKGNAME}: Makefile errors /!\\"
5235 .for m in ${DEV_ERROR}
5236 @${ECHO_MSG} "${m}" | ${FMT_80}
5243 ${_PORTS_DIRECTORIES}:
5244 @${MKDIR} ${.TARGET}
5246 # Please note that the order of the following targets is important, and
5247 # should not be modified.
5249 _TARGETS_STAGES= SANITY PKG FETCH EXTRACT PATCH CONFIGURE BUILD INSTALL TEST PACKAGE STAGE
5251 # Define the SEQ of actions to take when each target is ran, and which targets
5252 # it depends on before running its SEQ.
5254 # Main target has a priority of 500, pre-target 300, post-target 700,
5255 # target-depends 150. Other targets are spaced in between those
5257 # If you change the pre-foo and post-foo values here, go and keep them in sync
5258 # in _OPTIONS_TARGETS in bsd.options.mk
5260 _SANITY_SEQ= 050:post-chroot 100:pre-everything \
5261 125:show-unsupported-system-error 150:check-makefile \
5262 200:show-warnings 210:show-dev-warnings 220:show-dev-errors \
5263 250:check-categories 300:check-makevars \
5264 350:check-desktop-entries 400:check-depends \
5265 450:identify-install-conflicts 500:check-deprecated \
5266 550:check-vulnerable 600:check-license 650:check-config \
5267 700:buildanyway-message 750:options-message ${_USES_sanity}
5269 _PKG_DEP= check-sanity
5270 _PKG_SEQ= 500:pkg-depends
5272 _FETCH_SEQ= 150:fetch-depends 300:pre-fetch 450:pre-fetch-script \
5273 500:do-fetch 550:fetch-specials 700:post-fetch \
5274 850:post-fetch-script \
5275 ${_OPTIONS_fetch} ${_USES_fetch}
5277 _EXTRACT_SEQ= 010:check-build-conflicts 050:extract-message 100:checksum \
5278 150:extract-depends 190:clean-wrkdir 200:${EXTRACT_WRKDIR} \
5279 300:pre-extract 450:pre-extract-script 500:do-extract \
5280 700:post-extract 850:post-extract-script \
5281 999:extract-fixup-modes \
5282 ${_OPTIONS_extract} ${_USES_extract} ${_SITES_extract}
5284 _PATCH_SEQ= 050:ask-license 100:patch-message 150:patch-depends \
5285 300:pre-patch 450:pre-patch-script 500:do-patch \
5286 700:post-patch 850:post-patch-script \
5288 ${_OPTIONS_patch} ${_USES_patch}
5289 _CONFIGURE_DEP= patch
5290 _CONFIGURE_SEQ= 150:build-depends 151:lib-depends 200:configure-message \
5291 300:pre-configure 450:pre-configure-script \
5292 490:run-autotools-fixup 500:do-configure 700:post-configure \
5293 850:post-configure-script \
5294 ${_OPTIONS_configure} ${_USES_configure}
5295 _BUILD_DEP= configure
5296 _BUILD_SEQ= 100:build-message 300:pre-build 450:pre-build-script \
5297 500:do-build 700:post-build 850:post-build-script \
5298 ${_OPTIONS_build} ${_USES_build}
5300 # STAGE is special in its numbering as it has install and stage, so install is
5301 # the main, and stage goes after.
5302 _STAGE_SEQ= 050:stage-message 100:stage-dir 150:run-depends \
5303 151:lib-depends 200:apply-slist 300:pre-install \
5304 400:generate-plist 450:pre-su-install 475:create-users-groups \
5305 500:do-install 550:kmod-post-install 600:fixup-lib-pkgconfig 700:post-install \
5306 750:post-install-script 800:post-stage 850:compress-man \
5307 860:install-rc-script 870:install-ldconfig-file \
5308 880:install-license 890:install-desktop-entries \
5309 900:add-plist-info 910:add-plist-docs 920:add-plist-examples \
5310 930:add-plist-data 940:add-plist-post ${POST_PLIST:C/^/990:/} \
5311 ${_OPTIONS_install} ${_USES_install} \
5312 ${_OPTIONS_stage} ${_USES_stage}
5313 .if defined(DEVELOPER)
5314 _STAGE_SEQ+= 995:stage-qa
5319 _TEST_SEQ= 100:test-message 150:test-depends 300:pre-test 500:do-test \
5321 ${_OPTIONS_test} ${_USES_test}
5323 _INSTALL_SEQ= 100:install-message 150:run-depends 151:lib-depends \
5324 200:check-already-installed
5325 _INSTALL_SUSEQ= 300:fake-pkg 500:security-check
5328 _PACKAGE_SEQ= 100:package-message 300:pre-package 450:pre-package-script \
5329 500:do-package 850:post-package-script \
5330 ${_OPTIONS_package} ${_USES_package}
5332 # Enforce order for -jN builds
5333 .for _t in ${_TARGETS_STAGES}
5334 # Check if the port need to change the default order of some targets...
5335 . if defined(TARGET_ORDER_OVERRIDE)
5337 . for _entry in ${_${_t}_SEQ}
5338 # for _target because :M${_target} does not work with fmake
5339 . for _target in ${_entry:C/^[0-9]+://}
5340 . if ${TARGET_ORDER_OVERRIDE:M*\:${_target}}
5341 _tmp_seq:= ${_tmp_seq} ${TARGET_ORDER_OVERRIDE:M*\:${_target}}
5343 _tmp_seq:= ${_tmp_seq} ${_entry}
5347 _${_t}_SEQ:= ${_tmp_seq}
5349 . for s in ${_${_t}_SEQ:O:C/^[0-9]+://}
5351 . if ! ${NOTPHONY:M${s}}
5352 _PHONY_TARGETS+= ${s}
5354 _${_t}_REAL_SEQ+= ${s}
5357 . for s in ${_${_t}_SUSEQ:O:C/^[0-9]+://}
5359 . if ! ${NOTPHONY:M${s}}
5360 _PHONY_TARGETS+= ${s}
5362 _${_t}_REAL_SUSEQ+= ${s}
5365 .ORDER: ${_${_t}_DEP} ${_${_t}_REAL_SEQ}
5368 # Define all of the main targets which depend on a sequence of other targets.
5369 # See above *_SEQ and *_DEP. The _DEP will run before this defined target is
5370 # ran. The _SEQ will run as this target once _DEP is satisfied.
5372 .for target in extract patch configure build stage install package
5374 # Check if config dialog needs to show and execute it if needed. If is it not
5375 # needed (_OPTIONS_OK), then just depend on the cookie which is defined later
5376 # to depend on the *_DEP and execute the *_SEQ.
5377 # If options are required, execute config-conditional and then re-execute the
5378 # target noting that config is no longer needed.
5379 .if !target(${target}) && defined(_OPTIONS_OK)
5380 _PHONY_TARGETS+= ${target}
5381 ${target}: ${${target:tu}_COOKIE}
5382 .elif !target(${target})
5383 ${target}: config-conditional
5384 @cd ${.CURDIR} && ${MAKE} CONFIG_DONE_${PKGBASE:tu}=1 ${${target:tu}_COOKIE}
5385 .elif target(${target}) && defined(IGNORE)
5388 .if !exists(${${target:tu}_COOKIE})
5390 # Define the real target behavior. Depend on the target's *_DEP. Execute
5391 # the target's *_SEQ. Also handle su and USE_SUBMAKE needs.
5392 .if ${UID} != 0 && defined(_${target:tu}_REAL_SUSEQ) && !defined(INSTALL_AS_USER)
5393 . if defined(USE_SUBMAKE)
5394 ${${target:tu}_COOKIE}: ${_${target:tu}_DEP}
5395 @cd ${.CURDIR} && ${MAKE} ${_${target:tu}_REAL_SEQ}
5396 . else # !USE_SUBMAKE
5397 ${${target:tu}_COOKIE}: ${_${target:tu}_DEP} ${_${target:tu}_REAL_SEQ}
5398 . endif # USE_SUBMAKE
5399 @${ECHO_MSG} "===> Switching to root credentials for '${target}' target"
5401 ${SU_CMD} "${MAKE} ${_${target:tu}_REAL_SUSEQ}"
5402 @${ECHO_MSG} "===> Returning to user credentials"
5403 @${TOUCH} ${TOUCH_FLAGS} ${.TARGET}
5404 .else # No SU needed
5405 . if defined(USE_SUBMAKE)
5406 ${${target:tu}_COOKIE}: ${_${target:tu}_DEP}
5408 ${MAKE} ${_${target:tu}_REAL_SEQ} ${_${target:tu}_REAL_SUSEQ}
5409 @${TOUCH} ${TOUCH_FLAGS} ${.TARGET}
5410 . else # !USE_SUBMAKE
5411 ${${target:tu}_COOKIE}: ${_${target:tu}_DEP} ${_${target:tu}_REAL_SEQ} ${_${target:tu}_REAL_SUSEQ}
5412 @${TOUCH} ${TOUCH_FLAGS} ${.TARGET}
5413 . endif # USE_SUBMAKE
5416 .else # exists(cookie)
5417 ${${target:tu}_COOKIE}::
5418 @if [ ! -e ${.TARGET} ]; then \
5419 cd ${.CURDIR} && ${MAKE} ${.TARGET}; \
5421 .endif # !exists(cookie)
5423 .endfor # foreach(targets)
5425 .PHONY: ${_PHONY_TARGETS} check-sanity fetch pkg
5427 .if !target(check-sanity)
5428 check-sanity: ${_SANITY_REAL_SEQ}
5432 fetch: ${_FETCH_DEP} ${_FETCH_REAL_SEQ}
5436 pkg: ${_PKG_DEP} ${_PKG_REAL_SEQ}
5441 .if !defined(NO_TEST)
5442 test: ${_TEST_REAL_SEQ}
5447 # End of post-makefile section.
5450 # End of the DESTDIR if statement