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 # UNIQUENAME - A name for your port that is globally unique. By default,
79 # this is set to ${LATEST_LINK} when LATEST_LINK is set,
80 # and to ${PKGNAMEPREFIX}${PORTNAME} otherwise.
81 # DISTVERSION - Vendor version of the distribution.
82 # Default: ${PORTVERSION}
83 # DISTNAME - Name of port or distribution used in generating
84 # WRKSRC and DISTFILES below.
86 # ${PORTNAME}-${DISTVERSIONPREFIX}${DISTVERSION}${DISTVERSIONSUFFIX}
87 # CATEGORIES - A list of descriptive categories into which this port falls.
90 # These variable describe how to fetch files required for building the port.
92 # DISTFILES - Name(s) of archive file(s) containing distribution.
93 # Set this to an empty string if the port doesn't require it.
94 # Default: ${DISTNAME}${EXTRACT_SUFX}
95 # EXTRACT_SUFX - Suffix for archive names
96 # You never have to set both DISTFILES and EXTRACT_SUFX.
97 # Default: .tar.bz2 if USE_BZIP2 is set, .tar.xz if USE_XZ is set,
99 # MASTER_SITES - Primary location(s) for distribution files if not found
100 # locally. See bsd.sites.mk for common choices for
103 # - Subdirectory of MASTER_SITES. Will sometimes need to be
104 # set to ${PORTNAME} for (e.g.) MASTER_SITE_SOURCEFORGE.
105 # Only guaranteed to work for choices of ${MASTER_SITES}
106 # defined in bsd.sites.mk.
108 # PATCHFILES - Name(s) of additional files that contain distribution
109 # patches. Make will look for them at PATCH_SITES (see below).
110 # They will automatically be uncompressed before patching if
111 # the names end with ".gz", ".bz2" or ".Z".
112 # For each file you can optionally specify a strip
113 # flag of patch(1) after a colon if it has a different
114 # base directory, e.g. "file1 file2:-p1 file3".
115 # You can also use a :group at the end for matching up to
116 # dist file groups. See Porters Handbook for more information.
117 # Syntax: PATCHFILES= patch[:-pX][:group]
119 # PATCH_SITES - Primary location(s) for distribution patch files
120 # if not found locally.
121 # DIST_SUBDIR - Suffix to ${DISTDIR}. If set, all ${DISTFILES} and
122 # ${PATCHFILES} will be put in this subdirectory of
123 # ${DISTDIR} (see below). Also they will be fetched in this
124 # subdirectory from FreeBSD mirror sites.
125 # ALLFILES - All of ${DISTFILES} and ${PATCHFILES}.
126 # NOFETCHFILES - If set, don't download these files from the ${MASTER_SITES}
127 # or ${MASTER_SITE_BACKUP} (but do from
128 # ${MASTER_SITE_OVERRIDE})
129 # EXTRACT_ONLY - If set, a subset of ${DISTFILES} you want to
131 # ALWAYS_KEEP_DISTFILES
132 # - If set, the package building cluster will save the distfiles
133 # along with the packages. This may be required to comply with
134 # some licenses, e.g. GPL in some cases.
137 # (NOTE: by convention, the MAINTAINER entry (see above) should go here.)
139 # These variables are typically set in /etc/make.conf to indicate
140 # the user's preferred location to fetch files from. You should
141 # rarely need to set these.
144 # - Backup location(s) for distribution files and patch
145 # files if not found locally and ${MASTER_SITES}/${PATCH_SITES}
147 # http://distcache.FreeBSD.org/ports-distfiles/${DIST_SUBDIR}/
148 # MASTER_SITE_OVERRIDE
149 # - If set, override the MASTER_SITES setting with this
151 # MASTER_SITE_FREEBSD
152 # - If set, only use ${MASTER_SITE_BACKUP} for
154 # CD_MOUNTPTS - List of CDROM mountpoints to look for distfiles under.
155 # This variable supercedes CD_MOUNTPT, which is
158 # Set these if your port should not be built under certain circumstances.
159 # These are string variables; you should set them to the reason why
160 # they are necessary.
162 # RESTRICTED - Prevent the distribution of distfiles and packages to
163 # the FTP sites or on CDROM (e.g. forbidden by license
165 # NO_CDROM - Packages and distfiles may not go on CDROM (e.g. must
166 # not be re-sold) but can go on FTP sites.
167 # NO_PACKAGE - Port should not be packaged for ftp sites or CDROMs,
168 # but distfiles can be put on ftp sites and CDROMs.
169 # FORBIDDEN - Package build should not be attempted because of
170 # security vulnerabilities.
171 # LEGAL_TEXT - Port has legal issues (e.g., special permission to distribute, lacks a license).
172 # LEGAL_PACKAGE - Port has no legal issues but defines NO_PACKAGE
173 # IGNORE - Package build should be skipped entirely (e.g.
174 # because of serious unfixable problems in the build,
175 # because it cannot be manually fetched, etc). Error
176 # logs will not appear on pointyhat, so this should be
178 # BROKEN - Port is believed to be broken. Package builds can
179 # still be attempted using TRYBROKEN to test this
181 # BROKEN_${ARCH} Port is believed to be broken on ${ARCH}. Package builds
182 # can still be attempted using TRYBROKEN to test this
184 # DEPRECATED - Port is deprecated to install. Advisory only.
186 # - If DEPRECATED is set, determines a date when
187 # the port is planed to remove. The date format is
188 # ISO 8601 (YYYY-MM-DD).
190 # DISABLE_VULNERABILITIES
191 # - If set, do not check if the port is listed in the
192 # vulnerabilities database.
194 # In addition to RESTRICTED or NO_CDROM, if only a subset of distfiles
195 # or patchfiles have redistribution restrictions, set the following
196 # to the list of such files.
199 # - List of files that cannot be redistributed.
200 # Default: "${DISTFILES} ${PATCHFILES}" if RESTRICTED
201 # or NO_CDROM is set, empty otherwise.
203 # These variables are booleans, so you don't need to set them to the reason.
206 # - Set this if your port needs to interact with the user
207 # during any step in a package build. User can then decide
208 # to skip this port by setting ${BATCH}, or compiling only
209 # the interactive ports by setting ${INTERACTIVE}.
211 # USE_SUBMAKE - Set this if you want that each of the port's main 7 targets
212 # (extract, patch, configure, build, stage, install and
213 # package) to be executed in a separate make(1) process.
214 # Useful when one of the stages needs to influence make(1)
215 # variables of the later stages using ${WRKDIR}/Makefile.inc
216 # generated on the fly.
219 # NO_ARCH - Set this if port is architecture neutral.
221 # Set these if your port only makes sense to certain architectures.
222 # They are lists containing names for them (e.g., "amd64 i386").
223 # (Defaults: not set.)
226 # - Only build ports if ${ARCH} matches one of these.
227 # NOT_FOR_ARCHS - Only build ports if ${ARCH} doesn't match one of these.
228 # ONLY_FOR_ARCHS_REASON
229 # ONLY_FOR_ARCHS_REASON_${ARCH}
230 # - Reason why it's only for ${ONLY_FOR_ARCHS}s
231 # NOT_FOR_ARCHS_REASON
232 # NOT_FOR_ARCHS_REASON_${ARCH}
233 # - Reason why it's not for ${NOT_FOR_ARCHS}s
235 # - Set this instead of ONLY_FOR_ARCHS if the given port
236 # fetches and installs compiled i386 binaries.
238 # Dependency checking. Use these if your port requires another port
239 # not in the list below. (Default: empty.)
242 # - A list of "path:dir[:target]" tuples of other ports this
243 # package depends on in the "extract" stage. "path" is
244 # the name of a file if it starts with a slash (/), an
245 # executable otherwise. make will test for the existence
246 # (if it is a full pathname) or search for it in your
247 # $PATH (if it is an executable) and go into "dir" to do
248 # a "make all install" if it's not found. If the third
249 # field ("target") exists, it will be used instead of
250 # ${DEPENDS_TARGET}. The first field also supports a
251 # package name with a version range, in the form package>=1.2
252 # if a particular version is desired.
253 # PATCH_DEPENDS - A list of "path:dir[:target]" tuples of other ports this
254 # package depends on in the "patch" stage. "path" is the
255 # name of a file if it starts with a slash (/), an
256 # executable otherwise. make will test for the existence
257 # (if it is a full pathname) or search for it in your
258 # $PATH (if it is an executable) and go into "dir" to do
259 # a "make all install" if it's not found. If the third
260 # field ("target") exists, it will be used instead of
261 # ${DEPENDS_TARGET}. The first field also supports a
262 # package name with a version range, in the form package>=1.2
263 # if a particular version is desired.
264 # FETCH_DEPENDS - A list of "path:dir[:target]" tuples of other ports this
265 # package depends in the "fetch" stage. "path" is the
266 # name of a file if it starts with a slash (/), an
267 # executable otherwise. make will test for the
268 # existence (if it is a full pathname) or search for
269 # it in your $PATH (if it is an executable) and go
270 # into "dir" to do a "make all install" if it's not
271 # found. If the third field ("target") exists, it will
272 # be used instead of ${DEPENDS_TARGET}. The first field
273 # also supports a package name with a version range, in
274 # the form package>=1.2 if a particular version is desired.
275 # BUILD_DEPENDS - A list of "path:dir[:target]" tuples of other ports this
276 # package depends to build (between the "extract" and
277 # "build" stages, inclusive). The test done to
278 # determine the existence of the dependency is the
279 # same as FETCH_DEPENDS. If the third field ("target")
280 # exists, it will be used instead of ${DEPENDS_TARGET}.
281 # RUN_DEPENDS - A list of "path:dir[:target]" tuples of other ports this
282 # package depends to run. The test done to determine
283 # the existence of the dependency is the same as
284 # FETCH_DEPENDS. This will be checked during the
285 # "install" stage and the name of the dependency will
286 # be put into the package as well. If the third field
287 # ("target") exists, it will be used instead of
288 # ${DEPENDS_TARGET}. The first field also supports a
289 # package name with a version range, in the form package>=1.2
290 # if a particular version is desired.
291 # LIB_DEPENDS - A list of "lib:dir[:target]" tuples of other ports this
292 # package depends on. "lib" is the name of a shared library.
293 # make will use "ldconfig -r" to search for the library.
294 # lib can contain extended regular expressions.
296 # - The default target to execute when a port is calling a
300 # These variables control options about how a port gets built and/or
301 # are shorthand notations for common sets of dependencies.
302 # Use these if your port uses some of the common software packages. By
303 # convention these should be set to 'yes', although they only need to be
304 # defined. Defaults: not set, unless explicitly indicated below.
306 # Note: the distinction between the USE_* and WANT_* variables, and the
307 # WITH_* and WITHOUT_* variables, are that the former are restricted to
308 # usage inside the ports framework, and the latter are reserved for user-
309 # settable options. (Setting USE_* in /etc/make.conf is always wrong).
311 # WITH_DEBUG - If set, debugging flags are added to CFLAGS and the
312 # binaries don't get stripped by INSTALL_PROGRAM or
313 # INSTALL_LIB. Besides, individual ports might
314 # add their specific to produce binaries for debugging
315 # purposes. You can override the debug flags that are
316 # passed to the compiler by setting DEBUG_FLAGS. It is
317 # set to "-g" at default.
319 # WITH_DEBUG_PORTS - A list of origins for which WITH_DEBUG will be set
322 # - If set, SSP_FLAGS (defaults to -fstack-protector)
323 # is added to CFLAGS and the necessary flags
324 # are added to LDFLAGS. Note that SSP_UNSAFE
325 # can be used in Makefiles by port maintainers
326 # if a port breaks with it (it should be
329 # USE_BZIP2 - If set, this port tarballs use bzip2, not gzip, for
331 # USE_XZ - If set, this port tarballs use xz (or lzma)
333 # USE_GCC - If set, this port requires this version of gcc, either in
334 # the system or installed from a port.
335 # USE_CSTD - Override the default C language standard (gnu89, gnu99)
336 # USE_CXXSTD Override the default C++ language standard
337 # USE_BINUTILS - Use binutils suite from port instead of the version in base.
338 # CFLAGS_${ARCH} Append the cflags to CFLAGS only on the specified architecture
340 # Append the cxxflags to CXXFLAGS only on the specified architecture
343 # - If set, this port needs ghostscript to both
344 # build and run. If a number is specified,
345 # the specified version will be used.
346 # The valid value is '7', '8', or '9' in that case.
347 # USE_GHOSTSCRIPT_BUILD
348 # - If set, this port needs ghostscript to build.
349 # USE_GHOSTSCRIPT_RUN
350 # - If set, this port needs ghostscript to run.
352 # - The port that provides postscript functionality.
353 # Some installations may wish to override the default
354 # to specify a version without X11 and/or localized
355 # versions for their nationality.
356 # Default: print/ghostscript9
357 # WITH_GHOSTSCRIPT_VER
358 # - If set, the specified version of ghostscript will be
359 # used. The valid value is "7", "8", or "9". Note that
360 # this is for users, not for port maintainers. This
361 # should not be used in Makefile.
363 # USE_GL - A list of Mesa or GL related dependencies needed by the port.
364 # Supported components are: egl, glesv2, glut, glu, glw, and gl.
365 # If set to "yes", this is equivalent to "glu". Note that
366 # glew and glut depend on glu, glw and glu depend on gl.
368 # USE_SDL - If set, this port uses the sdl libraries.
369 # See bsd.sdl.mk for more information.
371 # USE_OPENSSL - If set, this port relies on the OpenSSL package.
373 # USE_OPENLDAP - If set, this port uses the OpenLDAP libraries.
374 # Implies: WANT_OPENLDAP_VER?=24
376 # - Legal values are: 23, 24
377 # If set to an unknown value, the port is marked BROKEN.
379 # - If set, the system should use OpenLDAP libraries
382 # USE_AUTOTOOLS - If set, this port uses various GNU autotools
383 # (libtool, autoconf, autoheader, automake et al.)
384 # See bsd.autotools.mk for more details.
386 # USE_EFL - If set, this port use EFL libraries.
387 # Implies inclusion of bsd.efl.mk. (Also see
388 # that file for more information on USE_EFL_*).
389 # USE_FPC - If set, this port relies on the Free Pascal language.
390 # Implies inclusion of bsd.fpc.mk. (Also see
391 # that file for more information on WANT_FPC_*).
392 # USE_JAVA - If set, this port relies on the Java language.
393 # Implies inclusion of bsd.java.mk. (Also see
394 # that file for more information on USE_JAVA_*).
395 # USE_OCAML - If set, this port relies on the OCaml language.
396 # Implies inclusion of bsd.ocaml.mk. (Also see
397 # that file for more information on USE_OCAML*).
398 # USE_RUBY - If set, this port relies on the Ruby language.
399 # Implies inclusion of bsd.ruby.mk. (Also see
400 # that file for more information on USE_RUBY_*).
401 # USE_GNUSTEP - If set, this port relies on the GNUstep system.
402 # Implies the inclusion of bsd.gnustep.mk.
403 # (Also see that file for more information on
406 # USE_GECKO - If set, this port uses the Gecko/Mozilla product.
407 # See bsd.gecko.mk for more details.
409 # USE_GNOME - A list of the Gnome dependencies the port has (e.g.,
410 # glib12, gtk12). Implies that the port needs Gnome.
411 # Implies inclusion of bsd.gnome.mk. See bsd.gnome.mk
412 # or http://www.FreeBSD.org/gnome/docs/porting.html
415 # USE_MATE - A list of the MATE dependencies the port has. Implies
416 # that the port needs MATE. Implies inclusion of
417 # bsd.mate.mk. See bsd.mate.mk for more details.
419 # USE_WX - If set, this port uses the WxWidgets library and related
420 # components. See bsd.wx.mk for more details.
422 # USE_KDE4 - A list of the KDE 4 dependencies the port has (e.g.,
423 # kdelibs, kdebase). Implies that the port needs KDE.
424 # Implies inclusion of bsd.kde4.mk. See bsd.kde4.mk
427 # USE_QT4 - A list of the Qt 4 dependencies the port has (e.g,
428 # corelib, webkit). Implies that the port needs Qt.
429 # Implies the inclusion of bsd.qt.mk. See bsd.qt.mk
432 # USE_QT5 - A list of the Qt 5 dependencies the port has (e.g,
433 # core, webkit). Implies that the port needs Qt.
434 # Implies the inclusion of bsd.qt.mk. See bsd.qt.mk
437 # USE_LINUX - Set to yes to say the port needs the default linux base port.
438 # Set to value <X>, if the port needs emulators/linux_base-<X>.
439 # Implies appropriate settings for STRIP and STRIP_CMD.
441 # - controls the action of PREFIX (see above). Only use this
442 # if the port is a linux infrastructure port (e.g. contains libs
443 # or a sound server which supports the FreeBSD native one),
444 # use the default or the X11 prefix if it's a leaf port
445 # (e.g. a game or program).
446 # Implies NO_MTREE=yes, and, if USE_LDCONFIG is defined:
448 # - appropriate invocation of the Linux ldconfig
449 # USE_LINUX_RPM - Set to yes to pull in variables and targets useful to Linux
451 # Implies inclusion of bsd.linux-rpm.mk.
453 # LINUX_OSRELEASE - Contains the value of compat.linux.osrelease sysctl.
454 # Will be used to distinguish which linux
455 # infrastructure ports should be used.
456 # Valid values: 2.6.16.
458 # - Set to yes to enable automatic packing list generation.
459 # Currently has no effect unless USE_LINUX_RPM is set.
461 # OVERRIDE_LINUX_BASE_PORT
462 # - This specifies the default linux base to use, for valid
463 # values have a look at the description of USE_LINUX. This is
464 # an user-only variable. Don't use it in any port, it's meant
465 # to be used in make.conf.
468 # - This is a read-only variable, it gets set to a value which is
469 # usable in *_DEPENDS (e.g. BUILD_DEPENDS=${LINUX_BASE_PORT}).
470 # It honors USE_LINUX=foo and OVERRIDE_LINUX_BASE_PORT.
472 # USE_XORG - Set to a list of X.org module dependencies.
473 # Implies inclusion of bsd.xorg.mk.
475 # USE_TEX - A list of the TeX dependencies the port has.
478 # USE_RC_SUBR - If set, the ports startup/shutdown script uses the common
479 # routines found in /etc/rc.subr.
480 # If this is set to a list of files, these files will be
481 # automatically added to ${SUB_FILES}, some %%VAR%%'s will
482 # automatically be expanded, they will be installed in
483 # ${PREFIX}/etc/rc.d and added to the packing list.
484 # USE_RCORDER - List of rc.d startup scripts to be called early in the boot
485 # process. This acts exactly like USE_RC_SUBR except that
486 # scripts are installed in /etc/rc.d.
487 # Because local rc.d scripts are included in the base rcorder
488 # this option is not needed unless the port installs in the base.
490 # USE_APACHE - If set, this port relies on an apache webserver.
492 # Conflict checking. Use if your port cannot be installed at the same time as
495 # CONFLICTS - A list of package name patterns that the port conflicts
496 # with, separated by blanks. The names may include shell
497 # pattern meta-characters "*", "?", "[", "]", and "!".
498 # Example: apache*-1.2* apache*-1.3.[012345] apache-*+ssl_*
501 # - Check conflict prior to the build.
504 # - Check conflict prior to the installation stage.
506 # Various directory definitions and variables to control them.
507 # You rarely need to redefine any of these except WRKSRC and NO_WRKSUBDIR.
509 # LOCALBASE - Where non-X11 ports install things.
510 # Default: /usr/local
511 # LINUXBASE - Where Linux ports install things.
512 # Default: /compat/linux
513 # PREFIX - Where *this* port installs its files.
514 # Default: ${LINUXBASE} if USE_LINUX_PREFIX is set,
515 # otherwise ${LOCALBASE}
518 # - There are some sanity checks against PREFIX.
519 # You can disable these checks with defining
520 # this variable, but this is not recommended!
521 # Only do this if you really know what you are
522 # doing. These sanity checks are the following:
523 # - PREFIX has to be an absolute path.
524 # - PREFIX can't have a trailing slash.
526 # MASTERDIR - Where the port finds patches, package files, etc. Define
527 # this is you have two or more ports that share most of the
529 # Default: ${.CURDIR}
530 # PORTSDIR - The root of the ports tree.
531 # Default: /usr/ports
532 # DISTDIR - Where to search for and store copies of original sources
533 # Default: ${PORTSDIR}/distfiles
534 # PACKAGES - A top level directory where all packages go (rather than
535 # going locally to each port).
536 # Default: ${PORTSDIR}/packages
537 # WRKDIRPREFIX - The place to root the temporary working directory
540 # WRKDIR - A temporary working directory that gets *clobbered* on clean
541 # Default: ${WRKDIRPREFIX}${.CURDIR}/work
542 # WRKSRC - A subdirectory of ${WRKDIR} where the distribution actually
544 # Default: ${WRKDIR}/${DISTNAME} unless NO_WRKSUBDIR is set,
545 # in which case simply ${WRKDIR}
546 # WRKSRC_SUBDIR - A subdirectory of ${WRKSRC} where the distribution actually
549 # NO_WRKSUBDIR - Assume port unpacks directly into ${WRKDIR}.
550 # PATCHDIR - A directory containing any additional patches you made
551 # to port this software to FreeBSD.
552 # Default: ${MASTERDIR}/files
553 # SCRIPTDIR - A directory containing any auxiliary scripts
554 # Default: ${MASTERDIR}/scripts
555 # FILESDIR - A directory containing any miscellaneous additional files.
556 # Default: ${MASTERDIR}/files
557 # DFLY_PATCHDIR= - A directory containing additional patches required
558 # to build port on DragonFly
559 # Default: ${MASTERDIR}/dragonfly
560 # DFLY_FILESDIR - A directory containing any miscellaneous files
561 # needed to build port on DragonFly
562 # Default: ${MASTERDIR}/dragonfly
563 # PKGDIR - A directory containing any package creation files.
564 # Default: ${MASTERDIR}
565 # SRC_BASE - The root of the src tree. (Some ports require this to get
566 # kernel sources). Default: /usr/src
567 # UID_FILES - A list of files containing information about registered UIDs.
568 # Note that files have decreasing priority.
569 # GID_FILES - A list of files containing information about registered GIDs.
570 # Note that files have decreasing priority.
572 # Variables that serve as convenient "aliases" for your *-install targets.
573 # Use these like: "${INSTALL_PROGRAM} ${WRKSRC}/prog ${PREFIX}/bin".
576 # - A command to install binary executables. (By
577 # default, also strips them, unless ${STRIP} is
578 # overridden to be the empty string).
579 # INSTALL_KLD - As INSTALL_PROGRAM, but without the STRIP.
580 # INSTALL_LIB - As INSTALL_DATA, but also strips the file.
582 # - A command to install executable scripts.
583 # INSTALL_DATA - A command to install sharable data.
584 # INSTALL_MAN - A command to install manpages.
587 # - Similiar to INSTALL_PROGRAM and INSTALL_DATA commands but
588 # working on whole trees of directories, takes 3 arguments,
589 # last one is find(1) arguments and optional.
591 # cd ${WRKSRC}/doc && ${COPYTREE_SHARE} . ${DOCSDIR} "! -name *\.bak"
593 # Installs all directories and files from ${WRKSRC}/doc
594 # to ${DOCSDIR} except sed backup files.
596 # MANPREFIX - The directory prefix for ${MAN<sect>} and ${MLINKS}.
599 # - If manual pages of some sections install in different
600 # locations than others, use these.
601 # Default: ${MANPREFIX}
603 # Set the following to specify all .info files your port installs.
605 # INFO - A list of .info files (omitting the trailing ".info");
606 # only one entry per document! These files are listed in
607 # the path relative to ${INFO_PATH}.
608 # INFO_PATH - Path, where all .info files will be installed by your
609 # port, relative to ${PREFIX}
610 # Default: "share/info" if ${PREFIX} is equal to /usr
611 # and "info" otherwise.
613 # Set the following to specify all documentation your port installs into
616 # PORTDOCS - A list of files and directories relative to DOCSDIR.
617 # Shell glob patterns can be used, directories include
618 # the entire subtree of contained files and directories.
619 # Should not be set when no documentation files are
621 # Useful for dynamically generated documentation.
623 # Set the following to specify all documentation your port installs into
626 # PORTEXAMPLES - A list of files and directories relative to EXAMPLESDIR.
627 # Shell glob patterns can be used, directories include
628 # the entire subtree of contained files and directories.
629 # Should not be set when no examples files are
631 # Useful for dynamically generated examples.
633 # Set the following to specify all files and directories your port installs into
636 # PORTDATA - A list of files and directories relative to DATADIR.
637 # Shell glob patterns can be used, directories include
638 # the entire subtree of contained files and directories.
639 # Should not be set when no data files are
641 # Useful for dynamically generated data files.
643 # Default targets and their behaviors:
645 # fetch - Retrieves missing ${DISTFILES} and ${PATCHFILES} for this
647 # fetch-list - Show list of commands to retrieve missing ${DISTFILES} and
648 # ${PATCHFILES} for this port.
650 # - Retrieves missing ${DISTFILES} and ${PATCHFILES} for this
651 # port and dependencies.
652 # fetch-recursive-list
653 # - Show list of commands to retrieve missing ${DISTFILES} and
654 # ${PATCHFILES} for this port and dependencies.
656 # - Retrieves missing ${DISTFILES} and ${PATCHFILES} for this
657 # port and dependencies.
658 # fetch-required-list
659 # - Show list of commands to retrieve missing ${DISTFILES} and
660 # ${PATCHFILES} for this port and dependencies.
662 # - Show list of URLS to retrieve missing ${DISTFILES} and
663 # ${PATCHFILES} for this port.
665 # - Show list of URLS to retrieve ${DISTFILES} and
666 # ${PATCHFILES} for this port.
669 # - Show all directories which are dependencies
672 # - Show all directories which are build-dependencies
674 # package-depends-list
675 # - Show all directories which are package-dependencies
676 # for this port. This is based upon the dependency
677 # tree as recorded in the Makefiles of the ports
678 # collection, not as recorded in the currently
680 # actual-package-depends
681 # - Like package-depends-list but with the difference
682 # that the dependencies of the currently installed
683 # ports are used instead of the dependencies as
684 # recorded in the ports collection.
686 # - Show all directories which are run-dependencies
689 # extract - Unpacks ${DISTFILES} into ${WRKDIR}.
690 # patch - Apply any provided patches to the source.
691 # configure - Runs either GNU configure, one or more local configure
692 # scripts or nothing, depending on what's available.
693 # build - Actually compile the sources.
694 # install - Install the results of a build.
695 # reinstall - Install the results of a build, ignoring "already installed"
697 # deinstall - Remove the installation.
698 # deinstall-all - Remove all installations with the same PKGORIGIN.
699 # package - Create a package from an _installed_ port.
701 # - Create a package for a port and _all_ of its dependencies.
702 # describe - Try to generate a one-line description for each port for
703 # use in INDEX files and the like.
704 # checkpatch - Do a "patch -C" instead of a "patch". Note that it may
705 # give incorrect results if multiple patches deal with
707 # checksum - Use distinfo to ensure that your distfiles are valid.
709 # - Run checksum in this port and all dependencies.
710 # makesum - Generate distinfo (only do this for your own ports!).
711 # clean - Remove ${WRKDIR} and other temporary files used for building.
712 # clean-depends - Do a "make clean" for all dependencies.
713 # config - Configure options for this port (using ${DIALOG}).
714 # Automatically run prior to extract, patch, configure, build,
715 # install, and package.
717 # - Configure options for this port for a port and all its
719 # showconfig - Display options config for this port.
720 # showconfig-recursive
721 # - Display options config for this port and all its
723 # rmconfig - Remove the options config for this port.
725 # - Remove the options config for this port and all its
728 # Default sequence for "all" is:
730 # check-sanity fetch checksum extract patch configure build
732 # Please read the comments in the targets section below; you
733 # should be able to use the pre-* or post-* targets/scripts
734 # (which are available for every stage except checksum) or
735 # override the do-* targets to do pretty much anything you want.
737 # NEVER override the "regular" targets unless you want to open
738 # a major can of worms.
740 # Set these variables if your port doesn't need some of the steps.
741 # Note that there are no NO_PATCH or NO_CONFIGURE variables because
742 # those steps are empty by default. NO_EXTRACT is not allowed anymore
743 # since we need to at least create ${WRKDIR}. Also, NO_CHECKSUM is a user
744 # variable and is not to be set in a port's Makefile. See above for NO_PACKAGE.
746 # NO_BUILD - Use a dummy (do-nothing) build target.
747 # NO_INSTALL - Use a dummy (do-nothing) install target.
749 # Here are some variables used in various stages.
751 # For options see bsd.options.mk
755 # FETCH_BINARY - Path to ftp/http fetch command if not in $PATH.
756 # Default: "/usr/bin/fetch"
757 # FETCH_ARGS - Arguments to ftp/http fetch command.
759 # FETCH_CMD - ftp/http fetch command.
760 # Default: ${FETCH_BINARY} ${FETCH_ARGS}
762 # - Arguments to ${FETCH_CMD} before filename.
765 # - Arguments to ${FETCH_CMD} following filename.
767 # FETCH_ENV - Environment to pass to ${FETCH_CMD}.
769 # FETCH_REGET - Times to retry fetching of files on checksum errors.
772 # - Disable package dependency in fetch target for mass
773 # fetching. User settable.
777 # EXTRACT_CMD - Command for extracting archive: "bzip2" if USE_BZIP2
778 # is set, "gzip" otherwise.
779 # EXTRACT_BEFORE_ARGS
780 # - Arguments to ${EXTRACT_CMD} before filename.
783 # - Arguments to ${EXTRACT_CMD} following filename.
784 # default: "| tar -xf -"
785 # EXTRACT_PRESERVE_OWNERSHIP
786 # - Normally, when run as "root", the extract stage will
787 # change the owner and group of all files under ${WRKDIR}
788 # to 0:0. Set this variable if you want to turn off this
792 # EXTRA_PATCHES - Define this variable if you have patches not in
793 # ${PATCHDIR}. This usually happens when you need to
794 # do some pre-processing before some distribution
795 # patches can be applied. In that case, fetch them as
796 # extra distfiles, put the processed results in
797 # ${WRKDIR}, then point EXTRA_PATCHES to them.
798 # The patches specified by this variable will be
799 # applied after the normal distribution patches but
800 # before those in ${PATCHDIR}.
801 # PATCH_WRKSRC - Directory to apply patches in.
806 # HAS_CONFIGURE - If set, this port has its own configure script. The
807 # configure stage will not do anything if this is not set.
808 # GNU_CONFIGURE - If set, you are using GNU configure (optional). Implies
811 # - Directory to run configure in.
814 # - Name of configure script, relative to ${CONFIGURE_WRKSRC}.
815 # Default: "Makefile.PL" if USES=perl5 and USE_PERL5=configure
816 # are set, "configure" otherwise.
818 # - The name of target to call when GNU_CONFIGURE is
820 # Default: ${ARCH}-portbld-${OPSYS:tl}${OSREL}
821 # GNU_CONFIGURE_PREFIX
822 # - The directory passed as prefix to the configure script if
823 # GNU_CONFIGURE is set.
826 # - Pass these args to configure if ${HAS_CONFIGURE} is set.
827 # Default: "--prefix=${GNU_CONFIGURE_PREFIX} --infodir=${PREFIX}/${INFO_PATH}
828 # --mandir=${MANPREFIX}/man --build=${CONFIGURE_TARGET}" if
829 # GNU_CONFIGURE is set, "CC=${CC} CFLAGS=${CFLAGS}
830 # PREFIX=${PREFIX} INSTALLPRIVLIB=${PREFIX}/lib
831 # INSTALLARCHLIB=${PREFIX}/lib" if USES=perl5 and
832 # USE_PERL5=configure are set, empty otherwise.
833 # CONFIGURE_ENV - Pass these env (shell-like) to configure if
834 # ${HAS_CONFIGURE} is set.
835 # CONFIGURE_LOG - The name of configure log file. It will be printed to
836 # the screen if configure fails.
837 # Default: config.log
838 # CONFIGURE_FAIL_MESSAGE
839 # - A message displayed to users when configure
840 # fails (note: this assumes the do-configure
841 # target has not been overwritten). This message
842 # will be passed through /usr/bin/fmt before
843 # being shown to the user.
845 # WITHOUT_FBSD10_FIX Disable FreeBSD 10.0 autotools workaround.
847 # For build and install:
849 # MAKEFILE - Name of the makefile.
851 # ALL_TARGET - Default target for sub-make in build stage.
853 # BUILD_WRKSRC - Directory to do build in (default: ${WRKSRC}).
854 # MAKE_ENV - Additional environment vars passed to sub-make in build
855 # and install stages.
857 # MAKE_ARGS - Any extra arguments to sub-make in build and install stages.
861 # - Disallow multiple jobs even when user set a global override.
862 # To be used with known bad ports.
864 # - Set to disable the multiple jobs feature. User settable.
866 # - Override the number of make jobs to be used. User settable.
867 # MAKE_JOBS_NUMBER_LIMIT
868 # - Set a limit for maximum number of make jobs allowed to be
873 # - Enable CCACHE support (devel/ccache). User settable.
875 # - Which directory to use for ccache (default: $HOME/.ccache)
877 # - Disable CCACHE support for example for certain ports if
878 # CCACHE is enabled. User settable.
883 # - Default target for sub-make in install stage.
886 # - Directory to install from
888 # NO_MTREE - If set, will not invoke mtree from bsd.port.mk from
889 # the "install" target.
890 # MTREE_FILE - The name of the mtree file.
891 # Default: ${PORTSDIR}/Templates/BSD.local.dist or
892 # /etc/mtree/BSD.usr.dist if ${PREFIX} == "/usr".
893 # PLIST_DIRS - Directories to be added to packing list
894 # PLIST_DIRSTRY - Directories to be added to packing list and try to remove them.
895 # PLIST_FILES - Files and symbolic links to be added to packing list
897 # PLIST - Name of the `packing list' file.
898 # Change this to ${WRKDIR}/PLIST or something if you
899 # need to write to it. (It is not a good idea for a port
900 # to write to any file outside ${WRKDIR} during a normal
902 # Default: ${PKGDIR}/pkg-plist
903 # TMPPLIST - Name of the `packing list' file after processing
904 # Default: ${WRKDIR}/.PLIST.mktmp
905 # PLIST_SUB - List of "variable=value" pair for substitution in ${PLIST}
908 # SUB_FILES - Files that should be passed through sed and redirected to
910 # - For each file specified in SUB_FILES, there must be a
911 # corresponding file in ${FILESDIR} whose suffix is ".in". For
912 # instance, if the Makefile specifies "SUB_FILES= pkg-message"
913 # then there must be a file called pkg-message.in in
915 # - The substitution process is the same as PLIST_FILES, as
916 # described below except that any line beginning with @comment
918 # SUB_LIST - List of "variable=value" pair for substitution in ${SUB_FILES}
919 # Some pairs are added by default: eg. PREFIX=${PREFIX}
921 # USE_LDCONFIG - If set to "yes", this adds ${PREFIX}/lib to the list of
922 # directories to be searched for shared libraries.
923 # Otherwise, this is a list of directories to be added to that
924 # list. The directory names are written to
925 # ${PREFIX}/libdata/ldconfig/${UNIQUENAME} which is then
926 # used by the ldconfig startup script.
927 # This mechanism replaces ldconfig scripts installed by some
928 # ports, often under such names as 000.${UNQUENAME}.sh.
929 # If USE_LINUX_PREFIX is defined, the Linux version of
930 # ldconfig will be used instead of the native FreeBSD
931 # version, and the directory list given will be ignored.
933 # - Same as USE_LDCONFIG but the target file is
934 # ${PREFIX}/libdata/ldconfig32/${UNIQUENAME} instead.
935 # Note: that should only be used on 64-bit architectures.
937 # DOCSDIR - Name of the directory to install the packages docs in.
938 # Default: ${PREFIX}/share/doc/${PORTNAME}
939 # DOCSDIR_REL - The DOCSDIR relative to ${PREFIX}
940 # EXAMPLESDIR - Name of the directory to install the packages examples in.
941 # Default: ${PREFIX}/share/examples/${PORTNAME}
943 # - The EXAMPLESDIR relative to ${PREFIX}
944 # DATADIR - Name of the directory to install the packages shared data in.
945 # Default: ${PREFIX}/share/${PORTNAME}
946 # DATADIR_REL - The DATADIR relative to ${PREFIX}
948 # WWWDIR - Name of the directory to install the packages www data in.
949 # Default: ${PREFIX}/www/${PORTNAME}
950 # WWWDIR_REL - The WWWDIR relative to ${PREFIX}
952 # USERS - List of users to create at install time. Each login must
953 # have a corresponding entry in ${UID_FILES}.
954 # GROUPS - List of groups to create at install time. Each group must
955 # have a corresponding entry in ${GID_FILES}.
957 # DESKTOPDIR - Name of the directory to install ${DESKTOP_ENTRIES} in.
958 # Default: ${PREFIX}/share/applications
960 # - List of desktop entry files to generate and install in
961 # ${DESKTOPDIR}. The format is
962 # "Name" "Comment" "Icon" "Exec" "Categories" StartupNotify
964 # * Only add desktop entries for applications which do not
965 # require a terminal (ie. X applications).
966 # * If the upstream distribution already installs .desktop
967 # files, you do not need to use this.
968 # * If you require a more elaborate .desktop file than this
969 # variable permits, write it yourself and install it
972 # * Comment, Icon and StartupNotify may be empty
973 # strings (""). Categories may be an empty string in some
974 # cases (see below). The other fields are mandatory.
975 # * If Comment is an empty string, port ${COMMENT} will be
977 # * If set, Icon must be either absolute path (usually
978 # ${PREFIX}/share/pixmaps/${PORTNAME}.png) or icon name
979 # without extension if installed icons follow Icon Theme
981 # * If Categories is an empty string, bsd.port.mk will try
982 # to deduce a default value using the CATEGORIES variable.
983 # If the deduction fails, you will have to set Categories
984 # manually. You should check the generated value using
985 # "make desktop-categories", and override it if necessary.
986 # * Exec will also be used to name the .desktop file.
987 # * StartupNotify may be true, false or empty (see Desktop
988 # Entry Specification for details).
989 # * The files will be automatically added to ${PLIST}.
991 # "X Window Information" \
992 # "Get information about X windows" \
993 # "${PREFIX}/share/pixmaps/wininfo.png" \
994 # "${PREFIX}/bin/wininfo" \
997 # See http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html
998 # for an explanation of the fields. If you need to create more
999 # than one file, just chain them into a single variable.
1001 # Note that the install target will automatically add manpages (see
1002 # above) and also substitute special sequences of characters (delimited
1003 # by "%%") as defined in PLIST_SUB to generate ${TMPPLIST}. For
1004 # instance, "OSREL=${OSREL}" in PLIST_SUB causes all occurrences of
1005 # "%%OSREL%%" in ${PLIST} to be substituted by the value of OSREL.
1006 # ${TMPPLIST} is generated before the do-install stage. If you are
1007 # generating the packing list on-the-fly, make sure it's generated before
1008 # do-install is called!
1012 # LATEST_LINK - Install the "Latest" link for the package as ___. Define
1013 # this if the "Latest" link name will be incorrectly determined.
1015 # This is used in all stages:
1017 # SCRIPTS_ENV - Additional environment vars passed to scripts in
1018 # ${SCRIPTDIR} executed by bsd.port.mk.
1019 # Default: see below
1021 # Finally, variables to change if you want a special behavior. These
1022 # are for debugging purposes. Don't set them in your Makefile.
1024 # ECHO_MSG - Used to print all the '===>' style prompts - override this
1026 # Default: ${ECHO_CMD}
1027 # PATCH_DEBUG - If set, print out more information about the patches as
1028 # it attempts to apply them.
1029 # PKG_DBDIR - Where package installation is recorded; this directory
1030 # must not contain anything else.
1031 # Default: /var/db/pkg
1032 # PORT_DBDIR - Where port configuration options are recorded.
1033 # Default: /var/db/ports
1035 # - Don't register a port installation as a package.
1036 # FORCE_PKG_REGISTER
1037 # - If set, it will overwrite any existing package
1038 # registration information in ${PKG_DBDIR}/${PKGNAME}.
1039 # NO_DEPENDS - Don't verify build of dependencies.
1040 # CHECKSUM_ALGORITHMS
1041 # - Different checksum algorithms to check for verifying the
1042 # integrity of the distfiles. The absence of the algorithm
1043 # in distinfo doesn't make it fail.
1045 # NO_CHECKSUM - Don't verify the checksum. Typically used when
1046 # when you noticed the distfile you just fetched has
1047 # a different checksum and you intend to verify if
1048 # the port still works with it.
1049 # USE_PACKAGE_DEPENDS
1050 # - Try to install dependencies from existing packages instead
1051 # of building the port from scratch. Fallback on source
1052 # if an existing package is not present.
1053 # USE_PACKAGE_DEPENDS_ONLY
1054 # - Like USE_PACKAGE_DEPENDS, but do not fallback on source.
1056 # - Define this to install as the current user, intended
1057 # for systems where you have no root access.
1058 # DISABLE_SIZE - Do not check the size of a distfile even if the SIZE field
1059 # has been specified in distinfo. This is useful
1060 # when using an alternate FETCH_CMD.
1062 # End of the list of all variables that need to be defined in a port.
1063 # Most port authors should not need to understand anything after this point.
1066 # These need to be absolute since we don't know how deep in the ports
1067 # tree we are and thus can't go relative. They can, of course, be overridden
1068 # by individual Makefiles or local system make configuration.
1070 WITHOUT_FBSD10_FIX?= yes
1071 DFLY_PATCHDIR?= ${MASTERDIR}/dragonfly
1072 DFLY_FILESDIR?= ${MASTERDIR}/dragonfly
1073 PORTSDIR?= /usr/dports
1074 LOCALBASE?= /usr/local
1075 LINUXBASE?= /compat/linux
1076 DISTDIR?= /usr/distfiles
1077 WRKDIRPREFIX?= /usr/obj/dports
1078 _DISTDIR?= ${DISTDIR}/${DIST_SUBDIR}
1079 INDEXDIR?= ${PORTSDIR}
1081 USESDIR?= ${PORTSDIR}/Mk/Uses
1082 SCRIPTSDIR?= ${PORTSDIR}/Mk/Scripts
1083 LIB_DIRS?= /lib /usr/lib ${LOCALBASE}/lib
1084 STAGEDIR?= ${WRKDIR}/stage
1086 PKG_ENV+= PORTSDIR=${PORTSDIR}
1087 CONFIGURE_ENV+= XDG_DATA_HOME=${WRKDIR} \
1088 XDG_CONFIG_HOME=${WRKDIR} \
1090 MAKE_ENV+= XDG_DATA_HOME=${WRKDIR} \
1091 XDG_CONFIG_HOME=${WRKDIR} \
1093 QA_ENV+= STAGEDIR=${STAGEDIR} \
1095 LINUXBASE=${LINUXBASE} \
1096 LOCALBASE=${LOCALBASE} \
1098 TMPPLIST=${TMPPLIST}
1099 CO_ENV+= STAGEDIR=${STAGEDIR} \
1101 LOCALBASE=${LOCALBASE} \
1104 MTREE_FILE=${MTREE_FILE} \
1105 GNOME_MTREE_FILE=${GNOME_MTREE_FILE} \
1106 TMPPLIST=${TMPPLIST} \
1107 SCRIPTSDIR=${SCRIPTSDIR} \
1108 PLIST_SUB_SED="${PLIST_SUB_SED}" \
1109 PORT_OPTIONS="${PORT_OPTIONS}" \
1110 PORTSDIR="${PORTSDIR}"
1111 MINIMAL_PKG_VERSION= 1.3.8
1113 # make sure bmake treats -V as expected
1114 .MAKE.EXPAND_VARIABLES= yes
1116 .include "${PORTSDIR}/Mk/bsd.commands.mk"
1118 .if defined(NO_STAGE)
1120 DEPRECATED?= Not staged. See http://lists.freebsd.org/pipermail/freebsd-ports-announce/2014-May/000080.html
1121 EXPIRATION_DATE?= 2014-08-31
1124 .if defined(X_BUILD_FOR)
1125 .if !defined(.PARSEDIR)
1126 IGNORE= Cross building can only be done when using bmake(1) as make(1)
1128 BUILD_DEPENDS= ${X_BUILD_FOR}-cc:${PORTSDIR}/devel/${X_BUILD_FOR}-xdev
1129 # Do not define CPP on purpose
1134 .if !exists(/usr/${X_BUILD_FOR}/usr/bin/cc)
1135 X_SYSROOT= ${LOCALBASE}/${X_BUILD_FOR}
1137 X_SYSROOT= /usr/${X_BUILD_FOR}
1139 CC= ${X_SYSROOT}/usr/bin/cc
1140 CXX= ${X_SYSROOT}/usr/bin/c++
1141 PKG_ENV+= ABI_FILE=${X_SYSROOT}/usr/lib/crt1.o
1142 NM= ${X_BUILD_FOR}-nm
1143 STRIP_CMD= ${X_BUILD_FOR}-strip
1144 MAKE_ENV+= NM=${NM} STRIPBIN=${X_BUILD_FOR}-strip PKG_CONFIG_SYSROOT_DIR="${X_SYSROOT}"
1145 CONFIGURE_ENV+= PKG_CONFIG_SYSROOT_DIR="${X_SYSROOT}"
1146 # only bmake support the below
1147 STRIPBIN= ${STRIP_CMD}
1148 .export.env STRIPBIN
1152 # DESTDIR section to start a chrooted process if invoked with DESTDIR set
1155 .if defined(DESTDIR) && !empty(DESTDIR) && !defined(CHROOTED) && \
1156 !defined(BEFOREPORTMK) && !defined(INOPTIONSMK)
1158 .include "${PORTSDIR}/Mk/bsd.destdir.mk"
1162 # Look for ${PATCH_WRKSRC}/.../*.orig files, and (re-)create
1163 # ${FILEDIR}/patch-* files from them.
1165 .if !target(makepatch)
1167 @${MKDIR} ${FILESDIR}
1168 @(cd ${PATCH_WRKSRC}; \
1169 for f in `${FIND} . -type f -name '*.orig'`; do \
1171 NEW=$${ORIG%.orig}; \
1172 cmp -s $${ORIG} $${NEW} && continue; \
1173 PATCH=`${ECHO} $${NEW} | ${SED} -e 's|/|__|g'`; \
1174 OUT=${FILESDIR}/patch-$${PATCH}; \
1175 ${ECHO} ${DIFF} -ud $${ORIG} $${NEW} '>' $${OUT}; \
1176 TZ=UTC ${DIFF} -ud $${ORIG} $${NEW} | ${SED} -e \
1177 '/^---/s|\.[0-9]* +0000$$| UTC|' -e \
1178 '/^+++/s|\([[:blank:]][-0-9:.+]*\)*$$||' \
1179 > $${OUT} || ${TRUE}; \
1185 # Start of options section
1186 .if defined(INOPTIONSMK) || ( !defined(USEOPTIONSMK) && !defined(AFTERPORTMK) )
1189 # Get the default maintainer
1190 MAINTAINER?= ports@FreeBSD.org
1192 # Get the architecture
1197 # Get the operating system type
1204 # Get the operating system revision
1205 OSREL?= ${UNAMER:C/-.*//}
1207 # Get __FreeBSD_version
1208 .if !defined(OSVERSION)
1212 .if !defined(DFLYVERSION)
1213 .if exists(/usr/include/sys/param.h)
1214 DFLYVERSION!= ${AWK} '/^\#define[[:blank:]]__DragonFly_version/ {print $$3}' < /usr/include/sys/param.h
1215 OSREL!= ${ECHO} ${DFLYVERSION} | ${AWK} '{a=int($$1/100000); b=int(($$1-(a*100000))/100); print a "." b}'
1217 .error Unable to determine OS version. Either define OSVERSION, install /usr/include/sys/param.h or define SRC_BASE.
1221 # Enable new xorg for FreeBSD versions after Radeon KMS was imported unless
1222 # WITHOUT_NEW_XORG is set.
1223 .if !defined(WITHOUT_NEW_XORG)
1226 .undef WITH_NEW_XORG
1229 # Only define tools here (for transition period with between pkg tools)
1230 .include "${PORTSDIR}/Mk/bsd.commands.mk"
1232 .if exists(${PKG_BIN})
1233 .if !defined(_PKG_VERSION)
1234 _PKG_VERSION!= ${PKG_BIN} -v
1236 _PKG_STATUS!= ${PKG_BIN} version -t ${_PKG_VERSION:C/-.*//g} ${MINIMAL_PKG_VERSION}
1237 .if ${_PKG_STATUS} == "<"
1238 IGNORE= pkg(8) must be version ${MINIMAL_PKG_VERSION} or greater, but you have ${_PKG_VERSION}. You must upgrade the ${PKG_ORIGIN} port first
1242 MASTERDIR?= ${.CURDIR}
1244 .if ${MASTERDIR} != ${.CURDIR}
1246 MASTER_PORT?=${MASTERDIR:C/[^\/]+\/\.\.\///:C/[^\/]+\/\.\.\///:C/^.*\/([^\/]+\/[^\/]+)$/\\1/}
1252 # If they exist, include Makefile.inc, then architecture/operating
1253 # system specific Makefiles, then local Makefile.local.
1255 .if ${MASTERDIR} != ${.CURDIR} && exists(${.CURDIR}/../Makefile.inc)
1256 .include "${.CURDIR}/../Makefile.inc"
1260 .if exists(${MASTERDIR}/../Makefile.inc)
1261 .include "${MASTERDIR}/../Makefile.inc"
1265 .if exists(${MASTERDIR}/Makefile.${ARCH}-${OPSYS})
1266 .include "${MASTERDIR}/Makefile.${ARCH}-${OPSYS}"
1268 .elif exists(${MASTERDIR}/Makefile.${OPSYS})
1269 .include "${MASTERDIR}/Makefile.${OPSYS}"
1271 .elif exists(${MASTERDIR}/Makefile.${ARCH})
1272 .include "${MASTERDIR}/Makefile.${ARCH}"
1276 .if exists(${MASTERDIR}/Makefile.local)
1277 .include "${MASTERDIR}/Makefile.local"
1281 .for _CATEGORY in ${CATEGORIES}
1282 PKGCATEGORY?= ${_CATEGORY}
1284 _PORTDIRNAME= ${.CURDIR:T}
1285 PORTDIRNAME?= ${_PORTDIRNAME}
1286 PKGORIGIN?= ${PKGCATEGORY}/${PORTDIRNAME}
1288 # where 'make config' records user configuration options
1289 PORT_DBDIR?= /var/db/ports
1291 UID_FILES?= ${PORTSDIR}/UIDs
1292 GID_FILES?= ${PORTSDIR}/GIDs
1296 # predefined accounts from src/etc/master.passwd
1297 # alpha numeric sort order
1298 USERS_BLACKLIST= _dhcp _pflogd auditdistd bin bind daemon games hast kmem mailnull man news nobody operator pop proxy root smmsp sshd toor tty uucp www
1300 LDCONFIG_DIR= libdata/ldconfig
1301 LDCONFIG32_DIR= libdata/ldconfig32
1303 .if defined(LATEST_LINK)
1304 UNIQUENAME?= ${LATEST_LINK}
1306 UNIQUENAME?= ${PKGNAMEPREFIX}${PORTNAME}
1311 # At least KDE needs TMPDIR for the package building,
1312 # so we're setting it to the known default value.
1313 .if defined(PACKAGE_BUILDING)
1315 .endif # defined(PACKAGE_BUILDING)
1317 # Respect TMPDIR passed via make.conf or similar and pass it down
1318 # to configure and make.
1320 MAKE_ENV+= TMPDIR="${TMPDIR}"
1321 CONFIGURE_ENV+= TMPDIR="${TMPDIR}"
1322 .endif # defined(TMPDIR)
1324 .if defined(WITH_DEBUG_PORTS)
1325 .if ${WITH_DEBUG_PORTS:M${PKGORIGIN}}
1330 .include "${PORTSDIR}/Mk/bsd.options.mk"
1332 # Multiple make jobs support
1333 .if defined(DISABLE_MAKE_JOBS) || defined(MAKE_JOBS_UNSAFE)
1337 .if defined(MAKE_JOBS_NUMBER)
1338 _MAKE_JOBS_NUMBER:= ${MAKE_JOBS_NUMBER}
1340 _MAKE_JOBS_NUMBER!= ${SYSCTL} -n hw.ncpu
1342 .if defined(MAKE_JOBS_NUMBER_LIMIT) && ( ${MAKE_JOBS_NUMBER_LIMIT} < ${_MAKE_JOBS_NUMBER} )
1343 MAKE_JOBS_NUMBER= ${MAKE_JOBS_NUMBER_LIMIT}
1345 MAKE_JOBS_NUMBER= ${_MAKE_JOBS_NUMBER}
1347 _MAKE_JOBS?= -j${MAKE_JOBS_NUMBER}
1348 BUILD_FAIL_MESSAGE+= Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to the maintainer.
1351 # Start of pre-makefile section.
1352 .if !defined(AFTERPORTMK) && !defined(INOPTIONSMK)
1354 .include "${PORTSDIR}/Mk/bsd.sanity.mk"
1358 .if defined(PORTVERSION)
1359 .if ${PORTVERSION:M*[-_,]*}x != x
1360 IGNORE= PORTVERSION ${PORTVERSION} may not contain '-' '_' or ','
1362 DISTVERSION?= ${PORTVERSION:S/:/::/g}
1363 .elif defined(DISTVERSION)
1364 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}
1368 .if ${PORTREVISION} != 0
1369 _SUF1= _${PORTREVISION}
1373 .if ${PORTEPOCH} != 0
1374 _SUF2= ,${PORTEPOCH}
1377 PKGVERSION= ${PORTVERSION:C/[-_,]/./g}${_SUF1}${_SUF2}
1378 PKGNAME= ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}-${PKGVERSION}
1379 DISTNAME?= ${PORTNAME}-${DISTVERSIONPREFIX}${DISTVERSION:C/:(.)/\1/g}${DISTVERSIONSUFFIX}
1381 INDEXFILE?= INDEX-${DFLYVERSION:C/([0-9]*)[0-9]{5}/\1/}
1383 DOCSDIR?= ${PREFIX}/share/doc/${PORTNAME}
1384 EXAMPLESDIR?= ${PREFIX}/share/examples/${PORTNAME}
1385 DATADIR?= ${PREFIX}/share/${PORTNAME}
1386 WWWDIR?= ${PREFIX}/www/${PORTNAME}
1387 ETCDIR?= ${PREFIX}/etc/${PORTNAME}
1389 .if defined(USE_LINUX_RPM)
1390 .include "${PORTSDIR}/Mk/bsd.linux-rpm.mk"
1393 .if defined(USE_LINUX_APPS)
1394 .include "${PORTSDIR}/Mk/bsd.linux-apps.mk"
1397 .if defined(USE_XORG) || defined(XORG_CAT)
1398 .include "${PORTSDIR}/Mk/bsd.xorg.mk"
1401 PACKAGES?= /usr/packages
1402 TEMPLATES?= ${PORTSDIR}/Templates
1403 KEYWORDS?= ${PORTSDIR}/Keywords
1405 PATCHDIR?= ${MASTERDIR}/files
1406 FILESDIR?= ${MASTERDIR}/files
1407 SCRIPTDIR?= ${MASTERDIR}/scripts
1408 PKGDIR?= ${MASTERDIR}
1410 .if defined(USE_LINUX_PREFIX)
1411 PREFIX?= ${LINUXBASE}
1414 PREFIX?= ${LOCALBASE}
1417 .if defined(USE_LINUX_PREFIX)
1418 LDCONFIG_CMD?= ${LINUXBASE}/sbin/ldconfig -r ${LINUXBASE}
1421 PKGCOMPATDIR?= ${LOCALBASE}/lib/compat/pkg
1423 .if defined(USE_LOCAL_MK)
1424 .include "${PORTSDIR}/Mk/bsd.local.mk"
1427 .if defined(USE_OPENSSL)
1428 .include "${PORTSDIR}/Mk/bsd.openssl.mk"
1431 .if defined(USE_EMACS)
1432 .include "${PORTSDIR}/Mk/bsd.emacs.mk"
1435 .if defined(USE_GNUSTEP)
1436 .include "${PORTSDIR}/Mk/bsd.gnustep.mk"
1439 .if defined(USE_PHP)
1440 .include "${PORTSDIR}/Mk/bsd.php.mk"
1443 .if defined(USE_PYTHON) || defined(USE_PYTHON_BUILD) || defined(USE_PYTHON_RUN)
1447 .if defined(USE_EFL) || defined(WANT_EFL) || defined(USE_EFL_ESMART)
1448 .include "${PORTSDIR}/Mk/bsd.efl.mk"
1451 .if defined(USE_FPC) || defined(WANT_FPC_BASE) || defined(WANT_FPC_ALL)
1452 .include "${PORTSDIR}/Mk/bsd.fpc.mk"
1455 .if defined(USE_JAVA)
1456 .include "${PORTSDIR}/Mk/bsd.java.mk"
1459 .if defined(USE_RUBY) || defined(USE_LIBRUBY)
1460 .include "${PORTSDIR}/Mk/bsd.ruby.mk"
1463 .if defined(USE_OCAML)
1464 .include "${PORTSDIR}/Mk/bsd.ocaml.mk"
1467 .if defined(USE_APACHE) || defined(USE_APACHE_BUILD) || defined(USE_APACHE_RUN)
1468 .include "${PORTSDIR}/Mk/bsd.apache.mk"
1471 .if defined(USE_QT4) || defined(USE_QT5)
1472 .include "${PORTSDIR}/Mk/bsd.qt.mk"
1475 .if defined(USE_TEX)
1476 .include "${PORTSDIR}/Mk/bsd.tex.mk"
1479 .if defined(USE_GECKO)
1480 .include "${PORTSDIR}/Mk/bsd.gecko.mk"
1483 .if defined(WANT_GNOME) || defined(USE_GNOME) || defined(INSTALLS_ICONS)
1484 .include "${PORTSDIR}/Mk/bsd.gnome.mk"
1487 .if defined(USE_MATE)
1488 .include "${PORTSDIR}/Mk/bsd.mate.mk"
1491 .if defined(WANT_WX) || defined(USE_WX) || defined(USE_WX_NOT)
1492 .include "${PORTSDIR}/Mk/bsd.wx.mk"
1495 .if defined(WANT_GSTREAMER) || defined(USE_GSTREAMER) || defined(USE_GSTREAMER1)
1496 .include "${PORTSDIR}/Mk/bsd.gstreamer.mk"
1499 .if defined(USE_SDL) || defined(WANT_SDL)
1500 .include "${PORTSDIR}/Mk/bsd.sdl.mk"
1503 .if defined(USE_XFCE)
1504 .include "${PORTSDIR}/Mk/bsd.xfce.mk"
1507 .if defined(USE_KDE4) || defined(KDE4_BUILDENV)
1508 .include "${PORTSDIR}/Mk/bsd.kde4.mk"
1515 DESTDIRNAME?= DESTDIR
1517 .if !empty(USES:Mdesktop-file-utils)
1518 QA_ENV+= USESDESKTOPFILEUTILS=yes
1520 .if !empty(USES:Mlibtool*)
1521 QA_ENV+= USESLIBTOOL=yes
1523 .if !empty(USES:Mshared-mime-info)
1524 QA_ENV+= USESSHAREDMIMEINFO=yes
1530 .if !defined(${_f}_ARGS)
1531 ${_f}_ARGS:= ${f:C/^[^\:]*(\:|\$)//:S/,/ /g}
1535 .include "${USESDIR}/${f:C/\:.*//}.mk"
1538 .if defined(USE_BZIP2)
1539 EXTRACT_SUFX?= .tar.bz2
1540 .elif defined(USE_XZ)
1541 EXTRACT_SUFX?= .tar.xz
1543 EXTRACT_SUFX?= .tar.gz
1546 # You can force skipping these test by defining IGNORE_PATH_CHECKS
1547 .if !defined(IGNORE_PATH_CHECKS)
1550 @${ECHO_MSG} "PREFIX must be defined as an absolute path so that when 'make'"
1551 @${ECHO_MSG} "is invoked in the work area PREFIX points to the right place."
1556 # Location of mounted CDROM(s) to search for files
1557 CD_MOUNTPTS?= /cdrom ${CD_MOUNTPT}
1559 # Owner and group of the WWW user
1563 # Keep PKGNG_ORIGIN/WITH_PKGNG for compat with scripts which are looking for it
1564 PKG_ORIGIN?= ports-mgmt/pkg
1565 PKGNG_ORIGIN= ${PKG_ORIGIN}
1567 WITH_PKG?= ${WITH_PKGNG}
1569 .if defined(BUNDLE_LIBS)
1570 PKG_NOTES+= no_provide_shlib
1571 PKG_NOTE_no_provide_shlib= yes
1575 # End of pre-makefile section.
1577 # Start of post-makefile section.
1578 .if !defined(BEFOREPORTMK) && !defined(INOPTIONSMK)
1580 .if defined(_POSTMKINCLUDED)
1581 DEV_ERROR+= "${PKGNAME}: Makefile error: you cannot include bsd.port[.post].mk twice"
1585 _POSTMKINCLUDED= yes
1587 WRKDIR?= ${WRKDIRPREFIX}/${.CURDIR:H:T}/${.CURDIR:T}/work
1588 .if !defined(IGNORE_MASTER_SITE_GITHUB) && defined(USE_GITHUB)
1589 WRKSRC?= ${WRKDIR}/${GH_ACCOUNT}-${GH_PROJECT}-${GH_COMMIT}
1591 .if defined(NO_WRKSUBDIR)
1594 WRKSRC?= ${WRKDIR}/${DISTNAME}
1596 .if defined(WRKSRC_SUBDIR)
1597 WRKSRC:= ${WRKSRC}/${WRKSRC_SUBDIR}
1600 PATCH_WRKSRC?= ${WRKSRC}
1601 CONFIGURE_WRKSRC?= ${WRKSRC}
1602 BUILD_WRKSRC?= ${WRKSRC}
1603 INSTALL_WRKSRC?=${WRKSRC}
1605 PLIST_SUB+= OSREL=${OSREL} PREFIX=%D LOCALBASE=${LOCALBASE} \
1606 RESETPREFIX=${PREFIX}
1607 SUB_LIST+= PREFIX=${PREFIX} LOCALBASE=${LOCALBASE} \
1608 DATADIR=${DATADIR} DOCSDIR=${DOCSDIR} EXAMPLESDIR=${EXAMPLESDIR} \
1609 WWWDIR=${WWWDIR} ETCDIR=${ETCDIR}
1610 # This is used for check-stagedir.sh and check_leftover.sh to replace
1611 # directories/files with PLIST_SUB %%KEYS%%.
1612 # Remove VARS that are too generic
1613 # Remove empty values
1614 # Remove @comment values
1616 # Replace . with \. for later sed(1) usage
1617 PLIST_SUB_SED_MIN?= 2
1618 PLIST_SUB_SED?= ${PLIST_SUB:C/.*=.{1,${PLIST_SUB_SED_MIN}}$//g:NEXTRACT_SUFX=*:NOSREL=*:NLIB32DIR=*:NPREFIX=*:NLOCALBASE=*:NRESETPREFIX=*:N*="":N*="@comment*:C/([^=]*)="?([^"]*)"?/s!\2!%%\1%%!g;/g:C/\./\\./g}
1620 # kludge to strip trailing whitespace from CFLAGS;
1621 # sub-configure will not # survive double space
1622 # remove -O from /usr/share/mk/sys.mk and replace with -O2
1623 CFLAGS:= ${CFLAGS:C/ $//:N-O}
1626 .if defined(WITHOUT_CPU_CFLAGS)
1627 .if defined(_CPUCFLAGS)
1628 .if !empty(_CPUCFLAGS)
1629 CFLAGS:= ${CFLAGS:C/${_CPUCFLAGS}//}
1634 # Reset value from bsd.own.mk.
1635 .if defined(WITH_DEBUG) && !defined(WITHOUT_DEBUG)
1636 .if !defined(INSTALL_STRIPPED)
1638 MAKE_ENV+= DONTSTRIP=yes
1642 CFLAGS:= ${CFLAGS:N-O*:N-fno-strict*} ${DEBUG_FLAGS}
1643 .if defined(INSTALL_TARGET)
1644 INSTALL_TARGET:= ${INSTALL_TARGET:S/^install-strip$/install/g}
1648 .if defined(WITH_SSP) || defined(WITH_SSP_PORTS)
1649 .include "${PORTSDIR}/Mk/bsd.ssp.mk"
1652 # XXX PIE support to be added here
1653 MAKE_ENV+= NO_PIE=yes
1655 .if defined(NOPORTDOCS)
1656 PLIST_SUB+= PORTDOCS="@comment "
1658 PLIST_SUB+= PORTDOCS=""
1661 .if defined(NOPORTEXAMPLES)
1662 PLIST_SUB+= PORTEXAMPLES="@comment "
1664 PLIST_SUB+= PORTEXAMPLES=""
1667 CONFIGURE_SHELL?= ${SH}
1670 CONFIGURE_ENV+= SHELL=${CONFIGURE_SHELL} CONFIG_SHELL=${CONFIGURE_SHELL}
1671 MAKE_ENV+= SHELL=${MAKE_SHELL} NO_LINT=YES
1673 .if defined(PATCHFILES)
1674 .if ${PATCHFILES:M*.zip}x != x
1675 PATCH_DEPENDS+= ${LOCALBASE}/bin/unzip:${PORTSDIR}/archivers/unzip
1679 # Check the compatibility layer for amd64/ia64
1681 .if ${ARCH} == "amd64" || ${ARCH} =="ia64"
1682 .if exists(/usr/lib32)
1683 HAVE_COMPAT_IA32_LIBS?= YES
1685 .if !defined(HAVE_COMPAT_IA32_KERN)
1686 HAVE_COMPAT_IA32_KERN!= if ${SYSCTL} -n compat.ia32.maxvmem >/dev/null 2>&1; then echo YES; fi; echo
1687 .if empty(HAVE_COMPAT_IA32_KERN)
1688 .undef HAVE_COMPAT_IA32_KERN
1693 .if defined(IA32_BINARY_PORT) && ${ARCH} != "i386"
1694 .if ${ARCH} == "amd64" || ${ARCH} == "ia64"
1695 .if !defined(HAVE_COMPAT_IA32_KERN)
1696 IGNORE= requires a kernel with compiled-in IA32 compatibility
1697 .elif !defined(HAVE_COMPAT_IA32_LIBS)
1698 IGNORE= requires 32-bit libraries installed under /usr/lib32
1703 IGNORE= requires i386 (or compatible) platform to run
1708 PLIST_SUB+= LIB32DIR=${LIB32DIR}
1710 .if ${WITH_PKG} == devel
1711 PKG_ORIGIN= ports-mgmt/pkg-devel
1714 .if !defined(PKG_DEPENDS) && !defined(CLEAN_FETCH_ENV)
1715 PKG_DEPENDS+= ${LOCALBASE}/sbin/pkg:${PORTSDIR}/${PKG_ORIGIN}
1718 .if defined(USE_GCC)
1719 .include "${PORTSDIR}/Mk/bsd.gcc.mk"
1721 . if !defined(USE_GNUSTEP)
1722 CONFIGURE_ENV+= CCVER=gcc47
1723 MAKE_ENV+= CCVER=gcc47
1727 .if defined(USE_BINUTILS) && !defined(DISABLE_BINUTILS)
1728 BUILD_DEPENDS+= ${LOCALBASE}/bin/as:${PORTSDIR}/devel/binutils
1729 BINUTILS?= ADDR2LINE AR AS CPPFILT GPROF LD NM OBJCOPY OBJDUMP RANLIB \
1730 READELF SIZE STRINGS
1731 BINUTILS_NO_MAKE_ENV?=
1732 . for b in ${BINUTILS}
1733 ${b}= ${LOCALBASE}/bin/${b:C/PP/++/:tl}
1734 . if defined(GNU_CONFIGURE) || defined(BINUTILS_CONFIGURE)
1735 CONFIGURE_ENV+= ${b}="${${b}}"
1737 . if ${BINUTILS_NO_MAKE_ENV:M${b}} == ""
1738 MAKE_ENV+= ${b}="${${b}}"
1743 .if defined(USE_OPENLDAP) || defined(WANT_OPENLDAP_VER)
1744 .include "${PORTSDIR}/Mk/bsd.ldap.mk"
1747 .if defined(USE_RC_SUBR) && ${USE_RC_SUBR:tu} != "YES"
1748 SUB_FILES+= ${USE_RC_SUBR}
1751 .if defined(USE_RCORDER)
1752 SUB_FILES+= ${USE_RCORDER}
1755 .if defined(USE_LDCONFIG) && ${USE_LDCONFIG:tl} == "yes"
1756 USE_LDCONFIG= ${PREFIX}/lib
1758 .if defined(USE_LDCONFIG32) && ${USE_LDCONFIG32:tl} == "yes"
1759 IGNORE= has USE_LDCONFIG32 set to yes, which is not correct
1762 .if defined(USE_LINUX_PREFIX) && defined(USE_LDCONFIG)
1763 # we need ${LINUXBASE}/sbin/ldconfig
1767 .if defined(USE_LINUX)
1769 . if !defined(LINUX_OSRELEASE)
1770 LINUX_OSRELEASE!= ${ECHO_CMD} `${SYSCTL} -n compat.linux.osrelease 2>/dev/null`
1773 # install(1) also does a brandelf on strip, so don't strip with FreeBSD tools.
1775 . if exists(${LINUXBASE}/usr/bin/strip)
1776 STRIP_CMD= ${LINUXBASE}/usr/bin/strip
1781 # Allow the user to specify another linux_base version.
1782 . if defined(OVERRIDE_LINUX_BASE_PORT)
1783 . if ${USE_LINUX:tl} == yes
1784 USE_LINUX= ${OVERRIDE_LINUX_BASE_PORT}
1788 # NOTE: when you update the default linux_base version (case "yes"),
1789 # don't forget to update the Handbook!
1791 . if exists(${PORTSDIR}/emulators/linux_base-${USE_LINUX})
1792 LINUX_BASE_PORT= ${LINUXBASE}/bin/sh:${PORTSDIR}/emulators/linux_base-${USE_LINUX}
1794 . if ${USE_LINUX:tl} == "yes"
1795 USE_LINUX= f10 # temporary default, set to c6 soon
1796 LINUX_BASE_PORT= ${LINUXBASE}/etc/fedora-release:${PORTSDIR}/emulators/linux_base-f10
1797 #LINUX_BASE_PORT= ${LINUXBASE}/etc/redhat-release:${PORTSDIR}/emulators/linux_base-c6
1799 IGNORE= cannot be built: there is no emulators/linux_base-${USE_LINUX}, perhaps wrong use of USE_LINUX or OVERRIDE_LINUX_BASE_PORT
1803 RUN_DEPENDS+= ${LINUX_BASE_PORT}
1806 PKG_IGNORE_DEPENDS?= 'this_port_does_not_exist'
1808 _GL_gbm_LIB_DEPENDS= libgbm.so:${PORTSDIR}/graphics/gbm
1809 _GL_glesv2_LIB_DEPENDS= libGLESv2.so:${PORTSDIR}/graphics/libglesv2
1810 _GL_egl_LIB_DEPENDS= libEGL.so:${PORTSDIR}/graphics/libEGL
1811 _GL_gl_LIB_DEPENDS= libGL.so:${PORTSDIR}/graphics/libGL
1812 _GL_gl_USE_XORG= glproto dri2proto
1813 _GL_glew_LIB_DEPENDS= libGLEW.so:${PORTSDIR}/graphics/glew
1814 _GL_glu_LIB_DEPENDS= libGLU.so:${PORTSDIR}/graphics/libGLU
1815 _GL_glu_USE_XORG= glproto dri2proto
1816 _GL_glw_LIB_DEPENDS= libGLw.so:${PORTSDIR}/graphics/libGLw
1817 _GL_glut_LIB_DEPENDS= libglut.so:${PORTSDIR}/graphics/freeglut
1820 . if ${USE_GL:tl} == "yes"
1823 . for _component in ${USE_GL}
1824 . if !defined(_GL_${_component}_LIB_DEPENDS) && \
1825 !defined(_GL_${_component}_RUN_DEPENDS)
1826 IGNORE= uses unknown GL component
1828 USE_XORG+= ${_GL_${_component}_USE_XORG}
1829 BUILD_DEPENDS+= ${_GL_${_component}_BUILD_DEPENDS}
1830 LIB_DEPENDS+= ${_GL_${_component}_LIB_DEPENDS}
1831 RUN_DEPENDS+= ${_GL_${_component}_RUN_DEPENDS}
1836 .if defined(_DESTDIR_VIA_ENV)
1837 MAKE_ENV+= ${DESTDIRNAME}=${STAGEDIR}
1839 MAKE_ARGS+= ${DESTDIRNAME}=${STAGEDIR}
1842 .if defined(NO_PREFIX_RMDIR)
1843 CO_ENV+= NO_PREFIX_RMDIR=1
1845 CO_ENV+= NO_PREFIX_RMDIR=0
1849 METADIR= ${WRKDIR}/.metadir
1850 MANIFESTF= ${METADIR}/+MANIFEST
1852 PKGPREINSTALL?= ${PKGDIR}/pkg-pre-install
1853 PKGPOSTINSTALL?= ${PKGDIR}/pkg-post-install
1854 PKGPREDEINSTALL?= ${PKGDIR}/pkg-pre-deinstall
1855 PKGPOSTDEINSTALL?= ${PKGDIR}/pkg-post-deinstall
1856 PKGPREUPGRADE?= ${PKGDIR}/pkg-pre-upgrade
1857 PKGPOSTUPGRADE?= ${PKGDIR}/pkg-post-upgrade
1858 PKGUPGRADE?= ${PKGDIR}/pkg-upgrade
1860 _FORCE_POST_PATTERNS= rmdir kldxref mkfontscale mkfontdir fc-cache \
1861 fonts.dir fonts.scale gtk-update-icon-cache \
1863 gtk-query-immodules \
1867 update-desktop-database update-mime-database \
1868 gdk-pixbuf-query-loaders catalog.ports \
1869 glib-compile-schemas \
1872 .if defined(USE_LOCAL_MK)
1873 .include "${PORTSDIR}/Mk/bsd.local.mk"
1876 .if defined(USE_XORG) || defined(XORG_CAT)
1877 .include "${PORTSDIR}/Mk/bsd.xorg.mk"
1880 .if defined(USE_MYSQL) || defined(WANT_MYSQL_VER) || \
1881 defined(USE_PGSQL) || defined(WANT_PGSQL_VER) || \
1882 defined(USE_BDB) || defined(USE_SQLITE) || defined(USE_FIREBIRD)
1883 .include "${PORTSDIR}/Mk/bsd.database.mk"
1886 .if defined(WANT_GSTREAMER) || defined(USE_GSTREAMER) || defined(USE_GSTREAMER1)
1887 .include "${PORTSDIR}/Mk/bsd.gstreamer.mk"
1890 .if defined(USE_EFL) || defined(WANT_EFL) || defined(USE_EFL_ESMART)
1891 .include "${PORTSDIR}/Mk/bsd.efl.mk"
1894 .if defined(USE_JAVA)
1895 .include "${PORTSDIR}/Mk/bsd.java.mk"
1898 .if defined(USE_OCAML)
1899 .include "${PORTSDIR}/Mk/bsd.ocaml.mk"
1902 .if defined(USE_LINUX_RPM)
1903 .include "${PORTSDIR}/Mk/bsd.linux-rpm.mk"
1906 .if defined(USE_LINUX_APPS)
1907 .include "${PORTSDIR}/Mk/bsd.linux-apps.mk"
1910 .if defined(USE_QT4) || defined(USE_QT5)
1911 .include "${PORTSDIR}/Mk/bsd.qt.mk"
1914 .if defined(USE_SDL) || defined(WANT_SDL)
1915 .include "${PORTSDIR}/Mk/bsd.sdl.mk"
1918 .if defined(USE_PHP)
1919 .include "${PORTSDIR}/Mk/bsd.php.mk"
1922 .if defined(USE_WX) || defined(USE_WX_NOT)
1923 .include "${PORTSDIR}/Mk/bsd.wx.mk"
1926 .if defined(USE_APACHE) || defined(USE_APACHE_BUILD) || defined(USE_APACHE_RUN)
1927 .include "${PORTSDIR}/Mk/bsd.apache.mk"
1930 .if defined(USE_AUTOTOOLS)
1931 .include "${PORTSDIR}/Mk/bsd.autotools.mk"
1934 .if defined(USE_FPC) || defined(WANT_FPC_BASE) || defined(WANT_FPC_ALL)
1935 .include "${PORTSDIR}/Mk/bsd.fpc.mk"
1938 .if defined(USE_GECKO)
1939 .include "${PORTSDIR}/Mk/bsd.gecko.mk"
1942 .if defined(WANT_GNOME) || defined(USE_GNOME)
1943 .include "${PORTSDIR}/Mk/bsd.gnome.mk"
1946 .if defined(USE_MATE)
1947 .include "${PORTSDIR}/Mk/bsd.mate.mk"
1950 .if defined(USE_XFCE)
1951 .include "${PORTSDIR}/Mk/bsd.xfce.mk"
1954 .if defined(USE_KDE4)
1955 .include "${PORTSDIR}/Mk/bsd.kde4.mk"
1958 .if exists(${PORTSDIR}/Makefile.inc)
1959 .include "${PORTSDIR}/Makefile.inc"
1964 .for f in ${_USES_POST}
1966 .if !defined(${_f}_ARGS)
1967 ${_f}_ARGS:= ${f:C/^[^\:]*(\:|\$)//:S/,/ /g}
1970 .for f in ${_USES_POST}
1971 .include "${USESDIR}/${f:C/\:.*//}.mk"
1974 .if defined(USE_XORG)
1975 # Add explicit X options to avoid problems with false positives in configure
1976 .if defined(GNU_CONFIGURE)
1977 CONFIGURE_ARGS+=--x-libraries=${LOCALBASE}/lib --x-includes=${LOCALBASE}/include
1981 # Set the default for the installation of Postscript(TM)-
1982 # compatible functionality.
1983 .if !defined(USE_GHOSTSCRIPT)
1984 . if defined(USE_GHOSTSCRIPT_BUILD)
1985 _USE_GHOSTSCRIPT= ${USE_GHOSTSCRIPT_BUILD}
1986 . elif defined(USE_GHOSTSCRIPT_RUN)
1987 _USE_GHOSTSCRIPT= ${USE_GHOSTSCRIPT_RUN}
1990 _USE_GHOSTSCRIPT= ${USE_GHOSTSCRIPT}
1993 .if defined(WITH_GHOSTSCRIPT_VER) && !empty(WITH_GHOSTSCRIPT_VER:M[789])
1994 _USE_GHOSTSCRIPT_DEFAULT_VER= ${WITH_GHOSTSCRIPT_VER}
1996 _USE_GHOSTSCRIPT_DEFAULT_VER= 9
1999 .if defined(_USE_GHOSTSCRIPT)
2000 . if !defined(WITHOUT_X11)
2001 _USE_GHOSTSCRIPT_PKGNAME_SUFFIX=
2003 _USE_GHOSTSCRIPT_PKGNAME_SUFFIX=-nox11
2005 . if !empty(_USE_GHOSTSCRIPT:M[789])
2006 _USE_GHOSTSCRIPT_VER=${_USE_GHOSTSCRIPT:M[789]}
2008 _USE_GHOSTSCRIPT_VER=${_USE_GHOSTSCRIPT_DEFAULT_VER}
2011 _USE_GHOSTSCRIPT_VER=${_USE_GHOSTSCRIPT_DEFAULT_VER}
2015 .if defined(_USE_GHOSTSCRIPT) && defined(WITH_GHOSTSCRIPT_VER)
2016 . if empty(WITH_GHOSTSCRIPT_VER:M[789])
2017 . error You set an invalid value "${WITH_GHOSTSCRIPT_VER}" in WITH_GHOSTSCRIPT_VER. Abort.
2018 . elif ${_USE_GHOSTSCRIPT_VER} != ${WITH_GHOSTSCRIPT_VER}
2019 . error You set WITH_GHOSTSCRIPT_VER as ${WITH_GHOSTSCRIPT_VER} but ${PKGNAME} requires print/ghostscript${_USE_GHOSTSCRIPT_VER}. Abort.
2023 GHOSTSCRIPT_PORT?= print/ghostscript${_USE_GHOSTSCRIPT_VER}${_USE_GHOSTSCRIPT_PKGNAME_SUFFIX}
2025 # Set up the ghostscript dependencies.
2026 .if defined(USE_GHOSTSCRIPT) || defined(USE_GHOSTSCRIPT_BUILD)
2027 BUILD_DEPENDS+= gs:${PORTSDIR}/${GHOSTSCRIPT_PORT}
2029 .if defined(USE_GHOSTSCRIPT) || defined(USE_GHOSTSCRIPT_RUN)
2030 RUN_DEPENDS+= gs:${PORTSDIR}/${GHOSTSCRIPT_PORT}
2033 # Macro for doing in-place file editing using regexps
2034 REINPLACE_ARGS?= -i.bak
2035 REINPLACE_CMD?= ${SED} ${REINPLACE_ARGS}
2037 # Names of cookies used to skip already completed stages
2038 EXTRACT_COOKIE?= ${WRKDIR}/.extract_done.${PORTNAME}.${PREFIX:S/\//_/g}
2039 CONFIGURE_COOKIE?= ${WRKDIR}/.configure_done.${PORTNAME}.${PREFIX:S/\//_/g}
2040 INSTALL_COOKIE?= ${WRKDIR}/.install_done.${PORTNAME}.${PREFIX:S/\//_/g}
2041 BUILD_COOKIE?= ${WRKDIR}/.build_done.${PORTNAME}.${PREFIX:S/\//_/g}
2042 PATCH_COOKIE?= ${WRKDIR}/.patch_done.${PORTNAME}.${PREFIX:S/\//_/g}
2043 PACKAGE_COOKIE?= ${WRKDIR}/.package_done.${PORTNAME}.${PREFIX:S/\//_/g}
2044 STAGE_COOKIE?= ${WRKDIR}/.stage_done.${PORTNAME}.${PREFIX:S/\//_/g}
2046 # How to do nothing. Override if you, for some strange reason, would rather
2050 # Use this as the first operand to always build dependency.
2051 NONEXISTENT?= /nonexistent
2053 CHECKSUM_ALGORITHMS?= sha256
2055 DISTINFO_FILE?= ${MASTERDIR}/distinfo
2059 MAKE_CMD?= /usr/bin/make
2060 PLIST_SUB:= ${PLIST_SUB:NPROFILE=*} PROFILE="@comment "
2061 MAKE_ENV+= PREFIX=${PREFIX} \
2062 LOCALBASE=${LOCALBASE} \
2063 LIBDIR="${LIBDIR}" \
2065 CC="${CC}" CFLAGS="${CFLAGS}" \
2066 CPP="${CPP}" CPPFLAGS="${CPPFLAGS}" \
2067 LDFLAGS="${LDFLAGS}" LIBS="${LIBS}" \
2068 CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" \
2069 MANPREFIX="${MANPREFIX}"
2071 # Add -fno-strict-aliasing to CFLAGS with optimization level -O2 or higher.
2072 # gcc 4.x enable strict aliasing optimization with -O2 which is known to break
2074 .if !defined(WITHOUT_NO_STRICT_ALIASING)
2076 .if empty(CFLAGS:M-fno-strict-aliasing)
2077 CFLAGS+= -fno-strict-aliasing
2083 .if defined(USE_${lang}STD)
2084 ${lang}FLAGS:= ${${lang}FLAGS:N-std=*} -std=${USE_${lang}STD}
2087 .if defined(${lang}FLAGS_${ARCH})
2088 ${lang}FLAGS+= ${${lang}FLAGS_${ARCH}}
2094 # Try to set a default CCACHE_DIR to workaround HOME=/dev/null and
2095 # HOME=${WRKDIR}/* staging fixes
2096 .if defined(WITH_CCACHE_BUILD) && !defined(CCACHE_DIR) && \
2097 (!defined(HOME) || ${HOME} == /dev/null || ${HOME:S/^${WRKDIR}//} != ${HOME})
2098 . if defined(USER) && ${USER} == root
2099 CCACHE_DIR= /root/.ccache
2102 WARNING+= WITH_CCACHE_BUILD support disabled, please set CCACHE_DIR.
2106 # Support NO_CCACHE for common setups, require WITH_CCACHE_BUILD, and
2107 # don't use if ccache already set in CC
2108 .if !defined(NO_CCACHE) && defined(WITH_CCACHE_BUILD) && !${CC:M*ccache*} && \
2109 !defined(NO_BUILD) && !defined(NOCCACHE)
2110 # Avoid depends loops between pkg and ccache
2111 . if !${.CURDIR:M*/devel/ccache} && !${.CURDIR:M*/ports-mgmt/pkg}
2112 BUILD_DEPENDS+= ${LOCALBASE}/bin/ccache:${PORTSDIR}/devel/ccache
2115 _CCACHE_PATH= ${LOCALBASE}/libexec/ccache
2117 # Prepend the ccache dir into the PATH and setup ccache env
2118 PATH:= ${_CCACHE_PATH}:${PATH}
2119 #.MAKEFLAGS: PATH=${PATH}
2120 .if !${MAKE_ENV:MPATH=*} && !${CONFIGURE_ENV:MPATH=*}
2121 MAKE_ENV+= PATH=${PATH}
2122 CONFIGURE_ENV+= PATH=${PATH}
2125 # Ensure this is always in subchild environments
2126 . if defined(CCACHE_DIR)
2127 #.MAKEFLAGS: CCACHE_DIR=${CCACHE_DIR}
2128 MAKE_ENV+= CCACHE_DIR="${CCACHE_DIR}"
2129 CONFIGURE_ENV+= CCACHE_DIR="${CCACHE_DIR}"
2134 PTHREAD_LIBS?= -pthread
2136 FETCH_ENV?= SSL_NO_VERIFY_PEER=1 SSL_NO_VERIFY_HOSTNAME=1
2137 FETCH_BINARY?= /usr/bin/fetch
2140 .if !defined(DISABLE_SIZE)
2141 FETCH_BEFORE_ARGS+= $${CKSIZE:+-S $$CKSIZE}
2143 FETCH_CMD?= ${FETCH_BINARY} ${FETCH_ARGS}
2145 .if defined(RANDOMIZE_MASTER_SITES)
2146 .if exists(/usr/games/random)
2147 RANDOM_CMD?= /usr/games/random
2148 RANDOM_ARGS?= "-w -f -"
2149 _RANDOMIZE_SITES= " |${RANDOM_CMD} ${RANDOM_ARGS}"
2153 TOUCH?= /usr/bin/touch
2156 DISTORIG?= .bak.orig
2157 PATCH?= /usr/bin/patch
2159 PATCH_DIST_STRIP?= -p0
2160 .if defined(PATCH_DEBUG)
2161 PATCH_DEBUG_TMP= yes
2162 PATCH_ARGS?= -d ${PATCH_WRKSRC} -E ${PATCH_STRIP}
2163 PATCH_DIST_ARGS?= --suffix ${DISTORIG} -d ${PATCH_WRKSRC} -E ${PATCH_DIST_STRIP}
2166 PATCH_ARGS?= -d ${PATCH_WRKSRC} --forward --quiet -E ${PATCH_STRIP}
2167 PATCH_DIST_ARGS?= --suffix ${DISTORIG} -d ${PATCH_WRKSRC} --forward --quiet -E ${PATCH_DIST_STRIP}
2170 PATCH_SILENT= PATCH_SILENT=yes
2173 PATCH_ARGS+= --batch
2174 PATCH_DIST_ARGS+= --batch
2177 # Prevent breakage with VERSION_CONTROL=numbered
2178 PATCH_ARGS+= -V simple
2180 .if defined(PATCH_CHECK_ONLY)
2182 PATCH_DIST_ARGS+= -C
2185 .if ${PATCH} == "/usr/bin/patch"
2186 PATCH_ARGS+= --suffix .orig
2187 PATCH_DIST_ARGS+= --suffix .orig
2192 # EXTRACT_SUFX is defined in .pre.mk section
2194 LHA_BEFORE_ARGS?= xfpw=${WRKDIR}
2197 .if defined(EXTRACT_PRESERVE_OWNERSHIP)
2198 TAR_AFTER_ARGS_DEFAULT=
2200 TAR_AFTER_ARGS_DEFAULT= --no-same-owner --no-same-permissions
2202 TAR_BEFORE_ARGS_DEFAULT= -xf
2204 .if !defined(TAR_BEFORE_ARGS)
2205 . if defined(EXTRACT_BEFORE_ARGS)
2206 TAR_BEFORE_ARGS= ${EXTRACT_BEFORE_ARGS}
2208 TAR_BEFORE_ARGS= ${TAR_BEFORE_ARGS_DEFAULT}
2212 # ZIP_* variables are always defined by zip.mk, so ?= only kicks in USES+=zip
2213 # when does not exist. In this case, assume $TAR is desired for zip archives
2214 ZIP_BEFORE_ARGS?= ${TAR_BEFORE_ARGS_DEFAULT}
2215 ZIP_AFTER_ARGS?= ${TAR_AFTER_ARGS_DEFAULT}
2216 ZIP_EXTRACT_CMD?= ${TAR}
2218 .if !defined(TAR_AFTER_ARGS)
2219 . if defined(EXTRACT_AFTER_ARGS)
2220 TAR_AFTER_ARGS= ${EXTRACT_AFTER_ARGS}
2222 TAR_AFTER_ARGS= ${TAR_AFTER_ARGS_DEFAULT}
2226 EXTRACT_BEFORE_ARGS?= ${TAR_BEFORE_ARGS_DEFAULT}
2227 EXTRACT_AFTER_ARGS?= ${TAR_AFTER_ARGS_DEFAULT}
2229 # Figure out where the local mtree file is
2230 .if !defined(MTREE_FILE) && !defined(NO_MTREE)
2231 .if ${PREFIX} == /usr
2232 MTREE_FILE= /etc/mtree/BSD.usr.dist
2234 MTREE_FILE= ${PORTSDIR}/Templates/BSD.local.dist
2236 MTREE_FILE_DEFAULT=yes
2238 MTREE_CMD?= /usr/sbin/mtree
2239 MTREE_ARGS?= -U ${MTREE_FOLLOWS_SYMLINKS} -f ${MTREE_FILE} -d -e -p
2241 READLINK_CMD?= /usr/bin/readlink
2243 # Determine whether or not we can use rootly owner/group functions.
2245 _BINOWNGRP= -o ${BINOWN} -g ${BINGRP}
2246 _SHROWNGRP= -o ${SHAREOWN} -g ${SHAREGRP}
2247 _MANOWNGRP= -o ${MANOWN} -g ${MANGRP}
2256 # A few aliases for *-install targets
2258 ${INSTALL} ${COPY} ${STRIP} ${_BINOWNGRP} -m ${BINMODE}
2260 ${INSTALL} ${COPY} ${_BINOWNGRP} -m ${BINMODE}
2262 ${INSTALL} ${COPY} ${STRIP} ${_SHROWNGRP} -m ${SHAREMODE}
2264 ${INSTALL} ${COPY} ${_BINOWNGRP} -m ${BINMODE}
2266 ${INSTALL} ${COPY} ${_SHROWNGRP} -m ${_SHAREMODE}
2268 ${INSTALL} ${COPY} ${_MANOWNGRP} -m ${MANMODE}
2270 INSTALL_MACROS= BSD_INSTALL_PROGRAM="${INSTALL_PROGRAM}" \
2271 BSD_INSTALL_LIB="${INSTALL_LIB}" \
2272 BSD_INSTALL_SCRIPT="${INSTALL_SCRIPT}" \
2273 BSD_INSTALL_DATA="${INSTALL_DATA}" \
2274 BSD_INSTALL_MAN="${INSTALL_MAN}"
2275 MAKE_ENV+= ${INSTALL_MACROS}
2276 SCRIPTS_ENV+= ${INSTALL_MACROS}
2278 # Macro for copying entire directory tree with correct permissions
2280 COPYTREE_BIN= ${SH} -c '(${FIND} -d $$0 $$2 | ${CPIO} -dumpl $$1 >/dev/null \
2282 ${CHOWN} -Rh ${BINOWN}:${BINGRP} $$1 && \
2283 ${FIND} -d $$0 $$2 -type d -exec chmod 755 $$1/{} \; && \
2284 ${FIND} -d $$0 $$2 -type f -exec chmod ${BINMODE} $$1/{} \;' --
2285 COPYTREE_SHARE= ${SH} -c '(${FIND} -d $$0 $$2 | ${CPIO} -dumpl $$1 >/dev/null \
2287 ${CHOWN} -Rh ${SHAREOWN}:${SHAREGRP} $$1 && \
2288 ${FIND} -d $$0 $$2 -type d -exec chmod 755 $$1/{} \; && \
2289 ${FIND} -d $$0 $$2 -type f -exec chmod ${SHAREMODE} $$1/{} \;' --
2291 COPYTREE_BIN= ${SH} -c '(${FIND} -d $$0 $$2 | ${CPIO} -dumpl $$1 >/dev/null \
2293 ${FIND} -d $$0 $$2 -type d -exec chmod 755 $$1/{} \; && \
2294 ${FIND} -d $$0 $$2 -type f -exec chmod ${BINMODE} $$1/{} \;' --
2295 COPYTREE_SHARE= ${SH} -c '(${FIND} -d $$0 $$2 | ${CPIO} -dumpl $$1 >/dev/null \
2297 ${FIND} -d $$0 $$2 -type d -exec chmod 755 $$1/{} \; && \
2298 ${FIND} -d $$0 $$2 -type f -exec chmod ${SHAREMODE} $$1/{} \;' --
2301 # The user can override the NO_PACKAGE by specifying this from
2302 # the make command line
2303 .if defined(FORCE_PACKAGE)
2307 DESCR?= ${PKGDIR}/pkg-descr
2308 PLIST?= ${PKGDIR}/pkg-plist
2309 PKGHELP?= ${PKGDIR}/pkg-help
2310 PKGINSTALL?= ${PKGDIR}/pkg-install
2311 PKGDEINSTALL?= ${PKGDIR}/pkg-deinstall
2312 PKGREQ?= ${PKGDIR}/pkg-req
2313 PKGMESSAGE?= ${PKGDIR}/pkg-message
2315 TMPPLIST?= ${WRKDIR}/.PLIST.mktmp
2316 TMPPLIST_SORT?= ${WRKDIR}/.PLIST.mktmp.sorted
2317 TMPGUCMD?= ${WRKDIR}/.PLIST.gucmd
2319 .if defined(PKG_NOCOMPRESS)
2324 # where pkg_add records its dirty deeds.
2325 PKG_DBDIR?= /var/db/pkg
2328 INSTALL_TARGET?= install
2329 INSTALL_TARGET+= ${LATE_INSTALL_ARGS}
2331 # Integrate with the license auditing framework
2332 .if !defined (DISABLE_LICENSES)
2333 .include "${PORTSDIR}/Mk/bsd.licenses.mk"
2336 # Popular master sites
2337 .include "${PORTSDIR}/Mk/bsd.sites.mk"
2339 # Empty declaration to avoid "variable MASTER_SITES recursive" error
2342 _MASTER_SITES_DEFAULT?=
2343 _PATCH_SITES_DEFAULT?=
2345 # Feed internal _{MASTER,PATCH}_SITES_n where n is a group designation
2346 # as per grouping rules (:something)
2347 # Organize _{MASTER,PATCH}_SITES_{DEFAULT,[^/:]+} according to grouping
2348 # rules (:something)
2349 .for _S in ${MASTER_SITES}
2350 _S_TEMP= ${_S:S/^${_S:C@/?:[^/:]+$@/@}//:S/^://}
2351 . if !empty(_S_TEMP)
2352 . for _group in ${_S_TEMP:S/,/ /g}
2354 . if ${_G_TEMP} == all || ${_G_TEMP} == ALL || ${_G_TEMP} == default
2356 @${ECHO_MSG} "Makefile error: the words all, ALL and default are reserved and cannot be"
2357 @${ECHO_MSG} "used in group definitions. Please fix your MASTER_SITES"
2360 _MASTER_SITES_${_group}+= ${_S:C@^(.*/):[^/:]+$@\1@}
2363 _MASTER_SITES_DEFAULT+= ${_S:C@^(.*/):[^/:]+$@\1@}
2366 .for _S in ${PATCH_SITES}
2367 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://}
2368 . if !empty(_S_TEMP)
2369 . for _group in ${_S_TEMP:S/,/ /g}
2371 . if ${_G_TEMP} == all || ${_G_TEMP} == ALL || ${_G_TEMP} == default
2373 @${ECHO_MSG} "The words all, ALL and default are reserved and cannot be"
2374 @${ECHO_MSG} "used in group definitions. Please fix your PATCH_SITES"
2377 _PATCH_SITES_${_group}+= ${_S:C@^(.*/):[^/:]+$@\1@}
2380 _PATCH_SITES_DEFAULT+= ${_S:C@^(.*/):[^/:]+$@\1@}
2384 # Feed internal _{MASTER,PATCH}_SITE_SUBDIR_n where n is a group designation
2385 # as per grouping rules (:something)
2386 # Organize _{MASTER,PATCH}_SITE_SUBDIR_{DEFAULT,[^/:]+} according to grouping
2387 # rules (:something)
2388 .for _S in ${MASTER_SITE_SUBDIR}
2389 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://}
2390 . if !empty(_S_TEMP)
2391 . for _group in ${_S_TEMP:S/,/ /g}
2393 . if ${_G_TEMP} == all || ${_G_TEMP} == ALL || ${_G_TEMP} == default
2395 @${ECHO_MSG} "Makefile error: the words all, ALL and default are reserved and cannot be"
2396 @${ECHO_MSG} "used in group definitions. Please fix your MASTER_SITE_SUBDIR"
2399 . if defined(_MASTER_SITES_${_group})
2400 _MASTER_SITE_SUBDIR_${_group}+= ${_S:C@^(.*)/:[^/:]+$@\1@}
2404 . if defined(_MASTER_SITES_DEFAULT)
2405 _MASTER_SITE_SUBDIR_DEFAULT+= ${_S:C@^(.*)/:[^/:]+$@\1@}
2409 .for _S in ${PATCH_SITE_SUBDIR}
2410 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://}
2411 . if !empty(_S_TEMP)
2412 . for _group in ${_S_TEMP:S/,/ /g}
2414 . if ${_G_TEMP} == all || ${_G_TEMP} == ALL || ${_G_TEMP} == default
2416 @${ECHO_MSG} "Makefile error: the words all, ALL and default are reserved and cannot be"
2417 @${ECHO_MSG} "used in group definitions. Please fix your PATCH_SITE_SUBDIR"
2420 . if defined(_PATCH_SITES_${_group})
2421 _PATCH_SITE_SUBDIR_${_group}+= ${_S:C@^(.*)/:[^/:]+$@\1@}
2425 . if defined(_PATCH_SITES_DEFAULT)
2426 _PATCH_SITE_SUBDIR_DEFAULT+= ${_S:C@^(.*)/:[^/:]+$@\1@}
2431 # Substitute subdirectory names
2432 # XXX simpler/faster solution but not the best space wise, suggestions please
2433 .for _S in ${MASTER_SITES}
2434 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://}
2435 . if !empty(_S_TEMP)
2436 . for _group in ${_S_TEMP:S/,/ /g}
2437 . if !defined(_MASTER_SITE_SUBDIR_${_group})
2438 MASTER_SITES_TMP= ${_MASTER_SITES_${_group}:S^%SUBDIR%/^^}
2440 _S_TEMP_TEMP= ${_MASTER_SITES_${_group}:M*%SUBDIR%/*}
2441 . if empty(_S_TEMP_TEMP)
2442 MASTER_SITES_TMP= ${_MASTER_SITES_${_group}}
2445 . for site in ${_MASTER_SITES_${_group}}
2446 _S_TEMP_TEMP= ${site:M*%SUBDIR%/*}
2447 . if empty(_S_TEMP_TEMP)
2448 MASTER_SITES_TMP+= ${site}
2450 . for dir in ${_MASTER_SITE_SUBDIR_${_group}}
2451 MASTER_SITES_TMP+= ${site:S^%SUBDIR%^\${dir}^}
2457 _MASTER_SITES_${_group}:= ${MASTER_SITES_TMP}
2461 .if defined(_MASTER_SITE_SUBDIR_DEFAULT)
2462 _S_TEMP= ${_MASTER_SITES_DEFAULT:M*%SUBDIR%/*}
2464 MASTER_SITES_TMP= ${_MASTER_SITES_DEFAULT}
2467 . for site in ${_MASTER_SITES_DEFAULT}
2468 _S_TEMP_TEMP= ${site:M*%SUBDIR%/*}
2469 . if empty(_S_TEMP_TEMP)
2470 MASTER_SITES_TMP+= ${site}
2472 . for dir in ${_MASTER_SITE_SUBDIR_DEFAULT}
2473 MASTER_SITES_TMP+= ${site:S^%SUBDIR%^\${dir}^}
2479 MASTER_SITES_TMP= ${_MASTER_SITES_DEFAULT:S^%SUBDIR%/^^}
2481 _MASTER_SITES_DEFAULT:= ${MASTER_SITES_TMP}
2483 .for _S in ${PATCH_SITES}
2484 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://}
2485 . if !empty(_S_TEMP)
2486 . for _group in ${_S_TEMP:S/,/ /g}
2487 . if !defined(_PATCH_SITE_SUBDIR_${_group})
2488 PATCH_SITES_TMP= ${_PATCH_SITES_${_group}:S^%SUBDIR%/^^}
2490 _S_TEMP_TEMP= ${_PATCH_SITES_${_group}:M*%SUBDIR%/*}
2491 . if empty(_S_TEMP_TEMP)
2492 PATCH_SITES_TMP= ${_PATCH_SITES_${_group}}
2495 . for site in ${_PATCH_SITES_${_group}}
2496 _S_TEMP_TEMP= ${site:M*%SUBDIR%/*}
2497 . if empty(_S_TEMP_TEMP)
2498 PATCH_SITES_TMP+= ${site}
2500 . for dir in ${_PATCH_SITE_SUBDIR_${_group}}
2501 PATCH_SITES_TMP+= ${site:S^%SUBDIR%^\${dir}^}
2507 _PATCH_SITES_${_group}:= ${PATCH_SITES_TMP}
2511 .if defined(_PATCH_SITE_SUBDIR_DEFAULT)
2512 _S_TEMP= ${_PATCH_SITES_DEFAULT:M*%SUBDIR%/*}
2514 PATCH_SITES_TMP= ${_PATCH_SITES_DEFAULT}
2517 . for site in ${_PATCH_SITES_DEFAULT}
2518 _S_TEMP_TEMP= ${site:M*%SUBDIR%/*}
2519 . if empty(_S_TEMP_TEMP)
2520 PATCH_SITES_TMP+= ${site}
2522 . for dir in ${_PATCH_SITE_SUBDIR_DEFAULT}
2523 PATCH_SITES_TMP+= ${site:S^%SUBDIR%^\${dir}^}
2529 PATCH_SITES_TMP= ${_PATCH_SITES_DEFAULT:S^%SUBDIR%/^^}
2531 _PATCH_SITES_DEFAULT:= ${PATCH_SITES_TMP}
2534 # The primary backup site.
2535 MASTER_SITE_BACKUP?= \
2536 http://distcache.FreeBSD.org/ports-distfiles/${DIST_SUBDIR}/
2537 MASTER_SITE_BACKUP:= ${MASTER_SITE_BACKUP:S^\${DIST_SUBDIR}/^^}
2539 # If the user has MASTER_SITE_FREEBSD set, go to the FreeBSD repository
2540 # for everything, but don't search it twice by appending it to the end.
2541 .if defined(MASTER_SITE_FREEBSD)
2542 _MASTER_SITE_OVERRIDE:= ${MASTER_SITE_BACKUP}
2543 _MASTER_SITE_BACKUP:= # empty
2545 _MASTER_SITE_OVERRIDE= ${MASTER_SITE_OVERRIDE}
2546 _MASTER_SITE_BACKUP= ${MASTER_SITE_BACKUP}
2549 # Search CDROM first if mounted, symlink instead of copy if
2550 # FETCH_SYMLINK_DISTFILES is set
2551 .for MOUNTPT in ${CD_MOUNTPTS}
2552 .if exists(${MOUNTPT}/ports/distfiles)
2553 _MASTER_SITE_OVERRIDE:= file:${MOUNTPT}/ports/distfiles/${DIST_SUBDIR}/ ${_MASTER_SITE_OVERRIDE}
2554 .if defined(FETCH_SYMLINK_DISTFILES)
2555 FETCH_BEFORE_ARGS+= -l
2562 # Organize DISTFILES, PATCHFILES, _MASTER_SITES_ALL, _PATCH_SITES_ALL
2563 # according to grouping rules (:something)
2564 DISTFILES?= ${DISTNAME}${EXTRACT_SUFX}
2565 _MASTER_SITES_ALL= ${_MASTER_SITES_DEFAULT}
2566 _PATCH_SITES_ALL= ${_PATCH_SITES_DEFAULT}
2568 .for _D in ${DISTFILES}
2569 _D_TEMP= ${_D:S/^${_D:C/:[^:]+$//}//}
2570 . if !empty(_D_TEMP)
2571 . for _group in ${_D_TEMP:S/^://:S/,/ /g}
2572 . if !defined(_MASTER_SITES_${_group})
2573 _G_TEMP_TEMP= ${_G_TEMP:M/${_group}/}
2574 . if empty(_G_TEMP_TEMP)
2576 _MASTER_SITES_ALL+= ${_MASTER_SITES_${_group}}
2580 _DISTFILES+= ${_D:C/:[^:]+$//}
2586 .for _P in ${PATCHFILES}
2587 _P_TEMP= ${_P:C/:[^-:][^:]*$//}
2588 _P_groups= ${_P:S/^${_P:C/:[^:]+$//}//:S/^://}
2589 _P_file= ${_P_TEMP:C/:-[^:]+$//}
2590 _P_strip= ${_P_TEMP:S/^${_P_TEMP:C/:-[^:]*$//}//:S/^://}
2591 . if !empty(_P_groups)
2592 . for _group in ${_P_groups:S/,/ /g}
2593 . if !defined(_PATCH_SITES_${_group})
2594 _G_TEMP_TEMP= ${_G_TEMP:M/${_group}/}
2595 . if empty(_G_TEMP_TEMP)
2597 _PATCH_SITES_ALL+= ${_PATCH_SITES_${_group}}
2602 _PATCHFILES:= ${_PATCHFILES} ${_P_file}
2603 . if !empty(_P_strip)
2604 _PATCH_DIST_STRIP_CASES:= ${_PATCH_DIST_STRIP_CASES} ("${_P_file}") printf %s "${_P_strip}" ;;
2612 ALLFILES?= ${_DISTFILES} ${_PATCHFILES}
2615 # Sort the master site list according to the patterns in MASTER_SORT
2619 MASTER_SORT_REGEX+= ${MASTER_SORT:S|.|\\.|g:S|^|://[^/]*|:S|$|/|}
2621 MASTER_SORT_AWK= BEGIN { RS = " "; ORS = " "; IGNORECASE = 1 ; gl = "${MASTER_SORT_REGEX:S|\\|\\\\|g}"; }
2622 .for srt in ${MASTER_SORT_REGEX}
2623 MASTER_SORT_AWK+= /${srt:S|/|\\/|g}/ { good["${srt:S|\\|\\\\|g}"] = good["${srt:S|\\|\\\\|g}"] " " $$0 ; next; }
2625 MASTER_SORT_AWK+= { rest = rest " " $$0; } END { n=split(gl, gla); for(i=1;i<=n;i++) { print good[gla[i]]; } print rest; }
2627 SORTED_MASTER_SITES_DEFAULT_CMD= cd ${.CURDIR} && ${MAKE} master-sites-DEFAULT
2628 SORTED_PATCH_SITES_DEFAULT_CMD= cd ${.CURDIR} && ${MAKE} patch-sites-DEFAULT
2629 SORTED_MASTER_SITES_ALL_CMD= cd ${.CURDIR} && ${MAKE} master-sites-ALL
2630 SORTED_PATCH_SITES_ALL_CMD= cd ${.CURDIR} && ${MAKE} patch-sites-ALL
2632 # has similar effect to old targets, i.e., access only {MASTER,PATCH}_SITES, not working with the new _n variables
2633 master-sites-DEFAULT:
2634 @${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_MASTER_SITES_DEFAULT}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
2635 patch-sites-DEFAULT:
2636 @${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_PATCH_SITES_DEFAULT}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
2639 # Sort the master site list according to the patterns in MASTER_SORT
2640 # according to grouping rules (:something)
2642 # for use in the fetch targets
2643 .for _S in ${MASTER_SITES}
2644 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//}
2645 . if !empty(_S_TEMP)
2646 . for _group in ${_S_TEMP:S/^://:S/,/ /g}
2647 . if !target(master-sites-${_group})
2648 SORTED_MASTER_SITES_${_group}_CMD= cd ${.CURDIR} && ${MAKE} master-sites-${_group}
2649 master-sites-${_group}:
2650 @${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_MASTER_SITES_${_group}}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
2655 .for _S in ${PATCH_SITES}
2656 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//}
2657 . if !empty(_S_TEMP)
2658 . for _group in ${_S_TEMP:S/^://:S/,/ /g}
2659 . if !target(patch-sites-${_group})
2660 SORTED_PATCH_SITES_${_group}_CMD= cd ${.CURDIR} && ${MAKE} patch-sites-${_group}
2661 patch-sites-${_group}:
2662 @${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_PATCH_SITES_${_group}}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
2669 # Hackery to enable simple fetch targets with several dynamic MASTER_SITES
2671 _MASTER_SITES_ENV= _MASTER_SITES_DEFAULT="${_MASTER_SITES_DEFAULT}"
2672 .for _F in ${DISTFILES}
2673 _F_TEMP= ${_F:S/^${_F:C/:[^:]+$//}//:S/^://}
2674 . if !empty(_F_TEMP)
2675 . for _group in ${_F_TEMP:S/,/ /g}
2676 . if defined(_MASTER_SITES_${_group})
2677 _MASTER_SITES_ENV+= _MASTER_SITES_${_group}="${_MASTER_SITES_${_group}}"
2682 _PATCH_SITES_ENV= _PATCH_SITES_DEFAULT="${_PATCH_SITES_DEFAULT}"
2683 .for _F in ${PATCHFILES}
2684 _F_TEMP= ${_F:S/^${_F:C/:[^-:][^:]*$//}//:S/^://}
2685 . if !empty(_F_TEMP)
2686 . for _group in ${_F_TEMP:S/,/ /g}
2687 . if defined(_PATCH_SITES_${_group})
2688 _PATCH_SITES_ENV+= _PATCH_SITES_${_group}="${_PATCH_SITES_${_group}}"
2695 @${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_MASTER_SITES_ALL}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
2697 @${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_PATCH_SITES_ALL}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
2699 # synonyms, mnemonics
2700 master-sites-all: master-sites-ALL
2701 patch-sites-all: patch-sites-ALL
2702 master-sites-default: master-sites-DEFAULT
2703 patch-sites-default: patch-sites-DEFAULT
2705 # compatibility with old behavior
2706 master-sites: master-sites-DEFAULT
2707 patch-sites: patch-sites-DEFAULT
2709 CKSUMFILES= ${ALLFILES}
2711 # List of all files, with ${DIST_SUBDIR} in front. Used for checksum.
2712 .if defined(DIST_SUBDIR)
2713 .if defined(CKSUMFILES) && ${CKSUMFILES}!=""
2714 _CKSUMFILES?= ${CKSUMFILES:S/^/${DIST_SUBDIR}\//}
2717 _CKSUMFILES?= ${CKSUMFILES}
2720 # This is what is actually going to be extracted, and is overridable
2722 EXTRACT_ONLY?= ${_DISTFILES}
2724 .if !target(maintainer)
2726 @${ECHO_CMD} "${MAINTAINER}"
2729 .if !defined(CATEGORIES)
2731 @${ECHO_MSG} "${PKGNAME}: Makefile error: CATEGORIES is mandatory."
2735 VALID_CATEGORIES+= accessibility afterstep arabic archivers astro audio \
2736 benchmarks biology cad chinese comms converters databases \
2737 deskutils devel docs dns editors elisp emulators enlightenment finance french ftp \
2738 games geography german gnome gnustep graphics hamradio haskell hebrew hungarian \
2739 ipv6 irc japanese java kde kld korean lang linux lisp \
2740 mail mate math mbone misc multimedia net net-im net-mgmt net-p2p news \
2741 palm parallel pear perl5 plan9 polish portuguese ports-mgmt \
2742 print python ruby rubygems russian \
2743 scheme science security shells spanish sysutils \
2745 ukrainian vietnamese windowmaker www \
2746 x11 x11-clocks x11-drivers x11-fm x11-fonts x11-servers x11-themes \
2747 x11-toolkits x11-wm xfce zope
2750 .for cat in ${CATEGORIES}
2751 . if empty(VALID_CATEGORIES:M${cat})
2752 @${ECHO_MSG} "${PKGNAME}: Makefile error: category ${cat} not in list of valid categories."; \
2758 PKGREPOSITORYSUBDIR?= All
2759 PKGREPOSITORY?= ${PACKAGES}/${PKGREPOSITORYSUBDIR}
2760 .if exists(${PACKAGES})
2761 PKGFILE?= ${PKGREPOSITORY}/${PKGNAME}${PKG_SUFX}
2763 PKGFILE?= ${.CURDIR}/${PKGNAME}${PKG_SUFX}
2766 # The "latest version" link -- ${PKGNAME} minus everthing after the last '-'
2767 PKGLATESTREPOSITORY?= ${PACKAGES}/Latest
2768 PKGBASE?= ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}
2769 LATEST_LINK?= ${PKGBASE}
2770 PKGLATESTFILE= ${PKGLATESTREPOSITORY}/${LATEST_LINK}${PKG_SUFX}
2772 CONFIGURE_SCRIPT?= configure
2773 CONFIGURE_TARGET?= ${ARCH}-portbld-${OPSYS:tl}${OSREL}
2774 CONFIGURE_TARGET:= ${CONFIGURE_TARGET:S/--build=//}
2775 CONFIGURE_LOG?= config.log
2777 # A default message to print if do-configure fails.
2778 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)."
2780 .if defined(GNU_CONFIGURE)
2781 # Maximum command line length
2782 .if !defined(CONFIGURE_MAX_CMD_LEN)
2783 CONFIGURE_MAX_CMD_LEN!= ${SYSCTL} -n kern.argmax
2785 GNU_CONFIGURE_PREFIX?= ${PREFIX}
2786 GNU_CONFIGURE_MANPREFIX?= ${MANPREFIX}
2787 CONFIG_SITE?= ${PORTSDIR}/Templates/config.site
2788 CONFIGURE_ARGS+= --prefix=${GNU_CONFIGURE_PREFIX} $${_LATE_CONFIGURE_ARGS}
2789 .if defined(X_BUILD_FOR)
2790 CONFIGURE_ARGS+= --host=${X_BUILD_FOR}
2792 CONFIGURE_ENV+= CONFIG_SITE=${CONFIG_SITE} lt_cv_sys_max_cmd_len=${CONFIGURE_MAX_CMD_LEN}
2795 SET_LATE_CONFIGURE_ARGS= \
2796 _LATE_CONFIGURE_ARGS="" ; \
2797 if [ ! -z "`./${CONFIGURE_SCRIPT} --help 2>&1 | ${GREP} -- '--mandir'`" ]; then \
2798 _LATE_CONFIGURE_ARGS="$${_LATE_CONFIGURE_ARGS} --mandir=${GNU_CONFIGURE_MANPREFIX}/man" ; \
2800 if [ ! -z "`./${CONFIGURE_SCRIPT} --help 2>&1 | ${GREP} -- '--infodir'`" ]; then \
2801 _LATE_CONFIGURE_ARGS="$${_LATE_CONFIGURE_ARGS} --infodir=${GNU_CONFIGURE_PREFIX}/${INFO_PATH}/${INFO_SUBDIR}" ; \
2803 if [ -z "`./${CONFIGURE_SCRIPT} --version 2>&1 | ${EGREP} -i '(autoconf.*2\.13|Unrecognized option)'`" ]; then \
2804 _LATE_CONFIGURE_ARGS="$${_LATE_CONFIGURE_ARGS} --build=${CONFIGURE_TARGET}" ; \
2806 _LATE_CONFIGURE_ARGS="$${_LATE_CONFIGURE_ARGS} ${CONFIGURE_TARGET}" ; \
2810 # Passed to most of script invocations
2811 SCRIPTS_ENV+= CURDIR=${MASTERDIR} DISTDIR=${DISTDIR} \
2812 WRKDIR=${WRKDIR} WRKSRC=${WRKSRC} PATCHDIR=${PATCHDIR} \
2813 SCRIPTDIR=${SCRIPTDIR} FILESDIR=${FILESDIR} \
2814 DFLY_PATCHDIR=${DFLY_PATCHDIR} \
2815 DFLY_FILESDIR=${DFLY_FILESDIR} \
2816 PORTSDIR=${PORTSDIR} PREFIX=${PREFIX} LOCALBASE=${LOCALBASE}
2819 SCRIPTS_ENV+= BATCH=yes
2822 .if ${PREFIX} == /usr
2823 MANPREFIX?= /usr/share
2825 MANPREFIX?= ${PREFIX}
2828 MANDIRS+= ${MANPREFIX}/man
2829 .for sect in 1 2 3 4 5 6 7 8 9
2830 MAN${sect}PREFIX?= ${MANPREFIX}
2832 MANLPREFIX?= ${MANPREFIX}
2833 MANNPREFIX?= ${MANPREFIX}
2835 .if ${PREFIX} == /usr
2836 INFO_PATH?= share/info
2842 RUN_DEPENDS+= indexinfo:${PORTSDIR}/print/indexinfo
2844 . for D in ${INFO:H}
2847 . if !defined(INFO_SUBDIR)
2849 . elif ${INFO_SUBDIR} != ${RD}
2850 BROKEN= only one subdirectory in INFO is allowed
2857 DOCSDIR_REL?= ${DOCSDIR:S,^${PREFIX}/,,}
2858 EXAMPLESDIR_REL?= ${EXAMPLESDIR:S,^${PREFIX}/,,}
2859 DATADIR_REL?= ${DATADIR:S,^${PREFIX}/,,}
2860 WWWDIR_REL?= ${WWWDIR:S,^${PREFIX}/,,}
2861 ETCDIR_REL?= ${ETCDIR:S,^${PREFIX}/,,}
2863 PLIST_SUB+= DOCSDIR="${DOCSDIR_REL}" \
2864 EXAMPLESDIR="${EXAMPLESDIR_REL}" \
2865 DATADIR="${DATADIR_REL}" \
2866 WWWDIR="${WWWDIR_REL}" \
2867 ETCDIR="${ETCDIR_REL}"
2869 DESKTOPDIR?= ${PREFIX}/share/applications
2873 ################################################################
2874 # Many ways to disable a port.
2876 # If we're in BATCH mode and the port is interactive, or we're
2877 # in interactive mode and the port is non-interactive, skip all
2878 # the important targets. The reason we have two modes is that
2879 # one might want to leave a build in BATCH mode running
2880 # overnight, then come back in the morning and do _only_ the
2881 # interactive ones that required your intervention.
2883 # Ignore ports that can't be resold if building for a CDROM.
2885 # Don't build a port if it's restricted and we don't want to get
2888 # Don't build a port if it's broken, unless we're running a parallel
2889 # build (in case it's fixed).
2891 # Don't build a port if it's forbidden for whatever reason.
2893 # Don't build a port if the system is too old.
2894 ################################################################
2896 # Check the machine architectures
2897 .if defined(ONLY_FOR_ARCHS)
2898 .for __ARCH in ${ONLY_FOR_ARCHS:S/amd64/x86_64/}
2899 .if ${ARCH:M${__ARCH}} != ""
2907 .if defined(NOT_FOR_ARCHS)
2908 .for __NARCH in ${NOT_FOR_ARCHS:S/amd64/x86_64/}
2909 .if ${ARCH:M${__NARCH}} != ""
2915 .if !defined(__ARCH_OK)
2916 .if defined(ONLY_FOR_ARCHS)
2917 IGNORE= is only for ${ONLY_FOR_ARCHS:S/amd64/x86_64/},
2918 .else # defined(NOT_FOR_ARCHS)
2919 IGNORE= does not run on ${NOT_FOR_ARCHS:S/amd64/x86_64/},
2921 IGNORE+= while you are running ${ARCH}
2923 .if defined(ONLY_FOR_ARCHS_REASON_${ARCH})
2924 IGNORE+= (reason: ${ONLY_FOR_ARCHS_REASON_${ARCH}})
2925 .elif defined(ONLY_FOR_ARCHS_REASON)
2926 IGNORE+= (reason: ${ONLY_FOR_ARCHS_REASON})
2929 .if defined(NOT_FOR_ARCHS_REASON_${ARCH})
2930 IGNORE+= (reason: ${NOT_FOR_ARCHS_REASON_${ARCH}})
2931 .elif defined(NOT_FOR_ARCHS_REASON)
2932 IGNORE+= (reason: ${NOT_FOR_ARCHS_REASON})
2937 # Check the user interaction and legal issues
2938 .if !defined(NO_IGNORE)
2939 .if (defined(IS_INTERACTIVE) && defined(BATCH))
2940 IGNORE= is an interactive port
2941 .elif (!defined(IS_INTERACTIVE) && defined(INTERACTIVE))
2942 IGNORE= is not an interactive port
2943 .elif (defined(NO_CDROM) && defined(FOR_CDROM))
2944 IGNORE= may not be placed on a CDROM: ${NO_CDROM}
2945 .elif (defined(RESTRICTED) && defined(NO_RESTRICTED))
2946 IGNORE= is restricted: ${RESTRICTED}
2947 .elif (defined(NO_PACKAGE) && defined(PACKAGE_BUILDING))
2948 IGNORE= may not be packaged: ${NO_PACKAGE}
2949 .elif defined(BROKEN)
2950 .if !defined(TRYBROKEN)
2951 IGNORE= is marked as broken: ${BROKEN}
2953 .elif defined(BROKEN_${ARCH})
2954 .if !defined(TRYBROKEN)
2955 IGNORE= is marked as broken on ${ARCH}: ${BROKEN_${ARCH}}
2957 .elif defined(FORBIDDEN)
2958 IGNORE= is forbidden: ${FORBIDDEN}
2961 # Define the text to be output to LEGAL
2962 .if defined(LEGAL_TEXT)
2963 LEGAL= ${LEGAL_TEXT}
2964 .elif defined(RESTRICTED)
2965 LEGAL= ${RESTRICTED}
2966 .elif defined(NO_CDROM)
2968 .elif defined(NO_PACKAGE) && ! defined(LEGAL_PACKAGE)
2969 LEGAL= ${NO_PACKAGE}
2972 .if (defined(MANUAL_PACKAGE_BUILD) && defined(PACKAGE_BUILDING))
2973 IGNORE= has to be built manually: ${MANUAL_PACKAGE_BUILD}
2979 .if defined(IGNORE_SILENT)
2980 IGNORECMD= ${DO_NADA}
2982 IGNORECMD= ${ECHO_MSG} "===> ${PKGNAME} "${IGNORE:Q}.;exit 1
2985 _TARGETS= check-sanity fetch checksum extract patch configure all build \
2986 install reinstall package stage restage
2988 .for target in ${_TARGETS}
2989 .if !target(${target})
2992 .if defined(INSTALLS_DEPENDS)
3002 .if defined(IGNORE) || defined(NO_PACKAGE)
3003 ignorelist: package-name
3009 .if defined(IGNORE) || defined(NO_PACKAGE)
3012 @${ECHO_CMD} "${PKGNAME}|IGNORE: "${IGNORE:Q}
3014 @${ECHO_CMD} "${PKGNAME}|NO_PACKAGE: "${NO_PACKAGE:Q}
3021 ################################################################
3022 # Clean directories for ftp or CDROM.
3023 ################################################################
3025 .if !defined(LICENSE)
3027 .if defined(RESTRICTED)
3028 clean-restricted: delete-distfiles delete-package
3029 clean-restricted-list: delete-distfiles-list delete-package-list
3030 RESTRICTED_FILES?= ${_DISTFILES} ${_PATCHFILES}
3033 clean-restricted-list:
3036 .if defined(NO_CDROM)
3037 clean-for-cdrom: delete-distfiles delete-package
3038 clean-for-cdrom-list: delete-distfiles-list delete-package-list
3039 RESTRICTED_FILES?= ${_DISTFILES} ${_PATCHFILES}
3042 clean-for-cdrom-list:
3045 .endif # !defined(LICENSE)
3047 .if defined(ALL_HOOK)
3049 @cd ${.CURDIR} && ${SETENV} CURDIR=${.CURDIR} DISTNAME=${DISTNAME} \
3050 DISTDIR=${DISTDIR} WRKDIR=${WRKDIR} WRKSRC=${WRKSRC} \
3051 PATCHDIR=${PATCHDIR} SCRIPTDIR=${SCRIPTDIR} \
3052 FILESDIR=${FILESDIR} PORTSDIR=${PORTSDIR} PREFIX=${PREFIX} \
3053 DFLY_PATCHDIR=${DFLY_PATCHDIR} DFLY_FILESDIR=${DFLY_FILESDIR} \
3054 BUILD_DEPENDS="${BUILD_DEPENDS}" RUN_DEPENDS="${RUN_DEPENDS}" \
3055 CONFLICTS="${CONFLICTS}" \
3063 .if !defined(DEPENDS_TARGET)
3064 .if defined(DEPENDS_PRECLEAN)
3065 DEPENDS_TARGET= clean
3066 DEPENDS_ARGS= NOCLEANDEPENDS=yes
3069 DEPENDS_TARGET+= reinstall
3071 DEPENDS_TARGET+= install
3073 .if defined(DEPENDS_CLEAN)
3074 DEPENDS_TARGET+= clean
3075 DEPENDS_ARGS+= NOCLEANDEPENDS=yes
3079 ################################################################
3081 # Do preliminary work to detect if we need to run the config
3084 ################################################################
3085 .if ((!defined(OPTIONS_DEFINE) && !defined(OPTIONS_SINGLE) && !defined(OPTIONS_MULTI)) \
3086 && !defined(OPTIONS_GROUP) && !defined(OPTIONS_RADIO) \
3087 || defined(CONFIG_DONE_${UNIQUENAME:tu}) || \
3088 defined(PACKAGE_BUILDING) || defined(BATCH))
3092 ################################################################
3093 # The following are used to create easy dummy targets for
3094 # disabling some bit of default target behavior you don't want.
3095 # They still check to see if the target exists, and if so don't
3096 # do anything, since you might want to set this globally for a
3097 # group of ports in a Makefile.inc, but still be able to
3098 # override from an individual Makefile.
3099 ################################################################
3102 .if defined(NO_CHECKSUM) && !target(checksum)
3108 .if defined(NO_BUILD) && !target(build)
3110 @${TOUCH} ${TOUCH_FLAGS} ${BUILD_COOKIE}
3114 .if defined(NO_INSTALL) && !target(do-install)
3120 .if defined(NO_PACKAGE) && !target(package)
3122 .if defined(IGNORE_SILENT)
3125 @${ECHO_MSG} "===> ${PKGNAME} may not be packaged: "${NO_PACKAGE:Q}.
3130 .if defined(NO_DESCRIBE) && !target(describe)
3135 ################################################################
3136 # More standard targets start here.
3138 # These are the body of the build/install framework. If you are
3139 # not happy with the default actions, and you can't solve it by
3140 # adding pre-* or post-* targets/scripts, override these.
3141 ################################################################
3148 .if defined(TRYBROKEN) && defined(BROKEN)
3149 buildanyway-message:
3150 @${ECHO_MSG} "Trying build of ${PKGNAME} even though it is marked BROKEN."
3154 .if defined(GNOME_OPTION_MSG) && (!defined(PACKAGE_BUILDING) || !defined(BATCH))
3155 @for m in ${GNOME_OPTION_MSG}; do \
3161 .if defined(_OPTIONS_READ)
3162 @${ECHO_MSG} "===> Found saved configuration for ${_OPTIONS_READ}"
3165 ${PKG_DBDIR} ${PREFIX} ${WRKDIR} ${WRKSRC}:
3166 @${MKDIR} ${.TARGET}
3168 # Warn user about deprecated packages. Advisory only.
3170 .if !target(check-deprecated)
3172 .if defined(DEPRECATED)
3173 @${ECHO_MSG} "===> NOTICE:"
3175 @${ECHO_MSG} "This port is deprecated; you may wish to reconsider installing it:"
3177 @${ECHO_MSG} ${DEPRECATED:Q}.
3179 .if defined(EXPIRATION_DATE)
3180 @${ECHO_MSG} "It is scheduled to be removed on or after ${EXPIRATION_DATE}."
3186 # Check if the port is listed in the vulnerability database
3188 AUDITFILE?= ${PKG_DBDIR}/vuln.xml
3189 _EXTRACT_AUDITFILE= ${CAT} "${AUDITFILE}"
3192 .if !defined(DISABLE_VULNERABILITIES) && !defined(PACKAGE_BUILDING)
3193 @if [ -f "${AUDITFILE}" ]; then \
3194 if [ -x "${PKG_BIN}" ]; then \
3195 vlist=`${PKG_BIN} audit "${PKGNAME}" || :`; \
3196 if [ "$${vlist}" = "0 problem(s) in the installed packages found." ]; then \
3199 elif [ "${PORTNAME}" = "pkg" ]; then \
3202 if [ -n "$$vlist" ]; then \
3203 ${ECHO_MSG} "===> ${PKGNAME} has known vulnerabilities:"; \
3204 ${ECHO_MSG} "$$vlist"; \
3205 ${ECHO_MSG} "=> Please update your ports tree and try again."; \
3206 ${ECHO_MSG} "=> Note: Vulnerable ports are marked as such even if there is no update available."; \
3207 ${ECHO_MSG} "=> If you wish to ignore this vulnerability rebuild with 'make DISABLE_VULNERABILITIES=yes'"; \
3213 # set alg to any of SIZE, SHA256 (or any other checksum algorithm):
3214 DISTINFO_DATA?= if [ \( -n "${DISABLE_SIZE}" -a -n "${NO_CHECKSUM}" \) -o ! -f "${DISTINFO_FILE}" ]; then exit; fi; \
3215 DIR=${DIST_SUBDIR}; ${AWK} -v alg=$$alg -v file=$${DIR:+$$DIR/}$${file} \
3216 '$$1 == alg && $$2 == "(" file ")" {print $$4}' ${DISTINFO_FILE}
3220 .if !target(do-fetch)
3222 @${MKDIR} ${_DISTDIR}
3224 ${_MASTER_SITES_ENV} ; \
3225 for _file in ${DISTFILES}; do \
3226 file=$${_file%%:*}; \
3227 if [ $$_file = $$file ]; then \
3230 select=`${ECHO_CMD} $${_file##*:} | ${SED} -e 's/,/ /g'` ; \
3232 force_fetch=false; \
3233 filebasename=$${file##*/}; \
3234 for afile in ${FORCE_FETCH}; do \
3235 afile=$${afile##*/}; \
3236 if [ "x$$afile" = "x$$filebasename" ]; then \
3240 if [ ! -f $$file -a ! -f $$filebasename -o "$$force_fetch" = "true" ]; then \
3241 if [ -L $$file -o -L $$filebasename ]; then \
3242 ${ECHO_MSG} "=> ${_DISTDIR}/$$file is a broken symlink."; \
3243 ${ECHO_MSG} "=> Perhaps a filesystem (most likely a CD) isn't mounted?"; \
3244 ${ECHO_MSG} "=> Please correct this problem and try again."; \
3247 if [ -f ${DISTINFO_FILE} -a "x${NO_CHECKSUM}" = "x" ]; then \
3248 _sha256sum=`alg=SHA256; ${DISTINFO_DATA}`; \
3249 if [ -z "$$_sha256sum" ]; then \
3250 ${ECHO_MSG} "=> $${DIR:+$$DIR/}$$file is not in ${DISTINFO_FILE}."; \
3251 ${ECHO_MSG} "=> Either ${DISTINFO_FILE} is out of date, or"; \
3252 ${ECHO_MSG} "=> $${DIR:+$$DIR/}$$file is spelled incorrectly."; \
3256 ${ECHO_MSG} "=> $$file doesn't seem to exist in ${_DISTDIR}."; \
3257 if [ ! -w ${_DISTDIR} ]; then \
3258 ${ECHO_MSG} "=> ${_DISTDIR} is not writable by you; cannot fetch."; \
3261 if [ ! -z "$$select" ] ; then \
3262 __MASTER_SITES_TMP= ; \
3263 for group in $$select; do \
3264 if [ ! -z \$${_MASTER_SITES_$${group}} ] ; then \
3265 eval ___MASTER_SITES_TMP="\$${_MASTER_SITES_$${group}}" ; \
3266 __MASTER_SITES_TMP="$${__MASTER_SITES_TMP} $${___MASTER_SITES_TMP}" ; \
3269 ___MASTER_SITES_TMP= ; \
3270 SORTED_MASTER_SITES_CMD_TMP="${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} $${__MASTER_SITES_TMP} | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}" ; \
3272 SORTED_MASTER_SITES_CMD_TMP="${SORTED_MASTER_SITES_DEFAULT_CMD}" ; \
3274 sites_remaining=0; \
3275 sites="`eval $$SORTED_MASTER_SITES_CMD_TMP ${_RANDOMIZE_SITES}`"; \
3276 for site in $${sites}; do \
3277 sites_remaining=$$(($${sites_remaining} + 1)); \
3279 for site in $${sites}; do \
3280 sites_remaining=$$(($${sites_remaining} - 1)); \
3281 ${ECHO_MSG} "=> Attempting to fetch $${site}$${file}"; \
3282 CKSIZE=`alg=SIZE; ${DISTINFO_DATA}`; \
3284 */*) ${MKDIR} $${file%/*}; \
3285 args="-o $${file} $${site}$${file}";; \
3286 *) args=$${site}$${file};; \
3288 if ${SETENV} ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${args} ${FETCH_AFTER_ARGS}; then \
3289 actual_size=`stat -f %z "$${file}"`; \
3290 if [ -n "${DISABLE_SIZE}" ] || [ -z "$${CKSIZE}" ] || [ $${actual_size} -eq $${CKSIZE} ]; then \
3293 ${ECHO_MSG} "=> Fetched file size mismatch (expected $${CKSIZE}, actual $${actual_size})"; \
3294 if [ $${sites_remaining} -gt 0 ]; then \
3295 ${ECHO_MSG} "=> Trying next site"; \
3296 ${RM} -f $${file}; \
3301 ${ECHO_MSG} "=> Couldn't fetch it - please try to retrieve this";\
3302 ${ECHO_MSG} "=> port manually into ${_DISTDIR} and try again."; \
3306 .if defined(PATCHFILES)
3308 ${_PATCH_SITES_ENV} ; \
3309 for _file in ${PATCHFILES}; do \
3310 file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^-:][^:]*$$//'` ; \
3311 select=`${ECHO_CMD} $${_file#$${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` ; \
3312 file=`${ECHO_CMD} $$file | ${SED} -E -e 's/:-[^:]+$$//'` ; \
3313 force_fetch=false; \
3314 filebasename=$${file##*/}; \
3315 for afile in ${FORCE_FETCH}; do \
3316 afile=$${afile##*/}; \
3317 if [ "x$$afile" = "x$$filebasename" ]; then \
3321 if [ ! -f $$file -a ! -f $$filebasename -o "$$force_fetch" = "true" ]; then \
3322 if [ -L $$file -o -L $${file##*/} ]; then \
3323 ${ECHO_MSG} "=> ${_DISTDIR}/$$file is a broken symlink."; \
3324 ${ECHO_MSG} "=> Perhaps a filesystem (most likely a CD) isn't mounted?"; \
3325 ${ECHO_MSG} "=> Please correct this problem and try again."; \
3328 ${ECHO_MSG} "=> $$file doesn't seem to exist in ${_DISTDIR}."; \
3329 if [ ! -z "$$select" ] ; then \
3330 __PATCH_SITES_TMP= ; \
3331 for group in $$select; do \
3332 if [ ! -z \$${_PATCH_SITES_$${group}} ] ; then \
3333 eval ___PATCH_SITES_TMP="\$${_PATCH_SITES_$${group}}" ; \
3334 __PATCH_SITES_TMP="$${__PATCH_SITES_TMP} $${___PATCH_SITES_TMP}" ; \
3337 ___PATCH_SITES_TMP= ; \
3338 SORTED_PATCH_SITES_CMD_TMP="${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} $${__PATCH_SITES_TMP} | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}" ; \
3340 SORTED_PATCH_SITES_CMD_TMP="${SORTED_PATCH_SITES_DEFAULT_CMD}" ; \
3342 sites_remaining=0; \
3343 sites="`eval $$SORTED_PATCH_SITES_CMD_TMP`"; \
3344 for site in $${sites}; do \
3345 sites_remaining=$$(($${sites_remaining} + 1)); \
3347 for site in $${sites}; do \
3348 sites_remaining=$$(($${sites_remaining} - 1)); \
3349 ${ECHO_MSG} "=> Attempting to fetch $${site}$${file}"; \
3350 CKSIZE=`alg=SIZE; ${DISTINFO_DATA}`; \
3352 */*) ${MKDIR} $${file%/*}; \
3353 args="-o $${file} $${site}$${file}";; \
3354 *) args=$${site}$${file};; \
3356 if ${SETENV} ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${args} ${FETCH_AFTER_ARGS}; then \
3357 actual_size=`stat -f %z "$${file}"`; \
3358 if [ -n "${DISABLE_SIZE}" ] || [ -z "$${CKSIZE}" ] || [ $${actual_size} -eq $${CKSIZE} ]; then \
3361 ${ECHO_MSG} "=> Fetched file size mismatch (expected $${CKSIZE}, actual $${actual_size})"; \
3362 if [ $${sites_remaining} -gt 1 ]; then \
3363 ${ECHO_MSG} "=> Trying next site"; \
3364 ${RM} -f $${file}; \
3369 ${ECHO_MSG} "=> Couldn't fetch it - please try to retrieve this";\
3370 ${ECHO_MSG} "=> port manually into ${_DISTDIR} and try again."; \
3380 @${RM} -rf ${WRKDIR}
3382 .if !target(do-extract)
3384 @for file in ${EXTRACT_ONLY}; do \
3385 if [ -n "${EXTRACT_CMD}" -a -z "${_INCLUDE_USES_ZIP_MK}" -a -z "${_INCLUDE_USES_LHA_MK}" ]; then \
3386 if ! (cd ${WRKDIR} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/$$file ${EXTRACT_AFTER_ARGS});\
3392 *.tar|*.tbz|*.tgz|*.txz|*.tar.bz2|*.tar.gz|*.tar.lzma|*.tar.xz|*.tar.Z) \
3393 if ! (cd ${WRKDIR} && ${TAR} ${TAR_BEFORE_ARGS} ${_DISTDIR}/$$file ${TAR_AFTER_ARGS}); \
3394 then exit 1; fi; ;; \
3396 if ! (cd ${WRKDIR} && ${LHA_CMD} ${LHA_BEFORE_ARGS} ${_DISTDIR}/$$file ${LHA_AFTER_ARGS}); \
3397 then exit 1; fi; ;; \
3398 *.zip|*.ZIP|*.xpi) \
3399 if ! (cd ${WRKDIR} && ${ZIP_EXTRACT_CMD} ${ZIP_BEFORE_ARGS} ${_DISTDIR}/$$file ${ZIP_AFTER_ARGS}); \
3400 then exit 1; fi; ;; \
3402 if ! (cd ${WRKDIR} && ${TAR} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/$$file ${EXTRA_AFTER_ARGS}); \
3403 then exit 1; fi; ;; \
3407 .if !defined(EXTRACT_PRESERVE_OWNERSHIP)
3408 @if [ ${UID} = 0 ]; then \
3409 ${CHMOD} -R ug-s ${WRKDIR}; \
3410 ${CHOWN} -R 0:0 ${WRKDIR}; \
3417 .if !target(do-patch)
3419 .if defined(PATCHFILES)
3420 @${ECHO_MSG} "===> Applying distribution patches for ${PKGNAME}"
3423 patch_dist_strip () { \
3425 ${_PATCH_DIST_STRIP_CASES} \
3428 for i in ${_PATCHFILES}; do \
3429 if [ ${PATCH_DEBUG_TMP} = yes ]; then \
3430 ${ECHO_MSG} "===> Applying distribution patch $$i" ; \
3433 *.Z|*.gz) ${GZCAT} $$i ;; \
3434 *.bz2) ${BZCAT} $$i ;; \
3435 *.xz) ${XZCAT} $$i ;; \
3437 esac | ${PATCH} ${PATCH_DIST_ARGS} `patch_dist_strip $$i` ; \
3440 .if defined(EXTRA_PATCHES)
3442 for i in ${EXTRA_PATCHES}; do \
3444 *:-p[0-9]) patch_file=$${i%:*} ; patch_strip=$${i##*:} ;; \
3445 *) patch_file=$$i ;; \
3447 ${ECHO_MSG} "===> Applying extra patch $$patch_file" ; \
3448 case $$patch_file in \
3449 *.Z|*.gz) ${GZCAT} $$patch_file ;; \
3450 *.bz2) ${BZCAT} $$patch_file ;; \
3451 *.xz) ${XZCAT} $$patch_file ;; \
3452 *) ${CAT} $$patch_file ;; \
3453 esac | ${PATCH} ${PATCH_ARGS} $$patch_strip ; \
3457 if [ -d ${PATCHDIR} ]; then \
3458 if [ "`${ECHO_CMD} ${PATCHDIR}/patch-*`" != "${PATCHDIR}/patch-*" ]; then \
3459 ${ECHO_MSG} "===> Applying ports patches for ${PKGNAME}" ; \
3460 PATCHES_APPLIED="" ; \
3461 for i in ${PATCHDIR}/patch-*; do \
3463 *.orig|*.rej|*~|*,v) \
3464 ${ECHO_MSG} "===> Ignoring patchfile $$i" ; \
3467 if [ ${PATCH_DEBUG_TMP} = yes ]; then \
3468 ${ECHO_MSG} "===> Applying ${OPSYS} patch $$i" ; \
3470 if ${PATCH} ${PATCH_ARGS} < $$i ; then \
3471 PATCHES_APPLIED="$$PATCHES_APPLIED $$i" ; \
3473 ${ECHO_MSG} `${ECHO_CMD} "=> Patch $$i failed to apply cleanly." | ${SED} "s|${PATCHDIR}/||"` ; \
3474 if [ x"$$PATCHES_APPLIED" != x"" -a ${PATCH_SILENT} != "yes" ]; then \
3475 ${ECHO_MSG} `${ECHO_CMD} "=> Patch(es) $$PATCHES_APPLIED applied cleanly." | ${SED} "s|${PATCHDIR}/||g"` ; \
3484 @set -e ; if [ -d ${DFLY_PATCHDIR} ]; then \
3485 if [ "`${ECHO_CMD} ${DFLY_PATCHDIR}/patch-*`" != "${DFLY_PATCHDIR}/patch-*" ]; then \
3486 ${ECHO_MSG} "===> Applying ${OPSYS} patches for ${PKGNAME}" ; \
3487 PATCHES_APPLIED="" ; \
3488 for i in ${DFLY_PATCHDIR}/patch-*; do \
3490 *.orig|*.rej|*~|*,v) \
3491 ${ECHO_MSG} "===> Ignoring patchfile $$i" ; \
3494 if [ ${PATCH_DEBUG_TMP} = yes ]; then \
3495 ${ECHO_MSG} "===> Applying ${OPSYS} patch $$i" ; \
3497 if ${PATCH} ${PATCH_ARGS} < $$i ; then \
3498 PATCHES_APPLIED="$$PATCHES_APPLIED $$i" ; \
3500 ${ECHO_MSG} `${ECHO_CMD} "=> Patch $$i failed to apply cleanly." | ${SED} "s|${DFLY_PATCHDIR}/||"` ; \
3501 if [ x"$$PATCHES_APPLIED" != x"" ]; then \
3502 ${ECHO_MSG} `${ECHO_CMD} "=> Patch(es) $$PATCHES_APPLIED applied cleanly." | ${SED} "s|${DFLY_PATCHDIR}/||g"` ; \
3513 .if !target(run-autotools-fixup)
3514 run-autotools-fixup:
3515 # Work around an issue where FreeBSD 10.0 is detected as FreeBSD 1.x.
3516 .if ${OSVERSION} >= 1000000 && !defined(WITHOUT_FBSD10_FIX)
3517 -@for f in `${FIND} ${WRKDIR} -type f \( -name config.libpath -o \
3518 -name config.rpath -o -name configure -o -name libtool.m4 -o \
3519 -name ltconfig -o -name libtool -o -name aclocal.m4 -o \
3520 -name acinclude.m4 \)` ; do \
3521 ${SED} -i.fbsd10bak \
3522 -e 's|freebsd1\*)|freebsd1.\*)|g' \
3523 -e 's|freebsd\[12\]\*)|freebsd[12].*)|g' \
3524 -e 's|freebsd\[123\]\*)|freebsd[123].*)|g' \
3525 -e 's|freebsd\[\[12\]\]\*)|freebsd[[12]].*)|g' \
3526 -e 's|freebsd\[\[123\]\]\*)|freebsd[[123]].*)|g' \
3528 ${TOUCH} ${TOUCH_FLAGS} -mr $${f}.fbsd10bak $${f} ; \
3529 ${RM} -f $${f}.fbsd10bak ; \
3530 ${ECHO_MSG} "===> FreeBSD 10 autotools fix applied to $${f}"; \
3537 .if !target(do-configure)
3539 @if [ -f ${SCRIPTDIR}/configure ]; then \
3540 cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \
3541 ${SCRIPTDIR}/configure; \
3543 .if defined(GNU_CONFIGURE)
3544 @CONFIG_GUESS_DIRS=$$(${FIND} ${WRKDIR} -name config.guess -o -name config.sub \
3545 | ${XARGS} -n 1 ${DIRNAME}); \
3546 for _D in $${CONFIG_GUESS_DIRS}; do \
3547 ${CP} -f ${TEMPLATES}/config.guess $${_D}/config.guess; \
3548 ${CHMOD} a+rx $${_D}/config.guess; \
3549 ${CP} -f ${TEMPLATES}/config.sub $${_D}/config.sub; \
3550 ${CHMOD} a+rx $${_D}/config.sub; \
3553 .if defined(HAS_CONFIGURE)
3554 @(cd ${CONFIGURE_WRKSRC} && \
3555 ${SET_LATE_CONFIGURE_ARGS} \
3556 if ! ${SETENV} CC="${CC}" CPP="${CPP}" CXX="${CXX}" \
3557 CFLAGS="${CFLAGS}" CPPFLAGS="${CPPFLAGS}" CXXFLAGS="${CXXFLAGS}" \
3558 LDFLAGS="${LDFLAGS}" LIBS="${LIBS}" \
3559 INSTALL="/usr/bin/install -c ${_BINOWNGRP}" \
3560 INSTALL_DATA="${INSTALL_DATA}" \
3561 INSTALL_LIB="${INSTALL_LIB}" \
3562 INSTALL_PROGRAM="${INSTALL_PROGRAM}" \
3563 INSTALL_SCRIPT="${INSTALL_SCRIPT}" \
3564 ${CONFIGURE_ENV} ./${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS}; then \
3565 ${ECHO_MSG} "===> Script \"${CONFIGURE_SCRIPT}\" failed unexpectedly."; \
3566 (${ECHO_CMD} ${CONFIGURE_FAIL_MESSAGE}) | ${FMT} 75 79 ; \
3573 # XXX: ${MAKE_ARGS:N${DESTDIRNAME}=*} would be easier but it is not valid with the old fmake
3574 DO_MAKE_BUILD?= ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_FLAGS} ${MAKEFILE} ${_MAKE_JOBS} ${MAKE_ARGS:C,^${DESTDIRNAME}=.*,,g}
3575 .if !target(do-build)
3577 @(cd ${BUILD_WRKSRC}; if ! ${DO_MAKE_BUILD} ${ALL_TARGET}; then \
3578 if [ -n "${BUILD_FAIL_MESSAGE}" ] ; then \
3579 ${ECHO_MSG} "===> Compilation failed unexpectedly."; \
3580 (${ECHO_CMD} "${BUILD_FAIL_MESSAGE}") | ${FMT} 75 79 ; \
3588 .if !target(check-conflicts)
3589 check-conflicts: check-build-conflicts check-install-conflicts
3592 .if !target(check-build-conflicts)
3593 check-build-conflicts:
3594 .if ( defined(CONFLICTS) || defined(CONFLICTS_BUILD) ) && !defined(DISABLE_CONFLICTS) && !defined(DEFER_CONFLICTS_CHECK)
3595 @conflicts_with=$$( \
3596 { ${PKG_QUERY} -g "%n-%v %p %o" ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_BUILD:C/.+/'&'/} 2>/dev/null || : ; } \
3597 | while read pkgname prfx orgn; do \
3598 if [ "/${PREFIX}" = "/$${prfx}" -a "/${PKGORIGIN}" != "/$${orgn}" ]; then \
3599 ${ECHO_CMD} -n " $${pkgname}"; \
3602 if [ -n "$${conflicts_with}" ]; then \
3604 ${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \
3605 for entry in $${conflicts_with}; do \
3606 ${ECHO_MSG} " $${entry}"; \
3609 ${ECHO_MSG} " They will not build together."; \
3610 ${ECHO_MSG} " Please remove them first with pkg delete."; \
3616 .if !target(identify-install-conflicts)
3617 identify-install-conflicts:
3618 .if ( defined(CONFLICTS) || defined(CONFLICTS_INSTALL) ) && !defined(DISABLE_CONFLICTS)
3619 @conflicts_with=$$( \
3620 { ${PKG_QUERY} -g "%n-%v %p %o" ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_INSTALL:C/.+/'&'/} 2>/dev/null || : ; } \
3621 | while read pkgname prfx orgn; do \
3622 if [ "/${PREFIX}" = "/$${prfx}" -a "/${PKGORIGIN}" != "/$${orgn}" ]; then \
3623 ${ECHO_CMD} -n " $${pkgname}"; \
3626 if [ -n "$${conflicts_with}" ]; then \
3628 ${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \
3629 for entry in $${conflicts_with}; do \
3630 ${ECHO_MSG} " $${entry}"; \
3633 ${ECHO_MSG} " They install files into the same place."; \
3634 ${ECHO_MSG} " You may want to stop build with Ctrl + C."; \
3640 .if !target(check-install-conflicts)
3641 check-install-conflicts:
3642 .if ( defined(CONFLICTS) || defined(CONFLICTS_INSTALL) || ( defined(CONFLICTS_BUILD) && defined(DEFER_CONFLICTS_CHECK) ) ) && !defined(DISABLE_CONFLICTS)
3643 .if defined(DEFER_CONFLICTS_CHECK)
3644 @conflicts_with=$$( \
3645 { ${PKG_QUERY} -g "%n-%v %p %o" ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_BUILD:C/.+/'&'/} ${CONFLICTS_INSTALL:C/.+/'&'/} 2>/dev/null || : ; } \
3646 | while read pkgname prfx orgn; do \
3647 if [ "/${PREFIX}" = "/$${prfx}" -a "/${PKGORIGIN}" != "/$${orgn}" ]; then \
3648 ${ECHO_CMD} -n " $${pkgname}"; \
3651 if [ -n "$${conflicts_with}" ]; then \
3653 ${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \
3654 for entry in $${conflicts_with}; do \
3655 ${ECHO_MSG} " $${entry}"; \
3658 ${ECHO_MSG} " Please remove them first with pkg delete."; \
3662 @conflicts_with=$$( \
3663 { ${PKG_QUERY} -g "%n-%v %p %o" ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_INSTALL:C/.+/'&'/} 2>/dev/null || : ; } \
3664 | while read pkgname prfx orgn; do \
3665 if [ "/${PREFIX}" = "/$${prfx}" -a "/${PKGORIGIN}" != "/$${orgn}" ]; then \
3666 ${ECHO_CMD} -n " $${pkgname}"; \
3669 if [ -n "$${conflicts_with}" ]; then \
3671 ${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \
3672 for entry in $${conflicts_with}; do \
3673 ${ECHO_MSG} " $${entry}"; \
3676 ${ECHO_MSG} " They install files into the same place."; \
3677 ${ECHO_MSG} " Please remove them first with pkg delete."; \
3680 .endif # defined(DEFER_CONFLICTS_CHECK)
3686 .if !target(do-install)
3688 @(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET})
3693 .if !target(do-package)
3694 PKG_CREATE_ARGS= -r ${STAGEDIR} -m ${METADIR} -p ${TMPPLIST}
3695 do-package: create-manifest
3696 do-package: ${TMPPLIST}
3697 @if [ -d ${PACKAGES} ]; then \
3698 if [ ! -d ${PKGREPOSITORY} ]; then \
3699 if ! ${MKDIR} ${PKGREPOSITORY}; then \
3700 ${ECHO_MSG} "=> Can't create directory ${PKGREPOSITORY}."; \
3705 @for cat in ${CATEGORIES}; do \
3706 ${RM} -f ${PACKAGES}/$$cat/${PKGNAMEPREFIX}${PORTNAME}*${PKG_SUFX} ; \
3708 @${MKDIR} ${WRKDIR}/pkg
3709 @if ${SETENV} ${PKG_ENV} FORCE_POST="${_FORCE_POST_PATTERNS}" ${PKG_CREATE} ${PKG_CREATE_ARGS} -f ${PKG_SUFX:S/.//} -o ${WRKDIR}/pkg ${PKGNAME}; then \
3710 if [ -d ${PKGREPOSITORY} -a -w ${PKGREPOSITORY} ]; then \
3711 ${LN} -f ${WRKDIR}/pkg/${PKGNAME}${PKG_SUFX} ${PKGFILE} 2>/dev/null \
3712 || ${CP} -f ${WRKDIR}/pkg/${PKGNAME}${PKG_SUFX} ${PKGFILE}; \
3713 if [ "${PKGORIGIN}" = "ports-mgmt/pkg" -o "${PKGORIGIN}" = "ports-mgmt/pkg-devel" ]; then \
3714 if [ ! -d ${PKGLATESTREPOSITORY} ]; then \
3715 if ! ${MKDIR} ${PKGLATESTREPOSITORY}; then \
3716 ${ECHO_MSG} "=> Can't create directory ${PKGLATESTREPOSITORY}."; \
3720 ${LN} -sf ../${PKGREPOSITORYSUBDIR}/${PKGNAME}${PKG_SUFX} ${PKGLATESTFILE} ; \
3724 cd ${.CURDIR} && eval ${MAKE} delete-package >/dev/null; \
3728 # Some support rules for do-package
3730 .if !target(delete-package)
3732 @${ECHO_MSG} "===> Deleting package for ${PKGNAME}"
3733 # When staging, the package may only be in the workdir if not root
3734 @${RM} -f ${PKGFILE} ${WRKDIR}/pkg/${PKGNAME}${PKG_SUFX} 2>/dev/null || :
3737 .if !target(delete-package-list)
3738 delete-package-list:
3739 @${ECHO_CMD} "[ -f ${PKGFILE} ] && (${ECHO_CMD} deleting ${PKGFILE}; ${RM} -f ${PKGFILE})"
3742 # Used by scripts and users to install a package from local repository.
3743 # Poudriere -i uses this, please keep.
3744 .if !target(install-package)
3745 .if defined(FORCE_PKG_REGISTER)
3746 _INSTALL_PKG_ARGS= -f
3748 .if defined(INSTALLS_DEPENDS)
3749 _INSTALL_PKG_ARGS+= -A
3752 @if [ -f "${WRKDIR}/pkg/${PKGNAME}${PKG_SUFX}" ]; then \
3753 _pkgfile="${WRKDIR}/pkg/${PKGNAME}${PKG_SUFX}"; \
3755 _pkgfile="${PKGFILE}"; \
3757 ${PKG_ADD} ${_INSTALL_PKG_ARGS} $${_pkgfile}
3761 # Utility targets follow
3763 .if !target(check-already-installed)
3764 .if !defined(NO_PKG_REGISTER) && !defined(FORCE_PKG_REGISTER)
3765 check-already-installed:
3766 @${ECHO_MSG} "===> Checking if ${PKGBASE} already installed"; \
3767 pkgname=`${PKG_INFO} -q -O ${PKGBASE}`; \
3768 if [ -n "$${pkgname}" ]; then \
3769 v=`${PKG_VERSION} -t $${pkgname} ${PKGNAME}`; \
3770 if [ "$${v}" = "<" ]; then \
3771 ${ECHO_CMD} "===> An older version of ${PKGBASE} is already installed ($${pkgname})"; \
3773 ${ECHO_CMD} "===> ${PKGNAME} is already installed"; \
3775 ${ECHO_MSG} " You may wish to \`\`make deinstall'' and install this port again"; \
3776 ${ECHO_MSG} " by \`\`make reinstall'' to upgrade it properly."; \
3777 ${ECHO_MSG} " If you really wish to overwrite the old port of ${PKGBASE}"; \
3778 ${ECHO_MSG} " without deleting it first, set the variable \"FORCE_PKG_REGISTER\""; \
3779 ${ECHO_MSG} " in your environment or the \"make install\" command line."; \
3785 .if !target(check-umask)
3787 @if [ `${SH} -c umask` != 0022 ]; then \
3788 ${ECHO_MSG} "===> Warning: your umask is \"`${SH} -c umask`"\".; \
3789 ${ECHO_MSG} " If this is not desired, set it to an appropriate value"; \
3790 ${ECHO_MSG} " and install this port again by \`\`make reinstall''."; \
3794 .if !target(install-mtree)
3799 .if !target(install-ldconfig-file)
3800 install-ldconfig-file:
3801 .if defined(USE_LDCONFIG) || defined(USE_LDCONFIG32)
3802 .if defined(USE_LDCONFIG)
3803 .if defined(USE_LINUX_PREFIX)
3805 .if ${USE_LDCONFIG} != "${LOCALBASE}/lib" && !defined(INSTALL_AS_USER)
3806 @${ECHO_MSG} "===> Installing ldconfig configuration file"
3807 .if defined(NO_MTREE) || ${PREFIX} != ${LOCALBASE}
3808 @${MKDIR} ${STAGEDIR}${LOCALBASE}/${LDCONFIG_DIR}
3810 @${ECHO_CMD} ${USE_LDCONFIG} | ${TR} ' ' '\n' \
3811 > ${STAGEDIR}${LOCALBASE}/${LDCONFIG_DIR}/${UNIQUENAME}
3812 @${ECHO_CMD} ${LOCALBASE}/${LDCONFIG_DIR}/${UNIQUENAME} >> ${TMPPLIST}
3816 .if defined(USE_LDCONFIG32)
3817 .if !defined(INSTALL_AS_USER)
3818 @${ECHO_MSG} "===> Installing 32-bit ldconfig configuration file"
3819 .if defined(NO_MTREE) || ${PREFIX} != ${LOCALBASE}
3820 @${MKDIR} ${STAGEDIR}${LOCALBASE}/${LDCONFIG32_DIR}
3822 @${ECHO_CMD} ${USE_LDCONFIG32} | ${TR} ' ' '\n' \
3823 > ${STAGEDIR}${LOCALBASE}/${LDCONFIG32_DIR}/${UNIQUENAME}
3824 @${ECHO_CMD} ${LOCALBASE}/${LDCONFIG32_DIR}/${UNIQUENAME} >> ${TMPPLIST}
3830 .if !target(create-users-groups)
3831 .if defined(GROUPS) || defined(USERS)
3832 _UG_OUTPUT= ${WRKDIR}/users-groups.sh
3833 PKGPREINSTALL+= ${_UG_OUTPUT}
3834 create-users-groups:
3836 .for _file in ${GID_FILES}
3837 .if !exists(${_file})
3838 @${ECHO_CMD} "** ${_file} doesn't exist. Exiting."; exit 1
3841 @${RM} -f ${_UG_OUTPUT} || ${TRUE}
3842 @${ECHO_MSG} "===> Creating users and/or groups."
3843 @${ECHO_CMD} "echo \"===> Creating users and/or groups.\"" >> ${_UG_OUTPUT}
3844 .for _group in ${GROUPS}
3846 @if ! ${GREP} -h ^${_group}: ${GID_FILES} >/dev/null 2>&1; then \
3847 ${ECHO_CMD} "** Cannot find any information about group \`${_group}' in ${GID_FILES}."; \
3850 @IFS=":"; ${GREP} -h ^${_group}: ${GID_FILES} | head -n 1 | while read group foo gid members; do \
3851 gid=$$(($$gid+${GID_OFFSET})); \
3852 ${ECHO_CMD} -e "if ! ${PW} groupshow $$group >/dev/null 2>&1; then \n \
3853 echo \"Creating group '$$group' with gid '$$gid'.\" \n \
3854 ${PW} groupadd $$group -g $$gid; else echo \"Using existing group '$$group'.\"\nfi" >> ${_UG_OUTPUT}; \
3859 .for _file in ${UID_FILES}
3860 .if !exists(${_file})
3861 @${ECHO_CMD} "** ${_file} doesn't exist. Exiting."; exit 1
3864 .for _user in ${USERS}
3865 # _bgpd:*:130:130:BGP Daemon:/var/empty:/sbin/nologin
3866 @if ! ${GREP} -h ^${_user}: ${UID_FILES} >/dev/null 2>&1; then \
3867 ${ECHO_CMD} "** Cannot find any information about user \`${_user}' in ${UID_FILES}."; \
3870 @IFS=":"; ${GREP} -h ^${_user}: ${UID_FILES} | head -n 1 | while read login passwd uid gid class change expire gecos homedir shell; do \
3871 uid=$$(($$uid+${UID_OFFSET})); \
3872 gid=$$(($$gid+${GID_OFFSET})); \
3873 class="$${class:+-L }$$class"; \
3874 homedir=$$(echo $$homedir | sed "s|^/usr/local|${PREFIX}|"); \
3875 ${ECHO_CMD} -e "if ! ${PW} usershow $$login >/dev/null 2>&1; then \n \
3876 echo \"Creating user '$$login' with uid '$$uid'.\" \n \
3877 ${PW} useradd $$login -u $$uid -g $$gid $$class -c \"$$gecos\" -d $$homedir -s $$shell \n \
3878 else \necho \"Using existing user '$$login'.\" \nfi" >> ${_UG_OUTPUT}; \
3879 case $$homedir in /|/nonexistent|/var/empty) ;; *) ${ECHO_CMD} "${INSTALL} -d -g $$gid -o $$uid $$homedir" >> ${_UG_OUTPUT};; esac; \
3883 .for _group in ${GROUPS}
3884 # mail:*:6:postfix,clamav
3885 @IFS=":"; ${GREP} -h ^${_group}: ${GID_FILES} | head -n 1 | while read group foo gid members; do \
3886 gid=$$(($$gid+${GID_OFFSET})); \
3887 IFS=","; for _login in $$members; do \
3888 for _user in ${USERS}; do \
3889 if [ "x$${_user}" = "x$${_login}" ]; then \
3890 ${ECHO_CMD} -e "if ! ${PW} groupshow ${_group} | ${GREP} -qw $${_login}; then \n \
3891 echo \"Adding user '$${_login}' to group '${_group}'.\" \n \
3892 ${PW} groupmod ${_group} -m $${_login} \nfi" >> ${_UG_OUTPUT}; \
3900 .for _user in ${USERS}
3901 @if [ ! ${USERS_BLACKLIST:M${_user}} ]; then \
3902 ${ECHO_CMD} "@unexec if ${PW} usershow ${_user} >/dev/null 2>&1; then \
3903 echo \"==> You should manually remove the \\\"${_user}\\\" user. \"; fi" >> ${TMPPLIST}; \
3911 .if !defined(DISABLE_SECURITY_CHECK)
3912 .if !target(security-check)
3913 security-check: ${TMPPLIST}
3916 # 2. accept()/recvfrom() which indicates network listening capability
3917 # 3. insecure functions (gets/mktemp/tempnam/[XXX])
3918 # 4. startup scripts, in conjunction with 2.
3919 # 5. world-writable files/dirs
3921 -@${RM} -f ${WRKDIR}/.PLIST.setuid ${WRKDIR}/.PLIST.writable ${WRKDIR}/.PLIST.objdump; \
3922 ${AWK} -v prefix='${PREFIX}' ' \
3923 match($$0, /^@cwd /) { prefix = substr($$0, RSTART + RLENGTH); if (prefix == "/") prefix=""; next; } \
3925 /^\// { print; next; } \
3926 { print prefix "/" $$0; } \
3927 ' ${TMPPLIST} > ${WRKDIR}/.PLIST.flattened; \
3928 ${TR} '\n' '\0' < ${WRKDIR}/.PLIST.flattened \
3929 | ${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; \
3930 ${TR} '\n' '\0' < ${WRKDIR}/.PLIST.flattened \
3931 | ${XARGS} -0 -J % ${FIND} % -prune -perm -0002 \! -type l 2> /dev/null > ${WRKDIR}/.PLIST.writable; \
3932 ${TR} '\n' '\0' < ${WRKDIR}/.PLIST.flattened \
3933 | ${XARGS} -0 -J % ${FIND} % -prune ! -type l -type f -print0 2> /dev/null \
3934 | ${XARGS} -0 -n 1 ${OBJDUMP} -R 2> /dev/null > ${WRKDIR}/.PLIST.objdump; \
3936 ! ${AWK} -v audit="$${PORTS_AUDIT}" -f ${SCRIPTSDIR}/security-check.awk \
3937 ${WRKDIR}/.PLIST.flattened ${WRKDIR}/.PLIST.objdump ${WRKDIR}/.PLIST.setuid ${WRKDIR}/.PLIST.writable; \
3939 www_site=$$(cd ${.CURDIR} && ${MAKE} www-site); \
3940 if [ ! -z "$${www_site}" ]; then \
3942 ${ECHO_MSG} " For more information, and contact details about the security"; \
3943 ${ECHO_MSG} " status of this software, see the following webpage: "; \
3944 ${ECHO_MSG} "$${www_site}"; \
3948 .else # i.e. defined(DISABLE_SECURITY_CHECK)
3950 @${ECHO_MSG} " WARNING: Security check has been disabled."
3951 .endif # !defined(DISABLE_SECURITY_CHECK)
3953 ################################################################
3954 # Skeleton targets start here
3956 # You shouldn't have to change these. Either add the pre-* or
3957 # post-* targets/scripts or redefine the do-* targets. These
3958 # targets don't do anything other than checking for cookies and
3959 # call the necessary targets/scripts.
3960 ################################################################
3963 @${ECHO_MSG} "===> Extracting for ${PKGNAME}"
3965 @${ECHO_MSG} "===> Patching for ${PKGNAME}"
3967 @${ECHO_MSG} "===> Configuring for ${PKGNAME}"
3969 @${ECHO_MSG} "===> Building for ${PKGNAME}"
3971 @${ECHO_MSG} "===> Staging for ${PKGNAME}"
3973 @${ECHO_MSG} "===> Installing for ${PKGNAME}"
3975 @${ECHO_MSG} "===> Building package for ${PKGNAME}"
3977 # Empty pre-* and post-* targets
3979 .for stage in pre post
3980 .for name in pkg check-sanity fetch extract patch configure build stage install package
3982 .if exists(${SCRIPTDIR}/${stage}-${name})
3983 .if !target(${stage}-${name}-script)
3984 ${stage}-${name}-script:
3985 @ cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \
3986 ${SCRIPTDIR}/${.TARGET:S/-script$//}
3993 .if !target(pretty-print-www-site)
3994 pretty-print-www-site:
3995 @www_site=$$(cd ${.CURDIR} && ${MAKE} www-site); \
3996 if [ -n "$${www_site}" ]; then \
3997 ${ECHO_MSG} -n " and/or visit the "; \
3998 ${ECHO_MSG} -n "<a href=\"$${www_site}\">web site</a>"; \
3999 ${ECHO_MSG} " for further information"; \
4003 ################################################################
4004 # Some more targets supplied for users' convenience
4005 ################################################################
4009 # Special target to verify patches
4011 .if !target(checkpatch)
4013 @cd ${.CURDIR} && ${MAKE} ${PATCH_SILENT} PATCH_CHECK_ONLY=yes ${_PATCH_DEP} ${_PATCH_REAL_SEQ}
4018 # Special target to re-run install
4020 .if !target(reinstall)
4022 @${RM} -f ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
4023 @cd ${.CURDIR} && DEPENDS_TARGET="${DEPENDS_TARGET}" ${MAKE} -DFORCE_PKG_REGISTER install
4026 .if !target(restage)
4028 @${RM} -rf ${STAGEDIR} ${STAGE_COOKIE} ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
4029 @cd ${.CURDIR} && ${MAKE} stage
4034 # Special target to remove installation
4036 .if !target(deinstall)
4038 .if defined(UID) && ${UID} != 0 && !defined(INSTALL_AS_USER)
4039 @${ECHO_MSG} "===> Switching to root credentials for '${.TARGET}' target"
4041 ${SU_CMD} "${MAKE} ${.TARGET}"
4042 @${ECHO_MSG} "===> Returning to user credentials"
4044 @${ECHO_MSG} "===> Deinstalling for ${PKGBASE}"
4045 @if ${PKG_INFO} -e ${PKGBASE}; then \
4046 p=`${PKG_INFO} -q -O ${PKGBASE}`; \
4047 ${ECHO_MSG} "===> Deinstalling $${p}"; \
4048 ${PKG_DELETE} -f ${PKGBASE} ; \
4050 ${ECHO_MSG} "===> ${PKGBASE} not installed, skipping"; \
4052 @${RM} -f ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
4058 # Special target to remove installation of all ports of the same origin
4060 .if !target(deinstall-all)
4062 .if ${UID} != 0 && !defined(INSTALL_AS_USER)
4063 @${ECHO_MSG} "===> Switching to root credentials for '${.TARGET}' target"
4065 ${SU_CMD} "${MAKE} ${.TARGET}"
4066 @${ECHO_MSG} "===> Returning to user credentials"
4068 @${ECHO_MSG} "===> Deinstalling for ${PKGORIGIN}"
4069 @deinstall_names=`${PKG_INFO} -q -O ${PKGORIGIN}`; \
4070 for oldpkgorigin in $$(${GREP} "|${PKGORIGIN}|" ${PORTSDIR}/MOVED | ${CUT} -f 1 -d '|' | ${SORT} -u); do \
4071 deinstall_names="$${deinstall_names} $$(${PKG_INFO} -q -O $${oldpkgorigin})"; \
4073 if [ -n "$${deinstall_names}" ]; then \
4074 for d in $${deinstall_names}; do \
4075 ${ECHO_MSG} "===> Deinstalling $${d}"; \
4076 ${PKG_DELETE} -f $${d}; \
4079 ${ECHO_MSG} "===> ${PKGORIGIN} not installed, skipping"; \
4081 ${RM} -f ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
4087 .if !target(do-clean)
4089 .if defined(NEED_ROOT) && ${UID} != 0 && !defined(INSTALL_AS_USER) && exists(${STAGE_COOKIE})
4090 @${ECHO_MSG} "===> Switching to root credentials for '${.TARGET}' target"
4092 ${SU_CMD} "${MAKE} ${.TARGET}"
4093 @${ECHO_MSG} "===> Returning to user credentials"
4095 @if [ -d ${WRKDIR} ]; then \
4096 if [ -w ${WRKDIR} ]; then \
4097 ${RM} -rf ${WRKDIR}; \
4099 ${ECHO_MSG} "===> ${WRKDIR} not writable, skipping"; \
4107 .if !defined(NOCLEANDEPENDS)
4108 @cd ${.CURDIR} && ${MAKE} limited-clean-depends
4110 @${ECHO_MSG} "===> Cleaning for ${PKGNAME}"
4111 .if target(pre-clean)
4112 @cd ${.CURDIR} && ${MAKE} pre-clean
4114 @cd ${.CURDIR} && ${MAKE} do-clean
4115 .if target(post-clean)
4116 @cd ${.CURDIR} && ${MAKE} post-clean
4120 .if !target(pre-distclean)
4125 .if !target(distclean)
4126 distclean: pre-distclean clean
4127 @cd ${.CURDIR} && ${MAKE} delete-distfiles RESTRICTED_FILES="${_DISTFILES} ${_PATCHFILES}"
4130 .if !target(delete-distfiles)
4132 @${ECHO_MSG} "===> Deleting distfiles for ${PKGNAME}"
4133 @(if [ "X${RESTRICTED_FILES}" != "X" -a -d ${_DISTDIR} ]; then \
4135 for file in ${RESTRICTED_FILES}; do \
4136 ${RM} -f $${file}; \
4138 if [ "$${dir}" != "$${file}" ]; then \
4139 ${RMDIR} -p $${dir} >/dev/null 2>&1 || :; \
4143 .if defined(DIST_SUBDIR)
4144 -@${RMDIR} ${_DISTDIR} >/dev/null 2>&1 || ${TRUE}
4148 .if !target(delete-distfiles-list)
4149 delete-distfiles-list:
4150 @${ECHO_CMD} "# ${PKGNAME}"
4151 @if [ "X${RESTRICTED_FILES}" != "X" ]; then \
4152 for file in ${RESTRICTED_FILES}; do \
4153 ${ECHO_CMD} "[ -f ${_DISTDIR}/$$file ] && (${ECHO_CMD} deleting ${_DISTDIR}/$$file; ${RM} -f ${_DISTDIR}/$$file)"; \
4155 if [ "$${dir}" != "$${file}" ]; then \
4156 ${ECHO_CMD} "(cd ${_DISTDIR} && ${RMDIR} -p $${dir} 2>/dev/null)"; \
4160 .if defined(DIST_SUBDIR)
4161 @${ECHO_CMD} "${RMDIR} ${_DISTDIR} 2>/dev/null || ${TRUE}"
4165 # Prints out a list of files to fetch (useful to do a batch fetch)
4167 .if !target(fetch-list)
4169 @${MKDIR} ${_DISTDIR}
4171 ${_MASTER_SITES_ENV} ; \
4172 for _file in ${DISTFILES}; do \
4173 file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^:]+$$//'` ; \
4174 select=`${ECHO_CMD} $${_file#$${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` ; \
4175 if [ ! -f $$file -a ! -f $${file##*/} ]; then \
4176 if [ ! -z "$$select" ] ; then \
4177 __MASTER_SITES_TMP= ; \
4178 for group in $$select; do \
4179 if [ ! -z \$${_MASTER_SITES_$${group}} ] ; then \
4180 eval ___MASTER_SITES_TMP=\$${_MASTER_SITES_$${group}} ; \
4181 __MASTER_SITES_TMP="$${__MASTER_SITES_TMP} $${___MASTER_SITES_TMP}" ; \
4184 ___MASTER_SITES_TMP= ; \
4185 SORTED_MASTER_SITES_CMD_TMP="${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} $${__MASTER_SITES_TMP} | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}" ; \
4187 SORTED_MASTER_SITES_CMD_TMP="${SORTED_MASTER_SITES_DEFAULT_CMD}" ; \
4189 for site in `eval $$SORTED_MASTER_SITES_CMD_TMP ${_RANDOMIZE_SITES}`; do \
4190 if [ ! -z "`${ECHO_CMD} ${NOFETCHFILES} | ${GREP} -w $${file}`" ]; then \
4191 if [ -z "`${ECHO_CMD} ${MASTER_SITE_OVERRIDE} | ${GREP} -w $${site}`" ]; then \
4195 DIR=${DIST_SUBDIR};\
4196 CKSIZE=`alg=SIZE; ${DISTINFO_DATA}`; \
4198 */*) args="-o $${file} $${site}$${file}";; \
4199 *) args=$${site}$${file};; \
4201 ${ECHO_CMD} -n ${SETENV} ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${args} "${FETCH_AFTER_ARGS}" '|| ' ; \
4203 ${ECHO_CMD} "${ECHO_CMD} $${file} not fetched" ; \
4206 .if defined(PATCHFILES)
4208 ${_PATCH_SITES_ENV} ; \
4209 for _file in ${PATCHFILES}; do \
4210 file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^-:][^:]*$$//'` ; \
4211 select=`${ECHO_CMD} $${_file#$${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` ; \
4212 file=`${ECHO_CMD} $$file | ${SED} -E -e 's/:-[^:]+$$//'` ; \
4213 if [ ! -f $$file -a ! -f $${file##*/} ]; then \
4214 if [ ! -z "$$select" ] ; then \
4215 __PATCH_SITES_TMP= ; \
4216 for group in $$select; do \
4217 if [ ! -z \$${_PATCH_SITES_$${group}} ] ; then \
4218 eval ___PATCH_SITES_TMP=\$${_PATCH_SITES_$${group}} ; \
4219 __PATCH_SITES_TMP="$${__PATCH_SITES_TMP} $${___PATCH_SITES_TMP}" ; \
4222 ___PATCH_SITES_TMP= ; \
4223 SORTED_PATCH_SITES_CMD_TMP="${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} $${__PATCH_SITES_TMP} | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}" ; \
4225 SORTED_PATCH_SITES_CMD_TMP="${SORTED_PATCH_SITES_DEFAULT_CMD}" ; \
4227 for site in `eval $$SORTED_PATCH_SITES_CMD_TMP ${_RANDOMIZE_SITES}`; do \
4228 CKSIZE=`alg=SIZE; ${DISTINFO_DATA}`; \
4230 */*) args="-o $${file} $${site}$${file}";; \
4231 *) args=$${site}$${file};; \
4233 ${ECHO_CMD} -n ${SETENV} ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${args} "${FETCH_AFTER_ARGS}" '|| ' ; \
4235 ${ECHO_CMD} "${ECHO_CMD} $${file} not fetched" ; \
4241 .if !target(fetch-url-list-int)
4243 @${MKDIR} ${_DISTDIR}
4245 ${_MASTER_SITES_ENV}; \
4246 for _file in ${DISTFILES}; do \
4247 file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^:]+$$//'` ; \
4248 fileptn=`${ECHO_CMD} $$file | ${SED} 's|/|\\\\/|g;s/\./\\\\./g;s/\+/\\\\+/g;s/\?/\\\\?/g'` ; \
4249 select=`${ECHO_CMD} $${_file#$${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` ; \
4250 if [ ! -z "${LISTALL}" -o ! -f $$file -a ! -f $${file##*/} ]; then \
4251 if [ ! -z "$$select" ] ; then \
4252 __MASTER_SITES_TMP= ; \
4253 for group in $$select; do \
4254 if [ ! -z \$${_MASTER_SITES_$${group}} ] ; then \
4255 eval ___MASTER_SITES_TMP=\$${_MASTER_SITES_$${group}} ; \
4256 __MASTER_SITES_TMP="$${__MASTER_SITES_TMP} $${___MASTER_SITES_TMP}" ; \
4259 ___MASTER_SITES_TMP= ; \
4260 SORTED_MASTER_SITES_CMD_TMP="${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} $${__MASTER_SITES_TMP} | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}" ; \
4262 SORTED_MASTER_SITES_CMD_TMP="${SORTED_MASTER_SITES_DEFAULT_CMD}" ; \
4264 for site in `eval $$SORTED_MASTER_SITES_CMD_TMP ${_RANDOMIZE_SITES}`; do \
4266 */*) args="-o $${file} $${site}$${file}";; \
4267 *) args=$${site}$${file};; \
4269 ${ECHO_CMD} $${args} ; \
4273 .if defined(PATCHFILES)
4275 ${_PATCH_SITES_ENV} ; \
4276 for _file in ${PATCHFILES}; do \
4277 file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^-:][^:]*$$//'` ; \
4278 select=`${ECHO_CMD} $${_file#$${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` ; \
4279 file=`${ECHO_CMD} $$file | ${SED} -E -e 's/:-[^:]+$$//'` ; \
4280 fileptn=`${ECHO_CMD} $$file | ${SED} 's|/|\\\\/|g;s/\./\\\\./g;s/\+/\\\\+/g;s/\?/\\\\?/g'` ; \
4281 if [ ! -z "${LISTALL}" -o ! -f $$file -a ! -f $${file##*/} ]; then \
4282 if [ ! -z "$$select" ] ; then \
4283 __PATCH_SITES_TMP= ; \
4284 for group in $$select; do \
4285 if [ ! -z \$${_PATCH_SITES_$${group}} ] ; then \
4286 eval ___PATCH_SITES_TMP=\$${_PATCH_SITES_$${group}} ; \
4287 __PATCH_SITES_TMP="$${__PATCH_SITES_TMP} $${___PATCH_SITES_TMP}" ; \
4290 ___PATCH_SITES_TMP= ; \
4291 SORTED_PATCH_SITES_CMD_TMP="${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} $${__PATCH_SITES_TMP} | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}" ; \
4293 SORTED_PATCH_SITES_CMD_TMP="${SORTED_PATCH_SITES_DEFAULT_CMD}" ; \
4295 for site in `eval $$SORTED_PATCH_SITES_CMD_TMP ${_RANDOMIZE_SITES}`; do \
4297 */*) args="-o $${file} $${site}$${file}";; \
4298 *) args=$${site}$${file};; \
4300 ${ECHO_CMD} $${args} ; \
4307 .if !target(fetch-urlall-list)
4309 @cd ${.CURDIR} && LISTALL=yes ${MAKE} fetch-url-list-int
4312 .if !target(fetch-url-list)
4314 @cd ${.CURDIR} && ${MAKE} fetch-url-list-int
4317 # Generates patches.
4320 @toedit=`PATCH_WRKSRC=${PATCH_WRKSRC} \
4321 PATCHDIR=${PATCHDIR} \
4322 PATCH_LIST=${PATCHDIR}/patch-* \
4323 DIFF_ARGS=${DIFF_ARGS} \
4324 DISTORIG=${DISTORIG} \
4325 ${SH} ${PORTSDIR}/Tools/scripts/update-patches`; \
4326 case $$toedit in "");; \
4327 *) ${ECHO_CMD} -n 'edit patches: '; read i; \
4328 cd ${PATCHDIR} && $${VISUAL:-$${EDIT:-/usr/bin/vi}} $$toedit;; esac
4330 # Checksumming utilities
4332 check-checksum-algorithms:
4336 for alg in ${CHECKSUM_ALGORITHMS:tu}; do \
4337 eval alg_executable=\$$$$alg; \
4338 if [ -z "$$alg_executable" ]; then \
4339 ${ECHO_MSG} "Checksum algorithm $$alg: Couldn't find the executable."; \
4340 ${ECHO_MSG} "Set $$alg=/path/to/$$alg in /etc/make.conf and try again."; \
4348 .if !target(makesum)
4349 makesum: check-checksum-algorithms
4350 @cd ${.CURDIR} && ${MAKE} fetch NO_CHECKSUM=yes \
4352 @if [ -f ${DISTINFO_FILE} ]; then ${CAT} /dev/null > ${DISTINFO_FILE}; fi
4358 for file in ${_CKSUMFILES}; do \
4359 for alg in ${CHECKSUM_ALGORITHMS:tu}; do \
4360 eval alg_executable=\$$$$alg; \
4362 if [ $$alg_executable != "NO" ]; then \
4363 $$alg_executable $$file >> ${DISTINFO_FILE}; \
4366 ${ECHO_CMD} "SIZE ($$file) = `${STAT} -f \"%z\" $$file`" >> ${DISTINFO_FILE}; \
4371 .if !target(checksum)
4372 checksum: fetch check-checksum-algorithms
4375 if [ -f ${DISTINFO_FILE} ]; then \
4376 cd ${DISTDIR}; OK="";\
4377 for file in ${_CKSUMFILES}; do \
4379 _file=$${file#${DIST_SUBDIR}/*}; \
4380 for alg in ${CHECKSUM_ALGORITHMS:tu}; do \
4382 eval alg_executable=\$$$$alg; \
4384 if [ $$alg_executable != "NO" ]; then \
4385 MKSUM=`$$alg_executable < $$file`; \
4386 CKSUM=`file=$$_file; ${DISTINFO_DATA}`; \
4391 if [ $$ignore = "false" -a -z "$$CKSUM" ]; then \
4392 ${ECHO_MSG} "=> No $$alg checksum recorded for $$file."; \
4396 if [ $$ignore = "false" ]; then \
4398 for chksum in $$CKSUM; do \
4399 if [ "$$chksum" = "$$MKSUM" ]; then \
4404 if [ $$match = "true" ]; then \
4405 ${ECHO_MSG} "=> $$alg Checksum OK for $$file."; \
4408 ${ECHO_MSG} "=> $$alg Checksum mismatch for $$file."; \
4409 refetchlist="$$refetchlist$$file "; \
4410 OK="$${OK:-retry}"; \
4411 [ "$${OK}" = "retry" -a ${FETCH_REGET} -gt 0 ] && ${RM} -f $${file}; \
4417 if [ $$ignored = "true" ]; then \
4418 ${ECHO_MSG} "=> No suitable checksum found for $$file."; \
4424 if [ "$${OK:=true}" = "retry" ] && [ ${FETCH_REGET} -gt 0 ]; then \
4425 ${ECHO_MSG} "===> Refetch for ${FETCH_REGET} more times files: $$refetchlist"; \
4426 if ( cd ${.CURDIR} && \
4427 ${MAKE} ${.MAKEFLAGS} FORCE_FETCH="$$refetchlist" FETCH_REGET="`${EXPR} ${FETCH_REGET} - 1`" fetch); then \
4428 if ( cd ${.CURDIR} && \
4429 ${MAKE} ${.MAKEFLAGS} FETCH_REGET="`${EXPR} ${FETCH_REGET} - 1`" checksum ); then \
4435 if [ "$$OK" != "true" -a ${FETCH_REGET} -eq 0 ]; then \
4436 ${ECHO_MSG} "===> Giving up on fetching files: $$refetchlist"; \
4437 ${ECHO_MSG} "Make sure the Makefile and distinfo file (${DISTINFO_FILE})"; \
4438 ${ECHO_MSG} "are up to date. If you are absolutely sure you want to override this"; \
4439 ${ECHO_MSG} "check, type \"make NO_CHECKSUM=yes [other args]\"."; \
4442 if [ "$$OK" != "true" ]; then \
4445 elif [ -n "${_CKSUMFILES:M*}" ]; then \
4446 ${ECHO_MSG} "=> No checksum file (${DISTINFO_FILE})."; \
4451 ################################################################
4452 # The special package-building targets
4453 # You probably won't need to touch these
4454 ################################################################
4456 # Nobody should want to override this unless PKGNAME is simply bogus.
4458 .if !target(package-name)
4460 @${ECHO_CMD} ${PKGNAME}
4463 # Build a package but don't check the package cookie
4465 .if !target(repackage)
4466 repackage: pre-repackage package
4469 @${RM} -f ${PACKAGE_COOKIE}
4472 # Build a package but don't check the cookie for installation, also don't
4473 # install package cookie
4475 .if !target(package-noinstall)
4477 @cd ${.CURDIR} && ${MAKE} package
4480 ################################################################
4481 # Dependency checking
4482 ################################################################
4484 .if !target(depends)
4485 depends: pkg-depends extract-depends patch-depends lib-depends fetch-depends build-depends run-depends
4487 .if defined(ALWAYS_BUILD_DEPENDS)
4494 if [ -n "${USE_PACKAGE_DEPENDS}" -o -n "${USE_PACKAGE_DEPENDS_ONLY}" ]; then \
4495 subpkgfile=`(cd $$dir; ${MAKE} $$depends_args -V PKGFILE)`; \
4496 subpkgname=$${subpkgfile%-*} ; \
4497 subpkgname=$${subpkgname\#\#*/} ; \
4498 if [ -r "$${subpkgfile}" -a "$$target" = "${DEPENDS_TARGET}" ]; then \
4499 ${ECHO_MSG} "===> Installing existing package $${subpkgfile}"; \
4500 if [ $${subpkgname} = "pkg" ]; then \
4501 [ -d ${WRKDIR} ] || ${MKDIR} ${WRKDIR} ; \
4502 ${TAR} xf $${subpkgfile} -C ${WRKDIR} -s ",/.*/,,g" "*/pkg-static" ; \
4503 ${WRKDIR}/pkg-static add $${subpkgfile}; \
4504 ${RM} -f ${WRKDIR}/pkg-static; \
4506 ${PKG_ADD} -A $${subpkgfile}; \
4508 elif [ -n "${USE_PACKAGE_DEPENDS_ONLY}" -a "$${target}" = "${DEPENDS_TARGET}" ]; then \
4509 ${ECHO_MSG} "===> ${PKGNAME} depends on package: $${subpkgfile} - not found"; \
4510 ${ECHO_MSG} "===> USE_PACKAGE_DEPENDS_ONLY set - not building missing dependency from source"; \
4513 (cd $$dir; ${MAKE} -DINSTALLS_DEPENDS $$target $$depends_args) ; \
4516 (cd $$dir; ${MAKE} -DINSTALLS_DEPENDS $$target $$depends_args) ; \
4518 ${ECHO_MSG} "===> Returning to build of ${PKGNAME}";
4520 .for deptype in PKG EXTRACT PATCH FETCH BUILD RUN
4521 ${deptype:tl}-depends:
4522 .if defined(${deptype}_DEPENDS)
4523 .if !defined(NO_DEPENDS)
4524 @set -e ; for i in `${ECHO_CMD} "${${deptype}_DEPENDS}"`; do \
4526 if [ -z "$$prog" ]; then \
4527 ${ECHO_MSG} "Error: there is an empty port dependency in ${deptype}_DEPENDS."; \
4530 dir=`${ECHO_CMD} $$i | ${SED} -e 's/[^:]*://'`; \
4531 if ${EXPR} "$$dir" : '.*:' > /dev/null; then \
4532 target=$${dir##*:}; \
4534 if [ X${DEPENDS_PRECLEAN} != "X" ]; then \
4535 target="clean $$target"; \
4536 depends_args="$$depends_args NOCLEANDEPENDS=yes"; \
4538 if [ X${DEPENDS_CLEAN} != "X" ]; then \
4539 target="$$target clean"; \
4540 depends_args="$$depends_args NOCLEANDEPENDS=yes"; \
4543 target="${DEPENDS_TARGET}"; \
4544 depends_args="${DEPENDS_ARGS}"; \
4546 if ${EXPR} "$$prog" : \\/ >/dev/null; then \
4547 if [ -e "$$prog" ]; then \
4548 if [ "$$prog" = "${NONEXISTENT}" ]; then \
4549 ${ECHO_MSG} "Error: ${NONEXISTENT} exists. Please remove it, and restart the build."; \
4552 ${ECHO_MSG} "===> ${PKGNAME} depends on file: $$prog - found"; \
4553 if [ ${_DEPEND_ALWAYS} = 1 ]; then \
4554 ${ECHO_MSG} " (but building it anyway)"; \
4561 ${ECHO_MSG} "===> ${PKGNAME} depends on file: $$prog - not found"; \
4566 *\>*|*\<*|*=*) pkg=yes;; \
4569 if [ "$$pkg" != "" ]; then \
4570 if ${PKG_INFO} "$$prog" > /dev/null 2>&1 ; then \
4571 ${ECHO_MSG} "===> ${PKGNAME} depends on package: $$prog - found"; \
4572 if [ ${_DEPEND_ALWAYS} = 1 ]; then \
4573 ${ECHO_MSG} " (but building it anyway)"; \
4579 ${ECHO_MSG} "===> ${PKGNAME} depends on package: $$prog - not found"; \
4582 if [ $$notfound != 0 ]; then \
4583 inverse_dep=`${ECHO_CMD} $$prog | ${SED} \
4584 -e 's/<=/=gt=/; s/</=ge=/; s/>=/=lt=/; s/>/=le=/' \
4585 -e 's/=gt=/>/; s/=ge=/>=/; s/=lt=/</; s/=le=/<=/'`; \
4586 pkg_info=`${PKG_INFO} -E "$$inverse_dep" 2>/dev/null || ${TRUE}`; \
4587 if [ "$$pkg_info" != "" ]; then \
4588 ${ECHO_MSG} "===> Found $$pkg_info, but you need to upgrade to $$prog."; \
4592 elif ${WHICH} "$$prog" > /dev/null 2>&1 ; then \
4593 ${ECHO_MSG} "===> ${PKGNAME} depends on executable: $$prog - found"; \
4594 if [ ${_DEPEND_ALWAYS} = 1 ]; then \
4595 ${ECHO_MSG} " (but building it anyway)"; \
4601 ${ECHO_MSG} "===> ${PKGNAME} depends on executable: $$prog - not found"; \
4605 if [ $$notfound != 0 ]; then \
4606 ${ECHO_MSG} "===> Verifying $$target for $$prog in $$dir"; \
4607 if [ ! -d "$$dir" ]; then \
4608 ${ECHO_MSG} " => No directory for $$prog. Skipping.."; \
4610 ${_INSTALL_DEPENDS} \
4621 .if defined(LIB_DEPENDS) && !defined(NO_DEPENDS)
4623 for i in ${LIB_DEPENDS}; do \
4626 target="${DEPENDS_TARGET}"; \
4627 depends_args="${DEPENDS_ARGS}"; \
4628 ${ECHO_MSG} -n "===> ${PKGNAME} depends on shared library: $${lib}" ; \
4630 dirs="${LIB_DIRS} `${CAT} ${LOCALBASE}/libdata/ldconfig/* 2>/dev/null || : `" ; \
4631 for libdir in $$dirs; do \
4632 test -f $${libdir}/$${lib} || continue; \
4633 if [ -x /usr/bin/file ]; then \
4634 _LIB_FILE=`realpath $${libdir}/$${lib}`; \
4635 [ `file -b -L --mime-type $${_LIB_FILE}` = "application/x-sharedlib" ] || continue ; \
4638 ${ECHO_MSG} -n " - found ($${_LIB_FILE})"; \
4640 if [ $${found} -eq 0 ]; then \
4641 ${ECHO_MSG} " - not found"; \
4642 ${ECHO_MSG} "===> Verifying for $$lib in $$dir"; \
4643 if [ ! -d "$$dir" ] ; then \
4644 ${ECHO_MSG} " => No directory for $$lib. Skipping.."; \
4646 ${_INSTALL_DEPENDS} \
4656 # Dependency lists: both build and runtime, recursive. Print out directory names.
4658 _UNIFIED_DEPENDS=${PKG_DEPENDS} ${EXTRACT_DEPENDS} ${PATCH_DEPENDS} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS} ${RUN_DEPENDS}
4659 _DEPEND_DIRS= ${_UNIFIED_DEPENDS:C,^[^:]*:([^:]*).*$,\1,}
4660 _DEPEND_SPECIALS= ${_UNIFIED_DEPENDS:M*\:*\:*:C,^[^:]*:([^:]*):.*$,\1,}
4663 @${ALL-DEPENDS-LIST}
4666 L="${_DEPEND_DIRS}"; \
4668 while [ -n "$$L" ]; do \
4672 $$d\ *|*\ $$d\ *|*\ $$d) \
4675 checked="$$checked $$d"; \
4676 if [ ! -d $$d ]; then \
4677 ${ECHO_MSG} "${PKGNAME}: \"$$d\" non-existent -- dependency list incomplete" >&2; \
4681 if ! children=$$(cd $$d && ${MAKE} -V '$${_DEPEND_DIRS}'); then\
4682 ${ECHO_MSG} "${PKGNAME}: \"$$d\" erroneous -- dependency list incomplete" >&2; \
4685 for child in $$children; do \
4686 case "$$checked $$l" in \
4687 $$child\ *|*\ $$child\ *|*\ $$child) \
4696 CLEAN-DEPENDS-FULL= \
4697 L="${_DEPEND_DIRS}"; \
4699 while [ -n "$$L" ]; do \
4703 $$d\ *|*\ $$d\ *|*\ $$d) \
4706 checked="$$checked $$d"; \
4707 if [ ! -d $$d ]; then \
4708 ${ECHO_MSG} "${PKGNAME}: \"$$d\" non-existent -- dependency list incomplete" >&2; \
4711 if ! children=$$(cd $$d && ${MAKE} -V WRKDIR -V _DEPEND_DIRS); then \
4712 ${ECHO_MSG} "${PKGNAME}: \"$$d\" erroneous -- dependency list incomplete" >&2; \
4716 for child in $$children; do \
4719 if [ -d $$child ]; then \
4724 case "$$checked $$l" in \
4725 $$child\ *|*\ $$child\ *|*\ $$child) \
4735 CLEAN-DEPENDS-LIMITED= \
4736 L="${_DEPEND_DIRS}"; \
4738 while [ -n "$$L" ]; do \
4742 $$d\ *|*\ $$d\ *|*\ $$d) \
4745 checked="$$checked $$d"; \
4746 if [ ! -d $$d ]; then \
4747 ${ECHO_MSG} "${PKGNAME}: \"$$d\" non-existent -- dependency list incomplete" >&2; \
4750 if ! children=$$(cd $$d && ${MAKE} -V '$${WRKDIR}' -V '$${_DEPEND_DIRS}'); then \
4751 ${ECHO_MSG} "${PKGNAME}: \"$$d\" erroneous -- dependency list incomplete" >&2; \
4755 for child in $$children; do \
4758 if [ ! -d $$child ]; then \
4764 case "$$checked $$l" in \
4765 $$child\ *|*\ $$child\ *|*\ $$child) \
4775 .if !target(clean-depends)
4777 @for dir in $$(${CLEAN-DEPENDS-FULL}); do \
4778 (cd $$dir; ${MAKE} NOCLEANDEPENDS=yes clean); \
4782 .if !target(limited-clean-depends)
4783 limited-clean-depends:
4784 @for dir in $$(${CLEAN-DEPENDS-LIMITED}); do \
4785 (cd $$dir; ${MAKE} NOCLEANDEPENDS=yes clean); \
4789 .if !target(deinstall-depends)
4791 @for dir in $$(${ALL-DEPENDS-LIST}); do \
4792 (cd $$dir; ${MAKE} deinstall); \
4796 .if !target(fetch-specials)
4798 @${ECHO_MSG} "===> Fetching all distfiles required by ${PKGNAME} for building"
4799 @for dir in ${_DEPEND_SPECIALS}; do \
4800 (cd $$dir; ${MAKE} fetch); \
4804 .if !target(fetch-recursive)
4806 @${ECHO_MSG} "===> Fetching all distfiles for ${PKGNAME} and dependencies"
4807 @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \
4808 (cd $$dir; ${MAKE} fetch); \
4812 .if !target(fetch-recursive-list)
4813 fetch-recursive-list:
4814 @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \
4815 (cd $$dir; ${MAKE} fetch-list); \
4819 # Used by fetch-required and fetch-required list, this script looks
4820 # at each of the dependencies. If 3 items are specified in the tuple,
4821 # such as foo:${PORTSDIR}/graphics/foo:extract, the first item (foo)
4822 # is examined. Only if it begins with a / and does not exist on the
4823 # file-system will ``make targ'' proceed.
4824 # For more usual (dual-item) dependency tuples, the ``make targ''
4825 # proceeds, if the exact package, which the directory WOULD'VE installed,
4826 # is not yet installed.
4827 # This is the exact behaviour of the old code, and it may need
4828 # revisiting. For example, the entire first case seems dubious, and in
4829 # the second case we, probably, should be satisfied with _any_ (earlier)
4830 # package, with the same origin as that of the dir.
4833 FETCH_LIST?= for i in $$deps; do \
4834 prog=$${i%%:*}; dir=$${i\#*:}; \
4836 *:*) if [ $$prog != $${prog\#/} -o ! -e $$prog ]; then \
4841 *) if [ -d ${PKG_DBDIR}/$$(cd $$dir; ${MAKE} -V '$${PKGNAME}') ]; then \
4845 echo cd $$dir; cd $$dir; ${MAKE} $$targ; \
4848 .if !target(fetch-required)
4849 fetch-required: fetch
4850 .if defined(NO_DEPENDS)
4851 @${ECHO_MSG} "===> NO_DEPENDS is set, not fetching any other distfiles for ${PKGNAME}"
4853 @${ECHO_MSG} "===> Fetching all required distfiles for ${PKGNAME} and dependencies"
4854 .for deptype in PKG EXTRACT PATCH FETCH BUILD RUN
4855 .if defined(${deptype}_DEPENDS)
4856 @targ=fetch; deps="${${deptype}_DEPENDS}"; ${FETCH_LIST}
4863 .if !target(fetch-required-list)
4864 fetch-required-list: fetch-list
4865 .if !defined(NO_DEPENDS)
4866 .for deptype in PKG EXTRACT PATCH FETCH BUILD RUN
4867 .if defined(${deptype}_DEPENDS)
4868 @targ=fetch-list; deps="${${deptype}_DEPENDS}"; ${FETCH_LIST}
4874 .if !target(checksum-recursive)
4876 @${ECHO_MSG} "===> Fetching and checking checksums for ${PKGNAME} and dependencies"
4877 @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \
4878 (cd $$dir; ${MAKE} checksum); \
4882 # Dependency lists: build and runtime. Print out directory names.
4885 .if defined(PKG_DEPENDS) || defined(EXTRACT_DEPENDS) || defined(PATCH_DEPENDS) || defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || defined(LIB_DEPENDS)
4886 @${BUILD-DEPENDS-LIST}
4889 BUILD-DEPENDS-LIST= \
4890 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 \
4891 if [ -d $$dir ]; then \
4892 ${ECHO_CMD} $$dir; \
4894 ${ECHO_MSG} "${PKGNAME}: \"$$dir\" non-existent -- dependency list incomplete" >&2; \
4899 .if defined(LIB_DEPENDS) || defined(RUN_DEPENDS)
4900 @${RUN-DEPENDS-LIST}
4904 for dir in $$(${ECHO_CMD} "${_LIB_RUN_DEPENDS:C,.*:([^:]*).*,\1,}" | ${SED} -e 'y/ /\n/' | ${SORT} -u); do \
4905 if [ -d $$dir ]; then \
4906 ${ECHO_CMD} $$dir; \
4908 ${ECHO_MSG} "${PKGNAME}: \"$$dir\" non-existent -- dependency list incomplete" >&2; \
4912 # Package (recursive runtime) dependency list. Print out both directory names
4913 # and package names.
4915 package-depends-list:
4916 .if defined(CHILD_DEPENDS) || defined(LIB_DEPENDS) || defined(RUN_DEPENDS)
4917 @${PACKAGE-DEPENDS-LIST}
4920 _LIB_RUN_DEPENDS= ${LIB_DEPENDS} ${RUN_DEPENDS}
4921 PACKAGE-DEPENDS-LIST?= \
4922 if [ "${CHILD_DEPENDS}" ]; then \
4923 installed=$$(${PKG_INFO} -qO ${PKGORIGIN} 2>/dev/null || \
4925 if [ "$$installed" ]; then \
4928 if [ -z "$$installed" ]; then \
4929 installed="${PKGNAME}"; \
4931 for pkgname in $$installed; do \
4932 ${ECHO_CMD} "$$pkgname ${.CURDIR} ${PKGORIGIN}"; \
4935 checked="${PARENT_CHECKED}"; \
4936 for dir in ${_LIB_RUN_DEPENDS:C,[^:]*:([^:]*):?.*,\1,}; do \
4937 dir=$$(${REALPATH} $$dir); \
4938 if [ -d $$dir ]; then \
4940 $$dir|$$dir\ *|*\ $$dir|*\ $$dir\ *) continue;; \
4942 childout=$$(cd $$dir; ${MAKE} CHILD_DEPENDS=yes PARENT_CHECKED="$$checked" package-depends-list); \
4943 set -- $$childout; \
4945 while [ $$\# != 0 ]; do \
4946 childdir="$$childdir $$2"; \
4947 ${ECHO_CMD} "$$1 $$2 $$3"; \
4950 checked="$$dir $$childdir $$checked"; \
4952 ${ECHO_MSG} "${PKGNAME}: \"$$dir\" non-existent -- dependency list incomplete" >&2; \
4956 ACTUAL-PACKAGE-DEPENDS?= \
4957 if [ "${_LIB_RUN_DEPENDS}" != " " ]; then \
4958 ${PKG_QUERY} "\"%n\": {origin: %o, version: \"%v\"}" " " ${_LIB_RUN_DEPENDS:C,[^:]*:([^:]*):?.*,\1,:C,${PORTSDIR}/,,} 2>/dev/null || : ; \
4962 @${MKDIR} ${METADIR}; \
4964 echo "name: \"${PKGBASE}\"" ; \
4965 echo "version: \"${PKGVERSION}\"" ; \
4966 echo "origin: ${PKGORIGIN}" ; \
4967 echo "comment: <<EOD" ; \
4968 echo ${COMMENT:Q} ; \
4970 echo "maintainer: ${MAINTAINER}" ; \
4971 echo "prefix: ${PREFIX}" ; \
4972 [ -z "${WWW}" ] || echo "www: ${WWW}" ; \
4974 ${ACTUAL-PACKAGE-DEPENDS} | ${GREP} -v -E ${PKG_IGNORE_DEPENDS} | ${SORT} -u ; \
4976 echo "categories: [ ${CATEGORIES:u:S/$/,/} ]" ; \
4977 l=${LICENSE_COMB} ; \
4978 [ -n "${NO_ARCH}" ] && echo "arch : `${PKG_BIN} config abi | ${CUT} -d: -f1,2`:*" ; \
4979 echo "licenselogic: $${l:-single}" ; \
4980 [ -z "${LICENSE}" ] || echo "licenses: [ ${LICENSE:u:S/$/,/} ]" ; \
4981 [ -z "${USERS}" ] || echo "users: [ ${USERS:u:S/$/,/} ]" ; \
4982 [ -z "${GROUPS}" ] || echo "groups: [ ${GROUPS:u:S/$/,/} ]" ; \
4984 @${ECHO_CMD} -n "options: {" >> ${MANIFESTF}
4985 .for opt in ${COMPLETE_OPTIONS_LIST}
4986 @[ -z "${PORT_OPTIONS:M${opt}}" ] || match="on" ; ${ECHO_MSG} -n " ${opt}: $${match:-off}," >> ${MANIFESTF}
4988 @${ECHO_CMD} "}" >> ${MANIFESTF}
4989 .if defined(PKG_NOTES)
4990 @${ECHO_CMD} -n "annotations: {" >> ${MANIFESTF}
4991 .for note in ${PKG_NOTES}
4992 @${ECHO_CMD} -n ' ${note}: "${PKG_NOTE_${note}:S/"/\"/g}",' >> ${MANIFESTF}
4994 @${ECHO_CMD} " }" >> ${MANIFESTF}
4996 @[ -f ${PKGINSTALL} ] && ${CP} ${PKGINSTALL} ${METADIR}/+INSTALL; \
4997 ${RM} -f ${METADIR}/+PRE_INSTALL ; \
4998 for a in ${PKGPREINSTALL}; do \
4999 [ -f $$a ] && ${CAT} $$a >> ${METADIR}/+PRE_INSTALL ; \
5001 ${RM} -f ${METADIR}/+POST_INSTALL ; \
5002 for a in ${PKGPOSTINSTALL}; do \
5003 [ -f $$a ] && ${CAT} $$a >> ${METADIR}/+POST_INSTALL ; \
5005 [ -f ${PKGDEINSTALL} ] && ${CP} ${PKGDEINSTALL} ${METADIR}/+DEINSTALL; \
5006 ${RM} -f ${METADIR}/+PRE_DEINSTALL ; \
5007 for a in ${PKGPREDEINSTALL}; do \
5008 [ -f $$a ] && ${CAT} $$a >> ${METADIR}/+PRE_DEINSTALL ; \
5010 ${RM} -f ${METADIR}/+POST_DEINSTALL ; \
5011 for a in ${PKGPOSTDEINSTALL}; do \
5012 [ -f $$a ] && ${CAT} $$a >> ${METADIR}/+POST_DEINSTALL ; \
5014 [ -f ${PKGPOSTDEINSTALL} ] && ${CP} ${PKGPOSTDEINSTALL} ${METADIR}/+POST_DEINSTALL; \
5015 [ -f ${PKGUPGRADE} ] && ${CP} ${PKGUPGRADE} ${METADIR}/+UPGRADE; \
5016 [ -f ${PKGPREUPGRADE} ] && ${CP} ${PKGPREUPGRADE} ${METADIR}/+PRE_UPGRADE; \
5017 [ -f ${PKGPOSTUPGRADE} ] && ${CP} ${PKGPOSTUPGRADE} ${METADIR}/+POST_UPGRADE; \
5018 ${CP} ${DESCR} ${METADIR}/+DESC; \
5019 [ -f ${PKGMESSAGE} ] && ${CP} ${PKGMESSAGE} ${METADIR}/+DISPLAY || return 0
5020 .if !defined(NO_MTREE)
5021 @[ -f ${MTREE_FILE} ] && ${CP} ${MTREE_FILE} ${METADIR}/+MTREE_DIRS || return 0
5024 # Print out package names.
5027 @${PACKAGE-DEPENDS-LIST} | ${AWK} '{print $$1":"$$3}'
5029 actual-package-depends:
5030 @${ACTUAL-PACKAGE-DEPENDS}
5032 # Build packages for port and dependencies
5034 package-recursive: package
5035 @for dir in $$(${ALL-DEPENDS-LIST}); do \
5036 (cd $$dir; ${MAKE} package-noinstall); \
5039 # Show missing dependencies
5041 @_origins=$$(${PKG_INFO} -aoq); \
5042 for dir in $$(${ALL-DEPENDS-LIST}); do \
5043 _origin=$${dir##${PORTSDIR}/}; \
5044 if ! $$(${ECHO_CMD} $${_origins} | ${GREP} -q $${_origin}); then \
5045 ${ECHO_CMD} $${_origin}; \
5049 # Show missing dependencies by name
5051 @_packages=$$(${PKG_INFO} -aq); \
5052 for dir in $$(${ALL-DEPENDS-LIST}); do \
5053 _p=$$(cd $$dir; ${MAKE} -VPKGNAME); \
5054 if ! $$(${ECHO_CMD} $${_packages} | ${GREP} -q $${_p}); then \
5055 ${ECHO_CMD} $${_p}; \
5059 ################################################################
5060 # Everything after here are internal targets and really
5061 # shouldn't be touched by anybody but the release engineers.
5062 ################################################################
5064 # This target generates an index entry suitable for aggregation into
5065 # a large index. Format is:
5067 # distribution-name|port-path|installation-prefix|comment| \
5068 # description-file|maintainer|categories|extract-depends| \
5069 # patch-depends|fetch-depends|build-depends|run-depends|www site
5071 # If this ever changes, portmgr should contact the portsnap maintainer
5072 # first to avoid gratuitous breakage.
5074 . if !target(describe)
5075 _EXTRACT_DEPENDS=${EXTRACT_DEPENDS:C/^[^ :]+:([^ :]+)(:[^ :]+)?/\1/:O:u}
5076 _PATCH_DEPENDS=${PATCH_DEPENDS:C/^[^ :]+:([^ :]+)(:[^ :]+)?/\1/:O:u}
5077 _FETCH_DEPENDS=${FETCH_DEPENDS:C/^[^ :]+:([^ :]+)(:[^ :]+)?/\1/:O:u}
5078 _LIB_DEPENDS=${LIB_DEPENDS:C/^[^ :]+:([^ :]+)(:[^ :]+)?/\1/:O:u}
5079 _BUILD_DEPENDS=${BUILD_DEPENDS:C/^[^ :]+:([^ :]+)(:[^ :]+)?/\1/:O:u} ${_LIB_DEPENDS}
5080 _RUN_DEPENDS=${RUN_DEPENDS:C/^[^ :]+:([^ :]+)(:[^ :]+)?/\1/:O:u} ${_LIB_DEPENDS}
5081 . if exists(${DESCR})
5087 . if defined(BUILDING_INDEX) && defined(INDEX_PORTS)
5088 INDEX_OUT=${INDEX_TMPDIR}/${INDEXFILE}.desc.aggr
5090 INDEX_OUT=/dev/stdout
5094 @(${ECHO_CMD} -n "${PKGNAME}|${.CURDIR}|${PREFIX}|"; \
5095 ${ECHO_CMD} -n ${COMMENT:Q}; \
5096 ${ECHO_CMD} -n "|${_DESCR}|${MAINTAINER}|${CATEGORIES}|${_EXTRACT_DEPENDS}|${_PATCH_DEPENDS}|${_FETCH_DEPENDS}|${_BUILD_DEPENDS:O:u}|${_RUN_DEPENDS:O:u}|"; \
5097 while read one two discard; do \
5099 WWW:) case "$$two" in \
5100 https://*|http://*|ftp://*) ${ECHO_CMD} -n "$$two" ;; \
5101 *) ${ECHO_CMD} -n "http://$$two" ;; \
5106 done < ${DESCR}; ${ECHO_CMD}) >>${INDEX_OUT}
5110 .if exists(${DESCR})
5111 @${AWK} '$$1 ~ /^WWW:/ {print $$2}' ${DESCR} | ${HEAD} -1
5116 .if !target(readmes)
5122 @${RM} -f ${.CURDIR}/README.html
5123 @cd ${.CURDIR} && ${MAKE} ${.CURDIR}/README.html
5126 ${.CURDIR}/README.html:
5127 @${ECHO_MSG} "===> Creating README.html for ${PKGNAME}"
5128 @${SED} -e 's|%%PORT%%|'$$(${ECHO_CMD} ${.CURDIR} | \
5129 ${SED} -e 's|.*/\([^/]*/[^/]*\)$$|\1|')'|g' \
5130 -e 's|%%PKG%%|${PKGNAME}|g' \
5131 -e 's|%%COMMENT%%|'"$$(${ECHO_CMD} ${COMMENT:Q})"'|' \
5132 -e '/%%COMMENT%%/d' \
5133 -e 's|%%DESCR%%|'"$$(${ECHO_CMD} ${DESCR} | \
5134 ${SED} -e 's|${.CURDIR}/||')"'|' \
5135 -e 's|%%EMAIL%%|'"$$(${ECHO_CMD} "${MAINTAINER}" | \
5136 ${SED} -e 's/([^)]*)//;s/.*<//;s/>.*//')"'|g' \
5137 -e 's|%%MAINTAINER%%|${MAINTAINER}|g' \
5138 -e 's|%%WEBSITE%%|'"$$(cd ${.CURDIR} && eval ${MAKE} pretty-print-www-site)"'|' \
5139 -e 's|%%BUILD_DEPENDS%%|'"$$(cd ${.CURDIR} && eval ${MAKE} pretty-print-build-depends-list)"'|' \
5140 -e 's|%%RUN_DEPENDS%%|'"$$(cd ${.CURDIR} && eval ${MAKE} pretty-print-run-depends-list)"'|' \
5141 -e 's|%%TOP%%|'"$$(${ECHO_CMD} ${CATEGORIES} | \
5142 ${SED} -e 's| .*||' -e 's|[^/]*|..|g')"'/..|' \
5143 ${TEMPLATES}/README.port >> ${.TARGET}
5145 # The following two targets require an up-to-date INDEX in ${PORTSDIR}
5147 _PRETTY_PRINT_DEPENDS_LIST=\
5148 if [ ! -r ${INDEXDIR}/${INDEXFILE} ] ; then \
5149 ${ECHO_MSG} "${.TARGET} requires an INDEX file (${INDEXFILE}). Please run make index or make fetchindex."; \
5151 target=${.TARGET:C/pretty-print-(.*)-depends-list/\1/} ; \
5152 if [ "$$target" = "build" ] ; then fldnum=8 ; else fldnum=9 ; fi; \
5153 ${ECHO_MSG} -n 'This port requires package(s) "' ; \
5154 ${ECHO_MSG} -n `${AWK} -F\| "\\$$1 ~ /^${PKGNAME}/ {print \\$$$${fldnum};}" ${INDEXDIR}/${INDEXFILE}` ; \
5155 ${ECHO_MSG} "\" to $$target."; \
5159 .if !target(pretty-print-build-depends-list)
5160 pretty-print-build-depends-list:
5161 .if defined(PKG_DEPENDS) || defined(EXTRACT_DEPENDS) || defined(PATCH_DEPENDS) || \
5162 defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || defined(LIB_DEPENDS)
5163 @${_PRETTY_PRINT_DEPENDS_LIST}
5167 .if !target(pretty-print-run-depends-list)
5168 pretty-print-run-depends-list:
5169 .if defined(RUN_DEPENDS) || defined(LIB_DEPENDS)
5170 @${_PRETTY_PRINT_DEPENDS_LIST}
5174 _SUB_LIST_TEMP= ${SUB_LIST:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/}
5175 .if !target(apply-slist)
5177 .if defined(SUB_FILES)
5178 .for file in ${SUB_FILES}
5179 .if exists(${FILESDIR}/${file}.in)
5180 @${SED} ${_SUB_LIST_TEMP} -e '/^@comment /d' ${FILESDIR}/${file}.in > ${WRKDIR}/${file}
5181 .elif exists(${DFLY_FILESDIR}/${file}.in)
5182 @${SED} ${_SUB_LIST_TEMP} -e '/^@comment /d' ${DFLY_FILESDIR}/${file}.in > ${WRKDIR}/${file}
5184 @${ECHO_MSG} "** Checked ${FILESDIR}:"; \
5185 @${ECHO_MSG} "** Checked ${DFLY_FILESDIR}:"; \
5186 @${ECHO_MSG} "** Missing ${file}.in for ${PKGNAME}."; \
5190 .for i in pkg-message pkg-install pkg-deinstall pkg-req
5191 .if ${SUB_FILES:M${i}*}!=""
5192 ${i:S/-//:tu}= ${WRKDIR}/${SUB_FILES:M${i}*}
5198 # Generate packing list. Also tests to make sure all required package
5201 .if !target(generate-plist)
5202 generate-plist: ${WRKDIR}
5203 @${ECHO_MSG} "===> Generating temporary packing list"
5204 @${MKDIR} `${DIRNAME} ${TMPPLIST}`
5205 @if [ ! -f ${DESCR} ]; then ${ECHO_MSG} "** Missing pkg-descr for ${PKGNAME}."; exit 1; fi
5207 @for file in ${PLIST_FILES}; do \
5208 ${ECHO_CMD} $${file} | ${SED} ${PLIST_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} >> ${TMPPLIST}; \
5210 @if [ -f ${PLIST} ]; then \
5211 ${SED} ${PLIST_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} ${PLIST} >> ${TMPPLIST}; \
5214 .for dir in ${PLIST_DIRS} ${PLIST_DIRSTRY}
5215 @${ECHO_CMD} ${dir} | ${SED} ${PLIST_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} -e 's,^,@dir ,' >> ${TMPPLIST}
5218 .if defined(USE_LINUX_PREFIX)
5219 .if defined(USE_LDCONFIG)
5220 @${ECHO_CMD} "@exec ${LDCONFIG_CMD}" >> ${TMPPLIST}
5221 @${ECHO_CMD} "@unexec ${LDCONFIG_CMD}" >> ${TMPPLIST}
5224 .if defined(USE_LDCONFIG)
5225 .if !defined(INSTALL_AS_USER)
5226 @${ECHO_CMD} "@exec ${LDCONFIG} -m ${USE_LDCONFIG}" >> ${TMPPLIST}
5227 @${ECHO_CMD} "@unexec ${LDCONFIG} -R" >> ${TMPPLIST}
5229 @${ECHO_CMD} "@exec ${LDCONFIG} -m ${USE_LDCONFIG} || ${TRUE}" >> ${TMPPLIST}
5230 @${ECHO_CMD} "@unexec ${LDCONFIG} -R || ${TRUE}" >> ${TMPPLIST}
5233 .if defined(USE_LDCONFIG32)
5234 .if !defined(INSTALL_AS_USER)
5235 @${ECHO_CMD} "@exec ${LDCONFIG} -32 -m ${USE_LDCONFIG32}" >> ${TMPPLIST}
5236 @${ECHO_CMD} "@unexec ${LDCONFIG} -32 -R" >> ${TMPPLIST}
5238 @${ECHO_CMD} "@exec ${LDCONFIG} -32 -m ${USE_LDCONFIG32} || ${TRUE}" >> ${TMPPLIST}
5239 @${ECHO_CMD} "@unexec ${LDCONFIG} -32 -R || ${TRUE}" >> ${TMPPLIST}
5246 @cd ${.CURDIR} && ${MAKE} generate-plist
5248 ${TMPPLIST_SORT}: ${TMPPLIST}
5249 @${SORT} -u ${TMPPLIST} >${TMPPLIST_SORT}
5251 .if !target(add-plist-docs)
5252 .if defined(PORTDOCS) && !defined(NOPORTDOCS)
5254 .for x in ${PORTDOCS}
5255 @if ${ECHO_CMD} "${x}"| ${AWK} '$$1 ~ /(\*|\||\[|\]|\?|\{|\}|\$$)/ { exit 1};'; then \
5256 if [ ! -e ${STAGEDIR}${DOCSDIR}/${x} ]; then \
5257 ${ECHO_CMD} ${DOCSDIR}/${x} >> ${TMPPLIST}; \
5260 @${FIND} -P ${PORTDOCS:S/^/${STAGEDIR}${DOCSDIR}\//} ! -type d 2>/dev/null | \
5261 ${SED} -ne 's,^${STAGEDIR},,p' >> ${TMPPLIST}
5265 .if !target(add-plist-examples)
5266 .if defined(PORTEXAMPLES) && !defined(NOPORTEXAMPLES)
5268 .for x in ${PORTEXAMPLES}
5269 @if ${ECHO_CMD} "${x}"| ${AWK} '$$1 ~ /(\*|\||\[|\]|\?|\{|\}|\$$)/ { exit 1};'; then \
5270 if [ ! -e ${STAGEDIR}${EXAMPLESDIR}/${x} ]; then \
5271 ${ECHO_CMD} ${EXAMPLESDIR}/${x} >> ${TMPPLIST}; \
5274 @${FIND} -P ${PORTEXAMPLES:S/^/${STAGEDIR}${EXAMPLESDIR}\//} ! -type d 2>/dev/null | \
5275 ${SED} -ne 's,^${STAGEDIR},,p' >> ${TMPPLIST}
5279 .if !target(add-plist-data)
5280 .if defined(PORTDATA)
5282 .for x in ${PORTDATA}
5283 @if ${ECHO_CMD} "${x}"| ${AWK} '$$1 ~ /(\*|\||\[|\]|\?|\{|\}|\$$)/ { exit 1};'; then \
5284 if [ ! -e ${STAGEDIR}${DATADIR}/${x} ]; then \
5285 ${ECHO_CMD} ${DATADIR}/${x} >> ${TMPPLIST}; \
5288 @${FIND} -P ${PORTDATA:S/^/${STAGEDIR}${DATADIR}\//} ! -type d 2>/dev/null | \
5289 ${SED} -ne 's,^${STAGEDIR},,p' >> ${TMPPLIST}
5293 .if !target(add-plist-buildinfo)
5294 add-plist-buildinfo:
5295 .if defined(PACKAGE_BUILDING)
5296 @${ECHO_CMD} "@comment Build details: ${BUILDHOST}|${JAIL}|${BUILD}|${PORTSTREE}|${BUILDDATE}" >> ${TMPPLIST}
5300 .if !target(add-plist-info)
5304 @${LS} ${STAGEDIR}${PREFIX}/${INFO_PATH}/$i.info* | ${SED} -e s:${STAGEDIR}:@info\ :g >> ${TMPPLIST}
5309 # If we're installing into a non-standard PREFIX, we need to remove that directory at
5311 .if !target(add-plist-post)
5312 .if (${PREFIX} != ${LOCALBASE} && ${PREFIX} != ${LINUXBASE} && \
5313 ${PREFIX} != "/usr" && !defined(NO_PREFIX_RMDIR))
5315 @${ECHO_CMD} "@dir ${PREFIX}" >> ${TMPPLIST}
5319 .if !target(install-rc-script)
5320 .if defined(USE_RCORDER) || defined(USE_RC_SUBR) && ${USE_RC_SUBR:tu} != "YES"
5322 .if defined(USE_RCORDER)
5323 @${ECHO_MSG} "===> Staging early rc.d startup script(s)"
5324 @for i in ${USE_RCORDER}; do \
5325 ${INSTALL_SCRIPT} ${WRKDIR}/$${i} ${STAGEDIR}/etc/rc.d/$${i%.sh}; \
5326 ${ECHO_CMD} "/etc/rc.d/$${i%.sh}" >> ${TMPPLIST}; \
5329 .if defined(USE_RC_SUBR) && ${USE_RC_SUBR:tu} != "YES"
5330 @${ECHO_MSG} "===> Staging rc.d startup script(s)"
5331 @for i in ${USE_RC_SUBR}; do \
5332 ${INSTALL_SCRIPT} ${WRKDIR}/$${i} ${STAGEDIR}${PREFIX}/etc/rc.d/$${i%.sh}; \
5333 ${ECHO_CMD} "${PREFIX}/etc/rc.d/$${i%.sh}" >> ${TMPPLIST}; \
5339 # Compress all manpage not already compressed which are not hardlinks
5340 # 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
5341 # Fixes all dead symlinks left by the previous round
5342 .if !target(compress-man)
5344 @${ECHO_MSG} "====> Compressing man pages (compress-man)"
5346 for dir in ${MANDIRS:S/^/${STAGEDIR}/} ; do \
5347 [ -d $$dir ] && mdirs="$$mdirs $$dir" ;\
5349 for dir in $$mdirs; do \
5350 ${FIND} $$dir -type f \! -name "*.gz" -links 1 -exec ${GZIP_CMD} {} \; ; \
5351 ${FIND} $$dir -type f \! -name "*.gz" \! -links 1 -exec ${STAT} -f '%i' {} \; | \
5352 ${SORT} -u | while read inode ; do \
5354 for f in $$(${FIND} $$dir -type f -inum $${inode} -print); do \
5355 if [ -z $$ref ]; then \
5357 ${GZIP_CMD} $${f} ; \
5361 (cd $${f%/*}; ${LN} -f $${ref##*/} $${f##*/}.gz) ; \
5364 ${FIND} $$dir -type l \! -name "*.gz" | while read link ; do \
5365 ${LN} -sf $$(readlink $$link).gz $$link.gz ;\
5371 .if !target(stage-dir)
5373 @${MKDIR} ${STAGEDIR}${PREFIX}
5374 .if !defined(NO_MTREE)
5375 @${MTREE_CMD} ${MTREE_ARGS} ${STAGEDIR}${PREFIX} > /dev/null
5379 .if !target(makeplist)
5381 @${SETENV} ${CO_ENV} ${SH} ${SCRIPTSDIR}/check-stagedir.sh makeplist
5384 .if !target(check-plist)
5386 @${ECHO_MSG} "====> Checking for pkg-plist issues (check-plist)"
5387 @${SETENV} ${CO_ENV} ${SH} ${SCRIPTSDIR}/check-stagedir.sh checkplist
5388 @${ECHO_MSG} "===> No pkg-plist issues found (check-plist)"
5391 .if !target(check-orphans)
5392 check-orphans: check-plist
5395 .if !target(stage-qa)
5397 @${ECHO_MSG} "====> Running Q/A tests (stage-qa)"
5398 @${SETENV} ${QA_ENV} ${SH} ${SCRIPTSDIR}/qa.sh
5401 # Fake installation of package so that user can pkg delete it later.
5402 .if !target(fake-pkg)
5403 STAGE_ARGS= -i ${STAGEDIR}
5405 .if !defined(NO_PKG_REGISTER)
5406 fake-pkg: create-manifest
5407 .if defined(INSTALLS_DEPENDS)
5408 @${ECHO_MSG} "===> Registering installation for ${PKGNAME} as automatic"
5410 @${ECHO_MSG} "===> Registering installation for ${PKGNAME}"
5412 .if defined(INSTALLS_DEPENDS)
5413 @${SETENV} ${PKG_ENV} FORCE_POST="${_FORCE_POST_PATTERNS}" ${PKG_CMD} -d ${STAGE_ARGS} -m ${METADIR} -f ${TMPPLIST}
5415 @${SETENV} ${PKG_ENV} FORCE_POST="${_FORCE_POST_PATTERNS}" ${PKG_CMD} ${STAGE_ARGS} -m ${METADIR} -f ${TMPPLIST}
5417 @${RM} -rf ${METADIR}
5421 # Depend is generally meaningless for arbitrary ports, but if someone wants
5422 # one they can override this. This is just to catch people who've gotten into
5423 # the habit of typing `make depend all install' as a matter of course.
5429 # Same goes for tags
5434 .if !defined(NOPRECIOUSMAKEVARS)
5435 # These won't change, so we can pass them through the environment
5437 ARCH="${ARCH:S/"/"'"'"/g:S/\$/\$\$/g:S/\\/\\\\/g}" \
5438 OPSYS="${OPSYS:S/"/"'"'"/g:S/\$/\$\$/g:S/\\/\\\\/g}" \
5439 OSREL="${OSREL:S/"/"'"'"/g:S/\$/\$\$/g:S/\\/\\\\/g}" \
5440 OSVERSION="${OSVERSION:S/"/"'"'"/g:S/\$/\$\$/g:S/\\/\\\\/g}" \
5441 DFLYVERSION="${DFLYVERSION:Q}" \
5442 SYSTEMVERSION="${SYSTEMVERSION:S/"/"'"'"/g:S/\$/\$\$/g:S/\\/\\\\/g}"
5445 .if !target(pre-check-config)
5447 .for single in ${OPTIONS_SINGLE}
5448 . for opt in ${OPTIONS_SINGLE_${single}}
5449 . if empty(ALL_OPTIONS:M${single}) || !empty(PORT_OPTIONS:M${single})
5450 . if !empty(PORT_OPTIONS:M${opt})
5451 . if defined(OPTFOUND)
5452 OPTIONS_WRONG_SINGLE+= ${single}
5458 # if conditional and if the condition is unchecked, remove opt from the list of
5460 PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}}
5464 . if !defined(OPTFOUND) && !defined(OPTNOCHECK)
5465 OPTIONS_WRONG_SINGLE+= ${single}
5472 .for radio in ${OPTIONS_RADIO}
5473 . for opt in ${OPTIONS_RADIO_${radio}}
5474 . if !empty(PORT_OPTIONS:M${opt})
5475 . if defined(OPTFOUND)
5476 OPTIONS_WRONG_RADIO+= ${radio}
5485 .for multi in ${OPTIONS_MULTI}
5486 . for opt in ${OPTIONS_MULTI_${multi}}
5487 . if empty(ALL_OPTIONS:M${multi}) || !empty(PORT_OPTIONS:M${multi})
5488 . if !empty(PORT_OPTIONS:M${opt})
5492 # if conditional and if the condition is unchecked, remove opt from the list of
5494 PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}}
5498 . if !defined(OPTFOUND) && !defined(OPTNOCHECK)
5499 OPTIONS_WRONG_MULTI+= ${multi}
5506 .endif #pre-check-config
5508 .if !target(_check-config)
5509 _check-config: pre-check-config
5510 .for multi in ${OPTIONS_WRONG_MULTI}
5511 @${ECHO_MSG} "====> You must check at least one option in the ${multi} multi"
5513 .for single in ${OPTIONS_WRONG_SINGLE}
5514 @${ECHO_MSG} "====> You must select one and only one option from the ${single} single"
5516 .for radio in ${OPTIONS_WRONG_RADIO}
5517 @${ECHO_MSG} "====> You cannot select multiple options from the ${radio} radio"
5519 .if !empty(OPTIONS_WRONG_MULTI) || !empty(OPTIONS_WRONG_SINGLE) || !empty(OPTIONS_WRONG_RADIO)
5520 _CHECK_CONFIG_ERROR= true
5522 .endif # _check-config
5524 .if !target(check-config)
5525 check-config: _check-config
5526 .if !empty(_CHECK_CONFIG_ERROR)
5529 .endif # check-config
5531 .if !target(sanity-config)
5532 sanity-config: _check-config
5533 .if !empty(_CHECK_CONFIG_ERROR)
5534 @echo -n "Config is invalid. Re-edit? [Y/n] "; \
5540 cd ${.CURDIR} && ${MAKE} config
5542 .endif # sanity-config
5544 .if !target(pre-config)
5546 D4P_ENV= PKGNAME="${PKGNAME}" \
5547 PORT_OPTIONS="${PORT_OPTIONS}" \
5548 ALL_OPTIONS="${ALL_OPTIONS}" \
5549 OPTIONS_MULTI="${OPTIONS_MULTI}" \
5550 OPTIONS_SINGLE="${OPTIONS_SINGLE}" \
5551 OPTIONS_RADIO="${OPTIONS_RADIO}" \
5552 OPTIONS_GROUP="${OPTIONS_GROUP}" \
5553 NEW_OPTIONS="${NEW_OPTIONS}" \
5554 DIALOG4PORTS="${DIALOG4PORTS}" \
5555 PREFIX="${PREFIX}" \
5556 LOCALBASE="${LOCALBASE}" \
5557 PORTSDIR="${PORTSDIR}" \
5559 D4PHEIGHT="${D4PHEIGHT}" \
5560 D4PWIDTH="${D4PWIDTH}" \
5561 D4PFULLSCREEN="${D4PFULLSCREEN}"
5562 .if exists(${PKGHELP})
5563 D4P_ENV+= PKGHELP="${PKGHELP}"
5565 .for opt in ${ALL_OPTIONS}
5566 D4P_ENV+= ${opt}_DESC=""${${opt}_DESC:Q}""
5568 .for otype in MULTI GROUP SINGLE RADIO
5569 . for m in ${OPTIONS_${otype}}
5570 D4P_ENV+= OPTIONS_${otype}_${m}="${OPTIONS_${otype}_${m}}" \
5571 ${m}_DESC=""${${m}_DESC:Q}""
5572 . for opt in ${OPTIONS_${otype}_${m}}
5573 D4P_ENV+= ${opt}_DESC=""${${opt}_DESC:Q}""
5582 .if !target(do-config)
5584 .if empty(ALL_OPTIONS) && empty(OPTIONS_SINGLE) && empty(OPTIONS_MULTI) && empty(OPTIONS_RADIO) && empty(OPTIONS_GROUP)
5585 @${ECHO_MSG} "===> No options to configure"
5587 .if ${UID} != 0 && !defined(INSTALL_AS_USER)
5588 @optionsdir=${OPTIONS_FILE}; optionsdir=$${optionsdir%/*}; \
5589 oldoptionsdir=${OPTIONSFILE}; oldoptionsdir=$${oldoptionsdir%/*}; \
5590 ${ECHO_MSG} "===> Switching to root credentials to create $${optionsdir}"; \
5591 (${SU_CMD} "${SH} -c \"if [ -d $${oldoptionsdir} -a ! -d $${optionsdir} ]; then ${MV} $${oldoptionsdir} $${optionsdir}; elif [ -d $${oldoptionsdir} -a -d $${optionsdir} ]; then ${RM} -rf $${oldoptionsdir} ; fi ; ${MKDIR} $${optionsdir} 2> /dev/null\"") || \
5592 (${ECHO_MSG} "===> Cannot create $${optionsdir}, check permissions"; exit 1); \
5593 ${ECHO_MSG} "===> Returning to user credentials"
5595 @optionsdir=${OPTIONS_FILE}; optionsdir=$${optionsdir%/*}; \
5596 oldoptionsdir=${OPTIONSFILE}; oldoptionsdir=$${oldoptionsdir%/*}; \
5597 if [ -d $${oldoptionsdir} -a ! -d $${optionsdir} ]; then \
5598 ${MV} $${oldoptionsdir} $${optionsdir}; \
5599 elif [ -d $${oldoptionsdir} -a -d $${optionsdir} ]; then \
5600 ${RM} -rf $${oldoptionsdir} ; \
5602 ${MKDIR} $${optionsdir} 2> /dev/null || \
5603 (${ECHO_MSG} "===> Cannot create $${optionsdir}, check permissions"; exit 1)
5605 @TMPOPTIONSFILE=$$(mktemp -t portoptions); \
5606 trap "${RM} -f $${TMPOPTIONSFILE}; exit 1" 1 2 3 5 10 13 15; \
5607 ${SETENV} ${D4P_ENV} ${SH} ${SCRIPTSDIR}/dialog4ports.sh $${TMPOPTIONSFILE} || { \
5608 ${RM} -f $${TMPOPTIONSFILE}; \
5609 ${ECHO_MSG} "===> Options unchanged"; \
5613 if [ ! -e $${TMPOPTIONSFILE} ]; then \
5614 ${ECHO_MSG} "===> No user-specified options to save for ${PKGNAME}"; \
5617 SELOPTIONS=$$(${CAT} $${TMPOPTIONSFILE}); \
5618 ${RM} -f $${TMPOPTIONSFILE}; \
5619 TMPOPTIONSFILE=$$(mktemp -t portoptions); \
5620 trap "${RM} -f $${TMPOPTIONSFILE}; exit 1" 1 2 3 5 10 13 15; \
5621 ${ECHO_CMD} "# This file is auto-generated by 'make config'." > $${TMPOPTIONSFILE}; \
5622 ${ECHO_CMD} "# Options for ${PKGNAME}" >> $${TMPOPTIONSFILE}; \
5623 ${ECHO_CMD} "_OPTIONS_READ=${PKGNAME}" >> $${TMPOPTIONSFILE}; \
5624 ${ECHO_CMD} "_FILE_COMPLETE_OPTIONS_LIST=${COMPLETE_OPTIONS_LIST}" >> $${TMPOPTIONSFILE}; \
5625 for i in ${COMPLETE_OPTIONS_LIST}; do \
5626 if ${ECHO_CMD} $${SELOPTIONS} | ${GREP} -qw $${i}; then \
5627 ${ECHO_CMD} "OPTIONS_FILE_SET+=$${i}" >> $${TMPOPTIONSFILE}; \
5629 ${ECHO_CMD} "OPTIONS_FILE_UNSET+=$${i}" >> $${TMPOPTIONSFILE}; \
5632 if [ ${UID} != 0 -a "x${INSTALL_AS_USER}" = "x" ]; then \
5633 ${ECHO_MSG} "===> Switching to root credentials to write ${OPTIONS_FILE}"; \
5634 ${SU_CMD} "${CAT} $${TMPOPTIONSFILE} > ${OPTIONS_FILE}"; \
5635 ${ECHO_MSG} "===> Returning to user credentials"; \
5637 ${CAT} $${TMPOPTIONSFILE} > ${OPTIONS_FILE}; \
5639 ${RM} -f $${TMPOPTIONSFILE}
5640 @cd ${.CURDIR} && ${MAKE} sanity-config
5645 .if !defined(NO_DIALOG)
5646 config: pre-config do-config
5649 @${ECHO_MSG} "===> Skipping 'config' as NO_DIALOG is defined"
5653 .if !target(config-recursive)
5655 @${ECHO_MSG} "===> Setting user-specified options for ${PKGNAME} and dependencies";
5656 @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \
5657 (cd $$dir; ${MAKE} config-conditional); \
5659 .endif # config-recursive
5661 .if !target(config-conditional)
5663 .if !empty(NEW_OPTIONS)
5664 @cd ${.CURDIR} && ${MAKE} config;
5666 .endif # config-conditional
5668 .if !target(showconfig)
5669 .include "${PORTSDIR}/Mk/bsd.options.desc.mk"
5670 MULTI_EOL= : you have to choose at least one of them
5671 SINGLE_EOL= : you have to select exactly one of them
5672 RADIO_EOL= : you can only select none or one of them
5674 .if !empty(COMPLETE_OPTIONS_LIST)
5675 @${ECHO_MSG} "===> The following configuration options are available for ${PKGNAME}":
5676 .for opt in ${ALL_OPTIONS}
5677 @[ -z "${PORT_OPTIONS:M${opt}}" ] || match="on" ; ${ECHO_MSG} -n " ${opt}=$${match:-off}"
5678 . if !empty(${opt}_DESC)
5679 @${ECHO_MSG} -n ": "${${opt}_DESC:Q}
5684 #multi and conditional multis
5685 .for otype in MULTI GROUP SINGLE RADIO
5686 . for m in ${OPTIONS_${otype}}
5687 . if empty(${m}_DESC)
5688 @${ECHO_MSG} "====> Options available for the ${otype:tl} ${m}${${otype}_EOL}"
5690 @${ECHO_MSG} "====> ${${m}_DESC}${${otype}_EOL}"
5692 . for opt in ${OPTIONS_${otype}_${m}}
5693 @[ -z "${PORT_OPTIONS:M${opt}}" ] || match="on" ; ${ECHO_MSG} -n " ${opt}=$${match:-off}"
5694 . if !empty(${opt}_DESC)
5695 @${ECHO_MSG} -n ": "${${opt}_DESC:Q}
5705 @${ECHO_MSG} "===> Use 'make config' to modify these settings"
5709 .if !target(showconfig-recursive)
5710 showconfig-recursive:
5711 @${ECHO_MSG} "===> The following configuration options are available for ${PKGNAME} and dependencies";
5712 @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \
5713 (cd $$dir; ${MAKE} showconfig); \
5715 .endif # showconfig-recursive
5717 .if !target(rmconfig)
5719 .if exists(${OPTIONSFILE})
5720 -@${ECHO_MSG} "===> Removing user-configured options for ${PKGNAME}"; \
5721 optionsdir=${OPTIONSFILE}; optionsdir=$${optionsdir%/*}; \
5722 if [ ${UID} != 0 -a "x${INSTALL_AS_USER}" = "x" ]; then \
5723 ${ECHO_MSG} "===> Switching to root credentials to remove ${OPTIONSFILE} and $${optionsdir}"; \
5724 ${SU_CMD} "${RM} -f ${OPTIONSFILE} ; \
5725 ${RMDIR} $${optionsdir}"; \
5726 ${ECHO_MSG} "===> Returning to user credentials"; \
5728 ${RM} -f ${OPTIONSFILE}; \
5729 ${RMDIR} $${optionsdir} 2>/dev/null || return 0; \
5732 .if exists(${OPTIONS_FILE})
5733 -@${ECHO_MSG} "===> Removing user-configured options for ${PKGNAME}"; \
5734 optionsdir=${OPTIONS_FILE}; optionsdir=$${optionsdir%/*}; \
5735 if [ ${UID} != 0 -a "x${INSTALL_AS_USER}" = "x" ]; then \
5736 ${ECHO_MSG} "===> Switching to root credentials to remove ${OPTIONS_FILE} and $${optionsdir}"; \
5737 ${SU_CMD} "${RM} -f ${OPTIONS_FILE} ; \
5738 ${RMDIR} $${optionsdir}"; \
5739 ${ECHO_MSG} "===> Returning to user credentials"; \
5741 ${RM} -f ${OPTIONS_FILE}; \
5742 ${RMDIR} $${optionsdir} 2>/dev/null || return 0; \
5745 @${ECHO_MSG} "===> No user-specified options configured for ${PKGNAME}"
5749 .if !target(rmconfig-recursive)
5751 @${ECHO_MSG} "===> Removing user-specified options for ${PKGNAME} and dependencies";
5752 @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \
5753 (cd $$dir; ${MAKE} rmconfig); \
5755 .endif # rmconfig-recursive
5757 .if !target(pretty-print-config)
5766 pretty-print-config:
5767 .for opt in ${ALL_OPTIONS}
5768 @[ -z "${PORT_OPTIONS:M${opt}}" ] || match="+" ; ${ECHO_MSG} -n "$${match:--}${opt} "
5770 .for otype in MULTI GROUP SINGLE RADIO
5771 . for m in ${OPTIONS_${otype}}
5772 @${ECHO_MSG} -n "${m}${${otype}_START} "
5773 . for opt in ${OPTIONS_${otype}_${m}}
5774 @[ -z "${PORT_OPTIONS:M${opt}}" ] || match="+" ; ${ECHO_MSG} -n "$${match:--}${opt} "
5776 @${ECHO_MSG} -n "${${otype}_END} "
5783 .endif # pretty-print-config
5787 for native_category in ${CATEGORIES}; do \
5789 case $$native_category in \
5790 accessibility) c="Utility Accessibility" ;; \
5791 archivers) c="Utility Archiving" ;; \
5792 astro) c="Education Science Astronomy" ;; \
5793 audio) c="AudioVideo Audio" ;; \
5794 benchmarks) c="System" ;; \
5795 biology) c="Education Science Biology" ;; \
5796 cad) c="Graphics Engineering" ;; \
5797 comms) c="Utility" ;; \
5798 converters) c="Utility" ;; \
5799 databases) c="Office Database" ;; \
5800 deskutils) c="Utility" ;; \
5801 devel) c="Development" ;; \
5802 dns) c="Network" ;; \
5803 elisp) c="Development" ;; \
5804 editors) c="Utility" ;; \
5805 emulators) c="System Emulator" ;; \
5806 finance) c="Office Finance" ;; \
5807 ftp) c="Network FileTransfer" ;; \
5808 games) c="Game" ;; \
5809 geography) c="Education Science Geography" ;; \
5810 gnome) c="GNOME GTK" ;; \
5811 graphics) c="Graphics" ;; \
5812 hamradio) c="HamRadio" ;; \
5813 haskell) c="Development" ;; \
5814 irc) c="Network IRCClient" ;; \
5815 java) c="Development Java" ;; \
5816 kde) c="KDE Qt" ;; \
5817 lang) c="Development" ;; \
5818 lisp) c="Development" ;; \
5819 mail) c="Office Email" ;; \
5820 mate) c="MATE GTK" ;; \
5821 math) c="Education Science Math" ;; \
5822 mbone) c="Network AudioVideo" ;; \
5823 multimedia) c="AudioVideo" ;; \
5824 net) c="Network" ;; \
5825 net-im) c="Network InstantMessaging" ;; \
5826 net-mgmt) c="Network" ;; \
5827 net-p2p) c="Network P2P" ;; \
5828 news) c="Network News" ;; \
5829 palm) c="Office PDA" ;; \
5830 parallel) c="ParallelComputing" ;; \
5831 pear) c="Development WebDevelopment" ;; \
5832 perl5) c="Development" ;; \
5833 python) c="Development" ;; \
5834 ruby) c="Development" ;; \
5835 rubygems) c="Development" ;; \
5836 scheme) c="Development" ;; \
5837 science) c="Science Education" ;; \
5838 security) c="System Security" ;; \
5839 shells) c="System Shell" ;; \
5840 sysutils) c="System" ;; \
5841 tcl*|tk*) c="Development" ;; \
5842 textproc) c="Utility TextTools" ;; \
5843 www) c="Network" ;; \
5844 x11-clocks) c="Utility Clock" ;; \
5845 x11-fm) c="System FileManager" ;; \
5846 xfce) c="GTK XFCE" ;; \
5847 zope) c="Development WebDevelopment" ;; \
5849 if [ -n "$$c" ]; then \
5850 categories="$$categories $$c"; \
5853 if [ -n "$$categories" ]; then \
5854 for c in $$categories; do ${ECHO_MSG} "$$c"; done \
5855 | ${SORT} -u | ${TR} '\n' ';'; \
5859 # http://standards.freedesktop.org/menu-spec/menu-spec-latest.html
5860 DESKTOP_CATEGORIES_MAIN= AudioVideo Audio Video Development Education \
5861 Game Graphics Network Office Science Settings System Utility
5862 DESKTOP_CATEGORIES_ADDITIONAL= Building Debugger IDE GUIDesigner Profiling \
5863 RevisionControl Translation Calendar ContactManagement Database \
5864 Dictionary Chart Email Finance FlowChart PDA ProjectManagement \
5865 Presentation Spreadsheet WordProcessor 2DGraphics VectorGraphics \
5866 RasterGraphics 3DGraphics Scanning OCR Photography Publishing Viewer \
5867 TextTools DesktopSettings HardwareSettings Printing PackageManager \
5868 Dialup InstantMessaging Chat IRCClient Feed FileTransfer HamRadio News \
5869 P2P RemoteAccess Telephony TelephonyTools VideoConference WebBrowser \
5870 WebDevelopment Midi Mixer Sequencer Tuner TV AudioVideoEditing Player \
5871 Recorder DiscBurning ActionGame AdventureGame ArcadeGame BoardGame \
5872 BlocksGame CardGame KidsGame LogicGame RolePlaying Shooter Simulation \
5873 SportsGame StrategyGame Art Construction Music Languages \
5874 ArtificialIntelligence Astronomy Biology Chemistry ComputerScience \
5875 DataVisualization Economy Electricity Geography Geology Geoscience \
5876 History Humanities ImageProcessing Literature Maps Math \
5877 NumericalAnalysis MedicalSoftware Physics Robotics Spirituality Sports \
5878 ParallelComputing Amusement Archiving Compression Electronics Emulator \
5879 Engineering FileTools FileManager TerminalEmulator Filesystem Monitor \
5880 Security Accessibility Calculator Clock TextEditor Documentation Adult \
5881 Core KDE GNOME MATE XFCE GTK Qt Motif Java ConsoleOnly
5882 DESKTOP_CATEGORIES_RESERVED= Screensaver TrayIcon Applet Shell
5884 VALID_DESKTOP_CATEGORIES+= ${DESKTOP_CATEGORIES_MAIN} \
5885 ${DESKTOP_CATEGORIES_ADDITIONAL} \
5886 ${DESKTOP_CATEGORIES_RESERVED}
5888 .if defined(DESKTOP_ENTRIES)
5889 check-desktop-entries:
5890 @set -- ${DESKTOP_ENTRIES} XXX; \
5891 if [ `${EXPR} \( $$# - 1 \) % 6` -ne 0 ]; then \
5892 ${ECHO_MSG} "${PKGNAME}: Makefile error: the DESKTOP_ENTRIES list must contain one or more groups of 6 elements"; \
5896 while [ $$# -gt 6 ]; do \
5898 if [ -n "$$4" ]; then \
5899 entry="$$entry ($$4)"; \
5900 elif [ -n "$$1" ]; then \
5901 entry="$$entry ($$1)"; \
5903 if [ -z "$$1" ]; then \
5904 ${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 1 (Name) is empty"; \
5907 if ${ECHO_CMD} "$$3" | ${GREP} -iq '.\(png\|svg\|xpm\)$$'; then \
5908 if ! ${ECHO_CMD} "$$3" | ${GREP} -iq '^/'; then \
5909 ${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"; \
5912 if [ -z "$$4" ]; then \
5913 ${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 4 (Exec) is empty"; \
5916 if [ -n "$$5" ]; then \
5917 for c in `${ECHO_CMD} "$$5" | ${TR} ';' ' '`; do \
5918 if ! ${ECHO_CMD} ${VALID_DESKTOP_CATEGORIES} | ${GREP} -wq $$c; then \
5919 ${ECHO_CMD} "${PKGNAME}: Makefile warning: in desktop entry $$entry: category $$c is not a valid desktop category"; \
5922 if ! ${ECHO_CMD} "$$5" | ${GREP} -q "`${ECHO_CMD} ${DESKTOP_CATEGORIES_MAIN} | ${SED} -E 's,[[:blank:]]+,\\\|,g'`"; then \
5923 ${ECHO_CMD} "${PKGNAME}: Makefile warning: in desktop entry $$entry: field 5 (Categories) must contain at least one main desktop category (make -VDESKTOP_CATEGORIES_MAIN)"; \
5925 if ! ${ECHO_CMD} "$$5" | ${GREP} -q ';$$'; then \
5926 ${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 5 (Categories) does not end with a semicolon"; \
5930 if [ -z "`cd ${.CURDIR} && ${MAKE} desktop-categories`" ]; then \
5931 ${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 5 (Categories) is empty and could not be deduced from the CATEGORIES variable"; \
5935 if [ "x$$6" != "xtrue" ] && [ "x$$6" != "xfalse" ] && [ "x$$6" != "x" ]; then \
5936 ${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 6 (StartupNotify) is not \"true\", \"false\" or \"\"(empty)"; \
5940 num=`${EXPR} $$num + 1`; \
5944 .if !target(install-desktop-entries)
5945 .if defined(DESKTOP_ENTRIES)
5946 install-desktop-entries:
5947 @set -- ${DESKTOP_ENTRIES} XXX; \
5948 while [ $$# -gt 6 ]; do \
5949 filename="`${ECHO_CMD} "$$4" | ${SED} -e 's,^/,,g;s,[/ ],_,g;s,[^_[:alnum:]],,g'`.desktop"; \
5950 pathname="${STAGEDIR}${DESKTOPDIR}/$$filename"; \
5952 if [ -z "$$categories" ]; then \
5953 categories="`cd ${.CURDIR} && ${MAKE} desktop-categories`"; \
5955 ${ECHO_CMD} "${DESKTOPDIR}/$$filename" >> ${TMPPLIST}; \
5956 ${ECHO_CMD} "[Desktop Entry]" > $$pathname; \
5957 ${ECHO_CMD} "Type=Application" >> $$pathname; \
5958 ${ECHO_CMD} "Version=1.0" >> $$pathname; \
5959 ${ECHO_CMD} "Name=$$1" >> $$pathname; \
5961 if [ -z "$$2" ]; then \
5962 comment="`cd ${.CURDIR} && ${MAKE} -VCOMMENT`"; \
5964 ${ECHO_CMD} "GenericName=$$comment" >> $$pathname; \
5965 ${ECHO_CMD} "Comment=$$comment" >> $$pathname; \
5966 if [ -n "$$3" ]; then \
5967 ${ECHO_CMD} "Icon=$$3" >> $$pathname; \
5969 ${ECHO_CMD} "Exec=$$4" >> $$pathname; \
5970 ${ECHO_CMD} "Categories=$$categories" >> $$pathname; \
5971 if [ -n "$$6" ]; then \
5972 ${ECHO_CMD} "StartupNotify=$$6" >> $$pathname; \
5979 .if defined(WARNING)
5982 @${ECHO_MSG} "/!\\ WARNING /!\\"
5983 .for m in ${WARNING}
5987 @sleep ${WARNING_WAIT}
5990 .if defined(DEVELOPER)
5991 .if defined(DEV_WARNING)
5992 DEV_WARNING_WAIT?= 10
5994 @${ECHO_MSG} "/!\\ ${PKGNAME}: Makefile warnings, please consider fixing /!\\"
5996 .for m in ${DEV_WARNING}
6000 .if defined(DEV_WARNING_FATAL)
6003 @sleep ${DEV_WARNING_WAIT}
6007 .if defined(DEV_ERROR)
6009 @${ECHO_MSG} "/!\\ ${PKGNAME}: Makefile errors /!\\"
6011 .for m in ${DEV_ERROR}
6019 # Please note that the order of the following targets is important, and
6020 # should not be modified.
6022 _TARGETS_STAGES= SANITY PKG FETCH EXTRACT PATCH CONFIGURE BUILD INSTALL PACKAGE STAGE
6024 # Define the SEQ of actions to take when each target is ran, and which targets
6025 # it depends on before running its SEQ.
6027 _SANITY_SEQ= post-chroot pre-everything check-makefile \
6028 show-warnings show-dev-warnings show-dev-errors \
6029 check-categories check-makevars check-desktop-entries \
6030 check-depends identify-install-conflicts check-deprecated \
6031 check-vulnerable check-license check-config buildanyway-message \
6034 _PKG_DEP= check-sanity
6035 _PKG_SEQ= pkg-depends
6037 _FETCH_SEQ= fetch-depends pre-fetch pre-fetch-script \
6038 do-fetch fetch-specials post-fetch post-fetch-script
6040 _EXTRACT_SEQ= check-build-conflicts extract-message checksum extract-depends \
6041 clean-wrkdir ${WRKDIR} pre-extract pre-extract-script do-extract \
6042 post-extract post-extract-script
6044 _PATCH_SEQ= ask-license patch-message patch-depends pathfix dos2unix fix-shebang \
6046 pre-patch-script do-patch charsetfix-post-patch post-patch post-patch-script
6047 _CONFIGURE_DEP= patch
6048 _CONFIGURE_SEQ= build-depends lib-depends configure-message run-autotools-fixup \
6049 pre-configure pre-configure-script \
6050 run-autotools do-autoreconf patch-libtool do-configure \
6051 post-configure post-configure-script
6052 _BUILD_DEP= configure
6053 _BUILD_SEQ= build-message pre-build pre-build-script do-build \
6054 post-build post-build-script
6057 _STAGE_SEQ= stage-message stage-dir run-depends lib-depends apply-slist pre-install generate-plist \
6059 .if defined(NEED_ROOT)
6060 _STAGE_SUSEQ= create-users-groups do-install \
6062 webplugin-post-install post-install post-install-script \
6063 move-uniquefiles patch-lafiles post-stage compress-man \
6064 install-rc-script install-ldconfig-file install-license \
6065 install-desktop-entries add-plist-info add-plist-docs \
6066 add-plist-examples add-plist-data add-plist-post \
6067 move-uniquefiles-plist fix-packlist fix-perl-bs
6068 .if defined(DEVELOPER)
6069 _STAGE_SUSEQ+= stage-qa
6072 _STAGE_SEQ+= create-users-groups do-install \
6074 webplugin-post-install post-install post-install-script \
6075 move-uniquefiles patch-lafiles post-stage compress-man \
6076 install-rc-script install-ldconfig-file install-license \
6077 install-desktop-entries add-plist-info add-plist-docs \
6078 add-plist-examples add-plist-data add-plist-post \
6079 move-uniquefiles-plist fix-packlist fix-perl-bs
6080 .if defined(DEVELOPER)
6081 _STAGE_SEQ+= stage-qa
6085 _INSTALL_SEQ= install-message run-depends lib-depends check-already-installed
6086 _INSTALL_SUSEQ= fake-pkg security-check
6089 _PACKAGE_SEQ= package-message pre-package pre-package-script do-package post-package-script
6091 # Enforce order for -jN builds
6093 .for _t in ${_TARGETS_STAGES}
6094 . for s in ${_${_t}_SEQ}
6096 . if ! ${NOTPHONY:M${s}}
6097 _PHONY_TARGETS+= ${s}
6099 _${_t}_REAL_SEQ+= ${s}
6102 . for s in ${_${_t}_SUSEQ}
6104 . if ! ${NOTPHONY:M${s}}
6105 _PHONY_TARGETS+= ${s}
6107 _${_t}_REAL_SUSEQ+= ${s}
6110 .ORDER: ${_${_t}_DEP} ${_${_t}_REAL_SEQ}
6113 # Define all of the main targets which depend on a sequence of other targets.
6114 # See above *_SEQ and *_DEP. The _DEP will run before this defined target is
6115 # ran. The _SEQ will run as this target once _DEP is satisfied.
6117 .for target in extract patch configure build stage install package
6119 # Check if config dialog needs to show and execute it if needed. If is it not
6120 # needed (_OPTIONS_OK), then just depend on the cookie which is defined later
6121 # to depend on the *_DEP and execute the *_SEQ.
6122 # If options are required, execute config-conditional and then re-execute the
6123 # target noting that config is no longer needed.
6124 .if !target(${target}) && defined(_OPTIONS_OK)
6125 _PHONY_TARGETS+= ${target}
6126 ${target}: ${${target:tu}_COOKIE}
6127 .elif !target(${target})
6128 ${target}: config-conditional
6129 @cd ${.CURDIR} && ${MAKE} CONFIG_DONE_${UNIQUENAME:tu}=1 ${${target:tu}_COOKIE}
6130 .elif target(${target}) && defined(IGNORE)
6133 .if !exists(${${target:tu}_COOKIE})
6135 # Define the real target behavior. Depend on the target's *_DEP. Execute
6136 # the target's *_SEQ. Also handle su and USE_SUBMAKE needs.
6137 .if ${UID} != 0 && defined(_${target:tu}_REAL_SUSEQ) && !defined(INSTALL_AS_USER)
6138 . if defined(USE_SUBMAKE)
6139 ${${target:tu}_COOKIE}: ${_${target:tu}_DEP}
6140 @cd ${.CURDIR} && ${MAKE} ${_${target:tu}_REAL_SEQ}
6141 . else # !USE_SUBMAKE
6142 ${${target:tu}_COOKIE}: ${_${target:tu}_DEP} ${_${target:tu}_REAL_SEQ}
6143 . endif # USE_SUBMAKE
6144 @${ECHO_MSG} "===> Switching to root credentials for '${target}' target"
6146 ${SU_CMD} "${MAKE} ${_${target:tu}_REAL_SUSEQ}"
6147 @${ECHO_MSG} "===> Returning to user credentials"
6148 @${TOUCH} ${TOUCH_FLAGS} ${.TARGET}
6149 .else # No SU needed
6150 . if defined(USE_SUBMAKE)
6151 ${${target:tu}_COOKIE}: ${_${target:tu}_DEP}
6153 ${MAKE} ${_${target:tu}_REAL_SEQ} ${_${target:tu}_REAL_SUSEQ}
6154 @${TOUCH} ${TOUCH_FLAGS} ${.TARGET}
6155 . else # !USE_SUBMAKE
6156 ${${target:tu}_COOKIE}: ${_${target:tu}_DEP} ${_${target:tu}_REAL_SEQ} ${_${target:tu}_REAL_SUSEQ}
6157 @${TOUCH} ${TOUCH_FLAGS} ${.TARGET}
6158 . endif # USE_SUBMAKE
6161 .else # exists(cookie)
6162 ${${target:tu}_COOKIE}::
6163 @if [ -e ${.TARGET} ]; then \
6166 cd ${.CURDIR} && ${MAKE} ${.TARGET}; \
6168 .endif # !exists(cookie)
6170 .endfor # foreach(targets)
6172 .PHONY: ${_PHONY_TARGETS} check-sanity fetch pkg
6174 .if !target(check-sanity)
6175 check-sanity: ${_SANITY_REAL_SEQ}
6179 fetch: ${_FETCH_DEP} ${_FETCH_REAL_SEQ}
6183 pkg: ${_PKG_DEP} ${_PKG_REAL_SEQ}
6187 # End of post-makefile section.
6190 # End of the DESTDIR if statement