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
321 # WITHOUT_SSP - Disable SSP.
323 # SSP_CFLAGS - Defaults to -fstack-protector. This value
324 # is added to CFLAGS and the necessary flags
325 # are added to LDFLAGS. Note that SSP_UNSAFE
326 # can be used in Makefiles by port maintainers
327 # if a port breaks with it (it should be
330 # USE_BZIP2 - If set, this port tarballs use bzip2, not gzip, for
332 # USE_XZ - If set, this port tarballs use xz (or lzma)
334 # USE_GCC - If set, this port requires this version of gcc, either in
335 # the system or installed from a port.
336 # USE_CSTD - Override the default C language standard (gnu89, gnu99)
337 # USE_CXXSTD Override the default C++ language standard
338 # USE_BINUTILS - Use binutils suite from port instead of the version in base.
339 # CFLAGS_${ARCH} Append the cflags to CFLAGS only on the specified architecture
341 # Append the cxxflags to CXXFLAGS only on the specified architecture
344 # - If set, this port needs ghostscript to both
345 # build and run. If a number is specified,
346 # the specified version will be used.
347 # The valid value is '7', '8', or '9' in that case.
348 # USE_GHOSTSCRIPT_BUILD
349 # - If set, this port needs ghostscript to build.
350 # USE_GHOSTSCRIPT_RUN
351 # - If set, this port needs ghostscript to run.
353 # - The port that provides postscript functionality.
354 # Some installations may wish to override the default
355 # to specify a version without X11 and/or localized
356 # versions for their nationality.
357 # Default: print/ghostscript9
358 # WITH_GHOSTSCRIPT_VER
359 # - If set, the specified version of ghostscript will be
360 # used. The valid value is "7", "8", or "9". Note that
361 # this is for users, not for port maintainers. This
362 # should not be used in Makefile.
364 # USE_GL - A list of Mesa or GL related dependencies needed by the port.
365 # Supported components are: egl, glesv2, glut, glu, glw, and gl.
366 # If set to "yes", this is equivalent to "glu". Note that
367 # glew and glut depend on glu, glw and glu depend on gl.
369 # USE_SDL - If set, this port uses the sdl libraries.
370 # See bsd.sdl.mk for more information.
372 # USE_OPENSSL - If set, this port relies on the OpenSSL package.
374 # USE_OPENLDAP - If set, this port uses the OpenLDAP libraries.
375 # Implies: WANT_OPENLDAP_VER?=24
377 # - Legal values are: 23, 24
378 # If set to an unknown value, the port is marked BROKEN.
380 # - If set, the system should use OpenLDAP libraries
383 # USE_AUTOTOOLS - If set, this port uses various GNU autotools
384 # (libtool, autoconf, autoheader, automake et al.)
385 # See bsd.autotools.mk for more details.
387 # USE_FPC - If set, this port relies on the Free Pascal language.
388 # Implies inclusion of bsd.fpc.mk. (Also see
389 # that file for more information on WANT_FPC_*).
390 # USE_JAVA - If set, this port relies on the Java language.
391 # Implies inclusion of bsd.java.mk. (Also see
392 # that file for more information on USE_JAVA_*).
393 # USE_OCAML - If set, this port relies on the OCaml language.
394 # Implies inclusion of bsd.ocaml.mk. (Also see
395 # that file for more information on USE_OCAML*).
396 # USE_RUBY - If set, this port relies on the Ruby language.
397 # Implies inclusion of bsd.ruby.mk. (Also see
398 # that file for more information on USE_RUBY_*).
399 # USE_GNUSTEP - If set, this port relies on the GNUstep system.
400 # Implies the inclusion of bsd.gnustep.mk.
401 # (Also see that file for more information on
404 # USE_GECKO - If set, this port uses the Gecko/Mozilla product.
405 # See bsd.gecko.mk for more details.
407 # USE_GNOME - A list of the Gnome dependencies the port has (e.g.,
408 # glib12, gtk12). Implies that the port needs Gnome.
409 # Implies inclusion of bsd.gnome.mk. See bsd.gnome.mk
410 # or http://www.FreeBSD.org/gnome/docs/porting.html
413 # USE_MATE - A list of the MATE dependencies the port has. Implies
414 # that the port needs MATE. Implies inclusion of
415 # bsd.mate.mk. See bsd.mate.mk for more details.
417 # USE_WX - If set, this port uses the WxWidgets library and related
418 # components. See bsd.wx.mk for more details.
420 # USE_KDE4 - A list of the KDE 4 dependencies the port has (e.g.,
421 # kdelibs, kdebase). Implies that the port needs KDE.
422 # Implies inclusion of bsd.kde4.mk. See bsd.kde4.mk
425 # USE_QT4 - A list of the Qt 4 dependencies the port has (e.g,
426 # corelib, webkit). Implies that the port needs Qt.
427 # Implies the inclusion of bsd.qt.mk. See bsd.qt.mk
430 # USE_QT5 - A list of the Qt 5 dependencies the port has (e.g,
431 # core, webkit). Implies that the port needs Qt.
432 # Implies the inclusion of bsd.qt.mk. See bsd.qt.mk
435 # USE_LINUX - Set to yes to say the port needs the default linux base port.
436 # Set to value <X>, if the port needs emulators/linux_base-<X>.
437 # Implies appropriate settings for STRIP and STRIP_CMD.
439 # - controls the action of PREFIX (see above). Only use this
440 # if the port is a linux infrastructure port (e.g. contains libs
441 # or a sound server which supports the FreeBSD native one),
442 # use the default or the X11 prefix if it's a leaf port
443 # (e.g. a game or program).
444 # Implies NO_MTREE=yes, and, if USE_LDCONFIG is defined:
446 # - appropriate invocation of the Linux ldconfig
447 # USE_LINUX_RPM - Set to yes to pull in variables and targets useful to Linux
449 # Implies inclusion of bsd.linux-rpm.mk.
451 # LINUX_OSRELEASE - Contains the value of compat.linux.osrelease sysctl.
452 # Will be used to distinguish which linux
453 # infrastructure ports should be used.
454 # Valid values: 2.6.16.
456 # - Set to yes to enable automatic packing list generation.
457 # Currently has no effect unless USE_LINUX_RPM is set.
459 # OVERRIDE_LINUX_BASE_PORT
460 # - This specifies the default linux base to use, for valid
461 # values have a look at the description of USE_LINUX. This is
462 # an user-only variable. Don't use it in any port, it's meant
463 # to be used in make.conf.
466 # - This is a read-only variable, it gets set to a value which is
467 # usable in *_DEPENDS (e.g. BUILD_DEPENDS=${LINUX_BASE_PORT}).
468 # It honors USE_LINUX=foo and OVERRIDE_LINUX_BASE_PORT.
470 # USE_XORG - Set to a list of X.org module dependencies.
471 # Implies inclusion of bsd.xorg.mk.
473 # USE_TEX - A list of the TeX dependencies the port has.
476 # USE_RC_SUBR - If set, the ports startup/shutdown script uses the common
477 # routines found in /etc/rc.subr.
478 # If this is set to a list of files, these files will be
479 # automatically added to ${SUB_FILES}, some %%VAR%%'s will
480 # automatically be expanded, they will be installed in
481 # ${PREFIX}/etc/rc.d and added to the packing list.
482 # USE_RCORDER - List of rc.d startup scripts to be called early in the boot
483 # process. This acts exactly like USE_RC_SUBR except that
484 # scripts are installed in /etc/rc.d.
485 # Because local rc.d scripts are included in the base rcorder
486 # this option is not needed unless the port installs in the base.
488 # USE_APACHE - If set, this port relies on an apache webserver.
490 # Conflict checking. Use if your port cannot be installed at the same time as
493 # CONFLICTS - A list of package name patterns that the port conflicts
494 # with, separated by blanks. The names may include shell
495 # pattern meta-characters "*", "?", "[", "]", and "!".
496 # Example: apache*-1.2* apache*-1.3.[012345] apache-*+ssl_*
499 # - Check conflict prior to the build.
502 # - Check conflict prior to the installation stage.
504 # Various directory definitions and variables to control them.
505 # You rarely need to redefine any of these except WRKSRC and NO_WRKSUBDIR.
507 # LOCALBASE - Where non-X11 ports install things.
508 # Default: /usr/local
509 # LINUXBASE - Where Linux ports install things.
510 # Default: /compat/linux
511 # PREFIX - Where *this* port installs its files.
512 # Default: ${LINUXBASE} if USE_LINUX_PREFIX is set,
513 # otherwise ${LOCALBASE}
516 # - There are some sanity checks against PREFIX.
517 # You can disable these checks with defining
518 # this variable, but this is not recommended!
519 # Only do this if you really know what you are
520 # doing. These sanity checks are the following:
521 # - PREFIX has to be an absolute path.
522 # - PREFIX can't have a trailing slash.
524 # MASTERDIR - Where the port finds patches, package files, etc. Define
525 # this is you have two or more ports that share most of the
527 # Default: ${.CURDIR}
528 # PORTSDIR - The root of the ports tree.
529 # Default: /usr/ports
530 # DISTDIR - Where to search for and store copies of original sources
531 # Default: ${PORTSDIR}/distfiles
532 # PACKAGES - A top level directory where all packages go (rather than
533 # going locally to each port).
534 # Default: ${PORTSDIR}/packages
535 # WRKDIRPREFIX - The place to root the temporary working directory
538 # WRKDIR - A temporary working directory that gets *clobbered* on clean
539 # Default: ${WRKDIRPREFIX}${.CURDIR}/work
540 # WRKSRC - A subdirectory of ${WRKDIR} where the distribution actually
542 # Default: ${WRKDIR}/${DISTNAME} unless NO_WRKSUBDIR is set,
543 # in which case simply ${WRKDIR}
544 # WRKSRC_SUBDIR - A subdirectory of ${WRKSRC} where the distribution actually
547 # NO_WRKSUBDIR - Assume port unpacks directly into ${WRKDIR}.
548 # PATCHDIR - A directory containing any additional patches you made
549 # to port this software to FreeBSD.
550 # Default: ${MASTERDIR}/files
551 # SCRIPTDIR - A directory containing any auxiliary scripts
552 # Default: ${MASTERDIR}/scripts
553 # FILESDIR - A directory containing any miscellaneous additional files.
554 # Default: ${MASTERDIR}/files
555 # DFLY_PATCHDIR= - A directory containing additional patches required
556 # to build port on DragonFly
557 # Default: ${MASTERDIR}/dragonfly
558 # DFLY_FILESDIR - A directory containing any miscellaneous files
559 # needed to build port on DragonFly
560 # Default: ${MASTERDIR}/dragonfly
561 # PKGDIR - A directory containing any package creation files.
562 # Default: ${MASTERDIR}
563 # SRC_BASE - The root of the src tree. (Some ports require this to get
564 # kernel sources). Default: /usr/src
565 # UID_FILES - A list of files containing information about registered UIDs.
566 # Note that files have decreasing priority.
567 # GID_FILES - A list of files containing information about registered GIDs.
568 # Note that files have decreasing priority.
570 # Variables that serve as convenient "aliases" for your *-install targets.
571 # Use these like: "${INSTALL_PROGRAM} ${WRKSRC}/prog ${PREFIX}/bin".
574 # - A command to install binary executables. (By
575 # default, also strips them, unless ${STRIP} is
576 # overridden to be the empty string).
577 # INSTALL_KLD - As INSTALL_PROGRAM, but without the STRIP.
578 # INSTALL_LIB - As INSTALL_DATA, but also strips the file.
580 # - A command to install executable scripts.
581 # INSTALL_DATA - A command to install sharable data.
582 # INSTALL_MAN - A command to install manpages.
585 # - Similiar to INSTALL_PROGRAM and INSTALL_DATA commands but
586 # working on whole trees of directories, takes 3 arguments,
587 # last one is find(1) arguments and optional.
589 # cd ${WRKSRC}/doc && ${COPYTREE_SHARE} . ${DOCSDIR} "! -name *\.bak"
591 # Installs all directories and files from ${WRKSRC}/doc
592 # to ${DOCSDIR} except sed backup files.
594 # MANPREFIX - The directory prefix for ${MAN<sect>} and ${MLINKS}.
597 # - If manual pages of some sections install in different
598 # locations than others, use these.
599 # Default: ${MANPREFIX}
601 # Set the following to specify all .info files your port installs.
603 # INFO - A list of .info files (omitting the trailing ".info");
604 # only one entry per document! These files are listed in
605 # the path relative to ${INFO_PATH}.
606 # INFO_PATH - Path, where all .info files will be installed by your
607 # port, relative to ${PREFIX}
608 # Default: "share/info" if ${PREFIX} is equal to /usr
609 # and "info" otherwise.
611 # Set the following to specify all documentation your port installs into
614 # PORTDOCS - A list of files and directories relative to DOCSDIR.
615 # Shell glob patterns can be used, directories include
616 # the entire subtree of contained files and directories.
617 # Should not be set when no documentation files are
619 # Useful for dynamically generated documentation.
621 # Set the following to specify all documentation your port installs into
624 # PORTEXAMPLES - A list of files and directories relative to EXAMPLESDIR.
625 # Shell glob patterns can be used, directories include
626 # the entire subtree of contained files and directories.
627 # Should not be set when no examples files are
629 # Useful for dynamically generated examples.
631 # Set the following to specify all files and directories your port installs into
634 # PORTDATA - A list of files and directories relative to DATADIR.
635 # Shell glob patterns can be used, directories include
636 # the entire subtree of contained files and directories.
637 # Should not be set when no data files are
639 # Useful for dynamically generated data files.
641 # Default targets and their behaviors:
643 # fetch - Retrieves missing ${DISTFILES} and ${PATCHFILES} for this
645 # fetch-list - Show list of commands to retrieve missing ${DISTFILES} and
646 # ${PATCHFILES} for this port.
648 # - Retrieves missing ${DISTFILES} and ${PATCHFILES} for this
649 # port and dependencies.
650 # fetch-recursive-list
651 # - Show list of commands to retrieve missing ${DISTFILES} and
652 # ${PATCHFILES} for this port and dependencies.
654 # - Retrieves missing ${DISTFILES} and ${PATCHFILES} for this
655 # port and dependencies.
656 # fetch-required-list
657 # - Show list of commands to retrieve missing ${DISTFILES} and
658 # ${PATCHFILES} for this port and dependencies.
660 # - Show list of URLS to retrieve missing ${DISTFILES} and
661 # ${PATCHFILES} for this port.
663 # - Show list of URLS to retrieve ${DISTFILES} and
664 # ${PATCHFILES} for this port.
667 # - Show all directories which are dependencies
670 # - Show all directories which are build-dependencies
672 # package-depends-list
673 # - Show all directories which are package-dependencies
674 # for this port. This is based upon the dependency
675 # tree as recorded in the Makefiles of the ports
676 # collection, not as recorded in the currently
678 # actual-package-depends
679 # - Like package-depends-list but with the difference
680 # that the dependencies of the currently installed
681 # ports are used instead of the dependencies as
682 # recorded in the ports collection.
684 # - Show all directories which are run-dependencies
687 # extract - Unpacks ${DISTFILES} into ${WRKDIR}.
688 # patch - Apply any provided patches to the source.
689 # configure - Runs either GNU configure, one or more local configure
690 # scripts or nothing, depending on what's available.
691 # build - Actually compile the sources.
692 # install - Install the results of a build.
693 # reinstall - Install the results of a build, ignoring "already installed"
695 # deinstall - Remove the installation.
696 # deinstall-all - Remove all installations with the same PKGORIGIN.
697 # package - Create a package from an _installed_ port.
699 # - Create a package for a port and _all_ of its dependencies.
700 # describe - Try to generate a one-line description for each port for
701 # use in INDEX files and the like.
702 # checkpatch - Do a "patch -C" instead of a "patch". Note that it may
703 # give incorrect results if multiple patches deal with
705 # checksum - Use distinfo to ensure that your distfiles are valid.
707 # - Run checksum in this port and all dependencies.
708 # makesum - Generate distinfo (only do this for your own ports!).
709 # clean - Remove ${WRKDIR} and other temporary files used for building.
710 # clean-depends - Do a "make clean" for all dependencies.
711 # config - Configure options for this port (using ${DIALOG}).
712 # Automatically run prior to extract, patch, configure, build,
713 # install, and package.
715 # - Configure options for this port for a port and all its
717 # showconfig - Display options config for this port.
718 # showconfig-recursive
719 # - Display options config for this port and all its
721 # rmconfig - Remove the options config for this port.
723 # - Remove the options config for this port and all its
726 # Default sequence for "all" is:
728 # check-sanity fetch checksum extract patch configure build
730 # Please read the comments in the targets section below; you
731 # should be able to use the pre-* or post-* targets/scripts
732 # (which are available for every stage except checksum) or
733 # override the do-* targets to do pretty much anything you want.
735 # NEVER override the "regular" targets unless you want to open
736 # a major can of worms.
738 # Set these variables if your port doesn't need some of the steps.
739 # Note that there are no NO_PATCH or NO_CONFIGURE variables because
740 # those steps are empty by default. NO_EXTRACT is not allowed anymore
741 # since we need to at least create ${WRKDIR}. Also, NO_CHECKSUM is a user
742 # variable and is not to be set in a port's Makefile. See above for NO_PACKAGE.
744 # NO_BUILD - Use a dummy (do-nothing) build target.
745 # NO_INSTALL - Use a dummy (do-nothing) install target.
747 # Here are some variables used in various stages.
749 # For options see bsd.options.mk
753 # FETCH_BINARY - Path to ftp/http fetch command if not in $PATH.
754 # Default: "/usr/bin/fetch"
755 # FETCH_ARGS - Arguments to ftp/http fetch command.
757 # FETCH_CMD - ftp/http fetch command.
758 # Default: ${FETCH_BINARY} ${FETCH_ARGS}
760 # - Arguments to ${FETCH_CMD} before filename.
763 # - Arguments to ${FETCH_CMD} following filename.
765 # FETCH_ENV - Environment to pass to ${FETCH_CMD}.
767 # FETCH_REGET - Times to retry fetching of files on checksum errors.
770 # - Disable package dependency in fetch target for mass
771 # fetching. User settable.
775 # EXTRACT_CMD - Command for extracting archive
777 # EXTRACT_BEFORE_ARGS
778 # - Arguments to ${EXTRACT_CMD} before filename.
781 # - Arguments to ${EXTRACT_CMD} following filename.
782 # Default: "--no-same-owner --no-same-permissions"
785 # EXTRA_PATCHES - Define this variable if you have patches not in
786 # ${PATCHDIR}. This usually happens when you need to
787 # do some pre-processing before some distribution
788 # patches can be applied. In that case, fetch them as
789 # extra distfiles, put the processed results in
790 # ${WRKDIR}, then point EXTRA_PATCHES to them.
791 # The patches specified by this variable will be
792 # applied after the normal distribution patches but
793 # before those in ${PATCHDIR}.
794 # PATCH_WRKSRC - Directory to apply patches in.
799 # HAS_CONFIGURE - If set, this port has its own configure script. The
800 # configure stage will not do anything if this is not set.
801 # GNU_CONFIGURE - If set, you are using GNU configure (optional). Implies
804 # - Directory to run configure in.
807 # - Name of configure script, relative to ${CONFIGURE_WRKSRC}.
808 # Default: "Makefile.PL" if USES=perl5 and USE_PERL5=configure
809 # are set, "configure" otherwise.
811 # - The name of target to call when GNU_CONFIGURE is
813 # Default: ${ARCH}-portbld-${OPSYS:tl}${OSREL}
814 # GNU_CONFIGURE_PREFIX
815 # - The directory passed as prefix to the configure script if
816 # GNU_CONFIGURE is set.
819 # - Pass these args to configure if ${HAS_CONFIGURE} is set.
820 # Default: "--prefix=${GNU_CONFIGURE_PREFIX} --infodir=${PREFIX}/${INFO_PATH}
821 # --mandir=${MANPREFIX}/man --build=${CONFIGURE_TARGET}" if
822 # GNU_CONFIGURE is set, "CC=${CC} CFLAGS=${CFLAGS}
823 # PREFIX=${PREFIX} INSTALLPRIVLIB=${PREFIX}/lib
824 # INSTALLARCHLIB=${PREFIX}/lib" if USES=perl5 and
825 # USE_PERL5=configure are set, empty otherwise.
826 # CONFIGURE_ENV - Pass these env (shell-like) to configure if
827 # ${HAS_CONFIGURE} is set.
828 # CONFIGURE_LOG - The name of configure log file. It will be printed to
829 # the screen if configure fails.
830 # Default: config.log
831 # CONFIGURE_FAIL_MESSAGE
832 # - A message displayed to users when configure
833 # fails (note: this assumes the do-configure
834 # target has not been overwritten). This message
835 # will be passed through /usr/bin/fmt before
836 # being shown to the user.
838 # WITHOUT_FBSD10_FIX Disable FreeBSD 10.0 autotools workaround.
840 # For build and install:
842 # MAKEFILE - Name of the makefile.
844 # ALL_TARGET - Default target for sub-make in build stage.
846 # BUILD_WRKSRC - Directory to do build in (default: ${WRKSRC}).
847 # MAKE_ENV - Additional environment vars passed to sub-make in build
848 # and install stages.
850 # MAKE_ARGS - Any extra arguments to sub-make in build and install stages.
854 # - Disallow multiple jobs even when user set a global override.
855 # To be used with known bad ports.
857 # - Set to disable the multiple jobs feature. User settable.
859 # - Override the number of make jobs to be used. User settable.
860 # MAKE_JOBS_NUMBER_LIMIT
861 # - Set a limit for maximum number of make jobs allowed to be
866 # - Enable CCACHE support (devel/ccache). User settable.
868 # - Which directory to use for ccache (default: $HOME/.ccache)
870 # - Disable CCACHE support for example for certain ports if
871 # CCACHE is enabled. User settable.
876 # - Default target for sub-make in install stage.
879 # - Directory to install from
881 # NO_MTREE - If set, will not invoke mtree from bsd.port.mk from
882 # the "install" target.
883 # MTREE_FILE - The name of the mtree file.
884 # Default: ${PORTSDIR}/Templates/BSD.local.dist or
885 # /etc/mtree/BSD.usr.dist if ${PREFIX} == "/usr".
886 # PLIST_DIRS - Directories to be added to packing list
887 # PLIST_FILES - Files and symbolic links to be added to packing list
889 # PLIST - Name of the `packing list' file.
890 # Change this to ${WRKDIR}/PLIST or something if you
891 # need to write to it. (It is not a good idea for a port
892 # to write to any file outside ${WRKDIR} during a normal
894 # Default: ${PKGDIR}/pkg-plist
895 # TMPPLIST - Name of the `packing list' file after processing
896 # Default: ${WRKDIR}/.PLIST.mktmp
897 # PLIST_SUB - List of "variable=value" pair for substitution in ${PLIST}
900 # SUB_FILES - Files that should be passed through sed and redirected to
902 # - For each file specified in SUB_FILES, there must be a
903 # corresponding file in ${FILESDIR} whose suffix is ".in". For
904 # instance, if the Makefile specifies "SUB_FILES= pkg-message"
905 # then there must be a file called pkg-message.in in
907 # - The substitution process is the same as PLIST_FILES, as
908 # described below except that any line beginning with @comment
910 # SUB_LIST - List of "variable=value" pair for substitution in ${SUB_FILES}
911 # Some pairs are added by default: eg. PREFIX=${PREFIX}
913 # USE_LDCONFIG - If set to "yes", this adds ${PREFIX}/lib to the list of
914 # directories to be searched for shared libraries.
915 # Otherwise, this is a list of directories to be added to that
916 # list. The directory names are written to
917 # ${LOCALBASE}/libdata/ldconfig/${UNIQUENAME} which is then
918 # used by the ldconfig startup script.
919 # This mechanism replaces ldconfig scripts installed by some
920 # ports, often under such names as 000.${UNQUENAME}.sh.
921 # If USE_LINUX_PREFIX is defined, the Linux version of
922 # ldconfig will be used instead of the native FreeBSD
923 # version, and the directory list given will be ignored.
925 # - Same as USE_LDCONFIG but the target file is
926 # ${LOCALBASE}/libdata/ldconfig32/${UNIQUENAME} instead.
927 # Note: that should only be used on 64-bit architectures.
929 # DOCSDIR - Name of the directory to install the packages docs in.
930 # Default: ${PREFIX}/share/doc/${PORTNAME}
931 # DOCSDIR_REL - The DOCSDIR relative to ${PREFIX}
932 # EXAMPLESDIR - Name of the directory to install the packages examples in.
933 # Default: ${PREFIX}/share/examples/${PORTNAME}
935 # - The EXAMPLESDIR relative to ${PREFIX}
936 # DATADIR - Name of the directory to install the packages shared data in.
937 # Default: ${PREFIX}/share/${PORTNAME}
938 # DATADIR_REL - The DATADIR relative to ${PREFIX}
940 # WWWDIR - Name of the directory to install the packages www data in.
941 # Default: ${PREFIX}/www/${PORTNAME}
942 # WWWDIR_REL - The WWWDIR relative to ${PREFIX}
944 # USERS - List of users to create at install time. Each login must
945 # have a corresponding entry in ${UID_FILES}.
946 # GROUPS - List of groups to create at install time. Each group must
947 # have a corresponding entry in ${GID_FILES}.
949 # DESKTOPDIR - Name of the directory to install ${DESKTOP_ENTRIES} in.
950 # Default: ${PREFIX}/share/applications
952 # - List of desktop entry files to generate and install in
953 # ${DESKTOPDIR}. The format is
954 # "Name" "Comment" "Icon" "Exec" "Categories" StartupNotify
956 # * Only add desktop entries for applications which do not
957 # require a terminal (ie. X applications).
958 # * If the upstream distribution already installs .desktop
959 # files, you do not need to use this.
960 # * If you require a more elaborate .desktop file than this
961 # variable permits, write it yourself and install it
964 # * Comment, Icon and StartupNotify may be empty
965 # strings (""). Categories may be an empty string in some
966 # cases (see below). The other fields are mandatory.
967 # * If Comment is an empty string, port ${COMMENT} will be
969 # * If set, Icon must be either absolute path (usually
970 # ${PREFIX}/share/pixmaps/${PORTNAME}.png) or icon name
971 # without extension if installed icons follow Icon Theme
973 # * If Categories is an empty string, bsd.port.mk will try
974 # to deduce a default value using the CATEGORIES variable.
975 # If the deduction fails, you will have to set Categories
976 # manually. You should check the generated value using
977 # "make desktop-categories", and override it if necessary.
978 # * Exec will also be used to name the .desktop file.
979 # * StartupNotify may be true, false or empty (see Desktop
980 # Entry Specification for details).
981 # * The files will be automatically added to ${PLIST}.
983 # "X Window Information" \
984 # "Get information about X windows" \
985 # "${PREFIX}/share/pixmaps/wininfo.png" \
986 # "${PREFIX}/bin/wininfo" \
989 # See http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html
990 # for an explanation of the fields. If you need to create more
991 # than one file, just chain them into a single variable.
993 # Note that the install target will automatically add manpages (see
994 # above) and also substitute special sequences of characters (delimited
995 # by "%%") as defined in PLIST_SUB to generate ${TMPPLIST}. For
996 # instance, "OSREL=${OSREL}" in PLIST_SUB causes all occurrences of
997 # "%%OSREL%%" in ${PLIST} to be substituted by the value of OSREL.
998 # ${TMPPLIST} is generated before the do-install stage. If you are
999 # generating the packing list on-the-fly, make sure it's generated before
1000 # do-install is called!
1004 # LATEST_LINK - Install the "Latest" link for the package as ___. Define
1005 # this if the "Latest" link name will be incorrectly determined.
1007 # This is used in all stages:
1009 # SCRIPTS_ENV - Additional environment vars passed to scripts in
1010 # ${SCRIPTDIR} executed by bsd.port.mk.
1011 # Default: see below
1013 # Finally, variables to change if you want a special behavior. These
1014 # are for debugging purposes. Don't set them in your Makefile.
1016 # ECHO_MSG - Used to print all the '===>' style prompts - override this
1018 # Default: ${ECHO_CMD}
1019 # PATCH_DEBUG - If set, print out more information about the patches as
1020 # it attempts to apply them.
1021 # PKG_DBDIR - Where package installation is recorded; this directory
1022 # must not contain anything else.
1023 # Default: /var/db/pkg
1024 # PORT_DBDIR - Where port configuration options are recorded.
1025 # Default: /var/db/ports
1027 # - Don't register a port installation as a package.
1028 # FORCE_PKG_REGISTER
1029 # - If set, it will overwrite any existing package
1030 # registration information in ${PKG_DBDIR}/${PKGNAME}.
1031 # NO_DEPENDS - Don't verify build of dependencies.
1032 # CHECKSUM_ALGORITHMS
1033 # - Different checksum algorithms to check for verifying the
1034 # integrity of the distfiles. The absence of the algorithm
1035 # in distinfo doesn't make it fail.
1037 # NO_CHECKSUM - Don't verify the checksum. Typically used when
1038 # when you noticed the distfile you just fetched has
1039 # a different checksum and you intend to verify if
1040 # the port still works with it.
1041 # USE_PACKAGE_DEPENDS
1042 # - Try to install dependencies from existing packages instead
1043 # of building the port from scratch. Fallback on source
1044 # if an existing package is not present.
1045 # USE_PACKAGE_DEPENDS_ONLY
1046 # - Like USE_PACKAGE_DEPENDS, but do not fallback on source.
1048 # - Define this to install as the current user, intended
1049 # for systems where you have no root access.
1050 # DISABLE_SIZE - Do not check the size of a distfile even if the SIZE field
1051 # has been specified in distinfo. This is useful
1052 # when using an alternate FETCH_CMD.
1054 # End of the list of all variables that need to be defined in a port.
1055 # Most port authors should not need to understand anything after this point.
1058 # These need to be absolute since we don't know how deep in the ports
1059 # tree we are and thus can't go relative. They can, of course, be overridden
1060 # by individual Makefiles or local system make configuration.
1062 WITHOUT_FBSD10_FIX?= yes
1063 DFLY_PATCHDIR?= ${MASTERDIR}/dragonfly
1064 DFLY_FILESDIR?= ${MASTERDIR}/dragonfly
1065 PORTSDIR?= /usr/dports
1066 LOCALBASE?= /usr/local
1067 LINUXBASE?= /compat/linux
1068 DISTDIR?= /usr/distfiles
1069 WRKDIRPREFIX?= /usr/obj/dports
1070 _DISTDIR?= ${DISTDIR}/${DIST_SUBDIR}
1071 INDEXDIR?= ${PORTSDIR}
1073 USESDIR?= ${PORTSDIR}/Mk/Uses
1074 SCRIPTSDIR?= ${PORTSDIR}/Mk/Scripts
1075 LIB_DIRS?= /lib /usr/lib ${LOCALBASE}/lib
1076 STAGEDIR?= ${WRKDIR}/stage
1078 PKG_ENV+= PORTSDIR=${PORTSDIR}
1079 CONFIGURE_ENV+= XDG_DATA_HOME=${WRKDIR} \
1080 XDG_CONFIG_HOME=${WRKDIR} \
1082 MAKE_ENV+= XDG_DATA_HOME=${WRKDIR} \
1083 XDG_CONFIG_HOME=${WRKDIR} \
1085 QA_ENV+= STAGEDIR=${STAGEDIR} \
1087 LINUXBASE=${LINUXBASE} \
1088 LOCALBASE=${LOCALBASE} \
1090 TMPPLIST=${TMPPLIST}
1091 CO_ENV+= STAGEDIR=${STAGEDIR} \
1093 LOCALBASE=${LOCALBASE} \
1096 MTREE_FILE=${MTREE_FILE} \
1097 TMPPLIST=${TMPPLIST} \
1098 SCRIPTSDIR=${SCRIPTSDIR} \
1099 PLIST_SUB_SED="${PLIST_SUB_SED}" \
1100 PORT_OPTIONS="${PORT_OPTIONS}" \
1101 PORTSDIR="${PORTSDIR}"
1102 MINIMAL_PKG_VERSION= 1.3.8
1104 # make sure bmake treats -V as expected
1105 .MAKE.EXPAND_VARIABLES= yes
1107 .include "${PORTSDIR}/Mk/bsd.commands.mk"
1109 .if defined(NO_STAGE)
1111 DEPRECATED?= Not staged. See http://lists.freebsd.org/pipermail/freebsd-ports-announce/2014-May/000080.html
1112 EXPIRATION_DATE?= 2014-08-31
1115 .if defined(X_BUILD_FOR)
1116 .if !defined(.PARSEDIR)
1117 IGNORE= Cross building can only be done when using bmake(1) as make(1)
1119 BUILD_DEPENDS= ${X_BUILD_FOR}-cc:${PORTSDIR}/devel/${X_BUILD_FOR}-xdev
1120 # Do not define CPP on purpose
1125 .if !exists(/usr/${X_BUILD_FOR}/usr/bin/cc)
1126 X_SYSROOT= ${LOCALBASE}/${X_BUILD_FOR}
1128 X_SYSROOT= /usr/${X_BUILD_FOR}
1130 CC= ${X_SYSROOT}/usr/bin/cc
1131 CXX= ${X_SYSROOT}/usr/bin/c++
1132 PKG_ENV+= ABI_FILE=${X_SYSROOT}/usr/lib/crt1.o
1133 NM= ${X_BUILD_FOR}-nm
1134 STRIP_CMD= ${X_BUILD_FOR}-strip
1135 MAKE_ENV+= NM=${NM} STRIPBIN=${X_BUILD_FOR}-strip PKG_CONFIG_SYSROOT_DIR="${X_SYSROOT}"
1136 CONFIGURE_ENV+= PKG_CONFIG_SYSROOT_DIR="${X_SYSROOT}"
1137 # only bmake support the below
1138 STRIPBIN= ${STRIP_CMD}
1139 .export.env STRIPBIN
1143 # DESTDIR section to start a chrooted process if invoked with DESTDIR set
1146 .if defined(DESTDIR) && !empty(DESTDIR) && !defined(CHROOTED) && \
1147 !defined(BEFOREPORTMK) && !defined(INOPTIONSMK)
1149 .include "${PORTSDIR}/Mk/bsd.destdir.mk"
1153 # Look for files named "*.orig" under ${PATCH_WRKSRC} and (re-)generate
1154 # ${PATCHDIR}/patch-* files from them. By popular demand, we currently
1155 # use '_' (underscore) to replace path separators in patch file names.
1157 # If a file name happens to contain character which is also a separator
1158 # replacement character, it will be doubled in the resulting patch name.
1160 # To minimize gratuitous patch renames, newly generated patches will be
1161 # written under existing file names when they use any of the previously
1162 # common path separators ([-+_]) or legacy double underscore (__).
1164 .if !target(makepatch)
1165 PATCH_PATH_SEPARATOR= _
1167 @${MKDIR} ${PATCHDIR}
1168 @(cd ${PATCH_WRKSRC}; \
1169 for f in `${FIND} -s . -type f -name '*.orig'`; do \
1171 NEW=$${ORIG%.orig}; \
1172 cmp -s $${ORIG} $${NEW} && continue; \
1173 ! for _lps in `${ECHO} _ - + | ${SED} -e \
1174 's|${PATCH_PATH_SEPARATOR}|__|'`; do \
1175 PATCH=`${ECHO} $${NEW} | ${SED} -e "s|/|$${_lps}|g"`; \
1176 test -f "${PATCHDIR}/patch-$${PATCH}" && break; \
1177 done || ${ECHO} $${_SEEN} | ${GREP} -q /$${PATCH} && { \
1178 PATCH=`${ECHO} $${NEW} | ${SED} -e \
1179 's|${PATCH_PATH_SEPARATOR}|&&|g' -e \
1180 's|/|${PATCH_PATH_SEPARATOR}|g'`; \
1181 _SEEN=$${_SEEN}/$${PATCH}; \
1183 OUT=${PATCHDIR}/patch-$${PATCH}; \
1184 ${ECHO} ${DIFF} -udp $${ORIG} $${NEW} '>' $${OUT}; \
1185 TZ=UTC ${DIFF} -udp $${ORIG} $${NEW} | ${SED} -e \
1186 '/^---/s|\.[0-9]* +0000$$| UTC|' -e \
1187 '/^+++/s|\([[:blank:]][-0-9:.+]*\)*$$||' \
1188 > $${OUT} || ${TRUE}; \
1194 # Start of options section
1195 .if defined(INOPTIONSMK) || ( !defined(USEOPTIONSMK) && !defined(AFTERPORTMK) )
1198 # Get the default maintainer
1199 MAINTAINER?= ports@FreeBSD.org
1201 # Get the architecture
1206 # Get the operating system type
1213 # Get the operating system revision
1214 OSREL?= ${UNAMER:C/-.*//}
1216 # Get __FreeBSD_version
1217 .if !defined(OSVERSION)
1221 .if !defined(DFLYVERSION)
1222 .if exists(/usr/include/sys/param.h)
1223 DFLYVERSION!= ${AWK} '/^\#define[[:blank:]]__DragonFly_version/ {print $$3}' < /usr/include/sys/param.h
1224 OSREL!= ${ECHO} ${DFLYVERSION} | ${AWK} '{a=int($$1/100000); b=int(($$1-(a*100000))/100); print a "." b}'
1226 .error Unable to determine OS version. Either define OSVERSION, install /usr/include/sys/param.h or define SRC_BASE.
1230 # Only define tools here (for transition period with between pkg tools)
1231 .include "${PORTSDIR}/Mk/bsd.commands.mk"
1233 .if exists(${PKG_BIN})
1234 .if !defined(_PKG_VERSION)
1235 _PKG_VERSION!= ${PKG_BIN} -v
1237 _PKG_STATUS!= ${PKG_BIN} version -t ${_PKG_VERSION:C/-.*//g} ${MINIMAL_PKG_VERSION}
1238 .if ${_PKG_STATUS} == "<"
1239 IGNORE= pkg(8) must be version ${MINIMAL_PKG_VERSION} or greater, but you have ${_PKG_VERSION}. You must upgrade the ${PKG_ORIGIN} port first
1243 MASTERDIR?= ${.CURDIR}
1245 .if ${MASTERDIR} != ${.CURDIR}
1247 MASTER_PORT?=${MASTERDIR:C/[^\/]+\/\.\.\///:C/[^\/]+\/\.\.\///:C/^.*\/([^\/]+\/[^\/]+)$/\\1/}
1253 # If they exist, include Makefile.inc, then architecture/operating
1254 # system specific Makefiles, then local Makefile.local.
1256 .if ${MASTERDIR} != ${.CURDIR} && exists(${.CURDIR}/../Makefile.inc)
1257 .include "${.CURDIR}/../Makefile.inc"
1261 .if exists(${MASTERDIR}/../Makefile.inc)
1262 .include "${MASTERDIR}/../Makefile.inc"
1266 .if exists(${MASTERDIR}/Makefile.${ARCH}-${OPSYS})
1267 .include "${MASTERDIR}/Makefile.${ARCH}-${OPSYS}"
1269 .elif exists(${MASTERDIR}/Makefile.${OPSYS})
1270 .include "${MASTERDIR}/Makefile.${OPSYS}"
1272 .elif exists(${MASTERDIR}/Makefile.${ARCH})
1273 .include "${MASTERDIR}/Makefile.${ARCH}"
1277 .if exists(${MASTERDIR}/Makefile.local)
1278 .include "${MASTERDIR}/Makefile.local"
1282 .for _CATEGORY in ${CATEGORIES}
1283 PKGCATEGORY?= ${_CATEGORY}
1285 _PORTDIRNAME= ${.CURDIR:T}
1286 PORTDIRNAME?= ${_PORTDIRNAME}
1287 PKGORIGIN?= ${PKGCATEGORY}/${PORTDIRNAME}
1289 # where 'make config' records user configuration options
1290 PORT_DBDIR?= /var/db/ports
1292 UID_FILES?= ${PORTSDIR}/UIDs
1293 GID_FILES?= ${PORTSDIR}/GIDs
1297 # predefined accounts from src/etc/master.passwd
1298 # alpha numeric sort order
1299 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
1301 LDCONFIG_DIR= libdata/ldconfig
1302 LDCONFIG32_DIR= libdata/ldconfig32
1304 .if defined(LATEST_LINK)
1305 UNIQUENAME?= ${LATEST_LINK}
1307 UNIQUENAME?= ${PKGNAMEPREFIX}${PORTNAME}
1312 # At least KDE needs TMPDIR for the package building,
1313 # so we're setting it to the known default value.
1314 .if defined(PACKAGE_BUILDING)
1316 .endif # defined(PACKAGE_BUILDING)
1318 # Respect TMPDIR passed via make.conf or similar and pass it down
1319 # to configure and make.
1321 MAKE_ENV+= TMPDIR="${TMPDIR}"
1322 CONFIGURE_ENV+= TMPDIR="${TMPDIR}"
1323 .endif # defined(TMPDIR)
1325 .if defined(WITH_DEBUG_PORTS)
1326 .if ${WITH_DEBUG_PORTS:M${PKGORIGIN}}
1331 .include "${PORTSDIR}/Mk/bsd.options.mk"
1333 # Start of pre-makefile section.
1334 .if !defined(AFTERPORTMK) && !defined(INOPTIONSMK)
1336 .include "${PORTSDIR}/Mk/bsd.sanity.mk"
1340 .if defined(PORTVERSION)
1341 .if ${PORTVERSION:M*[-_,]*}x != x
1342 IGNORE= PORTVERSION ${PORTVERSION} may not contain '-' '_' or ','
1344 DISTVERSION?= ${PORTVERSION:S/:/::/g}
1345 .elif defined(DISTVERSION)
1346 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}
1350 .if ${PORTREVISION} != 0
1351 _SUF1= _${PORTREVISION}
1355 .if ${PORTEPOCH} != 0
1356 _SUF2= ,${PORTEPOCH}
1359 PKGVERSION= ${PORTVERSION:C/[-_,]/./g}${_SUF1}${_SUF2}
1360 PKGNAME= ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}-${PKGVERSION}
1361 DISTNAME?= ${PORTNAME}-${DISTVERSIONPREFIX}${DISTVERSION:C/:(.)/\1/g}${DISTVERSIONSUFFIX}
1363 INDEXFILE?= INDEX-${DFLYVERSION:C/([0-9]*)[0-9]{5}/\1/}
1365 DOCSDIR?= ${PREFIX}/share/doc/${PORTNAME}
1366 EXAMPLESDIR?= ${PREFIX}/share/examples/${PORTNAME}
1367 DATADIR?= ${PREFIX}/share/${PORTNAME}
1368 WWWDIR?= ${PREFIX}/www/${PORTNAME}
1369 ETCDIR?= ${PREFIX}/etc/${PORTNAME}
1371 .if defined(USE_LINUX_RPM)
1372 .include "${PORTSDIR}/Mk/bsd.linux-rpm.mk"
1375 .if defined(USE_LINUX_APPS)
1376 .include "${PORTSDIR}/Mk/bsd.linux-apps.mk"
1379 .if defined(USE_XORG) || defined(XORG_CAT)
1380 .include "${PORTSDIR}/Mk/bsd.xorg.mk"
1383 PACKAGES?= /usr/packages
1384 TEMPLATES?= ${PORTSDIR}/Templates
1385 KEYWORDS?= ${PORTSDIR}/Keywords
1387 PATCHDIR?= ${MASTERDIR}/files
1388 FILESDIR?= ${MASTERDIR}/files
1389 SCRIPTDIR?= ${MASTERDIR}/scripts
1390 PKGDIR?= ${MASTERDIR}
1392 .if defined(USE_LINUX_PREFIX)
1393 PREFIX:= ${LINUXBASE}
1396 PREFIX?= ${LOCALBASE}
1399 .if defined(USE_LINUX_PREFIX)
1400 LDCONFIG_CMD?= ${LINUXBASE}/sbin/ldconfig -r ${LINUXBASE}
1403 PKGCOMPATDIR?= ${LOCALBASE}/lib/compat/pkg
1405 .if defined(USE_LOCAL_MK)
1406 .include "${PORTSDIR}/Mk/bsd.local.mk"
1409 .if defined(USE_OPENSSL)
1410 .include "${PORTSDIR}/Mk/bsd.openssl.mk"
1413 .if defined(USE_EMACS)
1414 .include "${PORTSDIR}/Mk/bsd.emacs.mk"
1417 .if defined(USE_GNUSTEP)
1418 .include "${PORTSDIR}/Mk/bsd.gnustep.mk"
1421 .if defined(USE_PHP)
1422 .include "${PORTSDIR}/Mk/bsd.php.mk"
1425 .if defined(USE_FPC) || defined(WANT_FPC_BASE) || defined(WANT_FPC_ALL)
1426 .include "${PORTSDIR}/Mk/bsd.fpc.mk"
1429 .if defined(USE_JAVA)
1430 .include "${PORTSDIR}/Mk/bsd.java.mk"
1433 .if defined(USE_RUBY) || defined(USE_LIBRUBY)
1434 .include "${PORTSDIR}/Mk/bsd.ruby.mk"
1437 .if defined(USE_OCAML)
1438 .include "${PORTSDIR}/Mk/bsd.ocaml.mk"
1441 .if defined(USE_APACHE) || defined(USE_APACHE_BUILD) || defined(USE_APACHE_RUN)
1442 .include "${PORTSDIR}/Mk/bsd.apache.mk"
1445 .if defined(USE_QT4) || defined(USE_QT5)
1446 .include "${PORTSDIR}/Mk/bsd.qt.mk"
1449 .if defined(USE_TEX)
1450 .include "${PORTSDIR}/Mk/bsd.tex.mk"
1453 .if defined(USE_GECKO)
1454 .include "${PORTSDIR}/Mk/bsd.gecko.mk"
1457 .if defined(WANT_GNOME) || defined(USE_GNOME) || defined(INSTALLS_ICONS)
1458 .include "${PORTSDIR}/Mk/bsd.gnome.mk"
1461 .if defined(USE_MATE)
1462 .include "${PORTSDIR}/Mk/bsd.mate.mk"
1465 .if defined(WANT_WX) || defined(USE_WX) || defined(USE_WX_NOT)
1466 .include "${PORTSDIR}/Mk/bsd.wx.mk"
1469 .if defined(WANT_GSTREAMER) || defined(USE_GSTREAMER) || defined(USE_GSTREAMER1)
1470 .include "${PORTSDIR}/Mk/bsd.gstreamer.mk"
1473 .if defined(USE_SDL) || defined(WANT_SDL)
1474 .include "${PORTSDIR}/Mk/bsd.sdl.mk"
1477 .if defined(USE_KDE4) || defined(KDE4_BUILDENV)
1478 .include "${PORTSDIR}/Mk/bsd.kde4.mk"
1485 DESTDIRNAME?= DESTDIR
1487 .if !empty(USES:Mdesktop-file-utils)
1488 QA_ENV+= USESDESKTOPFILEUTILS=yes
1490 .if !empty(USES:Mlibtool*)
1491 QA_ENV+= USESLIBTOOL=yes
1493 .if !empty(USES:Mshared-mime-info)
1494 QA_ENV+= USESSHAREDMIMEINFO=yes
1500 .if !defined(${_f}_ARGS)
1501 ${_f}_ARGS:= ${f:C/^[^\:]*(\:|\$)//:S/,/ /g}
1505 .include "${USESDIR}/${f:C/\:.*//}.mk"
1508 .if defined(USE_BZIP2)
1509 EXTRACT_SUFX?= .tar.bz2
1510 .elif defined(USE_XZ)
1511 EXTRACT_SUFX?= .tar.xz
1513 EXTRACT_SUFX?= .tar.gz
1516 # You can force skipping these test by defining IGNORE_PATH_CHECKS
1517 .if !defined(IGNORE_PATH_CHECKS)
1520 @${ECHO_MSG} "PREFIX must be defined as an absolute path so that when 'make'"
1521 @${ECHO_MSG} "is invoked in the work area PREFIX points to the right place."
1526 # Location of mounted CDROM(s) to search for files
1527 CD_MOUNTPTS?= /cdrom ${CD_MOUNTPT}
1529 # Owner and group of the WWW user
1533 # Keep PKGNG_ORIGIN/WITH_PKGNG for compat with scripts which are looking for it
1534 PKG_ORIGIN?= ports-mgmt/pkg
1535 PKGNG_ORIGIN= ${PKG_ORIGIN}
1537 WITH_PKG?= ${WITH_PKGNG}
1539 .if defined(BUNDLE_LIBS)
1540 PKG_NOTES+= no_provide_shlib
1541 PKG_NOTE_no_provide_shlib= yes
1545 # End of pre-makefile section.
1547 # Start of post-makefile section.
1548 .if !defined(BEFOREPORTMK) && !defined(INOPTIONSMK)
1550 .if defined(_POSTMKINCLUDED)
1551 DEV_ERROR+= "${PKGNAME}: Makefile error: you cannot include bsd.port[.post].mk twice"
1555 _POSTMKINCLUDED= yes
1557 WRKDIR?= ${WRKDIRPREFIX}/${.CURDIR:H:T}/${.CURDIR:T}/work
1558 .if !defined(IGNORE_MASTER_SITE_GITHUB) && defined(USE_GITHUB)
1559 WRKSRC?= ${WRKDIR}/${GH_ACCOUNT}-${GH_PROJECT}-${GH_COMMIT}
1561 .if defined(NO_WRKSUBDIR)
1564 WRKSRC?= ${WRKDIR}/${DISTNAME}
1566 .if defined(WRKSRC_SUBDIR)
1567 WRKSRC:= ${WRKSRC}/${WRKSRC_SUBDIR}
1570 PATCH_WRKSRC?= ${WRKSRC}
1571 CONFIGURE_WRKSRC?= ${WRKSRC}
1572 BUILD_WRKSRC?= ${WRKSRC}
1573 INSTALL_WRKSRC?=${WRKSRC}
1575 PLIST_SUB+= OSREL=${OSREL} PREFIX=%D LOCALBASE=${LOCALBASE} \
1576 RESETPREFIX=${PREFIX}
1577 SUB_LIST+= PREFIX=${PREFIX} LOCALBASE=${LOCALBASE} \
1578 DATADIR=${DATADIR} DOCSDIR=${DOCSDIR} EXAMPLESDIR=${EXAMPLESDIR} \
1579 WWWDIR=${WWWDIR} ETCDIR=${ETCDIR}
1580 # This is used for check-stagedir.sh and check_leftover.sh to replace
1581 # directories/files with PLIST_SUB %%KEYS%%.
1582 # Remove VARS that are too generic
1583 # Remove empty values
1584 # Remove @comment values
1586 # Replace . with \. for later sed(1) usage
1587 PLIST_SUB_SED_MIN?= 2
1588 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}
1590 # kludge to strip trailing whitespace from CFLAGS;
1591 # sub-configure will not # survive double space
1592 # remove -O from /usr/share/mk/sys.mk and replace with -O2
1593 CFLAGS:= ${CFLAGS:C/ $//:N-O}
1596 .if defined(WITHOUT_CPU_CFLAGS)
1597 .if defined(_CPUCFLAGS)
1598 .if !empty(_CPUCFLAGS)
1599 CFLAGS:= ${CFLAGS:C/${_CPUCFLAGS}//}
1604 # Reset value from bsd.own.mk.
1605 .if defined(WITH_DEBUG) && !defined(WITHOUT_DEBUG)
1606 .if !defined(INSTALL_STRIPPED)
1608 MAKE_ENV+= DONTSTRIP=yes
1612 CFLAGS:= ${CFLAGS:N-O*:N-fno-strict*} ${DEBUG_FLAGS}
1613 .if defined(INSTALL_TARGET)
1614 INSTALL_TARGET:= ${INSTALL_TARGET:S/^install-strip$/install/g}
1618 .if !defined(WITHOUT_SSP)
1619 .include "${PORTSDIR}/Mk/bsd.ssp.mk"
1622 # XXX PIE support to be added here
1623 MAKE_ENV+= NO_PIE=yes
1625 .if defined(NOPORTDOCS)
1626 PLIST_SUB+= PORTDOCS="@comment "
1628 PLIST_SUB+= PORTDOCS=""
1631 .if defined(NOPORTEXAMPLES)
1632 PLIST_SUB+= PORTEXAMPLES="@comment "
1634 PLIST_SUB+= PORTEXAMPLES=""
1637 CONFIGURE_SHELL?= ${SH}
1640 CONFIGURE_ENV+= SHELL=${CONFIGURE_SHELL} CONFIG_SHELL=${CONFIGURE_SHELL}
1641 MAKE_ENV+= SHELL=${MAKE_SHELL} NO_LINT=YES
1643 .if defined(PATCHFILES)
1644 .if ${PATCHFILES:M*.zip}x != x
1645 PATCH_DEPENDS+= ${LOCALBASE}/bin/unzip:${PORTSDIR}/archivers/unzip
1649 # Check the compatibility layer for amd64/ia64
1651 .if ${ARCH} == "amd64" || ${ARCH} =="ia64"
1652 .if exists(/usr/lib32)
1653 HAVE_COMPAT_IA32_LIBS?= YES
1655 .if !defined(HAVE_COMPAT_IA32_KERN)
1656 HAVE_COMPAT_IA32_KERN!= if ${SYSCTL} -n compat.ia32.maxvmem >/dev/null 2>&1; then echo YES; fi; echo
1657 .if empty(HAVE_COMPAT_IA32_KERN)
1658 .undef HAVE_COMPAT_IA32_KERN
1663 .if defined(IA32_BINARY_PORT) && ${ARCH} != "i386"
1664 .if ${ARCH} == "amd64" || ${ARCH} == "ia64"
1665 .if !defined(HAVE_COMPAT_IA32_KERN)
1666 IGNORE= requires a kernel with compiled-in IA32 compatibility
1667 .elif !defined(HAVE_COMPAT_IA32_LIBS)
1668 IGNORE= requires 32-bit libraries installed under /usr/lib32
1673 IGNORE= requires i386 (or compatible) platform to run
1678 PLIST_SUB+= LIB32DIR=${LIB32DIR}
1680 .if ${WITH_PKG} == devel
1681 PKG_ORIGIN= ports-mgmt/pkg-devel
1684 .if !defined(PKG_DEPENDS) && !defined(CLEAN_FETCH_ENV)
1685 PKG_DEPENDS+= ${LOCALBASE}/sbin/pkg:${PORTSDIR}/${PKG_ORIGIN}
1688 .if defined(USE_GCC)
1689 .include "${PORTSDIR}/Mk/bsd.gcc.mk"
1691 . if !defined(USE_GNUSTEP)
1692 . if !defined(NO_GCC50) && defined(DPORTS_BUILDER) && ${DFLYVERSION} >= 400103
1693 CONFIGURE_ENV+= CCVER=gcc50
1694 MAKE_ENV+= CCVER=gcc50
1696 CONFIGURE_ENV+= CCVER=gcc47
1697 MAKE_ENV+= CCVER=gcc47
1702 .if defined(USE_BINUTILS) && !defined(DISABLE_BINUTILS)
1703 BUILD_DEPENDS+= ${LOCALBASE}/bin/as:${PORTSDIR}/devel/binutils
1704 BINUTILS?= ADDR2LINE AR AS CPPFILT GPROF LD NM OBJCOPY OBJDUMP RANLIB \
1705 READELF SIZE STRINGS
1706 BINUTILS_NO_MAKE_ENV?=
1707 . for b in ${BINUTILS}
1708 ${b}= ${LOCALBASE}/bin/${b:C/PP/++/:tl}
1709 . if defined(GNU_CONFIGURE) || defined(BINUTILS_CONFIGURE)
1710 CONFIGURE_ENV+= ${b}="${${b}}"
1712 . if ${BINUTILS_NO_MAKE_ENV:M${b}} == ""
1713 MAKE_ENV+= ${b}="${${b}}"
1718 .if defined(USE_OPENLDAP) || defined(WANT_OPENLDAP_VER)
1719 .include "${PORTSDIR}/Mk/bsd.ldap.mk"
1722 .if defined(USE_RC_SUBR) && ${USE_RC_SUBR:tu} != "YES"
1723 SUB_FILES+= ${USE_RC_SUBR}
1726 .if defined(USE_RCORDER)
1727 SUB_FILES+= ${USE_RCORDER}
1730 .if defined(USE_LDCONFIG) && ${USE_LDCONFIG:tl} == "yes"
1731 USE_LDCONFIG= ${PREFIX}/lib
1733 .if defined(USE_LDCONFIG32) && ${USE_LDCONFIG32:tl} == "yes"
1734 IGNORE= has USE_LDCONFIG32 set to yes, which is not correct
1737 .if defined(USE_LINUX_PREFIX) && defined(USE_LDCONFIG)
1738 # we need ${LINUXBASE}/sbin/ldconfig
1742 .if defined(USE_LINUX)
1744 . if !defined(LINUX_OSRELEASE)
1745 LINUX_OSRELEASE!= ${ECHO_CMD} `${SYSCTL} -n compat.linux.osrelease 2>/dev/null`
1748 # install(1) also does a brandelf on strip, so don't strip with FreeBSD tools.
1750 . if exists(${LINUXBASE}/usr/bin/strip)
1751 STRIP_CMD= ${LINUXBASE}/usr/bin/strip
1756 # Allow the user to specify another linux_base version.
1757 . if defined(OVERRIDE_LINUX_BASE_PORT)
1758 . if ${USE_LINUX:tl} == yes
1759 USE_LINUX= ${OVERRIDE_LINUX_BASE_PORT}
1763 # NOTE: when you update the default linux_base version (case "yes"),
1764 # don't forget to update the Handbook!
1766 . if exists(${PORTSDIR}/emulators/linux_base-${USE_LINUX})
1767 LINUX_BASE_PORT= ${LINUXBASE}/bin/sh:${PORTSDIR}/emulators/linux_base-${USE_LINUX}
1769 . if ${USE_LINUX:tl} == "yes"
1771 LINUX_BASE_PORT= ${LINUXBASE}/etc/redhat-release:${PORTSDIR}/emulators/linux_base-c6
1773 IGNORE= cannot be built: there is no emulators/linux_base-${USE_LINUX}, perhaps wrong use of USE_LINUX or OVERRIDE_LINUX_BASE_PORT
1777 RUN_DEPENDS+= ${LINUX_BASE_PORT}
1780 PKG_IGNORE_DEPENDS?= 'this_port_does_not_exist'
1782 _GL_gbm_LIB_DEPENDS= libgbm.so:${PORTSDIR}/graphics/gbm
1783 _GL_glesv2_BUILD_DEPENDS= libglesv2>0:${PORTSDIR}/graphics/libglesv2
1784 _GL_glesv2_RUN_DEPENDS= libglesv2>0:${PORTSDIR}/graphics/libglesv2
1785 _GL_egl_BUILD_DEPENDS= libEGL>0:${PORTSDIR}/graphics/libEGL
1786 _GL_egl_RUN_DEPENDS= libEGL>0:${PORTSDIR}/graphics/libEGL
1787 _GL_gl_BUILD_DEPENDS= libGL>0:${PORTSDIR}/graphics/libGL
1788 _GL_gl_RUN_DEPENDS= libGL>0:${PORTSDIR}/graphics/libGL
1789 _GL_gl_USE_XORG= glproto dri2proto
1790 _GL_glew_LIB_DEPENDS= libGLEW.so:${PORTSDIR}/graphics/glew
1791 _GL_glu_LIB_DEPENDS= libGLU.so:${PORTSDIR}/graphics/libGLU
1792 _GL_glu_USE_XORG= glproto dri2proto
1793 _GL_glw_LIB_DEPENDS= libGLw.so:${PORTSDIR}/graphics/libGLw
1794 _GL_glut_LIB_DEPENDS= libglut.so:${PORTSDIR}/graphics/freeglut
1797 . if ${USE_GL:tl} == "yes"
1800 . for _component in ${USE_GL}
1801 . if !defined(_GL_${_component}_LIB_DEPENDS) && \
1802 !defined(_GL_${_component}_RUN_DEPENDS)
1803 IGNORE= uses unknown GL component
1805 USE_XORG+= ${_GL_${_component}_USE_XORG}
1806 BUILD_DEPENDS+= ${_GL_${_component}_BUILD_DEPENDS}
1807 LIB_DEPENDS+= ${_GL_${_component}_LIB_DEPENDS}
1808 RUN_DEPENDS+= ${_GL_${_component}_RUN_DEPENDS}
1813 .if defined(_DESTDIR_VIA_ENV)
1814 MAKE_ENV+= ${DESTDIRNAME}=${STAGEDIR}
1816 MAKE_ARGS+= ${DESTDIRNAME}=${STAGEDIR}
1819 .if defined(NO_PREFIX_RMDIR)
1820 CO_ENV+= NO_PREFIX_RMDIR=1
1822 CO_ENV+= NO_PREFIX_RMDIR=0
1826 METADIR= ${WRKDIR}/.metadir
1827 MANIFESTF= ${METADIR}/+MANIFEST
1829 PKGPREINSTALL?= ${PKGDIR}/pkg-pre-install
1830 PKGPOSTINSTALL?= ${PKGDIR}/pkg-post-install
1831 PKGPREDEINSTALL?= ${PKGDIR}/pkg-pre-deinstall
1832 PKGPOSTDEINSTALL?= ${PKGDIR}/pkg-post-deinstall
1833 PKGPREUPGRADE?= ${PKGDIR}/pkg-pre-upgrade
1834 PKGPOSTUPGRADE?= ${PKGDIR}/pkg-post-upgrade
1835 PKGUPGRADE?= ${PKGDIR}/pkg-upgrade
1837 _FORCE_POST_PATTERNS= rmdir kldxref mkfontscale mkfontdir fc-cache \
1838 fonts.dir fonts.scale gtk-update-icon-cache \
1840 gtk-query-immodules \
1844 update-desktop-database update-mime-database \
1845 gdk-pixbuf-query-loaders catalog.ports \
1846 glib-compile-schemas \
1849 .if defined(USE_LOCAL_MK)
1850 .include "${PORTSDIR}/Mk/bsd.local.mk"
1853 .if defined(USE_XORG) || defined(XORG_CAT)
1854 .include "${PORTSDIR}/Mk/bsd.xorg.mk"
1857 .if defined(USE_MYSQL) || defined(WANT_MYSQL_VER) || \
1858 defined(USE_BDB) || defined(USE_SQLITE) || defined(USE_FIREBIRD)
1859 .include "${PORTSDIR}/Mk/bsd.database.mk"
1862 .if defined(WANT_GSTREAMER) || defined(USE_GSTREAMER) || defined(USE_GSTREAMER1)
1863 .include "${PORTSDIR}/Mk/bsd.gstreamer.mk"
1866 .if defined(USE_JAVA)
1867 .include "${PORTSDIR}/Mk/bsd.java.mk"
1870 .if defined(USE_OCAML)
1871 .include "${PORTSDIR}/Mk/bsd.ocaml.mk"
1874 .if defined(USE_LINUX_RPM)
1875 .include "${PORTSDIR}/Mk/bsd.linux-rpm.mk"
1878 .if defined(USE_LINUX_APPS)
1879 .include "${PORTSDIR}/Mk/bsd.linux-apps.mk"
1882 .if defined(USE_QT4) || defined(USE_QT5)
1883 .include "${PORTSDIR}/Mk/bsd.qt.mk"
1886 .if defined(USE_SDL) || defined(WANT_SDL)
1887 .include "${PORTSDIR}/Mk/bsd.sdl.mk"
1890 .if defined(USE_PHP)
1891 .include "${PORTSDIR}/Mk/bsd.php.mk"
1894 .if defined(USE_WX) || defined(USE_WX_NOT)
1895 .include "${PORTSDIR}/Mk/bsd.wx.mk"
1898 .if defined(USE_APACHE) || defined(USE_APACHE_BUILD) || defined(USE_APACHE_RUN)
1899 .include "${PORTSDIR}/Mk/bsd.apache.mk"
1902 .if defined(USE_AUTOTOOLS)
1903 .include "${PORTSDIR}/Mk/bsd.autotools.mk"
1906 .if defined(USE_FPC) || defined(WANT_FPC_BASE) || defined(WANT_FPC_ALL)
1907 .include "${PORTSDIR}/Mk/bsd.fpc.mk"
1910 .if defined(USE_GECKO)
1911 .include "${PORTSDIR}/Mk/bsd.gecko.mk"
1914 .if defined(WANT_GNOME) || defined(USE_GNOME)
1915 .include "${PORTSDIR}/Mk/bsd.gnome.mk"
1918 .if defined(USE_MATE)
1919 .include "${PORTSDIR}/Mk/bsd.mate.mk"
1922 .if defined(USE_KDE4)
1923 .include "${PORTSDIR}/Mk/bsd.kde4.mk"
1926 .if exists(${PORTSDIR}/Makefile.inc)
1927 .include "${PORTSDIR}/Makefile.inc"
1932 .for f in ${_USES_POST}
1934 .if !defined(${_f}_ARGS)
1935 ${_f}_ARGS:= ${f:C/^[^\:]*(\:|\$)//:S/,/ /g}
1938 .for f in ${_USES_POST}
1939 .include "${USESDIR}/${f:C/\:.*//}.mk"
1942 .if defined(USE_XORG)
1943 # Add explicit X options to avoid problems with false positives in configure
1944 .if defined(GNU_CONFIGURE)
1945 CONFIGURE_ARGS+=--x-libraries=${LOCALBASE}/lib --x-includes=${LOCALBASE}/include
1949 # Set the default for the installation of Postscript(TM)-
1950 # compatible functionality.
1951 .if !defined(USE_GHOSTSCRIPT)
1952 . if defined(USE_GHOSTSCRIPT_BUILD)
1953 _USE_GHOSTSCRIPT= ${USE_GHOSTSCRIPT_BUILD}
1954 . elif defined(USE_GHOSTSCRIPT_RUN)
1955 _USE_GHOSTSCRIPT= ${USE_GHOSTSCRIPT_RUN}
1958 _USE_GHOSTSCRIPT= ${USE_GHOSTSCRIPT}
1961 .if defined(WITH_GHOSTSCRIPT_VER) && !empty(WITH_GHOSTSCRIPT_VER:M[789])
1962 _USE_GHOSTSCRIPT_DEFAULT_VER= ${WITH_GHOSTSCRIPT_VER}
1964 _USE_GHOSTSCRIPT_DEFAULT_VER= 9
1967 .if defined(_USE_GHOSTSCRIPT)
1968 . if !defined(WITHOUT_X11)
1969 _USE_GHOSTSCRIPT_PKGNAME_SUFFIX=
1971 _USE_GHOSTSCRIPT_PKGNAME_SUFFIX=-nox11
1973 . if !empty(_USE_GHOSTSCRIPT:M[789])
1974 _USE_GHOSTSCRIPT_VER=${_USE_GHOSTSCRIPT:M[789]}
1976 _USE_GHOSTSCRIPT_VER=${_USE_GHOSTSCRIPT_DEFAULT_VER}
1979 _USE_GHOSTSCRIPT_VER=${_USE_GHOSTSCRIPT_DEFAULT_VER}
1983 .if defined(_USE_GHOSTSCRIPT) && defined(WITH_GHOSTSCRIPT_VER)
1984 . if empty(WITH_GHOSTSCRIPT_VER:M[789])
1985 . error You set an invalid value "${WITH_GHOSTSCRIPT_VER}" in WITH_GHOSTSCRIPT_VER. Abort.
1986 . elif ${_USE_GHOSTSCRIPT_VER} != ${WITH_GHOSTSCRIPT_VER}
1987 . error You set WITH_GHOSTSCRIPT_VER as ${WITH_GHOSTSCRIPT_VER} but ${PKGNAME} requires print/ghostscript${_USE_GHOSTSCRIPT_VER}. Abort.
1991 GHOSTSCRIPT_PORT?= print/ghostscript${_USE_GHOSTSCRIPT_VER}${_USE_GHOSTSCRIPT_PKGNAME_SUFFIX}
1993 # Set up the ghostscript dependencies.
1994 .if defined(USE_GHOSTSCRIPT) || defined(USE_GHOSTSCRIPT_BUILD)
1995 BUILD_DEPENDS+= gs:${PORTSDIR}/${GHOSTSCRIPT_PORT}
1997 .if defined(USE_GHOSTSCRIPT) || defined(USE_GHOSTSCRIPT_RUN)
1998 RUN_DEPENDS+= gs:${PORTSDIR}/${GHOSTSCRIPT_PORT}
2001 # Macro for doing in-place file editing using regexps
2002 REINPLACE_ARGS?= -i.bak
2003 REINPLACE_CMD?= ${SED} ${REINPLACE_ARGS}
2005 # Names of cookies used to skip already completed stages
2006 EXTRACT_COOKIE?= ${WRKDIR}/.extract_done.${PORTNAME}.${PREFIX:S/\//_/g}
2007 CONFIGURE_COOKIE?= ${WRKDIR}/.configure_done.${PORTNAME}.${PREFIX:S/\//_/g}
2008 INSTALL_COOKIE?= ${WRKDIR}/.install_done.${PORTNAME}.${PREFIX:S/\//_/g}
2009 BUILD_COOKIE?= ${WRKDIR}/.build_done.${PORTNAME}.${PREFIX:S/\//_/g}
2010 PATCH_COOKIE?= ${WRKDIR}/.patch_done.${PORTNAME}.${PREFIX:S/\//_/g}
2011 PACKAGE_COOKIE?= ${WRKDIR}/.package_done.${PORTNAME}.${PREFIX:S/\//_/g}
2012 STAGE_COOKIE?= ${WRKDIR}/.stage_done.${PORTNAME}.${PREFIX:S/\//_/g}
2014 # How to do nothing. Override if you, for some strange reason, would rather
2018 # Use this as the first operand to always build dependency.
2019 NONEXISTENT?= /nonexistent
2021 CHECKSUM_ALGORITHMS?= sha256
2023 DISTINFO_FILE?= ${MASTERDIR}/distinfo
2027 MAKE_CMD?= /usr/bin/make
2028 PLIST_SUB:= ${PLIST_SUB:NPROFILE=*} PROFILE="@comment "
2029 MAKE_ENV+= PREFIX=${PREFIX} \
2030 LOCALBASE=${LOCALBASE} \
2031 LIBDIR="${LIBDIR}" \
2033 CC="${CC}" CFLAGS="${CFLAGS}" \
2034 CPP="${CPP}" CPPFLAGS="${CPPFLAGS}" \
2035 LDFLAGS="${LDFLAGS}" LIBS="${LIBS}" \
2036 CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" \
2037 MANPREFIX="${MANPREFIX}"
2039 # Add -fno-strict-aliasing to CFLAGS with optimization level -O2 or higher.
2040 # gcc 4.x enable strict aliasing optimization with -O2 which is known to break
2042 .if !defined(WITHOUT_NO_STRICT_ALIASING)
2044 .if empty(CFLAGS:M-fno-strict-aliasing)
2045 CFLAGS+= -fno-strict-aliasing
2051 .if defined(USE_${lang}STD)
2052 ${lang}FLAGS:= ${${lang}FLAGS:N-std=*} -std=${USE_${lang}STD}
2055 .if defined(${lang}FLAGS_${ARCH})
2056 ${lang}FLAGS+= ${${lang}FLAGS_${ARCH}}
2060 # Multiple make jobs support
2061 .if defined(DISABLE_MAKE_JOBS) || defined(MAKE_JOBS_UNSAFE)
2065 .if defined(MAKE_JOBS_NUMBER)
2066 _MAKE_JOBS_NUMBER:= ${MAKE_JOBS_NUMBER}
2068 _MAKE_JOBS_NUMBER!= ${SYSCTL} -n hw.ncpu
2070 .if defined(MAKE_JOBS_NUMBER_LIMIT) && ( ${MAKE_JOBS_NUMBER_LIMIT} < ${_MAKE_JOBS_NUMBER} )
2071 MAKE_JOBS_NUMBER= ${MAKE_JOBS_NUMBER_LIMIT}
2073 MAKE_JOBS_NUMBER= ${_MAKE_JOBS_NUMBER}
2075 _MAKE_JOBS?= -j${MAKE_JOBS_NUMBER}
2076 BUILD_FAIL_MESSAGE+= Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to the maintainer.
2079 .include "${PORTSDIR}/Mk/bsd.ccache.mk"
2082 PTHREAD_LIBS?= -pthread
2084 FETCH_ENV?= SSL_NO_VERIFY_PEER=1 SSL_NO_VERIFY_HOSTNAME=1
2085 FETCH_BINARY?= /usr/bin/fetch
2088 .if !defined(DISABLE_SIZE)
2089 FETCH_BEFORE_ARGS+= $${CKSIZE:+-S $$CKSIZE}
2091 FETCH_CMD?= ${FETCH_BINARY} ${FETCH_ARGS}
2093 .if defined(RANDOMIZE_MASTER_SITES)
2094 .if exists(/usr/games/random)
2095 RANDOM_CMD?= /usr/games/random
2096 RANDOM_ARGS?= "-w -f -"
2097 _RANDOMIZE_SITES= " |${RANDOM_CMD} ${RANDOM_ARGS}"
2101 TOUCH?= /usr/bin/touch
2104 DISTORIG?= .bak.orig
2105 PATCH?= /usr/bin/patch
2107 PATCH_DIST_STRIP?= -p0
2108 .if defined(PATCH_DEBUG)
2109 PATCH_DEBUG_TMP= yes
2110 PATCH_ARGS?= -d ${PATCH_WRKSRC} -E ${PATCH_STRIP}
2111 PATCH_DIST_ARGS?= --suffix ${DISTORIG} -d ${PATCH_WRKSRC} -E ${PATCH_DIST_STRIP}
2114 PATCH_ARGS?= -d ${PATCH_WRKSRC} --forward --quiet -E ${PATCH_STRIP}
2115 PATCH_DIST_ARGS?= --suffix ${DISTORIG} -d ${PATCH_WRKSRC} --forward --quiet -E ${PATCH_DIST_STRIP}
2118 PATCH_SILENT= PATCH_SILENT=yes
2121 PATCH_ARGS+= --batch
2122 PATCH_DIST_ARGS+= --batch
2125 # Prevent breakage with VERSION_CONTROL=numbered
2126 PATCH_ARGS+= -V simple
2128 .if defined(PATCH_CHECK_ONLY)
2130 PATCH_DIST_ARGS+= -C
2133 .if ${PATCH} == "/usr/bin/patch"
2134 PATCH_ARGS+= --suffix .orig
2135 PATCH_DIST_ARGS+= --suffix .orig
2140 # EXTRACT_SUFX is defined in .pre.mk section
2142 LHA_BEFORE_ARGS?= xfpw=${WRKDIR}
2145 TAR_AFTER_ARGS_DEFAULT= --no-same-owner --no-same-permissions
2146 TAR_BEFORE_ARGS_DEFAULT= -xf
2148 .if !defined(TAR_BEFORE_ARGS)
2149 . if defined(EXTRACT_BEFORE_ARGS)
2150 TAR_BEFORE_ARGS= ${EXTRACT_BEFORE_ARGS}
2152 TAR_BEFORE_ARGS= ${TAR_BEFORE_ARGS_DEFAULT}
2156 # ZIP_* variables are always defined by zip.mk, so ?= only kicks in USES+=zip
2157 # when does not exist. In this case, assume $TAR is desired for zip archives
2158 ZIP_BEFORE_ARGS?= ${TAR_BEFORE_ARGS_DEFAULT}
2159 ZIP_AFTER_ARGS?= ${TAR_AFTER_ARGS_DEFAULT}
2160 ZIP_EXTRACT_CMD?= ${TAR}
2162 .if !defined(TAR_AFTER_ARGS)
2163 . if defined(EXTRACT_AFTER_ARGS)
2164 TAR_AFTER_ARGS= ${EXTRACT_AFTER_ARGS}
2166 TAR_AFTER_ARGS= ${TAR_AFTER_ARGS_DEFAULT}
2170 EXTRACT_BEFORE_ARGS?= ${TAR_BEFORE_ARGS_DEFAULT}
2171 EXTRACT_AFTER_ARGS?= ${TAR_AFTER_ARGS_DEFAULT}
2173 # Figure out where the local mtree file is
2174 .if !defined(MTREE_FILE) && !defined(NO_MTREE)
2175 .if ${PREFIX} == /usr
2176 MTREE_FILE= /etc/mtree/BSD.usr.dist
2178 MTREE_FILE= ${PORTSDIR}/Templates/BSD.local.dist
2180 MTREE_FILE_DEFAULT=yes
2182 MTREE_CMD?= /usr/sbin/mtree
2183 MTREE_ARGS?= -U ${MTREE_FOLLOWS_SYMLINKS} -f ${MTREE_FILE} -d -e -p
2185 READLINK_CMD?= /usr/bin/readlink
2187 # Determine whether or not we can use rootly owner/group functions.
2189 _BINOWNGRP= -o ${BINOWN} -g ${BINGRP}
2190 _SHROWNGRP= -o ${SHAREOWN} -g ${SHAREGRP}
2191 _MANOWNGRP= -o ${MANOWN} -g ${MANGRP}
2200 # A few aliases for *-install targets
2202 ${INSTALL} ${COPY} ${STRIP} ${_BINOWNGRP} -m ${BINMODE}
2204 ${INSTALL} ${COPY} ${_BINOWNGRP} -m ${BINMODE}
2206 ${INSTALL} ${COPY} ${STRIP} ${_SHROWNGRP} -m ${SHAREMODE}
2208 ${INSTALL} ${COPY} ${_BINOWNGRP} -m ${BINMODE}
2210 ${INSTALL} ${COPY} ${_SHROWNGRP} -m ${_SHAREMODE}
2212 ${INSTALL} ${COPY} ${_MANOWNGRP} -m ${MANMODE}
2214 INSTALL_MACROS= BSD_INSTALL_PROGRAM="${INSTALL_PROGRAM}" \
2215 BSD_INSTALL_LIB="${INSTALL_LIB}" \
2216 BSD_INSTALL_SCRIPT="${INSTALL_SCRIPT}" \
2217 BSD_INSTALL_DATA="${INSTALL_DATA}" \
2218 BSD_INSTALL_MAN="${INSTALL_MAN}"
2219 MAKE_ENV+= ${INSTALL_MACROS}
2220 SCRIPTS_ENV+= ${INSTALL_MACROS}
2222 # Macro for copying entire directory tree with correct permissions
2224 COPYTREE_BIN= ${SH} -c '(${FIND} -d $$0 $$2 | ${CPIO} -dumpl $$1 >/dev/null \
2226 ${CHOWN} -Rh ${BINOWN}:${BINGRP} $$1 && \
2227 ${FIND} -d $$0 $$2 -type d -exec chmod 755 $$1/{} \; && \
2228 ${FIND} -d $$0 $$2 -type f -exec chmod ${BINMODE} $$1/{} \;' --
2229 COPYTREE_SHARE= ${SH} -c '(${FIND} -d $$0 $$2 | ${CPIO} -dumpl $$1 >/dev/null \
2231 ${CHOWN} -Rh ${SHAREOWN}:${SHAREGRP} $$1 && \
2232 ${FIND} -d $$0 $$2 -type d -exec chmod 755 $$1/{} \; && \
2233 ${FIND} -d $$0 $$2 -type f -exec chmod ${SHAREMODE} $$1/{} \;' --
2235 COPYTREE_BIN= ${SH} -c '(${FIND} -d $$0 $$2 | ${CPIO} -dumpl $$1 >/dev/null \
2237 ${FIND} -d $$0 $$2 -type d -exec chmod 755 $$1/{} \; && \
2238 ${FIND} -d $$0 $$2 -type f -exec chmod ${BINMODE} $$1/{} \;' --
2239 COPYTREE_SHARE= ${SH} -c '(${FIND} -d $$0 $$2 | ${CPIO} -dumpl $$1 >/dev/null \
2241 ${FIND} -d $$0 $$2 -type d -exec chmod 755 $$1/{} \; && \
2242 ${FIND} -d $$0 $$2 -type f -exec chmod ${SHAREMODE} $$1/{} \;' --
2245 # The user can override the NO_PACKAGE by specifying this from
2246 # the make command line
2247 .if defined(FORCE_PACKAGE)
2251 DESCR?= ${PKGDIR}/pkg-descr
2252 PLIST?= ${PKGDIR}/pkg-plist
2253 PKGHELP?= ${PKGDIR}/pkg-help
2254 PKGINSTALL?= ${PKGDIR}/pkg-install
2255 PKGDEINSTALL?= ${PKGDIR}/pkg-deinstall
2256 PKGREQ?= ${PKGDIR}/pkg-req
2257 PKGMESSAGE?= ${PKGDIR}/pkg-message
2259 TMPPLIST?= ${WRKDIR}/.PLIST.mktmp
2260 TMPPLIST_SORT?= ${WRKDIR}/.PLIST.mktmp.sorted
2261 TMPGUCMD?= ${WRKDIR}/.PLIST.gucmd
2263 .if defined(PKG_NOCOMPRESS)
2268 # where pkg_add records its dirty deeds.
2269 PKG_DBDIR?= /var/db/pkg
2272 INSTALL_TARGET?= install
2273 INSTALL_TARGET+= ${LATE_INSTALL_ARGS}
2275 # Integrate with the license auditing framework
2276 .if !defined (DISABLE_LICENSES)
2277 .include "${PORTSDIR}/Mk/bsd.licenses.mk"
2280 # Popular master sites
2281 .include "${PORTSDIR}/Mk/bsd.sites.mk"
2283 # Empty declaration to avoid "variable MASTER_SITES recursive" error
2286 _MASTER_SITES_DEFAULT?=
2287 _PATCH_SITES_DEFAULT?=
2289 # Feed internal _{MASTER,PATCH}_SITES_n where n is a group designation
2290 # as per grouping rules (:something)
2291 # Organize _{MASTER,PATCH}_SITES_{DEFAULT,[^/:]+} according to grouping
2292 # rules (:something)
2293 .for _S in ${MASTER_SITES}
2294 _S_TEMP= ${_S:S/^${_S:C@/?:[^/:]+$@/@}//:S/^://}
2295 . if !empty(_S_TEMP)
2296 . for _group in ${_S_TEMP:S/,/ /g}
2298 . if ${_G_TEMP} == all || ${_G_TEMP} == ALL || ${_G_TEMP} == default
2300 @${ECHO_MSG} "Makefile error: the words all, ALL and default are reserved and cannot be"
2301 @${ECHO_MSG} "used in group definitions. Please fix your MASTER_SITES"
2304 _MASTER_SITES_${_group}+= ${_S:C@^(.*/):[^/:]+$@\1@}
2307 _MASTER_SITES_DEFAULT+= ${_S:C@^(.*/):[^/:]+$@\1@}
2310 .for _S in ${PATCH_SITES}
2311 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://}
2312 . if !empty(_S_TEMP)
2313 . for _group in ${_S_TEMP:S/,/ /g}
2315 . if ${_G_TEMP} == all || ${_G_TEMP} == ALL || ${_G_TEMP} == default
2317 @${ECHO_MSG} "The words all, ALL and default are reserved and cannot be"
2318 @${ECHO_MSG} "used in group definitions. Please fix your PATCH_SITES"
2321 _PATCH_SITES_${_group}+= ${_S:C@^(.*/):[^/:]+$@\1@}
2324 _PATCH_SITES_DEFAULT+= ${_S:C@^(.*/):[^/:]+$@\1@}
2328 # Feed internal _{MASTER,PATCH}_SITE_SUBDIR_n where n is a group designation
2329 # as per grouping rules (:something)
2330 # Organize _{MASTER,PATCH}_SITE_SUBDIR_{DEFAULT,[^/:]+} according to grouping
2331 # rules (:something)
2332 .for _S in ${MASTER_SITE_SUBDIR}
2333 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://}
2334 . if !empty(_S_TEMP)
2335 . for _group in ${_S_TEMP:S/,/ /g}
2337 . if ${_G_TEMP} == all || ${_G_TEMP} == ALL || ${_G_TEMP} == default
2339 @${ECHO_MSG} "Makefile error: the words all, ALL and default are reserved and cannot be"
2340 @${ECHO_MSG} "used in group definitions. Please fix your MASTER_SITE_SUBDIR"
2343 . if defined(_MASTER_SITES_${_group})
2344 _MASTER_SITE_SUBDIR_${_group}+= ${_S:C@^(.*)/:[^/:]+$@\1@}
2348 . if defined(_MASTER_SITES_DEFAULT)
2349 _MASTER_SITE_SUBDIR_DEFAULT+= ${_S:C@^(.*)/:[^/:]+$@\1@}
2353 .for _S in ${PATCH_SITE_SUBDIR}
2354 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://}
2355 . if !empty(_S_TEMP)
2356 . for _group in ${_S_TEMP:S/,/ /g}
2358 . if ${_G_TEMP} == all || ${_G_TEMP} == ALL || ${_G_TEMP} == default
2360 @${ECHO_MSG} "Makefile error: the words all, ALL and default are reserved and cannot be"
2361 @${ECHO_MSG} "used in group definitions. Please fix your PATCH_SITE_SUBDIR"
2364 . if defined(_PATCH_SITES_${_group})
2365 _PATCH_SITE_SUBDIR_${_group}+= ${_S:C@^(.*)/:[^/:]+$@\1@}
2369 . if defined(_PATCH_SITES_DEFAULT)
2370 _PATCH_SITE_SUBDIR_DEFAULT+= ${_S:C@^(.*)/:[^/:]+$@\1@}
2375 # Substitute subdirectory names
2376 # XXX simpler/faster solution but not the best space wise, suggestions please
2377 .for _S in ${MASTER_SITES}
2378 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://}
2379 . if !empty(_S_TEMP)
2380 . for _group in ${_S_TEMP:S/,/ /g}
2381 . if !defined(_MASTER_SITE_SUBDIR_${_group})
2382 MASTER_SITES_TMP= ${_MASTER_SITES_${_group}:S^%SUBDIR%/^^}
2384 _S_TEMP_TEMP= ${_MASTER_SITES_${_group}:M*%SUBDIR%/*}
2385 . if empty(_S_TEMP_TEMP)
2386 MASTER_SITES_TMP= ${_MASTER_SITES_${_group}}
2389 . for site in ${_MASTER_SITES_${_group}}
2390 _S_TEMP_TEMP= ${site:M*%SUBDIR%/*}
2391 . if empty(_S_TEMP_TEMP)
2392 MASTER_SITES_TMP+= ${site}
2394 . for dir in ${_MASTER_SITE_SUBDIR_${_group}}
2395 MASTER_SITES_TMP+= ${site:S^%SUBDIR%^\${dir}^}
2401 _MASTER_SITES_${_group}:= ${MASTER_SITES_TMP}
2405 .if defined(_MASTER_SITE_SUBDIR_DEFAULT)
2406 _S_TEMP= ${_MASTER_SITES_DEFAULT:M*%SUBDIR%/*}
2408 MASTER_SITES_TMP= ${_MASTER_SITES_DEFAULT}
2411 . for site in ${_MASTER_SITES_DEFAULT}
2412 _S_TEMP_TEMP= ${site:M*%SUBDIR%/*}
2413 . if empty(_S_TEMP_TEMP)
2414 MASTER_SITES_TMP+= ${site}
2416 . for dir in ${_MASTER_SITE_SUBDIR_DEFAULT}
2417 MASTER_SITES_TMP+= ${site:S^%SUBDIR%^\${dir}^}
2423 MASTER_SITES_TMP= ${_MASTER_SITES_DEFAULT:S^%SUBDIR%/^^}
2425 _MASTER_SITES_DEFAULT:= ${MASTER_SITES_TMP}
2427 .for _S in ${PATCH_SITES}
2428 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://}
2429 . if !empty(_S_TEMP)
2430 . for _group in ${_S_TEMP:S/,/ /g}
2431 . if !defined(_PATCH_SITE_SUBDIR_${_group})
2432 PATCH_SITES_TMP= ${_PATCH_SITES_${_group}:S^%SUBDIR%/^^}
2434 _S_TEMP_TEMP= ${_PATCH_SITES_${_group}:M*%SUBDIR%/*}
2435 . if empty(_S_TEMP_TEMP)
2436 PATCH_SITES_TMP= ${_PATCH_SITES_${_group}}
2439 . for site in ${_PATCH_SITES_${_group}}
2440 _S_TEMP_TEMP= ${site:M*%SUBDIR%/*}
2441 . if empty(_S_TEMP_TEMP)
2442 PATCH_SITES_TMP+= ${site}
2444 . for dir in ${_PATCH_SITE_SUBDIR_${_group}}
2445 PATCH_SITES_TMP+= ${site:S^%SUBDIR%^\${dir}^}
2451 _PATCH_SITES_${_group}:= ${PATCH_SITES_TMP}
2455 .if defined(_PATCH_SITE_SUBDIR_DEFAULT)
2456 _S_TEMP= ${_PATCH_SITES_DEFAULT:M*%SUBDIR%/*}
2458 PATCH_SITES_TMP= ${_PATCH_SITES_DEFAULT}
2461 . for site in ${_PATCH_SITES_DEFAULT}
2462 _S_TEMP_TEMP= ${site:M*%SUBDIR%/*}
2463 . if empty(_S_TEMP_TEMP)
2464 PATCH_SITES_TMP+= ${site}
2466 . for dir in ${_PATCH_SITE_SUBDIR_DEFAULT}
2467 PATCH_SITES_TMP+= ${site:S^%SUBDIR%^\${dir}^}
2473 PATCH_SITES_TMP= ${_PATCH_SITES_DEFAULT:S^%SUBDIR%/^^}
2475 _PATCH_SITES_DEFAULT:= ${PATCH_SITES_TMP}
2478 # The primary backup site.
2479 MASTER_SITE_BACKUP?= \
2480 http://distcache.FreeBSD.org/ports-distfiles/${DIST_SUBDIR}/
2481 MASTER_SITE_BACKUP:= ${MASTER_SITE_BACKUP:S^\${DIST_SUBDIR}/^^}
2483 # If the user has MASTER_SITE_FREEBSD set, go to the FreeBSD repository
2484 # for everything, but don't search it twice by appending it to the end.
2485 .if defined(MASTER_SITE_FREEBSD)
2486 _MASTER_SITE_OVERRIDE:= ${MASTER_SITE_BACKUP}
2487 _MASTER_SITE_BACKUP:= # empty
2489 _MASTER_SITE_OVERRIDE= ${MASTER_SITE_OVERRIDE}
2490 _MASTER_SITE_BACKUP= ${MASTER_SITE_BACKUP}
2493 # Search CDROM first if mounted, symlink instead of copy if
2494 # FETCH_SYMLINK_DISTFILES is set
2495 .for MOUNTPT in ${CD_MOUNTPTS}
2496 .if exists(${MOUNTPT}/ports/distfiles)
2497 _MASTER_SITE_OVERRIDE:= file:${MOUNTPT}/ports/distfiles/${DIST_SUBDIR}/ ${_MASTER_SITE_OVERRIDE}
2498 .if defined(FETCH_SYMLINK_DISTFILES)
2499 FETCH_BEFORE_ARGS+= -l
2506 # Organize DISTFILES, PATCHFILES, _MASTER_SITES_ALL, _PATCH_SITES_ALL
2507 # according to grouping rules (:something)
2508 DISTFILES?= ${DISTNAME}${EXTRACT_SUFX}
2509 _MASTER_SITES_ALL= ${_MASTER_SITES_DEFAULT}
2510 _PATCH_SITES_ALL= ${_PATCH_SITES_DEFAULT}
2512 .for _D in ${DISTFILES}
2513 _D_TEMP= ${_D:S/^${_D:C/:[^:]+$//}//}
2514 . if !empty(_D_TEMP)
2515 . for _group in ${_D_TEMP:S/^://:S/,/ /g}
2516 . if !defined(_MASTER_SITES_${_group})
2517 _G_TEMP_TEMP= ${_G_TEMP:M/${_group}/}
2518 . if empty(_G_TEMP_TEMP)
2520 _MASTER_SITES_ALL+= ${_MASTER_SITES_${_group}}
2524 _DISTFILES+= ${_D:C/:[^:]+$//}
2530 .for _P in ${PATCHFILES}
2531 _P_TEMP= ${_P:C/:[^-:][^:]*$//}
2532 _P_groups= ${_P:S/^${_P:C/:[^:]+$//}//:S/^://}
2533 _P_file= ${_P_TEMP:C/:-[^:]+$//}
2534 _P_strip= ${_P_TEMP:S/^${_P_TEMP:C/:-[^:]*$//}//:S/^://}
2535 . if !empty(_P_groups)
2536 . for _group in ${_P_groups:S/,/ /g}
2537 . if !defined(_PATCH_SITES_${_group})
2538 _G_TEMP_TEMP= ${_G_TEMP:M/${_group}/}
2539 . if empty(_G_TEMP_TEMP)
2541 _PATCH_SITES_ALL+= ${_PATCH_SITES_${_group}}
2546 _PATCHFILES:= ${_PATCHFILES} ${_P_file}
2547 . if !empty(_P_strip)
2548 _PATCH_DIST_STRIP_CASES:= ${_PATCH_DIST_STRIP_CASES} ("${_P_file}") printf %s "${_P_strip}" ;;
2556 ALLFILES?= ${_DISTFILES} ${_PATCHFILES}
2559 # Sort the master site list according to the patterns in MASTER_SORT
2563 MASTER_SORT_REGEX+= ${MASTER_SORT:S|.|\\.|g:S|^|://[^/]*|:S|$|/|}
2565 MASTER_SORT_AWK= BEGIN { RS = " "; ORS = " "; IGNORECASE = 1 ; gl = "${MASTER_SORT_REGEX:S|\\|\\\\|g}"; }
2566 .for srt in ${MASTER_SORT_REGEX}
2567 MASTER_SORT_AWK+= /${srt:S|/|\\/|g}/ { good["${srt:S|\\|\\\\|g}"] = good["${srt:S|\\|\\\\|g}"] " " $$0 ; next; }
2569 MASTER_SORT_AWK+= { rest = rest " " $$0; } END { n=split(gl, gla); for(i=1;i<=n;i++) { print good[gla[i]]; } print rest; }
2571 SORTED_MASTER_SITES_DEFAULT_CMD= cd ${.CURDIR} && ${MAKE} master-sites-DEFAULT
2572 SORTED_PATCH_SITES_DEFAULT_CMD= cd ${.CURDIR} && ${MAKE} patch-sites-DEFAULT
2573 SORTED_MASTER_SITES_ALL_CMD= cd ${.CURDIR} && ${MAKE} master-sites-ALL
2574 SORTED_PATCH_SITES_ALL_CMD= cd ${.CURDIR} && ${MAKE} patch-sites-ALL
2576 # has similar effect to old targets, i.e., access only {MASTER,PATCH}_SITES, not working with the new _n variables
2577 master-sites-DEFAULT:
2578 @${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_MASTER_SITES_DEFAULT}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
2579 patch-sites-DEFAULT:
2580 @${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_PATCH_SITES_DEFAULT}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
2583 # Sort the master site list according to the patterns in MASTER_SORT
2584 # according to grouping rules (:something)
2586 # for use in the fetch targets
2587 .for _S in ${MASTER_SITES}
2588 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//}
2589 . if !empty(_S_TEMP)
2590 . for _group in ${_S_TEMP:S/^://:S/,/ /g}
2591 . if !target(master-sites-${_group})
2592 SORTED_MASTER_SITES_${_group}_CMD= cd ${.CURDIR} && ${MAKE} master-sites-${_group}
2593 master-sites-${_group}:
2594 @${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_MASTER_SITES_${_group}}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
2599 .for _S in ${PATCH_SITES}
2600 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//}
2601 . if !empty(_S_TEMP)
2602 . for _group in ${_S_TEMP:S/^://:S/,/ /g}
2603 . if !target(patch-sites-${_group})
2604 SORTED_PATCH_SITES_${_group}_CMD= cd ${.CURDIR} && ${MAKE} patch-sites-${_group}
2605 patch-sites-${_group}:
2606 @${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_PATCH_SITES_${_group}}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
2613 # Hackery to enable simple fetch targets with several dynamic MASTER_SITES
2615 _MASTER_SITES_ENV= _MASTER_SITES_DEFAULT="${_MASTER_SITES_DEFAULT}"
2616 .for _F in ${DISTFILES}
2617 _F_TEMP= ${_F:S/^${_F:C/:[^:]+$//}//:S/^://}
2618 . if !empty(_F_TEMP)
2619 . for _group in ${_F_TEMP:S/,/ /g}
2620 . if defined(_MASTER_SITES_${_group})
2621 _MASTER_SITES_ENV+= _MASTER_SITES_${_group}="${_MASTER_SITES_${_group}}"
2626 _PATCH_SITES_ENV= _PATCH_SITES_DEFAULT="${_PATCH_SITES_DEFAULT}"
2627 .for _F in ${PATCHFILES}
2628 _F_TEMP= ${_F:S/^${_F:C/:[^-:][^:]*$//}//:S/^://}
2629 . if !empty(_F_TEMP)
2630 . for _group in ${_F_TEMP:S/,/ /g}
2631 . if defined(_PATCH_SITES_${_group})
2632 _PATCH_SITES_ENV+= _PATCH_SITES_${_group}="${_PATCH_SITES_${_group}}"
2639 @${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_MASTER_SITES_ALL}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
2641 @${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_PATCH_SITES_ALL}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
2643 # synonyms, mnemonics
2644 master-sites-all: master-sites-ALL
2645 patch-sites-all: patch-sites-ALL
2646 master-sites-default: master-sites-DEFAULT
2647 patch-sites-default: patch-sites-DEFAULT
2649 # compatibility with old behavior
2650 master-sites: master-sites-DEFAULT
2651 patch-sites: patch-sites-DEFAULT
2653 CKSUMFILES= ${ALLFILES}
2655 # List of all files, with ${DIST_SUBDIR} in front. Used for checksum.
2656 .if defined(DIST_SUBDIR)
2657 .if defined(CKSUMFILES) && ${CKSUMFILES}!=""
2658 _CKSUMFILES?= ${CKSUMFILES:S/^/${DIST_SUBDIR}\//}
2661 _CKSUMFILES?= ${CKSUMFILES}
2664 # This is what is actually going to be extracted, and is overridable
2666 EXTRACT_ONLY?= ${_DISTFILES}
2668 .if !target(maintainer)
2670 @${ECHO_CMD} "${MAINTAINER}"
2673 .if !defined(CATEGORIES)
2675 @${ECHO_MSG} "${PKGNAME}: Makefile error: CATEGORIES is mandatory."
2679 VALID_CATEGORIES+= accessibility afterstep arabic archivers astro audio \
2680 benchmarks biology cad chinese comms converters databases \
2681 deskutils devel docs dns editors elisp emulators enlightenment finance french ftp \
2682 games geography german gnome gnustep graphics hamradio haskell hebrew hungarian \
2683 ipv6 irc japanese java kde kld korean lang linux lisp \
2684 mail mate math mbone misc multimedia net net-im net-mgmt net-p2p news \
2685 palm parallel pear perl5 plan9 polish portuguese ports-mgmt \
2686 print python ruby rubygems russian \
2687 scheme science security shells spanish sysutils \
2689 ukrainian vietnamese windowmaker www \
2690 x11 x11-clocks x11-drivers x11-fm x11-fonts x11-servers x11-themes \
2691 x11-toolkits x11-wm xfce zope
2694 .for cat in ${CATEGORIES}
2695 . if empty(VALID_CATEGORIES:M${cat})
2696 @${ECHO_MSG} "${PKGNAME}: Makefile error: category ${cat} not in list of valid categories."; \
2702 PKGREPOSITORYSUBDIR?= All
2703 PKGREPOSITORY?= ${PACKAGES}/${PKGREPOSITORYSUBDIR}
2704 .if exists(${PACKAGES})
2705 PKGFILE?= ${PKGREPOSITORY}/${PKGNAME}${PKG_SUFX}
2707 PKGFILE?= ${.CURDIR}/${PKGNAME}${PKG_SUFX}
2710 # The "latest version" link -- ${PKGNAME} minus everthing after the last '-'
2711 PKGLATESTREPOSITORY?= ${PACKAGES}/Latest
2712 PKGBASE?= ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}
2713 LATEST_LINK?= ${PKGBASE}
2714 PKGLATESTFILE= ${PKGLATESTREPOSITORY}/${LATEST_LINK}${PKG_SUFX}
2716 CONFIGURE_SCRIPT?= configure
2717 CONFIGURE_TARGET?= ${ARCH}-portbld-${OPSYS:tl}${OSREL}
2718 CONFIGURE_TARGET:= ${CONFIGURE_TARGET:S/--build=//}
2719 CONFIGURE_LOG?= config.log
2721 # A default message to print if do-configure fails.
2722 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)."
2724 .if defined(GNU_CONFIGURE)
2725 # Maximum command line length
2726 .if !defined(CONFIGURE_MAX_CMD_LEN)
2727 CONFIGURE_MAX_CMD_LEN!= ${SYSCTL} -n kern.argmax
2729 GNU_CONFIGURE_PREFIX?= ${PREFIX}
2730 GNU_CONFIGURE_MANPREFIX?= ${MANPREFIX}
2731 CONFIG_SITE?= ${PORTSDIR}/Templates/config.site
2732 CONFIGURE_ARGS+= --prefix=${GNU_CONFIGURE_PREFIX} $${_LATE_CONFIGURE_ARGS}
2733 .if defined(X_BUILD_FOR)
2734 CONFIGURE_ARGS+= --host=${X_BUILD_FOR}
2736 CONFIGURE_ENV+= CONFIG_SITE=${CONFIG_SITE} lt_cv_sys_max_cmd_len=${CONFIGURE_MAX_CMD_LEN}
2739 SET_LATE_CONFIGURE_ARGS= \
2740 _LATE_CONFIGURE_ARGS="" ; \
2741 if [ ! -z "`./${CONFIGURE_SCRIPT} --help 2>&1 | ${GREP} -- '--mandir'`" ]; then \
2742 _LATE_CONFIGURE_ARGS="$${_LATE_CONFIGURE_ARGS} --mandir=${GNU_CONFIGURE_MANPREFIX}/man" ; \
2744 if [ ! -z "`./${CONFIGURE_SCRIPT} --help 2>&1 | ${GREP} -- '--infodir'`" ]; then \
2745 _LATE_CONFIGURE_ARGS="$${_LATE_CONFIGURE_ARGS} --infodir=${GNU_CONFIGURE_PREFIX}/${INFO_PATH}/${INFO_SUBDIR}" ; \
2747 if [ -z "`./${CONFIGURE_SCRIPT} --version 2>&1 | ${EGREP} -i '(autoconf.*2\.13|Unrecognized option)'`" ]; then \
2748 _LATE_CONFIGURE_ARGS="$${_LATE_CONFIGURE_ARGS} --build=${CONFIGURE_TARGET}" ; \
2750 _LATE_CONFIGURE_ARGS="$${_LATE_CONFIGURE_ARGS} ${CONFIGURE_TARGET}" ; \
2754 # Passed to most of script invocations
2755 SCRIPTS_ENV+= CURDIR=${MASTERDIR} DISTDIR=${DISTDIR} \
2756 WRKDIR=${WRKDIR} WRKSRC=${WRKSRC} PATCHDIR=${PATCHDIR} \
2757 SCRIPTDIR=${SCRIPTDIR} FILESDIR=${FILESDIR} \
2758 DFLY_PATCHDIR=${DFLY_PATCHDIR} \
2759 DFLY_FILESDIR=${DFLY_FILESDIR} \
2760 PORTSDIR=${PORTSDIR} PREFIX=${PREFIX} LOCALBASE=${LOCALBASE}
2763 SCRIPTS_ENV+= BATCH=yes
2766 .if ${PREFIX} == /usr
2767 MANPREFIX?= /usr/share
2769 MANPREFIX?= ${PREFIX}
2772 MANDIRS+= ${MANPREFIX}/man
2773 .for sect in 1 2 3 4 5 6 7 8 9
2774 MAN${sect}PREFIX?= ${MANPREFIX}
2776 MANLPREFIX?= ${MANPREFIX}
2777 MANNPREFIX?= ${MANPREFIX}
2779 .if ${PREFIX} == /usr
2780 INFO_PATH?= share/info
2786 RUN_DEPENDS+= indexinfo:${PORTSDIR}/print/indexinfo
2788 . for D in ${INFO:H}
2791 . if !defined(INFO_SUBDIR)
2793 . elif ${INFO_SUBDIR} != ${RD}
2794 BROKEN= only one subdirectory in INFO is allowed
2801 DOCSDIR_REL?= ${DOCSDIR:S,^${PREFIX}/,,}
2802 EXAMPLESDIR_REL?= ${EXAMPLESDIR:S,^${PREFIX}/,,}
2803 DATADIR_REL?= ${DATADIR:S,^${PREFIX}/,,}
2804 WWWDIR_REL?= ${WWWDIR:S,^${PREFIX}/,,}
2805 ETCDIR_REL?= ${ETCDIR:S,^${PREFIX}/,,}
2807 PLIST_SUB+= DOCSDIR="${DOCSDIR_REL}" \
2808 EXAMPLESDIR="${EXAMPLESDIR_REL}" \
2809 DATADIR="${DATADIR_REL}" \
2810 WWWDIR="${WWWDIR_REL}" \
2811 ETCDIR="${ETCDIR_REL}"
2813 DESKTOPDIR?= ${PREFIX}/share/applications
2817 ################################################################
2818 # Many ways to disable a port.
2820 # If we're in BATCH mode and the port is interactive, or we're
2821 # in interactive mode and the port is non-interactive, skip all
2822 # the important targets. The reason we have two modes is that
2823 # one might want to leave a build in BATCH mode running
2824 # overnight, then come back in the morning and do _only_ the
2825 # interactive ones that required your intervention.
2827 # Ignore ports that can't be resold if building for a CDROM.
2829 # Don't build a port if it's restricted and we don't want to get
2832 # Don't build a port if it's broken, unless we're running a parallel
2833 # build (in case it's fixed).
2835 # Don't build a port if it's forbidden for whatever reason.
2837 # Don't build a port if the system is too old.
2838 ################################################################
2840 # Check the machine architectures
2841 .if defined(ONLY_FOR_ARCHS)
2842 .for __ARCH in ${ONLY_FOR_ARCHS:S/amd64/x86_64/}
2843 .if ${ARCH:M${__ARCH}} != ""
2851 .if defined(NOT_FOR_ARCHS)
2852 .for __NARCH in ${NOT_FOR_ARCHS:S/amd64/x86_64/}
2853 .if ${ARCH:M${__NARCH}} != ""
2859 .if !defined(__ARCH_OK)
2860 .if defined(ONLY_FOR_ARCHS)
2861 IGNORE= is only for ${ONLY_FOR_ARCHS:S/amd64/x86_64/},
2862 .else # defined(NOT_FOR_ARCHS)
2863 IGNORE= does not run on ${NOT_FOR_ARCHS:S/amd64/x86_64/},
2865 IGNORE+= while you are running ${ARCH}
2867 .if defined(ONLY_FOR_ARCHS_REASON_${ARCH})
2868 IGNORE+= (reason: ${ONLY_FOR_ARCHS_REASON_${ARCH}})
2869 .elif defined(ONLY_FOR_ARCHS_REASON)
2870 IGNORE+= (reason: ${ONLY_FOR_ARCHS_REASON})
2873 .if defined(NOT_FOR_ARCHS_REASON_${ARCH})
2874 IGNORE+= (reason: ${NOT_FOR_ARCHS_REASON_${ARCH}})
2875 .elif defined(NOT_FOR_ARCHS_REASON)
2876 IGNORE+= (reason: ${NOT_FOR_ARCHS_REASON})
2881 # Check the user interaction and legal issues
2882 .if !defined(NO_IGNORE)
2883 .if (defined(IS_INTERACTIVE) && defined(BATCH))
2884 IGNORE= is an interactive port
2885 .elif (!defined(IS_INTERACTIVE) && defined(INTERACTIVE))
2886 IGNORE= is not an interactive port
2887 .elif (defined(NO_CDROM) && defined(FOR_CDROM))
2888 IGNORE= may not be placed on a CDROM: ${NO_CDROM}
2889 .elif (defined(RESTRICTED) && defined(NO_RESTRICTED))
2890 IGNORE= is restricted: ${RESTRICTED}
2891 .elif (defined(NO_PACKAGE) && defined(PACKAGE_BUILDING))
2892 IGNORE= may not be packaged: ${NO_PACKAGE}
2893 .elif defined(BROKEN)
2894 .if !defined(TRYBROKEN)
2895 IGNORE= is marked as broken: ${BROKEN}
2897 .elif defined(BROKEN_${ARCH})
2898 .if !defined(TRYBROKEN)
2899 IGNORE= is marked as broken on ${ARCH}: ${BROKEN_${ARCH}}
2901 .elif defined(FORBIDDEN)
2902 IGNORE= is forbidden: ${FORBIDDEN}
2905 # Define the text to be output to LEGAL
2906 .if defined(LEGAL_TEXT)
2907 LEGAL= ${LEGAL_TEXT}
2908 .elif defined(RESTRICTED)
2909 LEGAL= ${RESTRICTED}
2910 .elif defined(NO_CDROM)
2912 .elif defined(NO_PACKAGE) && ! defined(LEGAL_PACKAGE)
2913 LEGAL= ${NO_PACKAGE}
2916 .if (defined(MANUAL_PACKAGE_BUILD) && defined(PACKAGE_BUILDING))
2917 IGNORE= has to be built manually: ${MANUAL_PACKAGE_BUILD}
2923 .if defined(IGNORE_SILENT)
2924 IGNORECMD= ${DO_NADA}
2926 IGNORECMD= ${ECHO_MSG} "===> ${PKGNAME} "${IGNORE:Q}.;exit 1
2929 _TARGETS= check-sanity fetch checksum extract patch configure all build \
2930 install reinstall package stage restage
2932 .for target in ${_TARGETS}
2933 .if !target(${target})
2936 .if defined(INSTALLS_DEPENDS)
2946 .if defined(IGNORE) || defined(NO_PACKAGE)
2947 ignorelist: package-name
2953 .if defined(IGNORE) || defined(NO_PACKAGE)
2956 @${ECHO_CMD} "${PKGNAME}|IGNORE: "${IGNORE:Q}
2958 @${ECHO_CMD} "${PKGNAME}|NO_PACKAGE: "${NO_PACKAGE:Q}
2965 ################################################################
2966 # Clean directories for ftp or CDROM.
2967 ################################################################
2969 .if !defined(LICENSE)
2971 .if defined(RESTRICTED)
2972 clean-restricted: delete-distfiles delete-package
2973 clean-restricted-list: delete-distfiles-list delete-package-list
2974 RESTRICTED_FILES?= ${_DISTFILES} ${_PATCHFILES}
2977 clean-restricted-list:
2980 .if defined(NO_CDROM)
2981 clean-for-cdrom: delete-distfiles delete-package
2982 clean-for-cdrom-list: delete-distfiles-list delete-package-list
2983 RESTRICTED_FILES?= ${_DISTFILES} ${_PATCHFILES}
2986 clean-for-cdrom-list:
2989 .endif # !defined(LICENSE)
2991 .if defined(ALL_HOOK)
2993 @cd ${.CURDIR} && ${SETENV} CURDIR=${.CURDIR} DISTNAME=${DISTNAME} \
2994 DISTDIR=${DISTDIR} WRKDIR=${WRKDIR} WRKSRC=${WRKSRC} \
2995 PATCHDIR=${PATCHDIR} SCRIPTDIR=${SCRIPTDIR} \
2996 FILESDIR=${FILESDIR} PORTSDIR=${PORTSDIR} PREFIX=${PREFIX} \
2997 DFLY_PATCHDIR=${DFLY_PATCHDIR} DFLY_FILESDIR=${DFLY_FILESDIR} \
2998 BUILD_DEPENDS="${BUILD_DEPENDS}" RUN_DEPENDS="${RUN_DEPENDS}" \
2999 CONFLICTS="${CONFLICTS}" \
3007 .if !defined(DEPENDS_TARGET)
3008 .if defined(DEPENDS_PRECLEAN)
3009 DEPENDS_TARGET= clean
3010 DEPENDS_ARGS= NOCLEANDEPENDS=yes
3013 DEPENDS_TARGET+= reinstall
3015 DEPENDS_TARGET+= install
3017 .if defined(DEPENDS_CLEAN)
3018 DEPENDS_TARGET+= clean
3019 DEPENDS_ARGS+= NOCLEANDEPENDS=yes
3023 ################################################################
3025 # Do preliminary work to detect if we need to run the config
3028 ################################################################
3029 .if ((!defined(OPTIONS_DEFINE) && !defined(OPTIONS_SINGLE) && !defined(OPTIONS_MULTI)) \
3030 && !defined(OPTIONS_GROUP) && !defined(OPTIONS_RADIO) \
3031 || defined(CONFIG_DONE_${UNIQUENAME:tu}) || \
3032 defined(PACKAGE_BUILDING) || defined(BATCH))
3036 ################################################################
3037 # The following are used to create easy dummy targets for
3038 # disabling some bit of default target behavior you don't want.
3039 # They still check to see if the target exists, and if so don't
3040 # do anything, since you might want to set this globally for a
3041 # group of ports in a Makefile.inc, but still be able to
3042 # override from an individual Makefile.
3043 ################################################################
3046 .if defined(NO_CHECKSUM) && !target(checksum)
3052 .if defined(NO_BUILD) && !target(build)
3054 @${TOUCH} ${TOUCH_FLAGS} ${BUILD_COOKIE}
3058 .if defined(NO_PACKAGE) && !target(package)
3060 .if defined(IGNORE_SILENT)
3063 @${ECHO_MSG} "===> ${PKGNAME} may not be packaged: "${NO_PACKAGE:Q}.
3068 .if defined(NO_DESCRIBE) && !target(describe)
3073 ################################################################
3074 # More standard targets start here.
3076 # These are the body of the build/install framework. If you are
3077 # not happy with the default actions, and you can't solve it by
3078 # adding pre-* or post-* targets/scripts, override these.
3079 ################################################################
3086 .if defined(TRYBROKEN) && defined(BROKEN)
3087 buildanyway-message:
3088 @${ECHO_MSG} "Trying build of ${PKGNAME} even though it is marked BROKEN."
3092 .if defined(GNOME_OPTION_MSG) && (!defined(PACKAGE_BUILDING) || !defined(BATCH))
3093 @for m in ${GNOME_OPTION_MSG}; do \
3099 .if defined(_OPTIONS_READ)
3100 @${ECHO_MSG} "===> Found saved configuration for ${_OPTIONS_READ}"
3103 ${PKG_DBDIR} ${PREFIX} ${WRKDIR} ${WRKSRC}:
3104 @${MKDIR} ${.TARGET}
3106 # Warn user about deprecated packages. Advisory only.
3108 .if !target(check-deprecated)
3110 .if defined(DEPRECATED)
3111 @${ECHO_MSG} "===> NOTICE:"
3113 @${ECHO_MSG} "This port is deprecated; you may wish to reconsider installing it:"
3115 @${ECHO_MSG} ${DEPRECATED:Q}.
3117 .if defined(EXPIRATION_DATE)
3118 @${ECHO_MSG} "It is scheduled to be removed on or after ${EXPIRATION_DATE}."
3124 # Check if the port is listed in the vulnerability database
3126 AUDITFILE?= ${PKG_DBDIR}/vuln.xml
3127 _EXTRACT_AUDITFILE= ${CAT} "${AUDITFILE}"
3130 .if !defined(DISABLE_VULNERABILITIES) && !defined(PACKAGE_BUILDING)
3131 @if [ -f "${AUDITFILE}" ]; then \
3132 if [ -x "${PKG_BIN}" ]; then \
3133 vlist=`${PKG_BIN} audit "${PKGNAME}" || :`; \
3134 if [ "$${vlist}" = "0 problem(s) in the installed packages found." ]; then \
3137 elif [ "${PORTNAME}" = "pkg" ]; then \
3140 if [ -n "$$vlist" ]; then \
3141 ${ECHO_MSG} "===> ${PKGNAME} has known vulnerabilities:"; \
3142 ${ECHO_MSG} "$$vlist"; \
3143 ${ECHO_MSG} "=> Please update your ports tree and try again."; \
3144 ${ECHO_MSG} "=> Note: Vulnerable ports are marked as such even if there is no update available."; \
3145 ${ECHO_MSG} "=> If you wish to ignore this vulnerability rebuild with 'make DISABLE_VULNERABILITIES=yes'"; \
3151 # set alg to any of SIZE, SHA256 (or any other checksum algorithm):
3152 DISTINFO_DATA?= if [ \( -n "${DISABLE_SIZE}" -a -n "${NO_CHECKSUM}" \) -o ! -f "${DISTINFO_FILE}" ]; then exit; fi; \
3153 DIR=${DIST_SUBDIR}; ${AWK} -v alg=$$alg -v file=$${DIR:+$$DIR/}$${file} \
3154 '$$1 == alg && $$2 == "(" file ")" {print $$4}' ${DISTINFO_FILE}
3158 .if !target(do-fetch)
3160 @${MKDIR} ${_DISTDIR}
3162 ${_MASTER_SITES_ENV} ; \
3163 for _file in ${DISTFILES}; do \
3164 file=$${_file%%:*}; \
3165 if [ $$_file = $$file ]; then \
3168 select=`${ECHO_CMD} $${_file##*:} | ${SED} -e 's/,/ /g'` ; \
3170 force_fetch=false; \
3171 filebasename=$${file##*/}; \
3172 for afile in ${FORCE_FETCH}; do \
3173 afile=$${afile##*/}; \
3174 if [ "x$$afile" = "x$$filebasename" ]; then \
3178 if [ ! -f $$file -a ! -f $$filebasename -o "$$force_fetch" = "true" ]; then \
3179 if [ -L $$file -o -L $$filebasename ]; then \
3180 ${ECHO_MSG} "=> ${_DISTDIR}/$$file is a broken symlink."; \
3181 ${ECHO_MSG} "=> Perhaps a filesystem (most likely a CD) isn't mounted?"; \
3182 ${ECHO_MSG} "=> Please correct this problem and try again."; \
3185 if [ -f ${DISTINFO_FILE} -a "x${NO_CHECKSUM}" = "x" ]; then \
3186 _sha256sum=`alg=SHA256; ${DISTINFO_DATA}`; \
3187 if [ -z "$$_sha256sum" ]; then \
3188 ${ECHO_MSG} "=> $${DIR:+$$DIR/}$$file is not in ${DISTINFO_FILE}."; \
3189 ${ECHO_MSG} "=> Either ${DISTINFO_FILE} is out of date, or"; \
3190 ${ECHO_MSG} "=> $${DIR:+$$DIR/}$$file is spelled incorrectly."; \
3194 ${ECHO_MSG} "=> $$file doesn't seem to exist in ${_DISTDIR}."; \
3195 if [ ! -w ${_DISTDIR} ]; then \
3196 ${ECHO_MSG} "=> ${_DISTDIR} is not writable by you; cannot fetch."; \
3199 if [ ! -z "$$select" ] ; then \
3200 __MASTER_SITES_TMP= ; \
3201 for group in $$select; do \
3202 if [ ! -z \$${_MASTER_SITES_$${group}} ] ; then \
3203 eval ___MASTER_SITES_TMP="\$${_MASTER_SITES_$${group}}" ; \
3204 __MASTER_SITES_TMP="$${__MASTER_SITES_TMP} $${___MASTER_SITES_TMP}" ; \
3207 ___MASTER_SITES_TMP= ; \
3208 SORTED_MASTER_SITES_CMD_TMP="${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} $${__MASTER_SITES_TMP} | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}" ; \
3210 SORTED_MASTER_SITES_CMD_TMP="${SORTED_MASTER_SITES_DEFAULT_CMD}" ; \
3212 sites_remaining=0; \
3213 sites="`eval $$SORTED_MASTER_SITES_CMD_TMP ${_RANDOMIZE_SITES}`"; \
3214 for site in $${sites}; do \
3215 sites_remaining=$$(($${sites_remaining} + 1)); \
3217 for site in $${sites}; do \
3218 sites_remaining=$$(($${sites_remaining} - 1)); \
3219 ${ECHO_MSG} "=> Attempting to fetch $${site}$${file}"; \
3220 CKSIZE=`alg=SIZE; ${DISTINFO_DATA}`; \
3222 */*) ${MKDIR} $${file%/*}; \
3223 args="-o $${file} $${site}$${file}";; \
3224 *) args=$${site}$${file};; \
3226 if ${SETENV} ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${args} ${FETCH_AFTER_ARGS}; then \
3227 actual_size=`stat -f %z "$${file}"`; \
3228 if [ -n "${DISABLE_SIZE}" ] || [ -z "$${CKSIZE}" ] || [ $${actual_size} -eq $${CKSIZE} ]; then \
3231 ${ECHO_MSG} "=> Fetched file size mismatch (expected $${CKSIZE}, actual $${actual_size})"; \
3232 if [ $${sites_remaining} -gt 0 ]; then \
3233 ${ECHO_MSG} "=> Trying next site"; \
3234 ${RM} -f $${file}; \
3239 ${ECHO_MSG} "=> Couldn't fetch it - please try to retrieve this";\
3240 ${ECHO_MSG} "=> port manually into ${_DISTDIR} and try again."; \
3244 .if defined(PATCHFILES)
3246 ${_PATCH_SITES_ENV} ; \
3247 for _file in ${PATCHFILES}; do \
3248 file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^-:][^:]*$$//'` ; \
3249 select=`${ECHO_CMD} $${_file#$${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` ; \
3250 file=`${ECHO_CMD} $$file | ${SED} -E -e 's/:-[^:]+$$//'` ; \
3251 force_fetch=false; \
3252 filebasename=$${file##*/}; \
3253 for afile in ${FORCE_FETCH}; do \
3254 afile=$${afile##*/}; \
3255 if [ "x$$afile" = "x$$filebasename" ]; then \
3259 if [ ! -f $$file -a ! -f $$filebasename -o "$$force_fetch" = "true" ]; then \
3260 if [ -L $$file -o -L $${file##*/} ]; then \
3261 ${ECHO_MSG} "=> ${_DISTDIR}/$$file is a broken symlink."; \
3262 ${ECHO_MSG} "=> Perhaps a filesystem (most likely a CD) isn't mounted?"; \
3263 ${ECHO_MSG} "=> Please correct this problem and try again."; \
3266 ${ECHO_MSG} "=> $$file doesn't seem to exist in ${_DISTDIR}."; \
3267 if [ ! -z "$$select" ] ; then \
3268 __PATCH_SITES_TMP= ; \
3269 for group in $$select; do \
3270 if [ ! -z \$${_PATCH_SITES_$${group}} ] ; then \
3271 eval ___PATCH_SITES_TMP="\$${_PATCH_SITES_$${group}}" ; \
3272 __PATCH_SITES_TMP="$${__PATCH_SITES_TMP} $${___PATCH_SITES_TMP}" ; \
3275 ___PATCH_SITES_TMP= ; \
3276 SORTED_PATCH_SITES_CMD_TMP="${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} $${__PATCH_SITES_TMP} | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}" ; \
3278 SORTED_PATCH_SITES_CMD_TMP="${SORTED_PATCH_SITES_DEFAULT_CMD}" ; \
3280 sites_remaining=0; \
3281 sites="`eval $$SORTED_PATCH_SITES_CMD_TMP`"; \
3282 for site in $${sites}; do \
3283 sites_remaining=$$(($${sites_remaining} + 1)); \
3285 for site in $${sites}; do \
3286 sites_remaining=$$(($${sites_remaining} - 1)); \
3287 ${ECHO_MSG} "=> Attempting to fetch $${site}$${file}"; \
3288 CKSIZE=`alg=SIZE; ${DISTINFO_DATA}`; \
3290 */*) ${MKDIR} $${file%/*}; \
3291 args="-o $${file} $${site}$${file}";; \
3292 *) args=$${site}$${file};; \
3294 if ${SETENV} ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${args} ${FETCH_AFTER_ARGS}; then \
3295 actual_size=`stat -f %z "$${file}"`; \
3296 if [ -n "${DISABLE_SIZE}" ] || [ -z "$${CKSIZE}" ] || [ $${actual_size} -eq $${CKSIZE} ]; then \
3299 ${ECHO_MSG} "=> Fetched file size mismatch (expected $${CKSIZE}, actual $${actual_size})"; \
3300 if [ $${sites_remaining} -gt 1 ]; then \
3301 ${ECHO_MSG} "=> Trying next site"; \
3302 ${RM} -f $${file}; \
3307 ${ECHO_MSG} "=> Couldn't fetch it - please try to retrieve this";\
3308 ${ECHO_MSG} "=> port manually into ${_DISTDIR} and try again."; \
3318 @${RM} -rf ${WRKDIR}
3320 .if !target(do-extract)
3322 @for file in ${EXTRACT_ONLY}; do \
3323 if [ -n "${EXTRACT_CMD}" -a -z "${_INCLUDE_USES_ZIP_MK}" -a -z "${_INCLUDE_USES_LHA_MK}" ]; then \
3324 if ! (cd ${WRKDIR} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/$$file ${EXTRACT_AFTER_ARGS});\
3330 *.tar|*.tbz|*.tgz|*.txz|*.tar.bz2|*.tar.gz|*.tar.lzma|*.tar.xz|*.tar.Z) \
3331 if ! (cd ${WRKDIR} && ${TAR} ${TAR_BEFORE_ARGS} ${_DISTDIR}/$$file ${TAR_AFTER_ARGS}); \
3332 then exit 1; fi; ;; \
3334 if ! (cd ${WRKDIR} && ${LHA_CMD} ${LHA_BEFORE_ARGS} ${_DISTDIR}/$$file ${LHA_AFTER_ARGS}); \
3335 then exit 1; fi; ;; \
3336 *.zip|*.ZIP|*.xpi) \
3337 if ! (cd ${WRKDIR} && ${ZIP_EXTRACT_CMD} ${ZIP_BEFORE_ARGS} ${_DISTDIR}/$$file ${ZIP_AFTER_ARGS}); \
3338 then exit 1; fi; ;; \
3340 if ! (cd ${WRKDIR} && ${TAR} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/$$file ${EXTRA_AFTER_ARGS}); \
3341 then exit 1; fi; ;; \
3345 @if [ ${UID} = 0 ]; then \
3346 ${CHMOD} -R ug-s ${WRKDIR}; \
3347 ${CHOWN} -R 0:0 ${WRKDIR}; \
3353 .if !target(do-patch)
3355 .if defined(PATCHFILES)
3356 @${ECHO_MSG} "===> Applying distribution patches for ${PKGNAME}"
3359 patch_dist_strip () { \
3361 ${_PATCH_DIST_STRIP_CASES} \
3364 for i in ${_PATCHFILES}; do \
3365 if [ ${PATCH_DEBUG_TMP} = yes ]; then \
3366 ${ECHO_MSG} "===> Applying distribution patch $$i" ; \
3369 *.Z|*.gz) ${GZCAT} $$i ;; \
3370 *.bz2) ${BZCAT} $$i ;; \
3371 *.xz) ${XZCAT} $$i ;; \
3373 esac | ${PATCH} ${PATCH_DIST_ARGS} `patch_dist_strip $$i` ; \
3376 .if defined(EXTRA_PATCHES)
3378 for i in ${EXTRA_PATCHES}; do \
3380 *:-p[0-9]) patch_file=$${i%:*} ; patch_strip=$${i##*:} ;; \
3381 *) patch_file=$$i ;; \
3383 ${ECHO_MSG} "===> Applying extra patch $$patch_file" ; \
3384 case $$patch_file in \
3385 *.Z|*.gz) ${GZCAT} $$patch_file ;; \
3386 *.bz2) ${BZCAT} $$patch_file ;; \
3387 *.xz) ${XZCAT} $$patch_file ;; \
3388 *) ${CAT} $$patch_file ;; \
3389 esac | ${PATCH} ${PATCH_ARGS} $$patch_strip ; \
3393 if [ -d ${PATCHDIR} ]; then \
3394 if [ "`${ECHO_CMD} ${PATCHDIR}/patch-*`" != "${PATCHDIR}/patch-*" ]; then \
3395 ${ECHO_MSG} "===> Applying ports patches for ${PKGNAME}" ; \
3396 PATCHES_APPLIED="" ; \
3397 for i in ${PATCHDIR}/patch-*; do \
3399 *.orig|*.rej|*~|*,v) \
3400 ${ECHO_MSG} "===> Ignoring patchfile $$i" ; \
3403 if [ ${PATCH_DEBUG_TMP} = yes ]; then \
3404 ${ECHO_MSG} "===> Applying ${OPSYS} patch $$i" ; \
3406 if ${PATCH} ${PATCH_ARGS} < $$i ; then \
3407 PATCHES_APPLIED="$$PATCHES_APPLIED $$i" ; \
3409 ${ECHO_MSG} `${ECHO_CMD} "=> Patch $$i failed to apply cleanly." | ${SED} "s|${PATCHDIR}/||"` ; \
3410 if [ x"$$PATCHES_APPLIED" != x"" -a ${PATCH_SILENT} != "yes" ]; then \
3411 ${ECHO_MSG} `${ECHO_CMD} "=> Patch(es) $$PATCHES_APPLIED applied cleanly." | ${SED} "s|${PATCHDIR}/||g"` ; \
3420 @set -e ; if [ -d ${DFLY_PATCHDIR} ]; then \
3421 if [ "`${ECHO_CMD} ${DFLY_PATCHDIR}/patch-*`" != "${DFLY_PATCHDIR}/patch-*" ]; then \
3422 ${ECHO_MSG} "===> Applying ${OPSYS} patches for ${PKGNAME}" ; \
3423 PATCHES_APPLIED="" ; \
3424 for i in ${DFLY_PATCHDIR}/patch-*; do \
3426 *.orig|*.rej|*~|*,v) \
3427 ${ECHO_MSG} "===> Ignoring patchfile $$i" ; \
3430 if [ ${PATCH_DEBUG_TMP} = yes ]; then \
3431 ${ECHO_MSG} "===> Applying ${OPSYS} patch $$i" ; \
3433 if ${PATCH} ${PATCH_ARGS} < $$i ; then \
3434 PATCHES_APPLIED="$$PATCHES_APPLIED $$i" ; \
3436 ${ECHO_MSG} `${ECHO_CMD} "=> Patch $$i failed to apply cleanly." | ${SED} "s|${DFLY_PATCHDIR}/||"` ; \
3437 if [ x"$$PATCHES_APPLIED" != x"" ]; then \
3438 ${ECHO_MSG} `${ECHO_CMD} "=> Patch(es) $$PATCHES_APPLIED applied cleanly." | ${SED} "s|${DFLY_PATCHDIR}/||g"` ; \
3449 .if !target(run-autotools-fixup)
3450 run-autotools-fixup:
3451 # Work around an issue where FreeBSD 10.0 is detected as FreeBSD 1.x.
3452 .if ${OSVERSION} >= 1000000 && !defined(WITHOUT_FBSD10_FIX)
3453 -@for f in `${FIND} ${WRKDIR} -type f \( -name config.libpath -o \
3454 -name config.rpath -o -name configure -o -name libtool.m4 -o \
3455 -name ltconfig -o -name libtool -o -name aclocal.m4 -o \
3456 -name acinclude.m4 \)` ; do \
3457 ${SED} -i.fbsd10bak \
3458 -e 's|freebsd1\*)|freebsd1.\*)|g' \
3459 -e 's|freebsd\[12\]\*)|freebsd[12].*)|g' \
3460 -e 's|freebsd\[123\]\*)|freebsd[123].*)|g' \
3461 -e 's|freebsd\[\[12\]\]\*)|freebsd[[12]].*)|g' \
3462 -e 's|freebsd\[\[123\]\]\*)|freebsd[[123]].*)|g' \
3464 cmp -s $${f}.fbsd10bak $${f} || \
3465 ${ECHO_MSG} "===> FreeBSD 10 autotools fix applied to $${f}"; \
3466 ${TOUCH} ${TOUCH_FLAGS} -mr $${f}.fbsd10bak $${f} ; \
3467 ${RM} -f $${f}.fbsd10bak ; \
3474 .if !target(do-configure)
3476 @if [ -f ${SCRIPTDIR}/configure ]; then \
3477 cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \
3478 ${SCRIPTDIR}/configure; \
3480 .if defined(GNU_CONFIGURE)
3481 @CONFIG_GUESS_DIRS=$$(${FIND} ${WRKDIR} -name config.guess -o -name config.sub \
3482 | ${XARGS} -n 1 ${DIRNAME}); \
3483 for _D in $${CONFIG_GUESS_DIRS}; do \
3484 ${CP} -f ${TEMPLATES}/config.guess $${_D}/config.guess; \
3485 ${CHMOD} a+rx $${_D}/config.guess; \
3486 ${CP} -f ${TEMPLATES}/config.sub $${_D}/config.sub; \
3487 ${CHMOD} a+rx $${_D}/config.sub; \
3490 .if defined(HAS_CONFIGURE)
3491 @(cd ${CONFIGURE_WRKSRC} && \
3492 ${SET_LATE_CONFIGURE_ARGS} \
3493 if ! ${SETENV} CC="${CC}" CPP="${CPP}" CXX="${CXX}" \
3494 CFLAGS="${CFLAGS}" CPPFLAGS="${CPPFLAGS}" CXXFLAGS="${CXXFLAGS}" \
3495 LDFLAGS="${LDFLAGS}" LIBS="${LIBS}" \
3496 INSTALL="/usr/bin/install -c ${_BINOWNGRP}" \
3497 INSTALL_DATA="${INSTALL_DATA}" \
3498 INSTALL_LIB="${INSTALL_LIB}" \
3499 INSTALL_PROGRAM="${INSTALL_PROGRAM}" \
3500 INSTALL_SCRIPT="${INSTALL_SCRIPT}" \
3501 ${CONFIGURE_ENV} ./${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS}; then \
3502 ${ECHO_MSG} "===> Script \"${CONFIGURE_SCRIPT}\" failed unexpectedly."; \
3503 (${ECHO_CMD} ${CONFIGURE_FAIL_MESSAGE}) | ${FMT} 75 79 ; \
3510 # XXX: ${MAKE_ARGS:N${DESTDIRNAME}=*} would be easier but it is not valid with the old fmake
3511 DO_MAKE_BUILD?= ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_FLAGS} ${MAKEFILE} ${_MAKE_JOBS} ${MAKE_ARGS:C,^${DESTDIRNAME}=.*,,g}
3512 .if !target(do-build)
3514 @(cd ${BUILD_WRKSRC}; if ! ${DO_MAKE_BUILD} ${ALL_TARGET}; then \
3515 if [ -n "${BUILD_FAIL_MESSAGE}" ] ; then \
3516 ${ECHO_MSG} "===> Compilation failed unexpectedly."; \
3517 (${ECHO_CMD} "${BUILD_FAIL_MESSAGE}") | ${FMT} 75 79 ; \
3525 .if !target(check-conflicts)
3526 check-conflicts: check-build-conflicts check-install-conflicts
3529 .if !target(check-build-conflicts)
3530 check-build-conflicts:
3531 .if ( defined(CONFLICTS) || defined(CONFLICTS_BUILD) ) && !defined(DISABLE_CONFLICTS) && !defined(DEFER_CONFLICTS_CHECK)
3532 @conflicts_with=$$( \
3533 { ${PKG_QUERY} -g "%n-%v %p %o" ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_BUILD:C/.+/'&'/} 2>/dev/null || : ; } \
3534 | while read pkgname prfx orgn; do \
3535 if [ "/${PREFIX}" = "/$${prfx}" -a "/${PKGORIGIN}" != "/$${orgn}" ]; then \
3536 ${ECHO_CMD} -n " $${pkgname}"; \
3539 if [ -n "$${conflicts_with}" ]; then \
3541 ${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \
3542 for entry in $${conflicts_with}; do \
3543 ${ECHO_MSG} " $${entry}"; \
3546 ${ECHO_MSG} " They will not build together."; \
3547 ${ECHO_MSG} " Please remove them first with pkg delete."; \
3553 .if !target(identify-install-conflicts)
3554 identify-install-conflicts:
3555 .if ( defined(CONFLICTS) || defined(CONFLICTS_INSTALL) ) && !defined(DISABLE_CONFLICTS)
3556 @conflicts_with=$$( \
3557 { ${PKG_QUERY} -g "%n-%v %p %o" ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_INSTALL:C/.+/'&'/} 2>/dev/null || : ; } \
3558 | while read pkgname prfx orgn; do \
3559 if [ "/${PREFIX}" = "/$${prfx}" -a "/${PKGORIGIN}" != "/$${orgn}" ]; then \
3560 ${ECHO_CMD} -n " $${pkgname}"; \
3563 if [ -n "$${conflicts_with}" ]; then \
3565 ${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \
3566 for entry in $${conflicts_with}; do \
3567 ${ECHO_MSG} " $${entry}"; \
3570 ${ECHO_MSG} " They install files into the same place."; \
3571 ${ECHO_MSG} " You may want to stop build with Ctrl + C."; \
3577 .if !target(check-install-conflicts)
3578 check-install-conflicts:
3579 .if ( defined(CONFLICTS) || defined(CONFLICTS_INSTALL) || ( defined(CONFLICTS_BUILD) && defined(DEFER_CONFLICTS_CHECK) ) ) && !defined(DISABLE_CONFLICTS)
3580 .if defined(DEFER_CONFLICTS_CHECK)
3581 @conflicts_with=$$( \
3582 { ${PKG_QUERY} -g "%n-%v %p %o" ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_BUILD:C/.+/'&'/} ${CONFLICTS_INSTALL:C/.+/'&'/} 2>/dev/null || : ; } \
3583 | while read pkgname prfx orgn; do \
3584 if [ "/${PREFIX}" = "/$${prfx}" -a "/${PKGORIGIN}" != "/$${orgn}" ]; then \
3585 ${ECHO_CMD} -n " $${pkgname}"; \
3588 if [ -n "$${conflicts_with}" ]; then \
3590 ${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \
3591 for entry in $${conflicts_with}; do \
3592 ${ECHO_MSG} " $${entry}"; \
3595 ${ECHO_MSG} " Please remove them first with pkg delete."; \
3599 @conflicts_with=$$( \
3600 { ${PKG_QUERY} -g "%n-%v %p %o" ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_INSTALL:C/.+/'&'/} 2>/dev/null || : ; } \
3601 | while read pkgname prfx orgn; do \
3602 if [ "/${PREFIX}" = "/$${prfx}" -a "/${PKGORIGIN}" != "/$${orgn}" ]; then \
3603 ${ECHO_CMD} -n " $${pkgname}"; \
3606 if [ -n "$${conflicts_with}" ]; then \
3608 ${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \
3609 for entry in $${conflicts_with}; do \
3610 ${ECHO_MSG} " $${entry}"; \
3613 ${ECHO_MSG} " They install files into the same place."; \
3614 ${ECHO_MSG} " Please remove them first with pkg delete."; \
3617 .endif # defined(DEFER_CONFLICTS_CHECK)
3623 .if !target(do-install) && !defined(NO_INSTALL)
3625 @(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${FAKEROOT} ${MAKE_CMD} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET})
3630 .if !target(do-package)
3631 PKG_CREATE_ARGS= -r ${STAGEDIR} -m ${METADIR} -p ${TMPPLIST}
3632 do-package: create-manifest
3633 do-package: ${TMPPLIST}
3634 @if [ -d ${PACKAGES} ]; then \
3635 if [ ! -d ${PKGREPOSITORY} ]; then \
3636 if ! ${MKDIR} ${PKGREPOSITORY}; then \
3637 ${ECHO_MSG} "=> Can't create directory ${PKGREPOSITORY}."; \
3642 @for cat in ${CATEGORIES}; do \
3643 ${RM} -f ${PACKAGES}/$$cat/${PKGNAMEPREFIX}${PORTNAME}*${PKG_SUFX} ; \
3645 @${MKDIR} ${WRKDIR}/pkg
3646 @if ${SETENV} ${PKG_ENV} FORCE_POST="${_FORCE_POST_PATTERNS}" ${PKG_CREATE} ${PKG_CREATE_ARGS} -f ${PKG_SUFX:S/.//} -o ${WRKDIR}/pkg ${PKGNAME}; then \
3647 if [ -d ${PKGREPOSITORY} -a -w ${PKGREPOSITORY} ]; then \
3648 ${LN} -f ${WRKDIR}/pkg/${PKGNAME}${PKG_SUFX} ${PKGFILE} 2>/dev/null \
3649 || ${CP} -f ${WRKDIR}/pkg/${PKGNAME}${PKG_SUFX} ${PKGFILE}; \
3650 if [ "${PKGORIGIN}" = "ports-mgmt/pkg" -o "${PKGORIGIN}" = "ports-mgmt/pkg-devel" ]; then \
3651 if [ ! -d ${PKGLATESTREPOSITORY} ]; then \
3652 if ! ${MKDIR} ${PKGLATESTREPOSITORY}; then \
3653 ${ECHO_MSG} "=> Can't create directory ${PKGLATESTREPOSITORY}."; \
3657 ${LN} -sf ../${PKGREPOSITORYSUBDIR}/${PKGNAME}${PKG_SUFX} ${PKGLATESTFILE} ; \
3661 cd ${.CURDIR} && eval ${MAKE} delete-package >/dev/null; \
3665 # Some support rules for do-package
3667 .if !target(delete-package)
3669 @${ECHO_MSG} "===> Deleting package for ${PKGNAME}"
3670 # When staging, the package may only be in the workdir if not root
3671 @${RM} -f ${PKGFILE} ${WRKDIR}/pkg/${PKGNAME}${PKG_SUFX} 2>/dev/null || :
3674 .if !target(delete-package-list)
3675 delete-package-list:
3676 @${ECHO_CMD} "[ -f ${PKGFILE} ] && (${ECHO_CMD} deleting ${PKGFILE}; ${RM} -f ${PKGFILE})"
3679 # Used by scripts and users to install a package from local repository.
3680 # Poudriere -i uses this, please keep.
3681 .if !target(install-package)
3682 .if defined(FORCE_PKG_REGISTER)
3683 _INSTALL_PKG_ARGS= -f
3685 .if defined(INSTALLS_DEPENDS)
3686 _INSTALL_PKG_ARGS+= -A
3689 @if [ -f "${WRKDIR}/pkg/${PKGNAME}${PKG_SUFX}" ]; then \
3690 _pkgfile="${WRKDIR}/pkg/${PKGNAME}${PKG_SUFX}"; \
3692 _pkgfile="${PKGFILE}"; \
3694 ${PKG_ADD} ${_INSTALL_PKG_ARGS} $${_pkgfile}
3698 # Utility targets follow
3700 .if !target(check-already-installed)
3701 .if !defined(NO_PKG_REGISTER) && !defined(FORCE_PKG_REGISTER)
3702 check-already-installed:
3703 @${ECHO_MSG} "===> Checking if ${PKGBASE} already installed"; \
3704 pkgname=`${PKG_INFO} -q -O ${PKGBASE}`; \
3705 if [ -n "$${pkgname}" ]; then \
3706 v=`${PKG_VERSION} -t $${pkgname} ${PKGNAME}`; \
3707 if [ "$${v}" = "<" ]; then \
3708 ${ECHO_CMD} "===> An older version of ${PKGBASE} is already installed ($${pkgname})"; \
3710 ${ECHO_CMD} "===> ${PKGNAME} is already installed"; \
3712 ${ECHO_MSG} " You may wish to \`\`make deinstall'' and install this port again"; \
3713 ${ECHO_MSG} " by \`\`make reinstall'' to upgrade it properly."; \
3714 ${ECHO_MSG} " If you really wish to overwrite the old port of ${PKGBASE}"; \
3715 ${ECHO_MSG} " without deleting it first, set the variable \"FORCE_PKG_REGISTER\""; \
3716 ${ECHO_MSG} " in your environment or the \"make install\" command line."; \
3722 .if !target(check-umask)
3724 @if [ `${SH} -c umask` != 0022 ]; then \
3725 ${ECHO_MSG} "===> Warning: your umask is \"`${SH} -c umask`"\".; \
3726 ${ECHO_MSG} " If this is not desired, set it to an appropriate value"; \
3727 ${ECHO_MSG} " and install this port again by \`\`make reinstall''."; \
3731 .if !target(install-mtree)
3736 .if !target(install-ldconfig-file)
3737 install-ldconfig-file:
3738 .if defined(USE_LDCONFIG) || defined(USE_LDCONFIG32)
3739 .if defined(USE_LDCONFIG)
3740 .if defined(USE_LINUX_PREFIX)
3742 .if ${USE_LDCONFIG} != "${LOCALBASE}/lib" && !defined(INSTALL_AS_USER)
3743 @${ECHO_MSG} "===> Installing ldconfig configuration file"
3744 .if defined(NO_MTREE) || ${PREFIX} != ${LOCALBASE}
3745 @${MKDIR} ${STAGEDIR}${LOCALBASE}/${LDCONFIG_DIR}
3747 @${ECHO_CMD} ${USE_LDCONFIG} | ${TR} ' ' '\n' \
3748 > ${STAGEDIR}${LOCALBASE}/${LDCONFIG_DIR}/${UNIQUENAME}
3749 @${ECHO_CMD} ${LOCALBASE}/${LDCONFIG_DIR}/${UNIQUENAME} >> ${TMPPLIST}
3753 .if defined(USE_LDCONFIG32)
3754 .if !defined(INSTALL_AS_USER)
3755 @${ECHO_MSG} "===> Installing 32-bit ldconfig configuration file"
3756 .if defined(NO_MTREE) || ${PREFIX} != ${LOCALBASE}
3757 @${MKDIR} ${STAGEDIR}${LOCALBASE}/${LDCONFIG32_DIR}
3759 @${ECHO_CMD} ${USE_LDCONFIG32} | ${TR} ' ' '\n' \
3760 > ${STAGEDIR}${LOCALBASE}/${LDCONFIG32_DIR}/${UNIQUENAME}
3761 @${ECHO_CMD} ${LOCALBASE}/${LDCONFIG32_DIR}/${UNIQUENAME} >> ${TMPPLIST}
3767 .if !target(create-users-groups)
3768 .if defined(GROUPS) || defined(USERS)
3769 _UG_OUTPUT= ${WRKDIR}/users-groups.sh
3770 PKGPREINSTALL+= ${_UG_OUTPUT}
3771 create-users-groups:
3773 .for _file in ${GID_FILES}
3774 .if !exists(${_file})
3775 @${ECHO_CMD} "** ${_file} doesn't exist. Exiting."; exit 1
3778 @${RM} -f ${_UG_OUTPUT} || ${TRUE}
3779 @${ECHO_MSG} "===> Creating users and/or groups."
3780 @${ECHO_CMD} "echo \"===> Creating users and/or groups.\"" >> ${_UG_OUTPUT}
3781 .for _group in ${GROUPS}
3783 @if ! ${GREP} -h ^${_group}: ${GID_FILES} >/dev/null 2>&1; then \
3784 ${ECHO_CMD} "** Cannot find any information about group \`${_group}' in ${GID_FILES}."; \
3787 @IFS=":"; ${GREP} -h ^${_group}: ${GID_FILES} | head -n 1 | while read group foo gid members; do \
3788 gid=$$(($$gid+${GID_OFFSET})); \
3789 ${ECHO_CMD} -e "if ! ${PW} groupshow $$group >/dev/null 2>&1; then \n \
3790 echo \"Creating group '$$group' with gid '$$gid'.\" \n \
3791 ${PW} groupadd $$group -g $$gid; else echo \"Using existing group '$$group'.\"\nfi" >> ${_UG_OUTPUT}; \
3796 .for _file in ${UID_FILES}
3797 .if !exists(${_file})
3798 @${ECHO_CMD} "** ${_file} doesn't exist. Exiting."; exit 1
3801 .for _user in ${USERS}
3802 # _bgpd:*:130:130:BGP Daemon:/var/empty:/sbin/nologin
3803 @if ! ${GREP} -h ^${_user}: ${UID_FILES} >/dev/null 2>&1; then \
3804 ${ECHO_CMD} "** Cannot find any information about user \`${_user}' in ${UID_FILES}."; \
3807 @IFS=":"; ${GREP} -h ^${_user}: ${UID_FILES} | head -n 1 | while read login passwd uid gid class change expire gecos homedir shell; do \
3808 uid=$$(($$uid+${UID_OFFSET})); \
3809 gid=$$(($$gid+${GID_OFFSET})); \
3810 class="$${class:+-L }$$class"; \
3811 homedir=$$(echo $$homedir | sed "s|^/usr/local|${PREFIX}|"); \
3812 ${ECHO_CMD} -e "if ! ${PW} usershow $$login >/dev/null 2>&1; then \n \
3813 echo \"Creating user '$$login' with uid '$$uid'.\" \n \
3814 ${PW} useradd $$login -u $$uid -g $$gid $$class -c \"$$gecos\" -d $$homedir -s $$shell \n \
3815 else \necho \"Using existing user '$$login'.\" \nfi" >> ${_UG_OUTPUT}; \
3816 case $$homedir in /|/nonexistent|/var/empty) ;; *) ${ECHO_CMD} "${INSTALL} -d -g $$gid -o $$uid $$homedir" >> ${_UG_OUTPUT};; esac; \
3820 .for _group in ${GROUPS}
3821 # mail:*:6:postfix,clamav
3822 @IFS=":"; ${GREP} -h ^${_group}: ${GID_FILES} | head -n 1 | while read group foo gid members; do \
3823 gid=$$(($$gid+${GID_OFFSET})); \
3824 IFS=","; for _login in $$members; do \
3825 for _user in ${USERS}; do \
3826 if [ "x$${_user}" = "x$${_login}" ]; then \
3827 ${ECHO_CMD} -e "if ! ${PW} groupshow ${_group} | ${GREP} -qw $${_login}; then \n \
3828 echo \"Adding user '$${_login}' to group '${_group}'.\" \n \
3829 ${PW} groupmod ${_group} -m $${_login} \nfi" >> ${_UG_OUTPUT}; \
3837 .for _user in ${USERS}
3838 @if [ ! ${USERS_BLACKLIST:M${_user}} ]; then \
3839 ${ECHO_CMD} "@unexec if ${PW} usershow ${_user} >/dev/null 2>&1; then \
3840 echo \"==> You should manually remove the \\\"${_user}\\\" user. \"; fi" >> ${TMPPLIST}; \
3848 .if !defined(DISABLE_SECURITY_CHECK)
3849 .if !target(security-check)
3850 security-check: ${TMPPLIST}
3853 # 2. accept()/recvfrom() which indicates network listening capability
3854 # 3. insecure functions (gets/mktemp/tempnam/[XXX])
3855 # 4. startup scripts, in conjunction with 2.
3856 # 5. world-writable files/dirs
3858 -@${RM} -f ${WRKDIR}/.PLIST.setuid ${WRKDIR}/.PLIST.writable ${WRKDIR}/.PLIST.objdump; \
3859 ${AWK} -v prefix='${PREFIX}' ' \
3860 match($$0, /^@cwd /) { prefix = substr($$0, RSTART + RLENGTH); if (prefix == "/") prefix=""; next; } \
3862 /^\// { print; next; } \
3863 { print prefix "/" $$0; } \
3864 ' ${TMPPLIST} > ${WRKDIR}/.PLIST.flattened; \
3865 ${TR} '\n' '\0' < ${WRKDIR}/.PLIST.flattened \
3866 | ${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; \
3867 ${TR} '\n' '\0' < ${WRKDIR}/.PLIST.flattened \
3868 | ${XARGS} -0 -J % ${FIND} % -prune -perm -0002 \! -type l 2> /dev/null > ${WRKDIR}/.PLIST.writable; \
3869 ${TR} '\n' '\0' < ${WRKDIR}/.PLIST.flattened \
3870 | ${XARGS} -0 -J % ${FIND} % -prune ! -type l -type f -print0 2> /dev/null \
3871 | ${XARGS} -0 -n 1 ${OBJDUMP} -R 2> /dev/null > ${WRKDIR}/.PLIST.objdump; \
3873 ! ${AWK} -v audit="$${PORTS_AUDIT}" -f ${SCRIPTSDIR}/security-check.awk \
3874 ${WRKDIR}/.PLIST.flattened ${WRKDIR}/.PLIST.objdump ${WRKDIR}/.PLIST.setuid ${WRKDIR}/.PLIST.writable; \
3876 www_site=$$(cd ${.CURDIR} && ${MAKE} www-site); \
3877 if [ ! -z "$${www_site}" ]; then \
3879 ${ECHO_MSG} " For more information, and contact details about the security"; \
3880 ${ECHO_MSG} " status of this software, see the following webpage: "; \
3881 ${ECHO_MSG} "$${www_site}"; \
3885 .else # i.e. defined(DISABLE_SECURITY_CHECK)
3887 @${ECHO_MSG} " WARNING: Security check has been disabled."
3888 .endif # !defined(DISABLE_SECURITY_CHECK)
3890 ################################################################
3891 # Skeleton targets start here
3893 # You shouldn't have to change these. Either add the pre-* or
3894 # post-* targets/scripts or redefine the do-* targets. These
3895 # targets don't do anything other than checking for cookies and
3896 # call the necessary targets/scripts.
3897 ################################################################
3900 @${ECHO_MSG} "===> Extracting for ${PKGNAME}"
3902 @${ECHO_MSG} "===> Patching for ${PKGNAME}"
3904 @${ECHO_MSG} "===> Configuring for ${PKGNAME}"
3906 @${ECHO_MSG} "===> Building for ${PKGNAME}"
3908 @${ECHO_MSG} "===> Staging for ${PKGNAME}"
3910 @${ECHO_MSG} "===> Installing for ${PKGNAME}"
3912 @${ECHO_MSG} "===> Building package for ${PKGNAME}"
3914 # Empty pre-* and post-* targets
3916 .for stage in pre post
3917 .for name in pkg check-sanity fetch extract patch configure build stage install package
3919 .if exists(${SCRIPTDIR}/${stage}-${name})
3920 .if !target(${stage}-${name}-script)
3921 ${stage}-${name}-script:
3922 @ cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \
3923 ${SCRIPTDIR}/${.TARGET:S/-script$//}
3930 .if !target(pretty-print-www-site)
3931 pretty-print-www-site:
3932 @www_site=$$(cd ${.CURDIR} && ${MAKE} www-site); \
3933 if [ -n "$${www_site}" ]; then \
3934 ${ECHO_MSG} -n " and/or visit the "; \
3935 ${ECHO_MSG} -n "<a href=\"$${www_site}\">web site</a>"; \
3936 ${ECHO_MSG} " for further information"; \
3940 ################################################################
3941 # Some more targets supplied for users' convenience
3942 ################################################################
3946 # Special target to verify patches
3948 .if !target(checkpatch)
3950 @cd ${.CURDIR} && ${MAKE} ${PATCH_SILENT} PATCH_CHECK_ONLY=yes ${_PATCH_DEP} ${_PATCH_REAL_SEQ}
3955 # Special target to re-run install
3957 .if !target(reinstall)
3959 @${RM} -f ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
3960 @cd ${.CURDIR} && DEPENDS_TARGET="${DEPENDS_TARGET}" ${MAKE} -DFORCE_PKG_REGISTER install
3963 .if !target(restage)
3965 @${RM} -rf ${STAGEDIR} ${STAGE_COOKIE} ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
3966 @cd ${.CURDIR} && ${MAKE} stage
3971 # Special target to remove installation
3973 .if !target(deinstall)
3975 .if defined(UID) && ${UID} != 0 && !defined(INSTALL_AS_USER)
3976 @${ECHO_MSG} "===> Switching to root credentials for '${.TARGET}' target"
3978 ${SU_CMD} "${MAKE} ${.TARGET}"
3979 @${ECHO_MSG} "===> Returning to user credentials"
3981 @${ECHO_MSG} "===> Deinstalling for ${PKGBASE}"
3982 @if ${PKG_INFO} -e ${PKGBASE}; then \
3983 p=`${PKG_INFO} -q -O ${PKGBASE}`; \
3984 ${ECHO_MSG} "===> Deinstalling $${p}"; \
3985 ${PKG_DELETE} -f ${PKGBASE} ; \
3987 ${ECHO_MSG} "===> ${PKGBASE} not installed, skipping"; \
3989 @${RM} -f ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
3995 # Special target to remove installation of all ports of the same origin
3997 .if !target(deinstall-all)
3999 .if ${UID} != 0 && !defined(INSTALL_AS_USER)
4000 @${ECHO_MSG} "===> Switching to root credentials for '${.TARGET}' target"
4002 ${SU_CMD} "${MAKE} ${.TARGET}"
4003 @${ECHO_MSG} "===> Returning to user credentials"
4005 @${ECHO_MSG} "===> Deinstalling for ${PKGORIGIN}"
4006 @deinstall_names=`${PKG_INFO} -q -O ${PKGORIGIN}`; \
4007 for oldpkgorigin in $$(${GREP} "|${PKGORIGIN}|" ${PORTSDIR}/MOVED | ${CUT} -f 1 -d '|' | ${SORT} -u); do \
4008 deinstall_names="$${deinstall_names} $$(${PKG_INFO} -q -O $${oldpkgorigin})"; \
4010 if [ -n "$${deinstall_names}" ]; then \
4011 for d in $${deinstall_names}; do \
4012 ${ECHO_MSG} "===> Deinstalling $${d}"; \
4013 ${PKG_DELETE} -f $${d}; \
4016 ${ECHO_MSG} "===> ${PKGORIGIN} not installed, skipping"; \
4018 ${RM} -f ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
4024 .if !target(do-clean)
4026 .if defined(NEED_ROOT) && ${UID} != 0 && !defined(INSTALL_AS_USER) && exists(${STAGE_COOKIE})
4027 @${ECHO_MSG} "===> Switching to root credentials for '${.TARGET}' target"
4029 ${SU_CMD} "${MAKE} ${.TARGET}"
4030 @${ECHO_MSG} "===> Returning to user credentials"
4032 @if [ -d ${WRKDIR} ]; then \
4033 if [ -w ${WRKDIR} ]; then \
4034 ${RM} -rf ${WRKDIR}; \
4036 ${ECHO_MSG} "===> ${WRKDIR} not writable, skipping"; \
4044 .if !defined(NOCLEANDEPENDS)
4045 @cd ${.CURDIR} && ${MAKE} limited-clean-depends
4047 @${ECHO_MSG} "===> Cleaning for ${PKGNAME}"
4048 .if target(pre-clean)
4049 @cd ${.CURDIR} && ${MAKE} pre-clean
4051 @cd ${.CURDIR} && ${MAKE} do-clean
4052 .if target(post-clean)
4053 @cd ${.CURDIR} && ${MAKE} post-clean
4057 .if !target(pre-distclean)
4062 .if !target(distclean)
4063 distclean: pre-distclean clean
4064 @cd ${.CURDIR} && ${MAKE} delete-distfiles RESTRICTED_FILES="${_DISTFILES} ${_PATCHFILES}"
4067 .if !target(delete-distfiles)
4069 @${ECHO_MSG} "===> Deleting distfiles for ${PKGNAME}"
4070 @(if [ "X${RESTRICTED_FILES}" != "X" -a -d ${_DISTDIR} ]; then \
4072 for file in ${RESTRICTED_FILES}; do \
4073 ${RM} -f $${file}; \
4075 if [ "$${dir}" != "$${file}" ]; then \
4076 ${RMDIR} -p $${dir} >/dev/null 2>&1 || :; \
4080 .if defined(DIST_SUBDIR)
4081 -@${RMDIR} ${_DISTDIR} >/dev/null 2>&1 || ${TRUE}
4085 .if !target(delete-distfiles-list)
4086 delete-distfiles-list:
4087 @${ECHO_CMD} "# ${PKGNAME}"
4088 @if [ "X${RESTRICTED_FILES}" != "X" ]; then \
4089 for file in ${RESTRICTED_FILES}; do \
4090 ${ECHO_CMD} "[ -f ${_DISTDIR}/$$file ] && (${ECHO_CMD} deleting ${_DISTDIR}/$$file; ${RM} -f ${_DISTDIR}/$$file)"; \
4092 if [ "$${dir}" != "$${file}" ]; then \
4093 ${ECHO_CMD} "(cd ${_DISTDIR} && ${RMDIR} -p $${dir} 2>/dev/null)"; \
4097 .if defined(DIST_SUBDIR)
4098 @${ECHO_CMD} "${RMDIR} ${_DISTDIR} 2>/dev/null || ${TRUE}"
4102 # Prints out a list of files to fetch (useful to do a batch fetch)
4104 .if !target(fetch-list)
4106 @${MKDIR} ${_DISTDIR}
4108 ${_MASTER_SITES_ENV} ; \
4109 for _file in ${DISTFILES}; do \
4110 file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^:]+$$//'` ; \
4111 select=`${ECHO_CMD} $${_file#$${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` ; \
4112 if [ ! -f $$file -a ! -f $${file##*/} ]; then \
4113 if [ ! -z "$$select" ] ; then \
4114 __MASTER_SITES_TMP= ; \
4115 for group in $$select; do \
4116 if [ ! -z \$${_MASTER_SITES_$${group}} ] ; then \
4117 eval ___MASTER_SITES_TMP=\$${_MASTER_SITES_$${group}} ; \
4118 __MASTER_SITES_TMP="$${__MASTER_SITES_TMP} $${___MASTER_SITES_TMP}" ; \
4121 ___MASTER_SITES_TMP= ; \
4122 SORTED_MASTER_SITES_CMD_TMP="${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} $${__MASTER_SITES_TMP} | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}" ; \
4124 SORTED_MASTER_SITES_CMD_TMP="${SORTED_MASTER_SITES_DEFAULT_CMD}" ; \
4126 for site in `eval $$SORTED_MASTER_SITES_CMD_TMP ${_RANDOMIZE_SITES}`; do \
4127 if [ ! -z "`${ECHO_CMD} ${NOFETCHFILES} | ${GREP} -w $${file}`" ]; then \
4128 if [ -z "`${ECHO_CMD} ${MASTER_SITE_OVERRIDE} | ${GREP} -w $${site}`" ]; then \
4132 DIR=${DIST_SUBDIR};\
4133 CKSIZE=`alg=SIZE; ${DISTINFO_DATA}`; \
4135 */*) args="-o $${file} $${site}$${file}";; \
4136 *) args=$${site}$${file};; \
4138 ${ECHO_CMD} -n ${SETENV} ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${args} "${FETCH_AFTER_ARGS}" '|| ' ; \
4140 ${ECHO_CMD} "${ECHO_CMD} $${file} not fetched" ; \
4143 .if defined(PATCHFILES)
4145 ${_PATCH_SITES_ENV} ; \
4146 for _file in ${PATCHFILES}; do \
4147 file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^-:][^:]*$$//'` ; \
4148 select=`${ECHO_CMD} $${_file#$${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` ; \
4149 file=`${ECHO_CMD} $$file | ${SED} -E -e 's/:-[^:]+$$//'` ; \
4150 if [ ! -f $$file -a ! -f $${file##*/} ]; then \
4151 if [ ! -z "$$select" ] ; then \
4152 __PATCH_SITES_TMP= ; \
4153 for group in $$select; do \
4154 if [ ! -z \$${_PATCH_SITES_$${group}} ] ; then \
4155 eval ___PATCH_SITES_TMP=\$${_PATCH_SITES_$${group}} ; \
4156 __PATCH_SITES_TMP="$${__PATCH_SITES_TMP} $${___PATCH_SITES_TMP}" ; \
4159 ___PATCH_SITES_TMP= ; \
4160 SORTED_PATCH_SITES_CMD_TMP="${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} $${__PATCH_SITES_TMP} | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}" ; \
4162 SORTED_PATCH_SITES_CMD_TMP="${SORTED_PATCH_SITES_DEFAULT_CMD}" ; \
4164 for site in `eval $$SORTED_PATCH_SITES_CMD_TMP ${_RANDOMIZE_SITES}`; do \
4165 CKSIZE=`alg=SIZE; ${DISTINFO_DATA}`; \
4167 */*) args="-o $${file} $${site}$${file}";; \
4168 *) args=$${site}$${file};; \
4170 ${ECHO_CMD} -n ${SETENV} ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${args} "${FETCH_AFTER_ARGS}" '|| ' ; \
4172 ${ECHO_CMD} "${ECHO_CMD} $${file} not fetched" ; \
4178 .if !target(fetch-url-list-int)
4180 @${MKDIR} ${_DISTDIR}
4182 ${_MASTER_SITES_ENV}; \
4183 for _file in ${DISTFILES}; do \
4184 file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^:]+$$//'` ; \
4185 fileptn=`${ECHO_CMD} $$file | ${SED} 's|/|\\\\/|g;s/\./\\\\./g;s/\+/\\\\+/g;s/\?/\\\\?/g'` ; \
4186 select=`${ECHO_CMD} $${_file#$${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` ; \
4187 if [ ! -z "${LISTALL}" -o ! -f $$file -a ! -f $${file##*/} ]; then \
4188 if [ ! -z "$$select" ] ; then \
4189 __MASTER_SITES_TMP= ; \
4190 for group in $$select; do \
4191 if [ ! -z \$${_MASTER_SITES_$${group}} ] ; then \
4192 eval ___MASTER_SITES_TMP=\$${_MASTER_SITES_$${group}} ; \
4193 __MASTER_SITES_TMP="$${__MASTER_SITES_TMP} $${___MASTER_SITES_TMP}" ; \
4196 ___MASTER_SITES_TMP= ; \
4197 SORTED_MASTER_SITES_CMD_TMP="${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} $${__MASTER_SITES_TMP} | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}" ; \
4199 SORTED_MASTER_SITES_CMD_TMP="${SORTED_MASTER_SITES_DEFAULT_CMD}" ; \
4201 for site in `eval $$SORTED_MASTER_SITES_CMD_TMP ${_RANDOMIZE_SITES}`; do \
4203 */*) args="-o $${file} $${site}$${file}";; \
4204 *) args=$${site}$${file};; \
4206 ${ECHO_CMD} $${args} ; \
4210 .if defined(PATCHFILES)
4212 ${_PATCH_SITES_ENV} ; \
4213 for _file in ${PATCHFILES}; do \
4214 file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^-:][^:]*$$//'` ; \
4215 select=`${ECHO_CMD} $${_file#$${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` ; \
4216 file=`${ECHO_CMD} $$file | ${SED} -E -e 's/:-[^:]+$$//'` ; \
4217 fileptn=`${ECHO_CMD} $$file | ${SED} 's|/|\\\\/|g;s/\./\\\\./g;s/\+/\\\\+/g;s/\?/\\\\?/g'` ; \
4218 if [ ! -z "${LISTALL}" -o ! -f $$file -a ! -f $${file##*/} ]; then \
4219 if [ ! -z "$$select" ] ; then \
4220 __PATCH_SITES_TMP= ; \
4221 for group in $$select; do \
4222 if [ ! -z \$${_PATCH_SITES_$${group}} ] ; then \
4223 eval ___PATCH_SITES_TMP=\$${_PATCH_SITES_$${group}} ; \
4224 __PATCH_SITES_TMP="$${__PATCH_SITES_TMP} $${___PATCH_SITES_TMP}" ; \
4227 ___PATCH_SITES_TMP= ; \
4228 SORTED_PATCH_SITES_CMD_TMP="${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} $${__PATCH_SITES_TMP} | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}" ; \
4230 SORTED_PATCH_SITES_CMD_TMP="${SORTED_PATCH_SITES_DEFAULT_CMD}" ; \
4232 for site in `eval $$SORTED_PATCH_SITES_CMD_TMP ${_RANDOMIZE_SITES}`; do \
4234 */*) args="-o $${file} $${site}$${file}";; \
4235 *) args=$${site}$${file};; \
4237 ${ECHO_CMD} $${args} ; \
4244 .if !target(fetch-urlall-list)
4246 @cd ${.CURDIR} && LISTALL=yes ${MAKE} fetch-url-list-int
4249 .if !target(fetch-url-list)
4251 @cd ${.CURDIR} && ${MAKE} fetch-url-list-int
4254 # Generates patches.
4257 @toedit=`PATCH_WRKSRC=${PATCH_WRKSRC} \
4258 PATCHDIR=${PATCHDIR} \
4259 PATCH_LIST=${PATCHDIR}/patch-* \
4260 DIFF_ARGS=${DIFF_ARGS} \
4261 DISTORIG=${DISTORIG} \
4262 ${SH} ${PORTSDIR}/Tools/scripts/update-patches`; \
4263 case $$toedit in "");; \
4264 *) ${ECHO_CMD} -n 'edit patches: '; read i; \
4265 cd ${PATCHDIR} && $${VISUAL:-$${EDIT:-/usr/bin/vi}} $$toedit;; esac
4267 # Checksumming utilities
4269 check-checksum-algorithms:
4273 for alg in ${CHECKSUM_ALGORITHMS:tu}; do \
4274 eval alg_executable=\$$$$alg; \
4275 if [ -z "$$alg_executable" ]; then \
4276 ${ECHO_MSG} "Checksum algorithm $$alg: Couldn't find the executable."; \
4277 ${ECHO_MSG} "Set $$alg=/path/to/$$alg in /etc/make.conf and try again."; \
4285 .if !target(makesum)
4286 makesum: check-checksum-algorithms
4287 @cd ${.CURDIR} && ${MAKE} fetch NO_CHECKSUM=yes \
4289 @if [ -f ${DISTINFO_FILE} ]; then ${CAT} /dev/null > ${DISTINFO_FILE}; fi
4295 for file in ${_CKSUMFILES}; do \
4296 for alg in ${CHECKSUM_ALGORITHMS:tu}; do \
4297 eval alg_executable=\$$$$alg; \
4299 if [ $$alg_executable != "NO" ]; then \
4300 $$alg_executable $$file >> ${DISTINFO_FILE}; \
4303 ${ECHO_CMD} "SIZE ($$file) = `${STAT} -f \"%z\" $$file`" >> ${DISTINFO_FILE}; \
4308 .if !target(checksum)
4309 checksum: fetch check-checksum-algorithms
4312 if [ -f ${DISTINFO_FILE} ]; then \
4313 cd ${DISTDIR}; OK="";\
4314 for file in ${_CKSUMFILES}; do \
4316 _file=$${file#${DIST_SUBDIR}/*}; \
4317 for alg in ${CHECKSUM_ALGORITHMS:tu}; do \
4319 eval alg_executable=\$$$$alg; \
4321 if [ $$alg_executable != "NO" ]; then \
4322 MKSUM=`$$alg_executable < $$file`; \
4323 CKSUM=`file=$$_file; ${DISTINFO_DATA}`; \
4328 if [ $$ignore = "false" -a -z "$$CKSUM" ]; then \
4329 ${ECHO_MSG} "=> No $$alg checksum recorded for $$file."; \
4333 if [ $$ignore = "false" ]; then \
4335 for chksum in $$CKSUM; do \
4336 if [ "$$chksum" = "$$MKSUM" ]; then \
4341 if [ $$match = "true" ]; then \
4342 ${ECHO_MSG} "=> $$alg Checksum OK for $$file."; \
4345 ${ECHO_MSG} "=> $$alg Checksum mismatch for $$file."; \
4346 refetchlist="$$refetchlist$$file "; \
4347 OK="$${OK:-retry}"; \
4348 [ "$${OK}" = "retry" -a ${FETCH_REGET} -gt 0 ] && ${RM} -f $${file}; \
4354 if [ $$ignored = "true" ]; then \
4355 ${ECHO_MSG} "=> No suitable checksum found for $$file."; \
4361 if [ "$${OK:=true}" = "retry" ] && [ ${FETCH_REGET} -gt 0 ]; then \
4362 ${ECHO_MSG} "===> Refetch for ${FETCH_REGET} more times files: $$refetchlist"; \
4363 if ( cd ${.CURDIR} && \
4364 ${MAKE} ${.MAKEFLAGS} FORCE_FETCH="$$refetchlist" FETCH_REGET="`${EXPR} ${FETCH_REGET} - 1`" fetch); then \
4365 if ( cd ${.CURDIR} && \
4366 ${MAKE} ${.MAKEFLAGS} FETCH_REGET="`${EXPR} ${FETCH_REGET} - 1`" checksum ); then \
4372 if [ "$$OK" != "true" -a ${FETCH_REGET} -eq 0 ]; then \
4373 ${ECHO_MSG} "===> Giving up on fetching files: $$refetchlist"; \
4374 ${ECHO_MSG} "Make sure the Makefile and distinfo file (${DISTINFO_FILE})"; \
4375 ${ECHO_MSG} "are up to date. If you are absolutely sure you want to override this"; \
4376 ${ECHO_MSG} "check, type \"make NO_CHECKSUM=yes [other args]\"."; \
4379 if [ "$$OK" != "true" ]; then \
4382 elif [ -n "${_CKSUMFILES:M*}" ]; then \
4383 ${ECHO_MSG} "=> No checksum file (${DISTINFO_FILE})."; \
4388 ################################################################
4389 # The special package-building targets
4390 # You probably won't need to touch these
4391 ################################################################
4393 # Nobody should want to override this unless PKGNAME is simply bogus.
4395 .if !target(package-name)
4397 @${ECHO_CMD} ${PKGNAME}
4400 # Build a package but don't check the package cookie
4402 .if !target(repackage)
4403 repackage: pre-repackage package
4406 @${RM} -f ${PACKAGE_COOKIE}
4409 # Build a package but don't check the cookie for installation, also don't
4410 # install package cookie
4412 .if !target(package-noinstall)
4414 @cd ${.CURDIR} && ${MAKE} package
4417 ################################################################
4418 # Dependency checking
4419 ################################################################
4421 .if !target(depends)
4422 depends: pkg-depends extract-depends patch-depends lib-depends fetch-depends build-depends run-depends
4424 .if defined(ALWAYS_BUILD_DEPENDS)
4431 if [ -n "${USE_PACKAGE_DEPENDS}" -o -n "${USE_PACKAGE_DEPENDS_ONLY}" ]; then \
4432 subpkgfile=`(cd $$dir; ${MAKE} $$depends_args -V PKGFILE)`; \
4433 subpkgname=$${subpkgfile%-*} ; \
4434 subpkgname=$${subpkgname\#\#*/} ; \
4435 if [ -r "$${subpkgfile}" -a "$$target" = "${DEPENDS_TARGET}" ]; then \
4436 ${ECHO_MSG} "===> Installing existing package $${subpkgfile}"; \
4437 if [ $${subpkgname} = "pkg" ]; then \
4438 [ -d ${WRKDIR} ] || ${MKDIR} ${WRKDIR} ; \
4439 ${TAR} xf $${subpkgfile} -C ${WRKDIR} -s ",/.*/,,g" "*/pkg-static" ; \
4440 ${WRKDIR}/pkg-static add $${subpkgfile}; \
4441 ${RM} -f ${WRKDIR}/pkg-static; \
4443 ${PKG_ADD} -A $${subpkgfile}; \
4445 elif [ -n "${USE_PACKAGE_DEPENDS_ONLY}" -a "$${target}" = "${DEPENDS_TARGET}" ]; then \
4446 ${ECHO_MSG} "===> ${PKGNAME} depends on package: $${subpkgfile} - not found"; \
4447 ${ECHO_MSG} "===> USE_PACKAGE_DEPENDS_ONLY set - not building missing dependency from source"; \
4450 (cd $$dir; ${MAKE} -DINSTALLS_DEPENDS $$target $$depends_args) ; \
4453 (cd $$dir; ${MAKE} -DINSTALLS_DEPENDS $$target $$depends_args) ; \
4455 ${ECHO_MSG} "===> Returning to build of ${PKGNAME}";
4457 .for deptype in PKG EXTRACT PATCH FETCH BUILD RUN
4458 ${deptype:tl}-depends:
4459 .if defined(${deptype}_DEPENDS)
4460 .if !defined(NO_DEPENDS)
4461 @set -e ; for i in `${ECHO_CMD} "${${deptype}_DEPENDS}"`; do \
4463 if [ -z "$$prog" ]; then \
4464 ${ECHO_MSG} "Error: there is an empty port dependency in ${deptype}_DEPENDS."; \
4467 dir=`${ECHO_CMD} $$i | ${SED} -e 's/[^:]*://'`; \
4468 if ${EXPR} "$$dir" : '.*:' > /dev/null; then \
4469 target=$${dir##*:}; \
4471 if [ X${DEPENDS_PRECLEAN} != "X" ]; then \
4472 target="clean $$target"; \
4473 depends_args="$$depends_args NOCLEANDEPENDS=yes"; \
4475 if [ X${DEPENDS_CLEAN} != "X" ]; then \
4476 target="$$target clean"; \
4477 depends_args="$$depends_args NOCLEANDEPENDS=yes"; \
4480 target="${DEPENDS_TARGET}"; \
4481 depends_args="${DEPENDS_ARGS}"; \
4483 if ${EXPR} "$$prog" : \\/ >/dev/null; then \
4484 if [ -e "$$prog" ]; then \
4485 if [ "$$prog" = "${NONEXISTENT}" ]; then \
4486 ${ECHO_MSG} "Error: ${NONEXISTENT} exists. Please remove it, and restart the build."; \
4489 ${ECHO_MSG} "===> ${PKGNAME} depends on file: $$prog - found"; \
4490 if [ ${_DEPEND_ALWAYS} = 1 ]; then \
4491 ${ECHO_MSG} " (but building it anyway)"; \
4498 ${ECHO_MSG} "===> ${PKGNAME} depends on file: $$prog - not found"; \
4503 *\>*|*\<*|*=*) pkg=yes;; \
4506 if [ "$$pkg" != "" ]; then \
4507 if ${PKG_INFO} "$$prog" > /dev/null 2>&1 ; then \
4508 ${ECHO_MSG} "===> ${PKGNAME} depends on package: $$prog - found"; \
4509 if [ ${_DEPEND_ALWAYS} = 1 ]; then \
4510 ${ECHO_MSG} " (but building it anyway)"; \
4516 ${ECHO_MSG} "===> ${PKGNAME} depends on package: $$prog - not found"; \
4519 if [ $$notfound != 0 ]; then \
4520 inverse_dep=`${ECHO_CMD} $$prog | ${SED} \
4521 -e 's/<=/=gt=/; s/</=ge=/; s/>=/=lt=/; s/>/=le=/' \
4522 -e 's/=gt=/>/; s/=ge=/>=/; s/=lt=/</; s/=le=/<=/'`; \
4523 pkg_info=`${PKG_INFO} -E "$$inverse_dep" 2>/dev/null || ${TRUE}`; \
4524 if [ "$$pkg_info" != "" ]; then \
4525 ${ECHO_MSG} "===> Found $$pkg_info, but you need to upgrade to $$prog."; \
4529 elif ${WHICH} "$$prog" > /dev/null 2>&1 ; then \
4530 ${ECHO_MSG} "===> ${PKGNAME} depends on executable: $$prog - found"; \
4531 if [ ${_DEPEND_ALWAYS} = 1 ]; then \
4532 ${ECHO_MSG} " (but building it anyway)"; \
4538 ${ECHO_MSG} "===> ${PKGNAME} depends on executable: $$prog - not found"; \
4542 if [ $$notfound != 0 ]; then \
4543 ${ECHO_MSG} "===> Verifying $$target for $$prog in $$dir"; \
4544 if [ ! -d "$$dir" ]; then \
4545 ${ECHO_MSG} " => No directory for $$prog. Skipping.."; \
4547 ${_INSTALL_DEPENDS} \
4558 .if defined(LIB_DEPENDS) && !defined(NO_DEPENDS)
4560 for i in ${LIB_DEPENDS}; do \
4563 target="${DEPENDS_TARGET}"; \
4564 depends_args="${DEPENDS_ARGS}"; \
4565 ${ECHO_MSG} -n "===> ${PKGNAME} depends on shared library: $${lib}" ; \
4566 libfile=`${SETENV} LIB_DIRS="${LIB_DIRS}" LOCALBASE="${LOCALBASE}" ${SH} ${SCRIPTSDIR}/find-lib.sh $${lib}` ; \
4567 if [ -z "$${libfile}" ]; then \
4568 ${ECHO_MSG} " - not found"; \
4569 ${ECHO_MSG} "===> Verifying for $$lib in $$dir"; \
4570 if [ ! -d "$$dir" ] ; then \
4571 ${ECHO_MSG} " => No directory for $$lib. Skipping.."; \
4573 ${_INSTALL_DEPENDS} \
4576 ${ECHO_MSG} " - found ($${libfile})"; \
4583 # Dependency lists: both build and runtime, recursive. Print out directory names.
4585 _UNIFIED_DEPENDS=${PKG_DEPENDS} ${EXTRACT_DEPENDS} ${PATCH_DEPENDS} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS} ${RUN_DEPENDS}
4586 _DEPEND_DIRS= ${_UNIFIED_DEPENDS:C,^[^:]*:([^:]*).*$,\1,}
4587 _DEPEND_SPECIALS= ${_UNIFIED_DEPENDS:M*\:*\:*:C,^[^:]*:([^:]*):.*$,\1,}
4590 @${ALL-DEPENDS-LIST}
4593 L="${_DEPEND_DIRS}"; \
4595 while [ -n "$$L" ]; do \
4599 $$d\ *|*\ $$d\ *|*\ $$d) \
4602 checked="$$checked $$d"; \
4603 if [ ! -d $$d ]; then \
4604 ${ECHO_MSG} "${PKGNAME}: \"$$d\" non-existent -- dependency list incomplete" >&2; \
4608 if ! children=$$(cd $$d && ${MAKE} -V '$${_DEPEND_DIRS}'); then\
4609 ${ECHO_MSG} "${PKGNAME}: \"$$d\" erroneous -- dependency list incomplete" >&2; \
4612 for child in $$children; do \
4613 case "$$checked $$l" in \
4614 $$child\ *|*\ $$child\ *|*\ $$child) \
4623 CLEAN-DEPENDS-FULL= \
4624 L="${_DEPEND_DIRS}"; \
4626 while [ -n "$$L" ]; do \
4630 $$d\ *|*\ $$d\ *|*\ $$d) \
4633 checked="$$checked $$d"; \
4634 if [ ! -d $$d ]; then \
4635 ${ECHO_MSG} "${PKGNAME}: \"$$d\" non-existent -- dependency list incomplete" >&2; \
4638 if ! children=$$(cd $$d && ${MAKE} -V WRKDIR -V _DEPEND_DIRS); then \
4639 ${ECHO_MSG} "${PKGNAME}: \"$$d\" erroneous -- dependency list incomplete" >&2; \
4643 for child in $$children; do \
4646 if [ -d $$child ]; then \
4651 case "$$checked $$l" in \
4652 $$child\ *|*\ $$child\ *|*\ $$child) \
4662 CLEAN-DEPENDS-LIMITED= \
4663 L="${_DEPEND_DIRS}"; \
4665 while [ -n "$$L" ]; do \
4669 $$d\ *|*\ $$d\ *|*\ $$d) \
4672 checked="$$checked $$d"; \
4673 if [ ! -d $$d ]; then \
4674 ${ECHO_MSG} "${PKGNAME}: \"$$d\" non-existent -- dependency list incomplete" >&2; \
4677 if ! children=$$(cd $$d && ${MAKE} -V '$${WRKDIR}' -V '$${_DEPEND_DIRS}'); then \
4678 ${ECHO_MSG} "${PKGNAME}: \"$$d\" erroneous -- dependency list incomplete" >&2; \
4682 for child in $$children; do \
4685 if [ ! -d $$child ]; then \
4691 case "$$checked $$l" in \
4692 $$child\ *|*\ $$child\ *|*\ $$child) \
4702 .if !target(clean-depends)
4704 @for dir in $$(${CLEAN-DEPENDS-FULL}); do \
4705 (cd $$dir; ${MAKE} NOCLEANDEPENDS=yes clean); \
4709 .if !target(limited-clean-depends)
4710 limited-clean-depends:
4711 @for dir in $$(${CLEAN-DEPENDS-LIMITED}); do \
4712 (cd $$dir; ${MAKE} NOCLEANDEPENDS=yes clean); \
4716 .if !target(deinstall-depends)
4718 @for dir in $$(${ALL-DEPENDS-LIST}); do \
4719 (cd $$dir; ${MAKE} deinstall); \
4723 .if !target(fetch-specials)
4725 @${ECHO_MSG} "===> Fetching all distfiles required by ${PKGNAME} for building"
4726 @for dir in ${_DEPEND_SPECIALS}; do \
4727 (cd $$dir; ${MAKE} fetch); \
4731 .if !target(fetch-recursive)
4733 @${ECHO_MSG} "===> Fetching all distfiles for ${PKGNAME} and dependencies"
4734 @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \
4735 (cd $$dir; ${MAKE} fetch); \
4739 .if !target(fetch-recursive-list)
4740 fetch-recursive-list:
4741 @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \
4742 (cd $$dir; ${MAKE} fetch-list); \
4746 # Used by fetch-required and fetch-required list, this script looks
4747 # at each of the dependencies. If 3 items are specified in the tuple,
4748 # such as foo:${PORTSDIR}/graphics/foo:extract, the first item (foo)
4749 # is examined. Only if it begins with a / and does not exist on the
4750 # file-system will ``make targ'' proceed.
4751 # For more usual (dual-item) dependency tuples, the ``make targ''
4752 # proceeds, if the exact package, which the directory WOULD'VE installed,
4753 # is not yet installed.
4754 # This is the exact behaviour of the old code, and it may need
4755 # revisiting. For example, the entire first case seems dubious, and in
4756 # the second case we, probably, should be satisfied with _any_ (earlier)
4757 # package, with the same origin as that of the dir.
4760 FETCH_LIST?= for i in $$deps; do \
4761 prog=$${i%%:*}; dir=$${i\#*:}; \
4763 *:*) if [ $$prog != $${prog\#/} -o ! -e $$prog ]; then \
4768 *) if [ -d ${PKG_DBDIR}/$$(cd $$dir; ${MAKE} -V '$${PKGNAME}') ]; then \
4772 echo cd $$dir; cd $$dir; ${MAKE} $$targ; \
4775 .if !target(fetch-required)
4776 fetch-required: fetch
4777 .if defined(NO_DEPENDS)
4778 @${ECHO_MSG} "===> NO_DEPENDS is set, not fetching any other distfiles for ${PKGNAME}"
4780 @${ECHO_MSG} "===> Fetching all required distfiles for ${PKGNAME} and dependencies"
4781 .for deptype in PKG EXTRACT PATCH FETCH BUILD RUN
4782 .if defined(${deptype}_DEPENDS)
4783 @targ=fetch; deps="${${deptype}_DEPENDS}"; ${FETCH_LIST}
4790 .if !target(fetch-required-list)
4791 fetch-required-list: fetch-list
4792 .if !defined(NO_DEPENDS)
4793 .for deptype in PKG EXTRACT PATCH FETCH BUILD RUN
4794 .if defined(${deptype}_DEPENDS)
4795 @targ=fetch-list; deps="${${deptype}_DEPENDS}"; ${FETCH_LIST}
4801 .if !target(checksum-recursive)
4803 @${ECHO_MSG} "===> Fetching and checking checksums for ${PKGNAME} and dependencies"
4804 @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \
4805 (cd $$dir; ${MAKE} checksum); \
4809 # Dependency lists: build and runtime. Print out directory names.
4812 .if defined(PKG_DEPENDS) || defined(EXTRACT_DEPENDS) || defined(PATCH_DEPENDS) || defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || defined(LIB_DEPENDS)
4813 @${BUILD-DEPENDS-LIST}
4816 BUILD-DEPENDS-LIST= \
4817 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 \
4818 if [ -d $$dir ]; then \
4819 ${ECHO_CMD} $$dir; \
4821 ${ECHO_MSG} "${PKGNAME}: \"$$dir\" non-existent -- dependency list incomplete" >&2; \
4826 .if defined(LIB_DEPENDS) || defined(RUN_DEPENDS)
4827 @${RUN-DEPENDS-LIST}
4831 for dir in $$(${ECHO_CMD} "${_LIB_RUN_DEPENDS:C,.*:([^:]*).*,\1,}" | ${SED} -e 'y/ /\n/' | ${SORT} -u); do \
4832 if [ -d $$dir ]; then \
4833 ${ECHO_CMD} $$dir; \
4835 ${ECHO_MSG} "${PKGNAME}: \"$$dir\" non-existent -- dependency list incomplete" >&2; \
4839 # Package (recursive runtime) dependency list. Print out both directory names
4840 # and package names.
4842 package-depends-list:
4843 .if defined(CHILD_DEPENDS) || defined(LIB_DEPENDS) || defined(RUN_DEPENDS)
4844 @${PACKAGE-DEPENDS-LIST}
4847 _LIB_RUN_DEPENDS= ${LIB_DEPENDS} ${RUN_DEPENDS}
4848 PACKAGE-DEPENDS-LIST?= \
4849 if [ "${CHILD_DEPENDS}" ]; then \
4850 installed=$$(${PKG_INFO} -qO ${PKGORIGIN} 2>/dev/null || \
4852 if [ "$$installed" ]; then \
4855 if [ -z "$$installed" ]; then \
4856 installed="${PKGNAME}"; \
4858 for pkgname in $$installed; do \
4859 ${ECHO_CMD} "$$pkgname ${.CURDIR} ${PKGORIGIN}"; \
4862 checked="${PARENT_CHECKED}"; \
4863 for dir in ${_LIB_RUN_DEPENDS:C,[^:]*:([^:]*):?.*,\1,}; do \
4864 dir=$$(${REALPATH} $$dir); \
4865 if [ -d $$dir ]; then \
4867 $$dir|$$dir\ *|*\ $$dir|*\ $$dir\ *) continue;; \
4869 childout=$$(cd $$dir; ${MAKE} CHILD_DEPENDS=yes PARENT_CHECKED="$$checked" package-depends-list); \
4870 set -- $$childout; \
4872 while [ $$\# != 0 ]; do \
4873 childdir="$$childdir $$2"; \
4874 ${ECHO_CMD} "$$1 $$2 $$3"; \
4877 checked="$$dir $$childdir $$checked"; \
4879 ${ECHO_MSG} "${PKGNAME}: \"$$dir\" non-existent -- dependency list incomplete" >&2; \
4883 ACTUAL-PACKAGE-DEPENDS?= \
4885 for lib in ${LIB_DEPENDS:C/\:.*//}; do \
4886 depfiles="$$depfiles `${SETENV} LIB_DIRS="${LIB_DIRS}" LOCALBASE="${LOCALBASE}" ${SH} ${SCRIPTSDIR}/find-lib.sh $${lib}`" ; \
4888 ${SETENV} PKG_BIN="${PKG_BIN}" ${SH} ${SCRIPTSDIR}/actual-package-depends.sh $${depfiles} ${RUN_DEPENDS:C/(.*)\:.*/"\1"/}
4891 @${MKDIR} ${METADIR}; \
4893 echo "name: \"${PKGBASE}\"" ; \
4894 echo "version: \"${PKGVERSION}\"" ; \
4895 echo "origin: ${PKGORIGIN}" ; \
4896 echo "comment: <<EOD" ; \
4897 echo ${COMMENT:Q} ; \
4899 echo "maintainer: ${MAINTAINER}" ; \
4900 echo "prefix: ${PREFIX}" ; \
4901 [ -z "${WWW}" ] || echo "www: ${WWW}" ; \
4903 ${ACTUAL-PACKAGE-DEPENDS} | ${GREP} -v -E ${PKG_IGNORE_DEPENDS} | ${SORT} -u ; \
4905 echo "categories: [ ${CATEGORIES:u:S/$/,/} ]" ; \
4906 l=${LICENSE_COMB} ; \
4907 [ -n "${NO_ARCH}" ] && echo "arch : `${PKG_BIN} config abi | tr '[:upper:]' '[:lower:]' | ${CUT} -d: -f1,2`:*" ; \
4908 [ -n "${NO_ARCH}" ] && echo "abi : `${PKG_BIN} config abi | ${CUT} -d: -f1,2`:*" ; \
4909 echo "licenselogic: $${l:-single}" ; \
4910 [ -z "${LICENSE}" ] || echo "licenses: [ ${LICENSE:u:S/$/,/} ]" ; \
4911 [ -z "${USERS}" ] || echo "users: [ ${USERS:u:S/$/,/} ]" ; \
4912 [ -z "${GROUPS}" ] || echo "groups: [ ${GROUPS:u:S/$/,/} ]" ; \
4914 @${ECHO_CMD} -n "options: {" >> ${MANIFESTF}
4915 .for opt in ${COMPLETE_OPTIONS_LIST}
4916 @[ -z "${PORT_OPTIONS:M${opt}}" ] || match="on" ; ${ECHO_MSG} -n " ${opt}: $${match:-off}," >> ${MANIFESTF}
4918 @${ECHO_CMD} "}" >> ${MANIFESTF}
4919 .if defined(PKG_NOTES)
4920 @${ECHO_CMD} -n "annotations: {" >> ${MANIFESTF}
4921 .for note in ${PKG_NOTES}
4922 @${ECHO_CMD} -n ' ${note}: "${PKG_NOTE_${note}:S/"/\"/g}",' >> ${MANIFESTF}
4924 @${ECHO_CMD} " }" >> ${MANIFESTF}
4926 @[ -f ${PKGINSTALL} ] && ${CP} ${PKGINSTALL} ${METADIR}/+INSTALL; \
4927 ${RM} -f ${METADIR}/+PRE_INSTALL ; \
4928 for a in ${PKGPREINSTALL}; do \
4929 [ -f $$a ] && ${CAT} $$a >> ${METADIR}/+PRE_INSTALL ; \
4931 ${RM} -f ${METADIR}/+POST_INSTALL ; \
4932 for a in ${PKGPOSTINSTALL}; do \
4933 [ -f $$a ] && ${CAT} $$a >> ${METADIR}/+POST_INSTALL ; \
4935 [ -f ${PKGDEINSTALL} ] && ${CP} ${PKGDEINSTALL} ${METADIR}/+DEINSTALL; \
4936 ${RM} -f ${METADIR}/+PRE_DEINSTALL ; \
4937 for a in ${PKGPREDEINSTALL}; do \
4938 [ -f $$a ] && ${CAT} $$a >> ${METADIR}/+PRE_DEINSTALL ; \
4940 ${RM} -f ${METADIR}/+POST_DEINSTALL ; \
4941 for a in ${PKGPOSTDEINSTALL}; do \
4942 [ -f $$a ] && ${CAT} $$a >> ${METADIR}/+POST_DEINSTALL ; \
4944 [ -f ${PKGPOSTDEINSTALL} ] && ${CP} ${PKGPOSTDEINSTALL} ${METADIR}/+POST_DEINSTALL; \
4945 [ -f ${PKGUPGRADE} ] && ${CP} ${PKGUPGRADE} ${METADIR}/+UPGRADE; \
4946 [ -f ${PKGPREUPGRADE} ] && ${CP} ${PKGPREUPGRADE} ${METADIR}/+PRE_UPGRADE; \
4947 [ -f ${PKGPOSTUPGRADE} ] && ${CP} ${PKGPOSTUPGRADE} ${METADIR}/+POST_UPGRADE; \
4948 ${CP} ${DESCR} ${METADIR}/+DESC; \
4949 [ -f ${PKGMESSAGE} ] && ${CP} ${PKGMESSAGE} ${METADIR}/+DISPLAY || return 0
4951 # Print out package names.
4954 @${PACKAGE-DEPENDS-LIST} | ${AWK} '{print $$1":"$$3}'
4956 actual-package-depends:
4957 @${ACTUAL-PACKAGE-DEPENDS}
4959 # Build packages for port and dependencies
4961 package-recursive: package
4962 @for dir in $$(${ALL-DEPENDS-LIST}); do \
4963 (cd $$dir; ${MAKE} package-noinstall); \
4966 # Show missing dependencies
4968 @_origins=$$(${PKG_INFO} -aoq); \
4969 for dir in $$(${ALL-DEPENDS-LIST}); do \
4970 _origin=$${dir##${PORTSDIR}/}; \
4971 if ! $$(${ECHO_CMD} $${_origins} | ${GREP} -q $${_origin}); then \
4972 ${ECHO_CMD} $${_origin}; \
4976 # Show missing dependencies by name
4978 @_packages=$$(${PKG_INFO} -aq); \
4979 for dir in $$(${ALL-DEPENDS-LIST}); do \
4980 _p=$$(cd $$dir; ${MAKE} -VPKGNAME); \
4981 if ! $$(${ECHO_CMD} $${_packages} | ${GREP} -q $${_p}); then \
4982 ${ECHO_CMD} $${_p}; \
4986 ################################################################
4987 # Everything after here are internal targets and really
4988 # shouldn't be touched by anybody but the release engineers.
4989 ################################################################
4991 # This target generates an index entry suitable for aggregation into
4992 # a large index. Format is:
4994 # distribution-name|port-path|installation-prefix|comment| \
4995 # description-file|maintainer|categories|extract-depends| \
4996 # patch-depends|fetch-depends|build-depends|run-depends|www site
4998 # If this ever changes, portmgr should contact the portsnap maintainer
4999 # first to avoid gratuitous breakage.
5001 . if !target(describe)
5002 _EXTRACT_DEPENDS=${EXTRACT_DEPENDS:C/^[^ :]+:([^ :]+)(:[^ :]+)?/\1/:O:u}
5003 _PATCH_DEPENDS=${PATCH_DEPENDS:C/^[^ :]+:([^ :]+)(:[^ :]+)?/\1/:O:u}
5004 _FETCH_DEPENDS=${FETCH_DEPENDS:C/^[^ :]+:([^ :]+)(:[^ :]+)?/\1/:O:u}
5005 _LIB_DEPENDS=${LIB_DEPENDS:C/^[^ :]+:([^ :]+)(:[^ :]+)?/\1/:O:u}
5006 _BUILD_DEPENDS=${BUILD_DEPENDS:C/^[^ :]+:([^ :]+)(:[^ :]+)?/\1/:O:u} ${_LIB_DEPENDS}
5007 _RUN_DEPENDS=${RUN_DEPENDS:C/^[^ :]+:([^ :]+)(:[^ :]+)?/\1/:O:u} ${_LIB_DEPENDS}
5008 . if exists(${DESCR})
5014 . if defined(BUILDING_INDEX) && defined(INDEX_PORTS)
5015 INDEX_OUT=${INDEX_TMPDIR}/${INDEXFILE}.desc.aggr
5017 INDEX_OUT=/dev/stdout
5021 @(${ECHO_CMD} -n "${PKGNAME}|${.CURDIR}|${PREFIX}|"; \
5022 ${ECHO_CMD} -n ${COMMENT:Q}; \
5023 ${ECHO_CMD} -n "|${_DESCR}|${MAINTAINER}|${CATEGORIES}|${_EXTRACT_DEPENDS}|${_PATCH_DEPENDS}|${_FETCH_DEPENDS}|${_BUILD_DEPENDS:O:u}|${_RUN_DEPENDS:O:u}|"; \
5024 while read one two discard; do \
5026 WWW:) case "$$two" in \
5027 https://*|http://*|ftp://*) ${ECHO_CMD} -n "$$two" ;; \
5028 *) ${ECHO_CMD} -n "http://$$two" ;; \
5033 done < ${DESCR}; ${ECHO_CMD}) >>${INDEX_OUT}
5037 .if exists(${DESCR})
5038 @${AWK} '$$1 ~ /^WWW:/ {print $$2}' ${DESCR} | ${HEAD} -1
5043 .if !target(readmes)
5049 @${RM} -f ${.CURDIR}/README.html
5050 @cd ${.CURDIR} && ${MAKE} ${.CURDIR}/README.html
5053 ${.CURDIR}/README.html:
5054 @${ECHO_MSG} "===> Creating README.html for ${PKGNAME}"
5055 @${SED} -e 's|%%PORT%%|'$$(${ECHO_CMD} ${.CURDIR} | \
5056 ${SED} -e 's|.*/\([^/]*/[^/]*\)$$|\1|')'|g' \
5057 -e 's|%%PKG%%|${PKGNAME}|g' \
5058 -e 's|%%COMMENT%%|'"$$(${ECHO_CMD} ${COMMENT:Q})"'|' \
5059 -e '/%%COMMENT%%/d' \
5060 -e 's|%%DESCR%%|'"$$(${ECHO_CMD} ${DESCR} | \
5061 ${SED} -e 's|${.CURDIR}/||')"'|' \
5062 -e 's|%%EMAIL%%|'"$$(${ECHO_CMD} "${MAINTAINER}" | \
5063 ${SED} -e 's/([^)]*)//;s/.*<//;s/>.*//')"'|g' \
5064 -e 's|%%MAINTAINER%%|${MAINTAINER}|g' \
5065 -e 's|%%WEBSITE%%|'"$$(cd ${.CURDIR} && eval ${MAKE} pretty-print-www-site)"'|' \
5066 -e 's|%%BUILD_DEPENDS%%|'"$$(cd ${.CURDIR} && eval ${MAKE} pretty-print-build-depends-list)"'|' \
5067 -e 's|%%RUN_DEPENDS%%|'"$$(cd ${.CURDIR} && eval ${MAKE} pretty-print-run-depends-list)"'|' \
5068 -e 's|%%TOP%%|'"$$(${ECHO_CMD} ${CATEGORIES} | \
5069 ${SED} -e 's| .*||' -e 's|[^/]*|..|g')"'/..|' \
5070 ${TEMPLATES}/README.port >> ${.TARGET}
5072 # The following two targets require an up-to-date INDEX in ${PORTSDIR}
5074 _PRETTY_PRINT_DEPENDS_LIST=\
5075 if [ ! -r ${INDEXDIR}/${INDEXFILE} ] ; then \
5076 ${ECHO_MSG} "${.TARGET} requires an INDEX file (${INDEXFILE}). Please run make index or make fetchindex."; \
5078 target=${.TARGET:C/pretty-print-(.*)-depends-list/\1/} ; \
5079 if [ "$$target" = "build" ] ; then fldnum=8 ; else fldnum=9 ; fi; \
5080 ${ECHO_MSG} -n 'This port requires package(s) "' ; \
5081 ${ECHO_MSG} -n `${AWK} -F\| "\\$$1 ~ /^${PKGNAME}/ {print \\$$$${fldnum};}" ${INDEXDIR}/${INDEXFILE}` ; \
5082 ${ECHO_MSG} "\" to $$target."; \
5086 .if !target(pretty-print-build-depends-list)
5087 pretty-print-build-depends-list:
5088 .if defined(PKG_DEPENDS) || defined(EXTRACT_DEPENDS) || defined(PATCH_DEPENDS) || \
5089 defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || defined(LIB_DEPENDS)
5090 @${_PRETTY_PRINT_DEPENDS_LIST}
5094 .if !target(pretty-print-run-depends-list)
5095 pretty-print-run-depends-list:
5096 .if defined(RUN_DEPENDS) || defined(LIB_DEPENDS)
5097 @${_PRETTY_PRINT_DEPENDS_LIST}
5101 _SUB_LIST_TEMP= ${SUB_LIST:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/}
5102 .if !target(apply-slist)
5104 .if defined(SUB_FILES)
5105 .for file in ${SUB_FILES}
5106 .if exists(${FILESDIR}/${file}.in)
5107 @${SED} ${_SUB_LIST_TEMP} -e '/^@comment /d' ${FILESDIR}/${file}.in > ${WRKDIR}/${file}
5108 .elif exists(${DFLY_FILESDIR}/${file}.in)
5109 @${SED} ${_SUB_LIST_TEMP} -e '/^@comment /d' ${DFLY_FILESDIR}/${file}.in > ${WRKDIR}/${file}
5111 @${ECHO_MSG} "** Checked ${FILESDIR}:"; \
5112 @${ECHO_MSG} "** Checked ${DFLY_FILESDIR}:"; \
5113 @${ECHO_MSG} "** Missing ${file}.in for ${PKGNAME}."; \
5117 .for i in pkg-message pkg-install pkg-deinstall pkg-req
5118 .if ${SUB_FILES:M${i}*}!=""
5119 ${i:S/-//:tu}= ${WRKDIR}/${SUB_FILES:M${i}*}
5125 # Generate packing list. Also tests to make sure all required package
5128 .if !target(generate-plist)
5129 generate-plist: ${WRKDIR}
5130 @${ECHO_MSG} "===> Generating temporary packing list"
5131 @${MKDIR} `${DIRNAME} ${TMPPLIST}`
5132 @if [ ! -f ${DESCR} ]; then ${ECHO_MSG} "** Missing pkg-descr for ${PKGNAME}."; exit 1; fi
5134 @for file in ${PLIST_FILES}; do \
5135 ${ECHO_CMD} $${file} | ${SED} ${PLIST_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} >> ${TMPPLIST}; \
5137 @if [ -f ${PLIST} ]; then \
5138 ${SED} ${PLIST_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} ${PLIST} >> ${TMPPLIST}; \
5141 # Keep PLIST_DIRSTRY as compatibility
5142 .for dir in ${PLIST_DIRS} ${PLIST_DIRSTRY}
5143 @${ECHO_CMD} ${dir} | ${SED} ${PLIST_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} -e 's,^,@dir ,' >> ${TMPPLIST}
5146 .if defined(USE_LINUX_PREFIX)
5147 .if defined(USE_LDCONFIG)
5148 @${ECHO_CMD} "@exec ${LDCONFIG_CMD}" >> ${TMPPLIST}
5149 @${ECHO_CMD} "@unexec ${LDCONFIG_CMD}" >> ${TMPPLIST}
5152 .if defined(USE_LDCONFIG)
5153 .if !defined(INSTALL_AS_USER)
5154 @${ECHO_CMD} "@exec ${LDCONFIG} -m ${USE_LDCONFIG}" >> ${TMPPLIST}
5155 @${ECHO_CMD} "@unexec ${LDCONFIG} -R" >> ${TMPPLIST}
5157 @${ECHO_CMD} "@exec ${LDCONFIG} -m ${USE_LDCONFIG} || ${TRUE}" >> ${TMPPLIST}
5158 @${ECHO_CMD} "@unexec ${LDCONFIG} -R || ${TRUE}" >> ${TMPPLIST}
5161 .if defined(USE_LDCONFIG32)
5162 .if !defined(INSTALL_AS_USER)
5163 @${ECHO_CMD} "@exec ${LDCONFIG} -32 -m ${USE_LDCONFIG32}" >> ${TMPPLIST}
5164 @${ECHO_CMD} "@unexec ${LDCONFIG} -32 -R" >> ${TMPPLIST}
5166 @${ECHO_CMD} "@exec ${LDCONFIG} -32 -m ${USE_LDCONFIG32} || ${TRUE}" >> ${TMPPLIST}
5167 @${ECHO_CMD} "@unexec ${LDCONFIG} -32 -R || ${TRUE}" >> ${TMPPLIST}
5174 @cd ${.CURDIR} && ${MAKE} generate-plist
5176 ${TMPPLIST_SORT}: ${TMPPLIST}
5177 @${SORT} -u ${TMPPLIST} >${TMPPLIST_SORT}
5179 .if !target(add-plist-docs)
5180 .if defined(PORTDOCS) && !defined(NOPORTDOCS)
5182 .for x in ${PORTDOCS}
5183 @if ${ECHO_CMD} "${x}"| ${AWK} '$$1 ~ /(\*|\||\[|\]|\?|\{|\}|\$$)/ { exit 1};'; then \
5184 if [ ! -e ${STAGEDIR}${DOCSDIR}/${x} ]; then \
5185 ${ECHO_CMD} ${DOCSDIR}/${x} >> ${TMPPLIST}; \
5188 @${FIND} -P ${PORTDOCS:S/^/${STAGEDIR}${DOCSDIR}\//} ! -type d 2>/dev/null | \
5189 ${SED} -ne 's,^${STAGEDIR},,p' >> ${TMPPLIST}
5193 .if !target(add-plist-examples)
5194 .if defined(PORTEXAMPLES) && !defined(NOPORTEXAMPLES)
5196 .for x in ${PORTEXAMPLES}
5197 @if ${ECHO_CMD} "${x}"| ${AWK} '$$1 ~ /(\*|\||\[|\]|\?|\{|\}|\$$)/ { exit 1};'; then \
5198 if [ ! -e ${STAGEDIR}${EXAMPLESDIR}/${x} ]; then \
5199 ${ECHO_CMD} ${EXAMPLESDIR}/${x} >> ${TMPPLIST}; \
5202 @${FIND} -P ${PORTEXAMPLES:S/^/${STAGEDIR}${EXAMPLESDIR}\//} ! -type d 2>/dev/null | \
5203 ${SED} -ne 's,^${STAGEDIR},,p' >> ${TMPPLIST}
5207 .if !target(add-plist-data)
5208 .if defined(PORTDATA)
5210 .for x in ${PORTDATA}
5211 @if ${ECHO_CMD} "${x}"| ${AWK} '$$1 ~ /(\*|\||\[|\]|\?|\{|\}|\$$)/ { exit 1};'; then \
5212 if [ ! -e ${STAGEDIR}${DATADIR}/${x} ]; then \
5213 ${ECHO_CMD} ${DATADIR}/${x} >> ${TMPPLIST}; \
5216 @${FIND} -P ${PORTDATA:S/^/${STAGEDIR}${DATADIR}\//} ! -type d 2>/dev/null | \
5217 ${SED} -ne 's,^${STAGEDIR},,p' >> ${TMPPLIST}
5221 .if !target(add-plist-buildinfo)
5222 add-plist-buildinfo:
5223 .if defined(PACKAGE_BUILDING)
5224 @${ECHO_CMD} "@comment Build details: ${BUILDHOST}|${JAIL}|${BUILD}|${PORTSTREE}|${BUILDDATE}" >> ${TMPPLIST}
5228 .if !target(add-plist-info)
5232 @${LS} ${STAGEDIR}${PREFIX}/${INFO_PATH}/$i.info* | ${SED} -e s:${STAGEDIR}:@info\ :g >> ${TMPPLIST}
5237 # If we're installing into a non-standard PREFIX, we need to remove that directory at
5239 .if !target(add-plist-post)
5240 .if (${PREFIX} != ${LOCALBASE} && ${PREFIX} != ${LINUXBASE} && \
5241 ${PREFIX} != "/usr" && !defined(NO_PREFIX_RMDIR))
5243 @${ECHO_CMD} "@dir ${PREFIX}" >> ${TMPPLIST}
5247 .if !target(install-rc-script)
5248 .if defined(USE_RCORDER) || defined(USE_RC_SUBR) && ${USE_RC_SUBR:tu} != "YES"
5250 .if defined(USE_RCORDER)
5251 @${ECHO_MSG} "===> Staging early rc.d startup script(s)"
5252 @for i in ${USE_RCORDER}; do \
5253 ${INSTALL_SCRIPT} ${WRKDIR}/$${i} ${STAGEDIR}/etc/rc.d/$${i%.sh}; \
5254 ${ECHO_CMD} "/etc/rc.d/$${i%.sh}" >> ${TMPPLIST}; \
5257 .if defined(USE_RC_SUBR) && ${USE_RC_SUBR:tu} != "YES"
5258 @${ECHO_MSG} "===> Staging rc.d startup script(s)"
5259 @for i in ${USE_RC_SUBR}; do \
5260 ${INSTALL_SCRIPT} ${WRKDIR}/$${i} ${STAGEDIR}${PREFIX}/etc/rc.d/$${i%.sh}; \
5261 ${ECHO_CMD} "${PREFIX}/etc/rc.d/$${i%.sh}" >> ${TMPPLIST}; \
5267 .if !target(check-man)
5269 @${ECHO_MSG} "====> Checking man pages (check-man)"
5271 for dir in ${MANDIRS:S/^/${STAGEDIR}/} ; do \
5272 [ -d $$dir ] && mdirs="$$mdirs $$dir" ;\
5275 for dir in $$mdirs; do \
5276 for f in $$(find $$dir -name "*.gz"); do \
5277 ${ECHO_CMD} "===> Checking $${f##*/}" ; \
5278 gunzip -c $$f | mandoc -Tlint -Werror && continue ; \
5285 # Compress all manpage not already compressed which are not hardlinks
5286 # 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
5287 # Fixes all dead symlinks left by the previous round
5288 .if !target(compress-man)
5290 @${ECHO_MSG} "====> Compressing man pages (compress-man)"
5292 for dir in ${MANDIRS:S/^/${STAGEDIR}/} ; do \
5293 [ -d $$dir ] && mdirs="$$mdirs $$dir" ;\
5295 for dir in $$mdirs; do \
5296 ${FIND} $$dir -type f \! -name "*.gz" -links 1 -exec ${GZIP_CMD} {} \; ; \
5297 ${FIND} $$dir -type f \! -name "*.gz" \! -links 1 -exec ${STAT} -f '%i' {} \; | \
5298 ${SORT} -u | while read inode ; do \
5300 for f in $$(${FIND} $$dir -type f -inum $${inode} -print); do \
5301 if [ -z $$ref ]; then \
5303 ${GZIP_CMD} $${f} ; \
5307 (cd $${f%/*}; ${LN} -f $${ref##*/} $${f##*/}.gz) ; \
5310 ${FIND} $$dir -type l \! -name "*.gz" | while read link ; do \
5311 ${LN} -sf $$(readlink $$link).gz $$link.gz ;\
5317 .if !target(stage-dir)
5319 @${MKDIR} ${STAGEDIR}${PREFIX}
5320 .if !defined(NO_MTREE)
5321 @${MTREE_CMD} ${MTREE_ARGS} ${STAGEDIR}${PREFIX} > /dev/null
5325 .if !target(makeplist)
5327 @${SETENV} ${CO_ENV} ${SH} ${SCRIPTSDIR}/check-stagedir.sh makeplist
5330 .if !target(check-plist)
5332 @${ECHO_MSG} "====> Checking for pkg-plist issues (check-plist)"
5333 @${SETENV} ${CO_ENV} ${SH} ${SCRIPTSDIR}/check-stagedir.sh checkplist
5334 @${ECHO_MSG} "===> No pkg-plist issues found (check-plist)"
5337 .if !target(check-orphans)
5338 check-orphans: check-plist
5341 .if !target(stage-qa)
5343 @${ECHO_MSG} "====> Running Q/A tests (stage-qa)"
5344 @${SETENV} ${QA_ENV} ${SH} ${SCRIPTSDIR}/qa.sh
5347 # Fake installation of package so that user can pkg delete it later.
5348 .if !target(fake-pkg)
5349 STAGE_ARGS= -i ${STAGEDIR}
5351 .if !defined(NO_PKG_REGISTER)
5352 fake-pkg: create-manifest
5353 .if defined(INSTALLS_DEPENDS)
5354 @${ECHO_MSG} "===> Registering installation for ${PKGNAME} as automatic"
5356 @${ECHO_MSG} "===> Registering installation for ${PKGNAME}"
5358 .if defined(INSTALLS_DEPENDS)
5359 @${SETENV} ${PKG_ENV} FORCE_POST="${_FORCE_POST_PATTERNS}" ${PKG_CMD} -d ${STAGE_ARGS} -m ${METADIR} -f ${TMPPLIST}
5361 @${SETENV} ${PKG_ENV} FORCE_POST="${_FORCE_POST_PATTERNS}" ${PKG_CMD} ${STAGE_ARGS} -m ${METADIR} -f ${TMPPLIST}
5363 @${RM} -rf ${METADIR}
5367 # Depend is generally meaningless for arbitrary ports, but if someone wants
5368 # one they can override this. This is just to catch people who've gotten into
5369 # the habit of typing `make depend all install' as a matter of course.
5375 # Same goes for tags
5380 .if !defined(NOPRECIOUSMAKEVARS)
5381 # These won't change, so we can pass them through the environment
5383 ARCH="${ARCH:S/"/"'"'"/g:S/\$/\$\$/g:S/\\/\\\\/g}" \
5384 OPSYS="${OPSYS:S/"/"'"'"/g:S/\$/\$\$/g:S/\\/\\\\/g}" \
5385 OSREL="${OSREL:S/"/"'"'"/g:S/\$/\$\$/g:S/\\/\\\\/g}" \
5386 OSVERSION="${OSVERSION:S/"/"'"'"/g:S/\$/\$\$/g:S/\\/\\\\/g}" \
5387 DFLYVERSION="${DFLYVERSION:Q}" \
5388 SYSTEMVERSION="${SYSTEMVERSION:S/"/"'"'"/g:S/\$/\$\$/g:S/\\/\\\\/g}"
5391 .if !target(pre-check-config)
5393 .for single in ${OPTIONS_SINGLE}
5394 . for opt in ${OPTIONS_SINGLE_${single}}
5395 . if empty(ALL_OPTIONS:M${single}) || !empty(PORT_OPTIONS:M${single})
5396 . if !empty(PORT_OPTIONS:M${opt})
5397 . if defined(OPTFOUND)
5398 OPTIONS_WRONG_SINGLE+= ${single}
5404 # if conditional and if the condition is unchecked, remove opt from the list of
5406 PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}}
5410 . if !defined(OPTFOUND) && !defined(OPTNOCHECK)
5411 OPTIONS_WRONG_SINGLE+= ${single}
5418 .for radio in ${OPTIONS_RADIO}
5419 . for opt in ${OPTIONS_RADIO_${radio}}
5420 . if !empty(PORT_OPTIONS:M${opt})
5421 . if defined(OPTFOUND)
5422 OPTIONS_WRONG_RADIO+= ${radio}
5431 .for multi in ${OPTIONS_MULTI}
5432 . for opt in ${OPTIONS_MULTI_${multi}}
5433 . if empty(ALL_OPTIONS:M${multi}) || !empty(PORT_OPTIONS:M${multi})
5434 . if !empty(PORT_OPTIONS:M${opt})
5438 # if conditional and if the condition is unchecked, remove opt from the list of
5440 PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}}
5444 . if !defined(OPTFOUND) && !defined(OPTNOCHECK)
5445 OPTIONS_WRONG_MULTI+= ${multi}
5452 .endif #pre-check-config
5454 .if !target(_check-config)
5455 _check-config: pre-check-config
5456 .for multi in ${OPTIONS_WRONG_MULTI}
5457 @${ECHO_MSG} "====> You must check at least one option in the ${multi} multi"
5459 .for single in ${OPTIONS_WRONG_SINGLE}
5460 @${ECHO_MSG} "====> You must select one and only one option from the ${single} single"
5462 .for radio in ${OPTIONS_WRONG_RADIO}
5463 @${ECHO_MSG} "====> You cannot select multiple options from the ${radio} radio"
5465 .if !empty(OPTIONS_WRONG_MULTI) || !empty(OPTIONS_WRONG_SINGLE) || !empty(OPTIONS_WRONG_RADIO)
5466 _CHECK_CONFIG_ERROR= true
5468 .endif # _check-config
5470 .if !target(check-config)
5471 check-config: _check-config
5472 .if !empty(_CHECK_CONFIG_ERROR)
5475 .endif # check-config
5477 .if !target(sanity-config)
5478 sanity-config: _check-config
5479 .if !empty(_CHECK_CONFIG_ERROR)
5480 @echo -n "Config is invalid. Re-edit? [Y/n] "; \
5486 cd ${.CURDIR} && ${MAKE} config
5488 .endif # sanity-config
5490 .if !target(pre-config)
5492 D4P_ENV= PKGNAME="${PKGNAME}" \
5493 PORT_OPTIONS="${PORT_OPTIONS}" \
5494 ALL_OPTIONS="${ALL_OPTIONS}" \
5495 OPTIONS_MULTI="${OPTIONS_MULTI}" \
5496 OPTIONS_SINGLE="${OPTIONS_SINGLE}" \
5497 OPTIONS_RADIO="${OPTIONS_RADIO}" \
5498 OPTIONS_GROUP="${OPTIONS_GROUP}" \
5499 NEW_OPTIONS="${NEW_OPTIONS}" \
5500 DIALOG4PORTS="${DIALOG4PORTS}" \
5501 PREFIX="${PREFIX}" \
5502 LOCALBASE="${LOCALBASE}" \
5503 PORTSDIR="${PORTSDIR}" \
5505 D4PHEIGHT="${D4PHEIGHT}" \
5506 D4PWIDTH="${D4PWIDTH}" \
5507 D4PFULLSCREEN="${D4PFULLSCREEN}"
5508 .if exists(${PKGHELP})
5509 D4P_ENV+= PKGHELP="${PKGHELP}"
5511 .for opt in ${ALL_OPTIONS}
5512 D4P_ENV+= ${opt}_DESC=""${${opt}_DESC:Q}""
5514 .for otype in MULTI GROUP SINGLE RADIO
5515 . for m in ${OPTIONS_${otype}}
5516 D4P_ENV+= OPTIONS_${otype}_${m}="${OPTIONS_${otype}_${m}}" \
5517 ${m}_DESC=""${${m}_DESC:Q}""
5518 . for opt in ${OPTIONS_${otype}_${m}}
5519 D4P_ENV+= ${opt}_DESC=""${${opt}_DESC:Q}""
5528 .if !target(do-config)
5530 .if empty(ALL_OPTIONS) && empty(OPTIONS_SINGLE) && empty(OPTIONS_MULTI) && empty(OPTIONS_RADIO) && empty(OPTIONS_GROUP)
5531 @${ECHO_MSG} "===> No options to configure"
5533 @optionsdir=${OPTIONS_FILE:H}; \
5534 oldoptionsdir=${OPTIONSFILE:H}; \
5535 if [ ${UID} != 0 -a -z "${INSTALL_AS_USER}" -a ! -w "${PORT_DBDIR}" ] ; then \
5536 ${ECHO_MSG} "===> Switching to root credentials to create $${optionsdir}"; \
5537 (${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\"") || \
5538 (${ECHO_MSG} "===> Cannot create $${optionsdir}, check permissions"; exit 1); \
5539 ${ECHO_MSG} "===> Returning to user credentials" ; \
5541 if [ -d $${oldoptionsdir} -a ! -d $${optionsdir} ]; then \
5542 ${MV} $${oldoptionsdir} $${optionsdir}; \
5543 elif [ -d $${oldoptionsdir} -a -d $${optionsdir} ]; then \
5544 ${RM} -rf $${oldoptionsdir} ; \
5546 ${MKDIR} $${optionsdir} 2> /dev/null || \
5547 (${ECHO_MSG} "===> Cannot create $${optionsdir}, check permissions"; exit 1) ; \
5549 @TMPOPTIONSFILE=$$(mktemp -t portoptions); \
5550 trap "${RM} -f $${TMPOPTIONSFILE}; exit 1" 1 2 3 5 10 13 15; \
5551 ${SETENV} ${D4P_ENV} ${SH} ${SCRIPTSDIR}/dialog4ports.sh $${TMPOPTIONSFILE} || { \
5552 ${RM} -f $${TMPOPTIONSFILE}; \
5553 ${ECHO_MSG} "===> Options unchanged"; \
5557 if [ ! -e $${TMPOPTIONSFILE} ]; then \
5558 ${ECHO_MSG} "===> No user-specified options to save for ${PKGNAME}"; \
5561 SELOPTIONS=$$(${CAT} $${TMPOPTIONSFILE}); \
5562 ${RM} -f $${TMPOPTIONSFILE}; \
5563 TMPOPTIONSFILE=$$(mktemp -t portoptions); \
5564 trap "${RM} -f $${TMPOPTIONSFILE}; exit 1" 1 2 3 5 10 13 15; \
5565 ${ECHO_CMD} "# This file is auto-generated by 'make config'." > $${TMPOPTIONSFILE}; \
5566 ${ECHO_CMD} "# Options for ${PKGNAME}" >> $${TMPOPTIONSFILE}; \
5567 ${ECHO_CMD} "_OPTIONS_READ=${PKGNAME}" >> $${TMPOPTIONSFILE}; \
5568 ${ECHO_CMD} "_FILE_COMPLETE_OPTIONS_LIST=${COMPLETE_OPTIONS_LIST}" >> $${TMPOPTIONSFILE}; \
5569 for i in ${COMPLETE_OPTIONS_LIST}; do \
5570 if ${ECHO_CMD} $${SELOPTIONS} | ${GREP} -qw $${i}; then \
5571 ${ECHO_CMD} "OPTIONS_FILE_SET+=$${i}" >> $${TMPOPTIONSFILE}; \
5573 ${ECHO_CMD} "OPTIONS_FILE_UNSET+=$${i}" >> $${TMPOPTIONSFILE}; \
5576 if [ ${UID} != 0 -a -z "${INSTALL_AS_USER}" -a ! -w "${OPTIONS_FILE:H}" ]; then \
5577 ${ECHO_MSG} "===> Switching to root credentials to write ${OPTIONS_FILE}"; \
5578 ${SU_CMD} "${CAT} $${TMPOPTIONSFILE} > ${OPTIONS_FILE}"; \
5579 ${ECHO_MSG} "===> Returning to user credentials"; \
5581 ${CAT} $${TMPOPTIONSFILE} > ${OPTIONS_FILE}; \
5583 ${RM} -f $${TMPOPTIONSFILE}
5584 @cd ${.CURDIR} && ${MAKE} sanity-config
5589 .if !defined(NO_DIALOG)
5590 config: pre-config do-config
5593 @${ECHO_MSG} "===> Skipping 'config' as NO_DIALOG is defined"
5597 .if !target(config-recursive)
5599 @${ECHO_MSG} "===> Setting user-specified options for ${PKGNAME} and dependencies";
5600 @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \
5601 (cd $$dir; ${MAKE} config-conditional); \
5603 .endif # config-recursive
5605 .if !target(config-conditional)
5607 .if !empty(NEW_OPTIONS)
5608 @cd ${.CURDIR} && ${MAKE} config;
5610 .endif # config-conditional
5612 .if !target(showconfig)
5613 .include "${PORTSDIR}/Mk/bsd.options.desc.mk"
5614 MULTI_EOL= : you have to choose at least one of them
5615 SINGLE_EOL= : you have to select exactly one of them
5616 RADIO_EOL= : you can only select none or one of them
5618 .if !empty(COMPLETE_OPTIONS_LIST)
5619 @${ECHO_MSG} "===> The following configuration options are available for ${PKGNAME}":
5620 .for opt in ${ALL_OPTIONS}
5621 @[ -z "${PORT_OPTIONS:M${opt}}" ] || match="on" ; ${ECHO_MSG} -n " ${opt}=$${match:-off}"
5622 . if !empty(${opt}_DESC)
5623 @${ECHO_MSG} -n ": "${${opt}_DESC:Q}
5628 #multi and conditional multis
5629 .for otype in MULTI GROUP SINGLE RADIO
5630 . for m in ${OPTIONS_${otype}}
5631 . if empty(${m}_DESC)
5632 @${ECHO_MSG} "====> Options available for the ${otype:tl} ${m}${${otype}_EOL}"
5634 @${ECHO_MSG} "====> ${${m}_DESC}${${otype}_EOL}"
5636 . for opt in ${OPTIONS_${otype}_${m}}
5637 @[ -z "${PORT_OPTIONS:M${opt}}" ] || match="on" ; ${ECHO_MSG} -n " ${opt}=$${match:-off}"
5638 . if !empty(${opt}_DESC)
5639 @${ECHO_MSG} -n ": "${${opt}_DESC:Q}
5649 @${ECHO_MSG} "===> Use 'make config' to modify these settings"
5653 .if !target(showconfig-recursive)
5654 showconfig-recursive:
5655 @${ECHO_MSG} "===> The following configuration options are available for ${PKGNAME} and dependencies";
5656 @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \
5657 (cd $$dir; ${MAKE} showconfig); \
5659 .endif # showconfig-recursive
5661 .if !target(rmconfig)
5663 .if exists(${OPTIONSFILE})
5664 -@${ECHO_MSG} "===> Removing user-configured options for ${PKGNAME}"; \
5665 optionsdir=${OPTIONSFILE:H}; \
5666 if [ ${UID} != 0 -a "x${INSTALL_AS_USER}" = "x" -a ! -w "${OPTIONSFILE}" ]; then \
5667 ${ECHO_MSG} "===> Switching to root credentials to remove ${OPTIONSFILE} and $${optionsdir}"; \
5668 ${SU_CMD} "${RM} -f ${OPTIONSFILE} ; \
5669 ${RMDIR} $${optionsdir}"; \
5670 ${ECHO_MSG} "===> Returning to user credentials"; \
5672 ${RM} -f ${OPTIONSFILE}; \
5673 ${RMDIR} $${optionsdir} 2>/dev/null || return 0; \
5676 .if exists(${OPTIONS_FILE})
5677 -@${ECHO_MSG} "===> Removing user-configured options for ${PKGNAME}"; \
5678 optionsdir=${OPTIONS_FILE:H}; \
5679 if [ ${UID} != 0 -a "x${INSTALL_AS_USER}" = "x" -a ! -w "${OPTIONS_FILE}" ]; then \
5680 ${ECHO_MSG} "===> Switching to root credentials to remove ${OPTIONS_FILE} and $${optionsdir}"; \
5681 ${SU_CMD} "${RM} -f ${OPTIONS_FILE} ; \
5682 ${RMDIR} $${optionsdir}"; \
5683 ${ECHO_MSG} "===> Returning to user credentials"; \
5685 ${RM} -f ${OPTIONS_FILE}; \
5686 ${RMDIR} $${optionsdir} 2>/dev/null || return 0; \
5689 @${ECHO_MSG} "===> No user-specified options configured for ${PKGNAME}"
5693 .if !target(rmconfig-recursive)
5695 @${ECHO_MSG} "===> Removing user-specified options for ${PKGNAME} and dependencies";
5696 @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \
5697 (cd $$dir; ${MAKE} rmconfig); \
5699 .endif # rmconfig-recursive
5701 .if !target(pretty-print-config)
5710 pretty-print-config:
5711 .for opt in ${ALL_OPTIONS}
5712 @[ -z "${PORT_OPTIONS:M${opt}}" ] || match="+" ; ${ECHO_MSG} -n "$${match:--}${opt} "
5714 .for otype in MULTI GROUP SINGLE RADIO
5715 . for m in ${OPTIONS_${otype}}
5716 @${ECHO_MSG} -n "${m}${${otype}_START} "
5717 . for opt in ${OPTIONS_${otype}_${m}}
5718 @[ -z "${PORT_OPTIONS:M${opt}}" ] || match="+" ; ${ECHO_MSG} -n "$${match:--}${opt} "
5720 @${ECHO_MSG} -n "${${otype}_END} "
5727 .endif # pretty-print-config
5731 for native_category in ${CATEGORIES}; do \
5733 case $$native_category in \
5734 accessibility) c="Utility Accessibility" ;; \
5735 archivers) c="Utility Archiving" ;; \
5736 astro) c="Education Science Astronomy" ;; \
5737 audio) c="AudioVideo Audio" ;; \
5738 benchmarks) c="System" ;; \
5739 biology) c="Education Science Biology" ;; \
5740 cad) c="Graphics Engineering" ;; \
5741 comms) c="Utility" ;; \
5742 converters) c="Utility" ;; \
5743 databases) c="Office Database" ;; \
5744 deskutils) c="Utility" ;; \
5745 devel) c="Development" ;; \
5746 dns) c="Network" ;; \
5747 elisp) c="Development" ;; \
5748 editors) c="Utility" ;; \
5749 emulators) c="System Emulator" ;; \
5750 finance) c="Office Finance" ;; \
5751 ftp) c="Network FileTransfer" ;; \
5752 games) c="Game" ;; \
5753 geography) c="Education Science Geography" ;; \
5754 gnome) c="GNOME GTK" ;; \
5755 graphics) c="Graphics" ;; \
5756 hamradio) c="HamRadio" ;; \
5757 haskell) c="Development" ;; \
5758 irc) c="Network IRCClient" ;; \
5759 java) c="Development Java" ;; \
5760 kde) c="KDE Qt" ;; \
5761 lang) c="Development" ;; \
5762 lisp) c="Development" ;; \
5763 mail) c="Office Email" ;; \
5764 mate) c="MATE GTK" ;; \
5765 math) c="Education Science Math" ;; \
5766 mbone) c="Network AudioVideo" ;; \
5767 multimedia) c="AudioVideo" ;; \
5768 net) c="Network" ;; \
5769 net-im) c="Network InstantMessaging" ;; \
5770 net-mgmt) c="Network" ;; \
5771 net-p2p) c="Network P2P" ;; \
5772 news) c="Network News" ;; \
5773 palm) c="Office PDA" ;; \
5774 parallel) c="ParallelComputing" ;; \
5775 pear) c="Development WebDevelopment" ;; \
5776 perl5) c="Development" ;; \
5777 python) c="Development" ;; \
5778 ruby) c="Development" ;; \
5779 rubygems) c="Development" ;; \
5780 scheme) c="Development" ;; \
5781 science) c="Science Education" ;; \
5782 security) c="System Security" ;; \
5783 shells) c="System Shell" ;; \
5784 sysutils) c="System" ;; \
5785 tcl*|tk*) c="Development" ;; \
5786 textproc) c="Utility TextTools" ;; \
5787 www) c="Network" ;; \
5788 x11-clocks) c="Utility Clock" ;; \
5789 x11-fm) c="System FileManager" ;; \
5790 xfce) c="GTK XFCE" ;; \
5791 zope) c="Development WebDevelopment" ;; \
5793 if [ -n "$$c" ]; then \
5794 categories="$$categories $$c"; \
5797 if [ -n "$$categories" ]; then \
5798 for c in $$categories; do ${ECHO_MSG} "$$c"; done \
5799 | ${SORT} -u | ${TR} '\n' ';'; \
5803 # http://standards.freedesktop.org/menu-spec/menu-spec-latest.html
5804 DESKTOP_CATEGORIES_MAIN= AudioVideo Audio Video Development Education \
5805 Game Graphics Network Office Science Settings System Utility
5806 DESKTOP_CATEGORIES_ADDITIONAL= Building Debugger IDE GUIDesigner Profiling \
5807 RevisionControl Translation Calendar ContactManagement Database \
5808 Dictionary Chart Email Finance FlowChart PDA ProjectManagement \
5809 Presentation Spreadsheet WordProcessor 2DGraphics VectorGraphics \
5810 RasterGraphics 3DGraphics Scanning OCR Photography Publishing Viewer \
5811 TextTools DesktopSettings HardwareSettings Printing PackageManager \
5812 Dialup InstantMessaging Chat IRCClient Feed FileTransfer HamRadio News \
5813 P2P RemoteAccess Telephony TelephonyTools VideoConference WebBrowser \
5814 WebDevelopment Midi Mixer Sequencer Tuner TV AudioVideoEditing Player \
5815 Recorder DiscBurning ActionGame AdventureGame ArcadeGame BoardGame \
5816 BlocksGame CardGame KidsGame LogicGame RolePlaying Shooter Simulation \
5817 SportsGame StrategyGame Art Construction Music Languages \
5818 ArtificialIntelligence Astronomy Biology Chemistry ComputerScience \
5819 DataVisualization Economy Electricity Geography Geology Geoscience \
5820 History Humanities ImageProcessing Literature Maps Math \
5821 NumericalAnalysis MedicalSoftware Physics Robotics Spirituality Sports \
5822 ParallelComputing Amusement Archiving Compression Electronics Emulator \
5823 Engineering FileTools FileManager TerminalEmulator Filesystem Monitor \
5824 Security Accessibility Calculator Clock TextEditor Documentation Adult \
5825 Core KDE GNOME MATE XFCE GTK Qt Motif Java ConsoleOnly
5826 DESKTOP_CATEGORIES_RESERVED= Screensaver TrayIcon Applet Shell
5828 VALID_DESKTOP_CATEGORIES+= ${DESKTOP_CATEGORIES_MAIN} \
5829 ${DESKTOP_CATEGORIES_ADDITIONAL} \
5830 ${DESKTOP_CATEGORIES_RESERVED}
5832 .if defined(DESKTOP_ENTRIES)
5833 check-desktop-entries:
5834 @set -- ${DESKTOP_ENTRIES} XXX; \
5835 if [ `${EXPR} \( $$# - 1 \) % 6` -ne 0 ]; then \
5836 ${ECHO_MSG} "${PKGNAME}: Makefile error: the DESKTOP_ENTRIES list must contain one or more groups of 6 elements"; \
5840 while [ $$# -gt 6 ]; do \
5842 if [ -n "$$4" ]; then \
5843 entry="$$entry ($$4)"; \
5844 elif [ -n "$$1" ]; then \
5845 entry="$$entry ($$1)"; \
5847 if [ -z "$$1" ]; then \
5848 ${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 1 (Name) is empty"; \
5851 if ${ECHO_CMD} "$$3" | ${GREP} -iq '.\(png\|svg\|xpm\)$$'; then \
5852 if ! ${ECHO_CMD} "$$3" | ${GREP} -iq '^/'; then \
5853 ${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"; \
5856 if [ -z "$$4" ]; then \
5857 ${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 4 (Exec) is empty"; \
5860 if [ -n "$$5" ]; then \
5861 for c in `${ECHO_CMD} "$$5" | ${TR} ';' ' '`; do \
5862 if ! ${ECHO_CMD} ${VALID_DESKTOP_CATEGORIES} | ${GREP} -wq $$c; then \
5863 ${ECHO_CMD} "${PKGNAME}: Makefile warning: in desktop entry $$entry: category $$c is not a valid desktop category"; \
5866 if ! ${ECHO_CMD} "$$5" | ${GREP} -q "`${ECHO_CMD} ${DESKTOP_CATEGORIES_MAIN} | ${SED} -E 's,[[:blank:]]+,\\\|,g'`"; then \
5867 ${ECHO_CMD} "${PKGNAME}: Makefile warning: in desktop entry $$entry: field 5 (Categories) must contain at least one main desktop category (make -VDESKTOP_CATEGORIES_MAIN)"; \
5869 if ! ${ECHO_CMD} "$$5" | ${GREP} -q ';$$'; then \
5870 ${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 5 (Categories) does not end with a semicolon"; \
5874 if [ -z "`cd ${.CURDIR} && ${MAKE} desktop-categories`" ]; then \
5875 ${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 5 (Categories) is empty and could not be deduced from the CATEGORIES variable"; \
5879 if [ "x$$6" != "xtrue" ] && [ "x$$6" != "xfalse" ] && [ "x$$6" != "x" ]; then \
5880 ${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 6 (StartupNotify) is not \"true\", \"false\" or \"\"(empty)"; \
5884 num=`${EXPR} $$num + 1`; \
5888 .if !target(install-desktop-entries)
5889 .if defined(DESKTOP_ENTRIES)
5890 install-desktop-entries:
5891 @set -- ${DESKTOP_ENTRIES} XXX; \
5892 while [ $$# -gt 6 ]; do \
5893 filename="`${ECHO_CMD} "$$4" | ${SED} -e 's,^/,,g;s,[/ ],_,g;s,[^_[:alnum:]],,g'`.desktop"; \
5894 pathname="${STAGEDIR}${DESKTOPDIR}/$$filename"; \
5896 if [ -z "$$categories" ]; then \
5897 categories="`cd ${.CURDIR} && ${MAKE} desktop-categories`"; \
5899 ${ECHO_CMD} "${DESKTOPDIR}/$$filename" >> ${TMPPLIST}; \
5900 ${ECHO_CMD} "[Desktop Entry]" > $$pathname; \
5901 ${ECHO_CMD} "Type=Application" >> $$pathname; \
5902 ${ECHO_CMD} "Version=1.0" >> $$pathname; \
5903 ${ECHO_CMD} "Name=$$1" >> $$pathname; \
5905 if [ -z "$$2" ]; then \
5906 comment="`cd ${.CURDIR} && ${MAKE} -VCOMMENT`"; \
5908 ${ECHO_CMD} "GenericName=$$comment" >> $$pathname; \
5909 ${ECHO_CMD} "Comment=$$comment" >> $$pathname; \
5910 if [ -n "$$3" ]; then \
5911 ${ECHO_CMD} "Icon=$$3" >> $$pathname; \
5913 ${ECHO_CMD} "Exec=$$4" >> $$pathname; \
5914 ${ECHO_CMD} "Categories=$$categories" >> $$pathname; \
5915 if [ -n "$$6" ]; then \
5916 ${ECHO_CMD} "StartupNotify=$$6" >> $$pathname; \
5923 .if defined(WARNING)
5926 @${ECHO_MSG} "/!\\ WARNING /!\\"
5927 .for m in ${WARNING}
5931 @sleep ${WARNING_WAIT}
5934 .if defined(DEVELOPER)
5935 .if defined(DEV_WARNING)
5936 DEV_WARNING_WAIT?= 10
5938 @${ECHO_MSG} "/!\\ ${PKGNAME}: Makefile warnings, please consider fixing /!\\"
5940 .for m in ${DEV_WARNING}
5944 .if defined(DEV_WARNING_FATAL)
5947 @sleep ${DEV_WARNING_WAIT}
5951 .if defined(DEV_ERROR)
5953 @${ECHO_MSG} "/!\\ ${PKGNAME}: Makefile errors /!\\"
5955 .for m in ${DEV_ERROR}
5963 # Please note that the order of the following targets is important, and
5964 # should not be modified.
5966 _TARGETS_STAGES= SANITY PKG FETCH EXTRACT PATCH CONFIGURE BUILD INSTALL PACKAGE STAGE
5968 # Define the SEQ of actions to take when each target is ran, and which targets
5969 # it depends on before running its SEQ.
5971 _SANITY_SEQ= post-chroot pre-everything check-makefile \
5972 show-warnings show-dev-warnings show-dev-errors \
5973 check-categories check-makevars check-desktop-entries \
5974 check-depends identify-install-conflicts check-deprecated \
5975 check-vulnerable check-license check-config buildanyway-message \
5978 _PKG_DEP= check-sanity
5979 _PKG_SEQ= pkg-depends
5981 _FETCH_SEQ= fetch-depends pre-fetch pre-fetch-script \
5982 do-fetch fetch-specials post-fetch post-fetch-script
5984 _EXTRACT_SEQ= check-build-conflicts extract-message checksum extract-depends \
5985 clean-wrkdir ${WRKDIR} pre-extract pre-extract-script do-extract \
5986 post-extract post-extract-script
5988 _PATCH_SEQ= ask-license patch-message patch-depends pathfix dos2unix fix-shebang \
5990 pre-patch-script do-patch charsetfix-post-patch post-patch post-patch-script
5991 _CONFIGURE_DEP= patch
5992 _CONFIGURE_SEQ= build-depends lib-depends configure-message \
5993 pre-configure pre-configure-script \
5994 run-autotools do-autoreconf patch-libtool run-autotools-fixup do-configure \
5995 post-configure post-configure-script
5996 _BUILD_DEP= configure
5997 _BUILD_SEQ= build-message pre-build pre-build-script do-build \
5998 post-build post-build-script
6001 _STAGE_SEQ= stage-message stage-dir run-depends lib-depends apply-slist pre-install generate-plist \
6003 # ${POST_PLIST} must be after anything that modifies TMPPLIST
6004 .if defined(NEED_ROOT)
6005 _STAGE_SUSEQ= create-users-groups do-install \
6006 kmod-post-install fix-perl-things \
6007 webplugin-post-install post-install post-install-script \
6008 move-uniquefiles patch-lafiles post-stage compress-man \
6009 install-rc-script install-ldconfig-file install-license \
6010 install-desktop-entries add-plist-info add-plist-docs \
6011 add-plist-examples add-plist-data add-plist-post \
6012 move-uniquefiles-plist ${POST_PLIST}
6013 .if defined(DEVELOPER)
6014 _STAGE_SUSEQ+= stage-qa
6017 _STAGE_SEQ+= create-users-groups do-install \
6018 kmod-post-install fix-perl-things \
6019 webplugin-post-install post-install post-install-script \
6020 move-uniquefiles patch-lafiles post-stage compress-man \
6021 install-rc-script install-ldconfig-file install-license \
6022 install-desktop-entries add-plist-info add-plist-docs \
6023 add-plist-examples add-plist-data add-plist-post \
6024 move-uniquefiles-plist ${POST_PLIST}
6025 .if defined(DEVELOPER)
6026 _STAGE_SEQ+= stage-qa
6030 _INSTALL_SEQ= install-message run-depends lib-depends check-already-installed
6031 _INSTALL_SUSEQ= fake-pkg security-check
6034 _PACKAGE_SEQ= package-message pre-package pre-package-script do-package post-package-script
6036 # Enforce order for -jN builds
6038 .for _t in ${_TARGETS_STAGES}
6039 . for s in ${_${_t}_SEQ}
6041 . if ! ${NOTPHONY:M${s}}
6042 _PHONY_TARGETS+= ${s}
6044 _${_t}_REAL_SEQ+= ${s}
6047 . for s in ${_${_t}_SUSEQ}
6049 . if ! ${NOTPHONY:M${s}}
6050 _PHONY_TARGETS+= ${s}
6052 _${_t}_REAL_SUSEQ+= ${s}
6055 .ORDER: ${_${_t}_DEP} ${_${_t}_REAL_SEQ}
6058 # Define all of the main targets which depend on a sequence of other targets.
6059 # See above *_SEQ and *_DEP. The _DEP will run before this defined target is
6060 # ran. The _SEQ will run as this target once _DEP is satisfied.
6062 .for target in extract patch configure build stage install package
6064 # Check if config dialog needs to show and execute it if needed. If is it not
6065 # needed (_OPTIONS_OK), then just depend on the cookie which is defined later
6066 # to depend on the *_DEP and execute the *_SEQ.
6067 # If options are required, execute config-conditional and then re-execute the
6068 # target noting that config is no longer needed.
6069 .if !target(${target}) && defined(_OPTIONS_OK)
6070 _PHONY_TARGETS+= ${target}
6071 ${target}: ${${target:tu}_COOKIE}
6072 .elif !target(${target})
6073 ${target}: config-conditional
6074 @cd ${.CURDIR} && ${MAKE} CONFIG_DONE_${UNIQUENAME:tu}=1 ${${target:tu}_COOKIE}
6075 .elif target(${target}) && defined(IGNORE)
6078 .if !exists(${${target:tu}_COOKIE})
6080 # Define the real target behavior. Depend on the target's *_DEP. Execute
6081 # the target's *_SEQ. Also handle su and USE_SUBMAKE needs.
6082 .if ${UID} != 0 && defined(_${target:tu}_REAL_SUSEQ) && !defined(INSTALL_AS_USER)
6083 . if defined(USE_SUBMAKE)
6084 ${${target:tu}_COOKIE}: ${_${target:tu}_DEP}
6085 @cd ${.CURDIR} && ${MAKE} ${_${target:tu}_REAL_SEQ}
6086 . else # !USE_SUBMAKE
6087 ${${target:tu}_COOKIE}: ${_${target:tu}_DEP} ${_${target:tu}_REAL_SEQ}
6088 . endif # USE_SUBMAKE
6089 @${ECHO_MSG} "===> Switching to root credentials for '${target}' target"
6091 ${SU_CMD} "${MAKE} ${_${target:tu}_REAL_SUSEQ}"
6092 @${ECHO_MSG} "===> Returning to user credentials"
6093 @${TOUCH} ${TOUCH_FLAGS} ${.TARGET}
6094 .else # No SU needed
6095 . if defined(USE_SUBMAKE)
6096 ${${target:tu}_COOKIE}: ${_${target:tu}_DEP}
6098 ${MAKE} ${_${target:tu}_REAL_SEQ} ${_${target:tu}_REAL_SUSEQ}
6099 @${TOUCH} ${TOUCH_FLAGS} ${.TARGET}
6100 . else # !USE_SUBMAKE
6101 ${${target:tu}_COOKIE}: ${_${target:tu}_DEP} ${_${target:tu}_REAL_SEQ} ${_${target:tu}_REAL_SUSEQ}
6102 @${TOUCH} ${TOUCH_FLAGS} ${.TARGET}
6103 . endif # USE_SUBMAKE
6106 .else # exists(cookie)
6107 ${${target:tu}_COOKIE}::
6108 @if [ -e ${.TARGET} ]; then \
6111 cd ${.CURDIR} && ${MAKE} ${.TARGET}; \
6113 .endif # !exists(cookie)
6115 .endfor # foreach(targets)
6117 .PHONY: ${_PHONY_TARGETS} check-sanity fetch pkg
6119 .if !target(check-sanity)
6120 check-sanity: ${_SANITY_REAL_SEQ}
6124 fetch: ${_FETCH_DEP} ${_FETCH_REAL_SEQ}
6128 pkg: ${_PKG_DEP} ${_PKG_REAL_SEQ}
6132 # End of post-makefile section.
6135 # End of the DESTDIR if statement