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 # IGNOREFILES - If set, don't perform checksum checks on these files.
127 # NOFETCHFILES - If set, don't download these files from the ${MASTER_SITES}
128 # or ${MASTER_SITE_BACKUP} (but do from
129 # ${MASTER_SITE_OVERRIDE})
130 # EXTRACT_ONLY - If set, a subset of ${DISTFILES} you want to
132 # ALWAYS_KEEP_DISTFILES
133 # - If set, the package building cluster will save the distfiles
134 # along with the packages. This may be required to comply with
135 # some licenses, e.g. GPL in some cases.
138 # (NOTE: by convention, the MAINTAINER entry (see above) should go here.)
140 # These variables are typically set in /etc/make.conf to indicate
141 # the user's preferred location to fetch files from. You should
142 # rarely need to set these.
145 # - Backup location(s) for distribution files and patch
146 # files if not found locally and ${MASTER_SITES}/${PATCH_SITES}
148 # ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/
149 # MASTER_SITE_OVERRIDE
150 # - If set, override the MASTER_SITES setting with this
152 # MASTER_SITE_FREEBSD
153 # - If set, only use ${MASTER_SITE_BACKUP} for
155 # CD_MOUNTPTS - List of CDROM mountpoints to look for distfiles under.
156 # This variable supercedes CD_MOUNTPT, which is
159 # Set these if your port should not be built under certain circumstances.
160 # These are string variables; you should set them to the reason why
161 # they are necessary.
163 # RESTRICTED - Prevent the distribution of distfiles and packages to
164 # the FTP sites or on CDROM (e.g. forbidden by license
166 # NO_CDROM - Packages and distfiles may not go on CDROM (e.g. must
167 # not be re-sold) but can go on FTP sites.
168 # NO_PACKAGE - Port should not be packaged for ftp sites or CDROMs,
169 # but distfiles can be put on ftp sites and CDROMs.
170 # FORBIDDEN - Package build should not be attempted because of
171 # security vulnerabilities.
172 # LEGAL_TEXT - Port has legal issues (e.g., special permission to distribute, lacks a license).
173 # LEGAL_PACKAGE - Port has no legal issues but defines NO_PACKAGE
174 # IGNORE - Package build should be skipped entirely (e.g.
175 # because of serious unfixable problems in the build,
176 # because it cannot be manually fetched, etc). Error
177 # logs will not appear on pointyhat, so this should be
179 # BROKEN - Port is believed to be broken. Package builds can
180 # still be attempted using TRYBROKEN to test this
182 # BROKEN_${ARCH} Port is believed to be broken on ${ARCH}. Package builds
183 # can still be attempted using TRYBROKEN to test this
185 # DEPRECATED - Port is deprecated to install. Advisory only.
187 # - If DEPRECATED is set, determines a date when
188 # the port is planed to remove. The date format is
189 # ISO 8601 (YYYY-MM-DD).
191 # DISABLE_VULNERABILITIES
192 # - If set, do not check if the port is listed in the
193 # vulnerabilities database.
195 # In addition to RESTRICTED or NO_CDROM, if only a subset of distfiles
196 # or patchfiles have redistribution restrictions, set the following
197 # to the list of such files.
200 # - List of files that cannot be redistributed.
201 # Default: "${DISTFILES} ${PATCHFILES}" if RESTRICTED
202 # or NO_CDROM is set, empty otherwise.
204 # These variables are booleans, so you don't need to set them to the reason.
207 # - Set this if your port needs to interact with the user
208 # during any step in a package build. User can then decide
209 # to skip this port by setting ${BATCH}, or compiling only
210 # the interactive ports by setting ${INTERACTIVE}.
212 # USE_SUBMAKE - Set this if you want that each of the port's main 7 targets
213 # (extract, patch, configure, build, stage, install and
214 # package) to be executed in a separate make(1) process.
215 # Useful when one of the stages needs to influence make(1)
216 # variables of the later stages using ${WRKDIR}/Makefile.inc
217 # generated on the fly.
220 # NO_ARCH - Set this if port is architecture neutral.
222 # Set these if your port only makes sense to certain architectures.
223 # They are lists containing names for them (e.g., "amd64 i386").
224 # (Defaults: not set.)
227 # - Only build ports if ${ARCH} matches one of these.
228 # NOT_FOR_ARCHS - Only build ports if ${ARCH} doesn't match one of these.
229 # ONLY_FOR_ARCHS_REASON
230 # ONLY_FOR_ARCHS_REASON_${ARCH}
231 # - Reason why it's only for ${ONLY_FOR_ARCHS}s
232 # NOT_FOR_ARCHS_REASON
233 # NOT_FOR_ARCHS_REASON_${ARCH}
234 # - Reason why it's not for ${NOT_FOR_ARCHS}s
236 # - Set this instead of ONLY_FOR_ARCHS if the given port
237 # fetches and installs compiled i386 binaries.
239 # Dependency checking. Use these if your port requires another port
240 # not in the list below. (Default: empty.)
243 # - A list of "path:dir[:target]" tuples of other ports this
244 # package depends on in the "extract" stage. "path" is
245 # the name of a file if it starts with a slash (/), an
246 # executable otherwise. make will test for the existence
247 # (if it is a full pathname) or search for it in your
248 # $PATH (if it is an executable) and go into "dir" to do
249 # a "make all install" if it's not found. If the third
250 # field ("target") exists, it will be used instead of
251 # ${DEPENDS_TARGET}. The first field also supports a
252 # package name with a version range, in the form package>=1.2
253 # if a particular version is desired.
254 # PATCH_DEPENDS - A list of "path:dir[:target]" tuples of other ports this
255 # package depends on in the "patch" stage. "path" is the
256 # name of a file if it starts with a slash (/), an
257 # executable otherwise. make will test for the existence
258 # (if it is a full pathname) or search for it in your
259 # $PATH (if it is an executable) and go into "dir" to do
260 # a "make all install" if it's not found. If the third
261 # field ("target") exists, it will be used instead of
262 # ${DEPENDS_TARGET}. The first field also supports a
263 # package name with a version range, in the form package>=1.2
264 # if a particular version is desired.
265 # FETCH_DEPENDS - A list of "path:dir[:target]" tuples of other ports this
266 # package depends in the "fetch" stage. "path" is the
267 # name of a file if it starts with a slash (/), an
268 # executable otherwise. make will test for the
269 # existence (if it is a full pathname) or search for
270 # it in your $PATH (if it is an executable) and go
271 # into "dir" to do a "make all install" if it's not
272 # found. If the third field ("target") exists, it will
273 # be used instead of ${DEPENDS_TARGET}. The first field
274 # also supports a package name with a version range, in
275 # the form package>=1.2 if a particular version is desired.
276 # BUILD_DEPENDS - A list of "path:dir[:target]" tuples of other ports this
277 # package depends to build (between the "extract" and
278 # "build" stages, inclusive). The test done to
279 # determine the existence of the dependency is the
280 # same as FETCH_DEPENDS. If the third field ("target")
281 # exists, it will be used instead of ${DEPENDS_TARGET}.
282 # RUN_DEPENDS - A list of "path:dir[:target]" tuples of other ports this
283 # package depends to run. The test done to determine
284 # the existence of the dependency is the same as
285 # FETCH_DEPENDS. This will be checked during the
286 # "install" stage and the name of the dependency will
287 # be put into the package as well. If the third field
288 # ("target") exists, it will be used instead of
289 # ${DEPENDS_TARGET}. The first field also supports a
290 # package name with a version range, in the form package>=1.2
291 # if a particular version is desired.
292 # LIB_DEPENDS - A list of "lib:dir[:target]" tuples of other ports this
293 # package depends on. "lib" is the name of a shared library.
294 # make will use "ldconfig -r" to search for the library.
295 # lib can contain extended regular expressions.
297 # - The default target to execute when a port is calling a
301 # These variables control options about how a port gets built and/or
302 # are shorthand notations for common sets of dependencies.
303 # Use these if your port uses some of the common software packages. By
304 # convention these should be set to 'yes', although they only need to be
305 # defined. Defaults: not set, unless explicitly indicated below.
307 # Note: the distinction between the USE_* and WANT_* variables, and the
308 # WITH_* and WITHOUT_* variables, are that the former are restricted to
309 # usage inside the ports framework, and the latter are reserved for user-
310 # settable options. (Setting USE_* in /etc/make.conf is always wrong).
312 # WITH_DEBUG - If set, debugging flags are added to CFLAGS and the
313 # binaries don't get stripped by INSTALL_PROGRAM or
314 # INSTALL_LIB. Besides, individual ports might
315 # add their specific to produce binaries for debugging
316 # purposes. You can override the debug flags that are
317 # passed to the compiler by setting DEBUG_FLAGS. It is
318 # set to "-g" at default.
320 # WITH_DEBUG_PORTS - A list of origins for which WITH_DEBUG will be set
323 # - If set, SSP_FLAGS (defaults to -fstack-protector)
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_SCONS - If set, this port uses the Python-based SCons build system
388 # See bsd.scons.mk for more details.
390 # USE_EFL - If set, this port use EFL libraries.
391 # Implies inclusion of bsd.efl.mk. (Also see
392 # that file for more information on USE_EFL_*).
393 # USE_FPC - If set, this port relies on the Free Pascal language.
394 # Implies inclusion of bsd.fpc.mk. (Also see
395 # that file for more information on WANT_FPC_*).
396 # USE_JAVA - If set, this port relies on the Java language.
397 # Implies inclusion of bsd.java.mk. (Also see
398 # that file for more information on USE_JAVA_*).
399 # USE_OCAML - If set, this port relies on the OCaml language.
400 # Implies inclusion of bsd.ocaml.mk. (Also see
401 # that file for more information on USE_OCAML*).
402 # USE_PYTHON - If set, this port relies on the Python language.
403 # Implies inclusion of bsd.python.mk. (Also see
404 # that file for more information on USE_PYTHON_*
405 # and USE_PYDISTUTILS).
406 # USE_RUBY - If set, this port relies on the Ruby language.
407 # Implies inclusion of bsd.ruby.mk. (Also see
408 # that file for more information on USE_RUBY_*).
409 # USE_GNUSTEP - If set, this port relies on the GNUstep system.
410 # Implies the inclusion of bsd.gnustep.mk.
411 # (Also see that file for more information on
414 # USE_GECKO - If set, this port uses the Gecko/Mozilla product.
415 # See bsd.gecko.mk for more details.
417 # USE_GNOME - A list of the Gnome dependencies the port has (e.g.,
418 # glib12, gtk12). Implies that the port needs Gnome.
419 # Implies inclusion of bsd.gnome.mk. See bsd.gnome.mk
420 # or http://www.FreeBSD.org/gnome/docs/porting.html
423 # USE_MATE - A list of the MATE dependencies the port has. Implies
424 # that the port needs MATE. Implies inclusion of
425 # bsd.mate.mk. See bsd.mate.mk for more details.
427 # USE_LUA - If set, this port uses the Lua library and related
428 # components. See bsd.lua.mk for more details.
430 # USE_WX - If set, this port uses the WxWidgets library and related
431 # components. See bsd.wx.mk for more details.
433 # USE_KDE4 - A list of the KDE 4 dependencies the port has (e.g.,
434 # kdelibs, kdebase). Implies that the port needs KDE.
435 # Implies inclusion of bsd.kde4.mk. See bsd.kde4.mk
438 # USE_QT4 - A list of the Qt 4 dependencies the port has (e.g,
439 # corelib, webkit). Implies that the port needs Qt.
440 # Implies the inclusion of bsd.qt.mk. See bsd.qt.mk
443 # USE_QT5 - A list of the Qt 5 dependencies the port has (e.g,
444 # core, webkit). Implies that the port needs Qt.
445 # Implies the inclusion of bsd.qt.mk. See bsd.qt.mk
448 # USE_LINUX - Set to yes to say the port needs the default linux base port.
449 # Set to value <X>, if the port needs emulators/linux_base-<X>.
450 # Implies appropriate settings for STRIP and STRIP_CMD.
452 # - controls the action of PREFIX (see above). Only use this
453 # if the port is a linux infrastructure port (e.g. contains libs
454 # or a sound server which supports the FreeBSD native one),
455 # use the default or the X11 prefix if it's a leaf port
456 # (e.g. a game or program).
457 # Implies NO_MTREE=yes, and, if USE_LDCONFIG is defined:
459 # - appropriate invocation of the Linux ldconfig
460 # USE_LINUX_RPM - Set to yes to pull in variables and targets useful to Linux
462 # Implies inclusion of bsd.linux-rpm.mk.
464 # LINUX_OSRELEASE - Contains the value of compat.linux.osrelease sysctl.
465 # Will be used to distinguish which linux
466 # infrastructure ports should be used.
467 # Valid values: 2.6.16.
469 # - Set to yes to enable automatic packing list generation.
470 # Currently has no effect unless USE_LINUX_RPM is set.
472 # OVERRIDE_LINUX_BASE_PORT
473 # - This specifies the default linux base to use, for valid
474 # values have a look at the description of USE_LINUX. This is
475 # an user-only variable. Don't use it in any port, it's meant
476 # to be used in make.conf.
479 # - This is a read-only variable, it gets set to a value which is
480 # usable in *_DEPENDS (e.g. BUILD_DEPENDS=${LINUX_BASE_PORT}).
481 # It honors USE_LINUX=foo and OVERRIDE_LINUX_BASE_PORT.
483 # USE_XORG - Set to a list of X.org module dependencies.
484 # Implies inclusion of bsd.xorg.mk.
486 # USE_TEX - A list of the TeX dependencies the port has.
489 # USE_RC_SUBR - If set, the ports startup/shutdown script uses the common
490 # routines found in /etc/rc.subr.
491 # If this is set to a list of files, these files will be
492 # automatically added to ${SUB_FILES}, some %%VAR%%'s will
493 # automatically be expanded, they will be installed in
494 # ${PREFIX}/etc/rc.d and added to the packing list.
495 # USE_RCORDER - List of rc.d startup scripts to be called early in the boot
496 # process. This acts exactly like USE_RC_SUBR except that
497 # scripts are installed in /etc/rc.d.
498 # Because local rc.d scripts are included in the base rcorder
499 # this option is not needed unless the port installs in the base.
501 # USE_APACHE - If set, this port relies on an apache webserver.
503 # Conflict checking. Use if your port cannot be installed at the same time as
506 # CONFLICTS - A list of package name patterns that the port conflicts
507 # with, separated by blanks. The names may include shell
508 # pattern meta-characters "*", "?", "[", "]", and "!".
509 # Example: apache*-1.2* apache*-1.3.[012345] apache-*+ssl_*
512 # - Check conflict prior to the build.
515 # - Check conflict prior to the installation stage.
517 # Various directory definitions and variables to control them.
518 # You rarely need to redefine any of these except WRKSRC and NO_WRKSUBDIR.
520 # LOCALBASE - Where non-X11 ports install things.
521 # Default: /usr/local
522 # LINUXBASE - Where Linux ports install things.
523 # Default: /compat/linux
524 # PREFIX - Where *this* port installs its files.
525 # Default: ${LINUXBASE} if USE_LINUX_PREFIX is set,
526 # otherwise ${LOCALBASE}
529 # - There are some sanity checks against PREFIX.
530 # You can disable these checks with defining
531 # this variable, but this is not recommended!
532 # Only do this if you really know what you are
533 # doing. These sanity checks are the following:
534 # - PREFIX has to be an absolute path.
535 # - PREFIX can't have a trailing slash.
537 # MASTERDIR - Where the port finds patches, package files, etc. Define
538 # this is you have two or more ports that share most of the
540 # Default: ${.CURDIR}
541 # PORTSDIR - The root of the ports tree.
542 # Default: /usr/ports
543 # DISTDIR - Where to search for and store copies of original sources
544 # Default: ${PORTSDIR}/distfiles
545 # PACKAGES - A top level directory where all packages go (rather than
546 # going locally to each port).
547 # Default: ${PORTSDIR}/packages
548 # WRKDIRPREFIX - The place to root the temporary working directory
551 # WRKDIR - A temporary working directory that gets *clobbered* on clean
552 # Default: ${WRKDIRPREFIX}${.CURDIR}/work
553 # WRKSRC - A subdirectory of ${WRKDIR} where the distribution actually
555 # Default: ${WRKDIR}/${DISTNAME} unless NO_WRKSUBDIR is set,
556 # in which case simply ${WRKDIR}
557 # WRKSRC_SUBDIR - A subdirectory of ${WRKSRC} where the distribution actually
560 # NO_WRKSUBDIR - Assume port unpacks directly into ${WRKDIR}.
561 # PATCHDIR - A directory containing any additional patches you made
562 # to port this software to FreeBSD.
563 # Default: ${MASTERDIR}/files
564 # SCRIPTDIR - A directory containing any auxiliary scripts
565 # Default: ${MASTERDIR}/scripts
566 # FILESDIR - A directory containing any miscellaneous additional files.
567 # Default: ${MASTERDIR}/files
568 # DFLY_PATCHDIR= - A directory containing additional patches required
569 # to build port on DragonFly
570 # Default: ${MASTERDIR}/dragonfly
571 # DFLY_FILESDIR - A directory containing any miscellaneous files
572 # needed to build port on DragonFly
573 # Default: ${MASTERDIR}/dragonfly
574 # PKGDIR - A directory containing any package creation files.
575 # Default: ${MASTERDIR}
576 # SRC_BASE - The root of the src tree. (Some ports require this to get
577 # kernel sources). Default: /usr/src
578 # UID_FILES - A list of files containing information about registered UIDs.
579 # Note that files have decreasing priority.
580 # GID_FILES - A list of files containing information about registered GIDs.
581 # Note that files have decreasing priority.
583 # Variables that serve as convenient "aliases" for your *-install targets.
584 # Use these like: "${INSTALL_PROGRAM} ${WRKSRC}/prog ${PREFIX}/bin".
587 # - A command to install binary executables. (By
588 # default, also strips them, unless ${STRIP} is
589 # overridden to be the empty string).
590 # INSTALL_KLD - As INSTALL_PROGRAM, but without the STRIP.
591 # INSTALL_LIB - As INSTALL_DATA, but also strips the file.
593 # - A command to install executable scripts.
594 # INSTALL_DATA - A command to install sharable data.
595 # INSTALL_MAN - A command to install manpages. May or not compress,
596 # depending on the value of MANCOMPRESSED (see below).
599 # - Similiar to INSTALL commands but working on whole
600 # trees of directories, takes 3 arguments, last one is
601 # find(1) arguments and optional.
603 # cd ${WRKSRC}/doc && ${COPYTREE} . ${DOCSDIR} "! -name *.bak"
605 # Installs all directories and files from ${WRKSRC}/doc
606 # to ${DOCSDIR} except sed backup files.
608 # Boolean to control whether manpages are installed.
610 # NO_INSTALL_MANPAGES
611 # - If set, this port doesn't want to install any manpages.
612 # Default: not set, i.e. manpages are installed by default.
614 # Set the following to specify all manpages that your port installs.
615 # These manpages will be automatically listed in ${PLIST}. Depending
616 # on the setting of NO_MANCOMPRESS, the make rules will compress the
619 # MAN<sect> - A list of manpages, categorized by section. For
620 # example, if your port has "man/man1/foo.1" and
621 # "man/mann/bar.n", set "MAN1=foo.1" and "MANN=bar.n".
622 # The available sections chars are "123456789LN".
624 # - If your port does not install all man pages for all
625 # languages in MANLANG, language specific pages for
626 # a language can be specified with this. For example,
627 # if the port installs foo.1 in English, Japanese, and
628 # German, bar.1 in English only, and baz.3 in German
634 # MLINKS - A list of <source, target> tuples for creating links
635 # for manpages. For example, "MLINKS= a.1 b.1 c.3 d.3"
636 # will do an "ln -sf a.1 b.1" and "ln -sf c.3 d.3" in
637 # appropriate directories. (Use this even if the port
638 # installs its own manpage links so they will show up
639 # correctly in ${PLIST}.)
640 # MANPREFIX - The directory prefix for ${MAN<sect>} and ${MLINKS}.
643 # - If manual pages of some sections install in different
644 # locations than others, use these.
645 # Default: ${MANPREFIX}
646 # MANCOMPRESSED - This variable can take values "yes", "no" or
647 # "maybe". "yes" means manpages are installed
648 # compressed; "no" means they are not; "maybe" means
649 # it changes depending on the value of NO_MANCOMPRESS.
650 # Default: "yes" if USES=imake is set and NO_INSTALL_MANPAGES
651 # is not set, and "no" otherwise.
653 # Set the following to specify all .info files your port installs.
655 # INFO - A list of .info files (omitting the trailing ".info");
656 # only one entry per document! These files are listed in
657 # the path relative to ${INFO_PATH}.
658 # INFO_PATH - Path, where all .info files will be installed by your
659 # port, relative to ${PREFIX}
660 # Default: "share/info" if ${PREFIX} is equal to /usr
661 # and "info" otherwise.
663 # Set the following to specify all documentation your port installs into
666 # PORTDOCS - A list of files and directories relative to DOCSDIR.
667 # Shell glob patterns can be used, directories include
668 # the entire subtree of contained files and directories.
669 # Should not be set when no documentation files are
671 # Useful for dynamically generated documentation.
673 # Set the following to specify all documentation your port installs into
676 # PORTEXAMPLES - A list of files and directories relative to EXAMPLESDIR.
677 # Shell glob patterns can be used, directories include
678 # the entire subtree of contained files and directories.
679 # Should not be set when no examples files are
681 # Useful for dynamically generated examples.
683 # Set the following to specify all files and directories your port installs into
686 # PORTDATA - A list of files and directories relative to DATADIR.
687 # Shell glob patterns can be used, directories include
688 # the entire subtree of contained files and directories.
689 # Should not be set when no data files are
691 # Useful for dynamically generated data files.
693 # Default targets and their behaviors:
695 # fetch - Retrieves missing ${DISTFILES} and ${PATCHFILES} for this
697 # fetch-list - Show list of commands to retrieve missing ${DISTFILES} and
698 # ${PATCHFILES} for this port.
700 # - Retrieves missing ${DISTFILES} and ${PATCHFILES} for this
701 # port and dependencies.
702 # fetch-recursive-list
703 # - Show list of commands to retrieve missing ${DISTFILES} and
704 # ${PATCHFILES} for this port and dependencies.
706 # - Retrieves missing ${DISTFILES} and ${PATCHFILES} for this
707 # port and dependencies.
708 # fetch-required-list
709 # - Show list of commands to retrieve missing ${DISTFILES} and
710 # ${PATCHFILES} for this port and dependencies.
712 # - Show list of URLS to retrieve missing ${DISTFILES} and
713 # ${PATCHFILES} for this port.
715 # - Show list of URLS to retrieve ${DISTFILES} and
716 # ${PATCHFILES} for this port.
719 # - Show all directories which are dependencies
722 # - Show all directories which are build-dependencies
724 # package-depends-list
725 # - Show all directories which are package-dependencies
726 # for this port. This is based upon the dependency
727 # tree as recorded in the Makefiles of the ports
728 # collection, not as recorded in the currently
730 # actual-package-depends
731 # - Like package-depends-list but with the difference
732 # that the dependencies of the currently installed
733 # ports are used instead of the dependencies as
734 # recorded in the ports collection.
736 # - Show all directories which are run-dependencies
739 # extract - Unpacks ${DISTFILES} into ${WRKDIR}.
740 # patch - Apply any provided patches to the source.
741 # configure - Runs either GNU configure, one or more local configure
742 # scripts or nothing, depending on what's available.
743 # build - Actually compile the sources.
744 # install - Install the results of a build.
745 # reinstall - Install the results of a build, ignoring "already installed"
747 # deinstall - Remove the installation.
748 # deinstall-all - Remove all installations with the same PKGORIGIN.
749 # package - Create a package from an _installed_ port.
751 # - Create a package for a port and _all_ of its dependencies.
752 # describe - Try to generate a one-line description for each port for
753 # use in INDEX files and the like.
754 # checkpatch - Do a "patch -C" instead of a "patch". Note that it may
755 # give incorrect results if multiple patches deal with
757 # checksum - Use distinfo to ensure that your distfiles are valid.
759 # - Run checksum in this port and all dependencies.
760 # makesum - Generate distinfo (only do this for your own ports!).
761 # clean - Remove ${WRKDIR} and other temporary files used for building.
762 # clean-depends - Do a "make clean" for all dependencies.
763 # config - Configure options for this port (using ${DIALOG}).
764 # Automatically run prior to extract, patch, configure, build,
765 # install, and package.
767 # - Configure options for this port for a port and all its
769 # showconfig - Display options config for this port.
770 # showconfig-recursive
771 # - Display options config for this port and all its
773 # rmconfig - Remove the options config for this port.
775 # - Remove the options config for this port and all its
778 # Default sequence for "all" is:
780 # check-sanity fetch checksum extract patch configure build
782 # Please read the comments in the targets section below; you
783 # should be able to use the pre-* or post-* targets/scripts
784 # (which are available for every stage except checksum) or
785 # override the do-* targets to do pretty much anything you want.
787 # NEVER override the "regular" targets unless you want to open
788 # a major can of worms.
790 # Set these variables if your port doesn't need some of the steps.
791 # Note that there are no NO_PATCH or NO_CONFIGURE variables because
792 # those steps are empty by default. NO_EXTRACT is not allowed anymore
793 # since we need to at least create ${WRKDIR}. Also, NO_CHECKSUM is a user
794 # variable and is not to be set in a port's Makefile. See above for NO_PACKAGE.
796 # NO_BUILD - Use a dummy (do-nothing) build target.
797 # NO_INSTALL - Use a dummy (do-nothing) install target.
799 # Here are some variables used in various stages.
801 # For options see bsd.options.mk
805 # FETCH_BINARY - Path to ftp/http fetch command if not in $PATH.
806 # Default: "/usr/bin/fetch"
807 # FETCH_ARGS - Arguments to ftp/http fetch command.
809 # FETCH_CMD - ftp/http fetch command.
810 # Default: ${FETCH_BINARY} ${FETCH_ARGS}
812 # - Arguments to ${FETCH_CMD} before filename.
815 # - Arguments to ${FETCH_CMD} following filename.
817 # FETCH_ENV - Environment to pass to ${FETCH_CMD}.
819 # FETCH_REGET - Times to retry fetching of files on checksum errors.
822 # - Disable package dependency in fetch target for mass
823 # fetching. User settable.
827 # EXTRACT_CMD - Command for extracting archive: "bzip2" if USE_BZIP2
828 # is set, "gzip" otherwise.
829 # EXTRACT_BEFORE_ARGS
830 # - Arguments to ${EXTRACT_CMD} before filename.
833 # - Arguments to ${EXTRACT_CMD} following filename.
834 # default: "| tar -xf -"
835 # EXTRACT_PRESERVE_OWNERSHIP
836 # - Normally, when run as "root", the extract stage will
837 # change the owner and group of all files under ${WRKDIR}
838 # to 0:0. Set this variable if you want to turn off this
842 # EXTRA_PATCHES - Define this variable if you have patches not in
843 # ${PATCHDIR}. This usually happens when you need to
844 # do some pre-processing before some distribution
845 # patches can be applied. In that case, fetch them as
846 # extra distfiles, put the processed results in
847 # ${WRKDIR}, then point EXTRA_PATCHES to them.
848 # The patches specified by this variable will be
849 # applied after the normal distribution patches but
850 # before those in ${PATCHDIR}.
851 # PATCH_WRKSRC - Directory to apply patches in.
856 # HAS_CONFIGURE - If set, this port has its own configure script. The
857 # configure stage will not do anything if this is not set.
858 # GNU_CONFIGURE - If set, you are using GNU configure (optional). Implies
861 # - Directory to run configure in.
864 # - Name of configure script, relative to ${CONFIGURE_WRKSRC}.
865 # Default: "Makefile.PL" if USES=perl5 and USE_PERL5=configure
866 # are set, "configure" otherwise.
868 # - The name of target to call when GNU_CONFIGURE is
870 # Default: ${ARCH}-dports-dragonfly${OSREL}
871 # GNU_CONFIGURE_PREFIX
872 # - The directory passed as prefix to the configure script if
873 # GNU_CONFIGURE is set.
876 # - Pass these args to configure if ${HAS_CONFIGURE} is set.
877 # Default: "--prefix=${GNU_CONFIGURE_PREFIX} --infodir=${PREFIX}/${INFO_PATH}
878 # --mandir=${MANPREFIX}/man --build=${CONFIGURE_TARGET}" if
879 # GNU_CONFIGURE is set, "CC=${CC} CFLAGS=${CFLAGS}
880 # PREFIX=${PREFIX} INSTALLPRIVLIB=${PREFIX}/lib
881 # INSTALLARCHLIB=${PREFIX}/lib" if USES=perl5 and
882 # USE_PERL5=configure are set, empty otherwise.
883 # CONFIGURE_ENV - Pass these env (shell-like) to configure if
884 # ${HAS_CONFIGURE} is set.
885 # CONFIGURE_LOG - The name of configure log file. It will be printed to
886 # the screen if configure fails.
887 # Default: config.log
888 # CONFIGURE_FAIL_MESSAGE
889 # - A message displayed to users when configure
890 # fails (note: this assumes the do-configure
891 # target has not been overwritten). This message
892 # will be passed through /usr/bin/fmt before
893 # being shown to the user.
895 # WITHOUT_FBSD10_FIX Disable FreeBSD 10.0 autotools workaround.
897 # For build and install:
899 # MAKEFILE - Name of the makefile.
901 # ALL_TARGET - Default target for sub-make in build stage.
903 # BUILD_WRKSRC - Directory to do build in (default: ${WRKSRC}).
904 # MAKE_ENV - Additional environment vars passed to sub-make in build
905 # and install stages.
907 # MAKE_ARGS - Any extra arguments to sub-make in build and install stages.
911 # - Disallow multiple jobs even when user set a global override.
912 # To be used with known bad ports.
914 # - Set to disable the multiple jobs feature. User settable.
916 # - Override the number of make jobs to be used. User settable.
917 # MAKE_JOBS_NUMBER_LIMIT
918 # - Set a limit for maximum number of make jobs allowed to be
923 # - Enable CCACHE support (devel/ccache). User settable.
925 # - Which directory to use for ccache (default: $HOME/.ccache)
927 # - Disable CCACHE support for example for certain ports if
928 # CCACHE is enabled. User settable.
933 # - Default target for sub-make in install stage.
936 # - Directory to install from
938 # NO_MTREE - If set, will not invoke mtree from bsd.port.mk from
939 # the "install" target.
940 # MTREE_FILE - The name of the mtree file.
941 # Default: ${PORTSDIR}/Templates/BSD.local.dist or
942 # /etc/mtree/BSD.usr.dist if ${PREFIX} == "/usr".
943 # PLIST_DIRS - Directories to be added to packing list
944 # PLIST_DIRSTRY - Directories to be added to packing list and try to remove them.
945 # PLIST_FILES - Files and symbolic links to be added to packing list
947 # PLIST - Name of the `packing list' file.
948 # Change this to ${WRKDIR}/PLIST or something if you
949 # need to write to it. (It is not a good idea for a port
950 # to write to any file outside ${WRKDIR} during a normal
952 # Default: ${PKGDIR}/pkg-plist
953 # TMPPLIST - Name of the `packing list' file after processing
954 # Default: ${WRKDIR}/.PLIST.mktmp
955 # PLIST_SUB - List of "variable=value" pair for substitution in ${PLIST}
958 # SUB_FILES - Files that should be passed through sed and redirected to
960 # - For each file specified in SUB_FILES, there must be a
961 # corresponding file in ${FILESDIR} whose suffix is ".in". For
962 # instance, if the Makefile specifies "SUB_FILES= pkg-message"
963 # then there must be a file called pkg-message.in in
965 # - The substitution process is the same as PLIST_FILES, as
966 # described below except that any line beginning with @comment
968 # SUB_LIST - List of "variable=value" pair for substitution in ${SUB_FILES}
969 # Some pairs are added by default: eg. PREFIX=${PREFIX}
971 # USE_LDCONFIG - If set to "yes", this adds ${PREFIX}/lib to the list of
972 # directories to be searched for shared libraries.
973 # Otherwise, this is a list of directories to be added to that
974 # list. The directory names are written to
975 # ${PREFIX}/libdata/ldconfig/${UNIQUENAME} which is then
976 # used by the ldconfig startup script.
977 # This mechanism replaces ldconfig scripts installed by some
978 # ports, often under such names as 000.${UNQUENAME}.sh.
979 # If USE_LINUX_PREFIX is defined, the Linux version of
980 # ldconfig will be used instead of the native FreeBSD
981 # version, and the directory list given will be ignored.
983 # - Same as USE_LDCONFIG but the target file is
984 # ${PREFIX}/libdata/ldconfig32/${UNIQUENAME} instead.
985 # Note: that should only be used on 64-bit architectures.
987 # - Denotes whether the libdata/ldconfig directory is part of
988 # the mtree on a given OSVERSION system. If it is not, we
989 # create the directory, pull in the ldconfig_compat port,
990 # and clean up on de-installation. NOTE: this variable is
991 # internal to bsd.port.mk and must not be set in your Makefile.
993 # DOCSDIR - Name of the directory to install the packages docs in.
994 # Default: ${PREFIX}/share/doc/${PORTNAME}
995 # DOCSDIR_REL - The DOCSDIR relative to ${PREFIX}
996 # EXAMPLESDIR - Name of the directory to install the packages examples in.
997 # Default: ${PREFIX}/share/examples/${PORTNAME}
999 # - The EXAMPLESDIR relative to ${PREFIX}
1000 # DATADIR - Name of the directory to install the packages shared data in.
1001 # Default: ${PREFIX}/share/${PORTNAME}
1002 # DATADIR_REL - The DATADIR relative to ${PREFIX}
1004 # WWWDIR - Name of the directory to install the packages www data in.
1005 # Default: ${PREFIX}/www/${PORTNAME}
1006 # WWWDIR_REL - The WWWDIR relative to ${PREFIX}
1008 # USERS - List of users to create at install time. Each login must
1009 # have a corresponding entry in ${UID_FILES}.
1010 # GROUPS - List of groups to create at install time. Each group must
1011 # have a corresponding entry in ${GID_FILES}.
1013 # DESKTOPDIR - Name of the directory to install ${DESKTOP_ENTRIES} in.
1014 # Default: ${PREFIX}/share/applications
1016 # - List of desktop entry files to generate and install in
1017 # ${DESKTOPDIR}. The format is
1018 # "Name" "Comment" "Icon" "Exec" "Categories" StartupNotify
1020 # * Only add desktop entries for applications which do not
1021 # require a terminal (ie. X applications).
1022 # * If the upstream distribution already installs .desktop
1023 # files, you do not need to use this.
1024 # * If you require a more elaborate .desktop file than this
1025 # variable permits, write it yourself and install it
1028 # * Comment, Icon and StartupNotify may be empty
1029 # strings (""). Categories may be an empty string in some
1030 # cases (see below). The other fields are mandatory.
1031 # * If Comment is an empty string, port ${COMMENT} will be
1033 # * If set, Icon must be either absolute path (usually
1034 # ${PREFIX}/share/pixmaps/${PORTNAME}.png) or icon name
1035 # without extension if installed icons follow Icon Theme
1037 # * If Categories is an empty string, bsd.port.mk will try
1038 # to deduce a default value using the CATEGORIES variable.
1039 # If the deduction fails, you will have to set Categories
1040 # manually. You should check the generated value using
1041 # "make desktop-categories", and override it if necessary.
1042 # * Exec will also be used to name the .desktop file.
1043 # * StartupNotify may be true, false or empty (see Desktop
1044 # Entry Specification for details).
1045 # * The files will be automatically added to ${PLIST}.
1047 # "X Window Information" \
1048 # "Get information about X windows" \
1049 # "${PREFIX}/share/pixmaps/wininfo.png" \
1050 # "${PREFIX}/bin/wininfo" \
1053 # See http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html
1054 # for an explanation of the fields. If you need to create more
1055 # than one file, just chain them into a single variable.
1057 # Note that the install target will automatically add manpages (see
1058 # above) and also substitute special sequences of characters (delimited
1059 # by "%%") as defined in PLIST_SUB to generate ${TMPPLIST}. For
1060 # instance, "OSREL=${OSREL}" in PLIST_SUB causes all occurrences of
1061 # "%%OSREL%%" in ${PLIST} to be substituted by the value of OSREL.
1062 # ${TMPPLIST} is generated before the do-install stage. If you are
1063 # generating the packing list on-the-fly, make sure it's generated before
1064 # do-install is called!
1069 # - Do not install the "Latest" link for package. Define this
1070 # if this port is a beta version of another stable port
1071 # which is also in the tree.
1072 # LATEST_LINK - Install the "Latest" link for the package as ___. Define
1073 # this if the "Latest" link name will be incorrectly determined.
1075 # This is used in all stages:
1077 # SCRIPTS_ENV - Additional environment vars passed to scripts in
1078 # ${SCRIPTDIR} executed by bsd.port.mk.
1079 # Default: see below
1081 # Finally, variables to change if you want a special behavior. These
1082 # are for debugging purposes. Don't set them in your Makefile.
1084 # ECHO_MSG - Used to print all the '===>' style prompts - override this
1086 # Default: ${ECHO_CMD}
1087 # PATCH_DEBUG - If set, print out more information about the patches as
1088 # it attempts to apply them.
1089 # PKG_DBDIR - Where package installation is recorded; this directory
1090 # must not contain anything else.
1091 # Default: /var/db/pkg
1092 # PORT_DBDIR - Where port configuration options are recorded.
1093 # Default: /var/db/ports
1095 # - Don't register a port installation as a package.
1096 # FORCE_PKG_REGISTER
1097 # - If set, it will overwrite any existing package
1098 # registration information in ${PKG_DBDIR}/${PKGNAME}.
1099 # NO_DEPENDS - Don't verify build of dependencies.
1100 # CHECKSUM_ALGORITHMS
1101 # - Different checksum algorithms to check for verifying the
1102 # integrity of the distfiles. The absence of the algorithm
1103 # in distinfo doesn't make it fail.
1105 # NO_CHECKSUM - Don't verify the checksum. Typically used when
1106 # when you noticed the distfile you just fetched has
1107 # a different checksum and you intend to verify if
1108 # the port still works with it.
1109 # USE_PACKAGE_DEPENDS
1110 # - Try to install dependencies from existing packages instead
1111 # of building the port from scratch. Fallback on source
1112 # if an existing package is not present.
1113 # USE_PACKAGE_DEPENDS_ONLY
1114 # - Like USE_PACKAGE_DEPENDS, but do not fallback on source.
1116 # - Define this to install as the current user, intended
1117 # for systems where you have no root access.
1118 # DISABLE_SIZE - Do not check the size of a distfile even if the SIZE field
1119 # has been specified in distinfo. This is useful
1120 # when using an alternate FETCH_CMD.
1122 # End of the list of all variables that need to be defined in a port.
1123 # Most port authors should not need to understand anything after this point.
1126 # These need to be absolute since we don't know how deep in the ports
1127 # tree we are and thus can't go relative. They can, of course, be overridden
1128 # by individual Makefiles or local system make configuration.
1130 WITHOUT_FBSD10_FIX?= yes
1131 DFLY_PATCHDIR?= ${MASTERDIR}/dragonfly
1132 DFLY_FILESDIR?= ${MASTERDIR}/dragonfly
1133 PORTSDIR?= /usr/dports
1134 LOCALBASE?= /usr/local
1135 LINUXBASE?= /compat/linux
1136 DISTDIR?= /usr/distfiles
1137 WRKDIRPREFIX?= /usr/obj/dports
1138 _DISTDIR?= ${DISTDIR}/${DIST_SUBDIR}
1139 INDEXDIR?= ${PORTSDIR}
1141 USESDIR?= ${PORTSDIR}/Mk/Uses
1142 SCRIPTSDIR?= ${PORTSDIR}/Mk/Scripts
1143 LIB_DIRS?= /lib /usr/lib ${LOCALBASE}/lib
1145 PKG_ENV+= PORTSDIR=${PORTSDIR}
1147 .if defined(FORCE_STAGE)
1151 # Prevent dport from building profile libraries
1155 .include "${PORTSDIR}/Mk/bsd.commands.mk"
1157 .if defined(X_BUILD_FOR)
1158 .if defined(NO_STAGE)
1159 IGNORE= Cross building is only compatible with stagified ports
1161 .if !defined(.PARSEDIR)
1162 IGNORE= Cross building can only be done when using bmake(1) as make(1)
1164 BUILD_DEPENDS= ${X_BUILD_FOR}-cc:${PORTSDIR}/devel/${X_BUILD_FOR}-xdev
1165 # Do not define CPP on purpose
1170 .if !exists(/usr/${X_BUILD_FOR}/usr/bin/cc)
1171 CC= ${LOCALBASE}/${X_BUILD_FOR}/usr/bin/cc
1172 CXX= ${LOCALBASE}/${X_BUILD_FOR}/usr/bin/c++
1173 PKG_ENV+= ABI_FILE=${LOCALBASE}/${X_BUILD_FOR}/usr/lib/crt1.o
1175 CC= /usr/${X_BUILD_FOR}/usr/bin/cc
1176 CXX= /usr/${X_BUILD_FOR}/usr/bin/c++
1177 PKG_ENV+= ABI_FILE=/usr/${X_BUILD_FOR}/usr/lib/crt1.o
1179 NM= ${X_BUILD_FOR}-nm
1180 STRIP_CMD= ${X_BUILD_FOR}-strip
1181 MAKE_ENV+= NM=${NM} STRIPBIN=${X_BUILD_FOR}-strip
1182 # only bmake support the below
1183 STRIPBIN= ${STRIP_CMD}
1184 .export.env STRIPBIN
1188 # DESTDIR section to start a chrooted process if invoked with DESTDIR set
1191 .if defined(DESTDIR) && !empty(DESTDIR) && !defined(CHROOTED) && \
1192 !defined(BEFOREPORTMK) && !defined(INOPTIONSMK)
1194 .include "${PORTSDIR}/Mk/bsd.destdir.mk"
1198 # Look for ${PATCH_WRKSRC}/.../*.orig files, and (re-)create
1199 # ${FILEDIR}/patch-* files from them.
1201 .if !target(makepatch)
1203 @${MKDIR} ${FILESDIR}
1204 @(cd ${PATCH_WRKSRC}; \
1205 for i in `find . -type f -name '*.orig'`; do \
1208 OUT=${FILESDIR}`${ECHO} $${NEW} | \
1209 ${SED} -e 's|/|__|g' \
1210 -e 's|^\.__|/patch-|'`; \
1211 ${ECHO} ${DIFF} -ud $${ORG} $${NEW} '>' $${OUT}; \
1212 ${DIFF} -ud $${ORG} $${NEW} > $${OUT} || ${TRUE}; \
1218 # Start of options section
1219 .if defined(INOPTIONSMK) || ( !defined(USEOPTIONSMK) && !defined(AFTERPORTMK) )
1222 # Get the default maintainer
1223 MAINTAINER?= ports@FreeBSD.org
1225 # Get the architecture
1230 # Get the operating system type
1235 # Get __FreeBSD_version
1236 .if !defined(OSVERSION)
1240 .if !defined(DFLYVERSION)
1241 .if exists(/usr/include/sys/param.h)
1242 DFLYVERSION!= ${AWK} '/^\#define[[:blank:]]__DragonFly_version/ {print $$3}' < /usr/include/sys/param.h
1243 OSREL!= ${ECHO} ${DFLYVERSION} | ${AWK} '{a=int($$1/100000); b=int(($$1-(a*100000))/100); print a "." b}'
1245 DFLYVERSION!= ${SYSCTL} -n kern.osreldate
1246 OSREL!= ${UNAME} -r | ${SED} -e 's/[-(].*//'
1250 .if !defined(WITH_PKGNG) && !defined(NO_WARNING_PKG_INSTALL_EOL)
1251 WARNING+= "pkg_install EOL is scheduled for 2014-09-01. Please consider migrating to pkgng"
1252 WARNING+= "http://blogs.freebsdish.org/portmgr/2014/02/03/time-to-bid-farewell-to-the-old-pkg_-tools/"
1253 WARNING+= "If you do not want to see this message again set NO_WARNING_PKG_INSTALL_EOL=yes in your make.conf"
1256 # Enable new xorg for FreeBSD versions after Radeon KMS was imported unless
1257 # WITHOUT_NEW_XORG is set.
1258 .if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1100000
1259 . if !defined(WITHOUT_NEW_XORG)
1262 .undef WITH_NEW_XORG
1266 # Only define tools here (for transition period with between pkg tools)
1267 .include "${PORTSDIR}/Mk/bsd.commands.mk"
1269 MASTERDIR?= ${.CURDIR}
1271 .if ${MASTERDIR} != ${.CURDIR}
1273 MASTER_PORT?=${MASTERDIR:C/[^\/]+\/\.\.\///:C/[^\/]+\/\.\.\///:C/^.*\/([^\/]+\/[^\/]+)$/\\1/}
1279 # If they exist, include Makefile.inc, then architecture/operating
1280 # system specific Makefiles, then local Makefile.local.
1282 .if ${MASTERDIR} != ${.CURDIR} && exists(${.CURDIR}/../Makefile.inc)
1283 .include "${.CURDIR}/../Makefile.inc"
1287 .if exists(${MASTERDIR}/../Makefile.inc)
1288 .include "${MASTERDIR}/../Makefile.inc"
1292 .if exists(${MASTERDIR}/Makefile.${ARCH}-${OPSYS})
1293 .include "${MASTERDIR}/Makefile.${ARCH}-${OPSYS}"
1295 .elif exists(${MASTERDIR}/Makefile.${OPSYS})
1296 .include "${MASTERDIR}/Makefile.${OPSYS}"
1298 .elif exists(${MASTERDIR}/Makefile.${ARCH})
1299 .include "${MASTERDIR}/Makefile.${ARCH}"
1303 .if exists(${MASTERDIR}/Makefile.local)
1304 .include "${MASTERDIR}/Makefile.local"
1308 .for _CATEGORY in ${CATEGORIES}
1309 PKGCATEGORY?= ${_CATEGORY}
1311 _PORTDIRNAME= ${.CURDIR:T}
1312 PORTDIRNAME?= ${_PORTDIRNAME}
1313 PKGORIGIN?= ${PKGCATEGORY}/${PORTDIRNAME}
1315 # where 'make config' records user configuration options
1316 PORT_DBDIR?= /var/db/ports
1318 UID_FILES?= ${PORTSDIR}/UIDs
1319 GID_FILES?= ${PORTSDIR}/GIDs
1323 # predefined accounts from src/etc/master.passwd
1324 # alpha numeric sort order
1325 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
1327 LDCONFIG_DIR= libdata/ldconfig
1328 LDCONFIG32_DIR= libdata/ldconfig32
1330 .if defined(LATEST_LINK)
1331 UNIQUENAME?= ${LATEST_LINK}
1333 UNIQUENAME?= ${PKGNAMEPREFIX}${PORTNAME}
1338 # At least KDE needs TMPDIR for the package building,
1339 # so we're setting it to the known default value.
1340 .if defined(PACKAGE_BUILDING)
1342 .endif # defined(PACKAGE_BUILDING)
1344 # Respect TMPDIR passed via make.conf or similar and pass it down
1345 # to configure and make.
1347 MAKE_ENV+= TMPDIR="${TMPDIR}"
1348 CONFIGURE_ENV+= TMPDIR="${TMPDIR}"
1349 .endif # defined(TMPDIR)
1351 .if defined(WITH_DEBUG_PORTS)
1352 .if ${WITH_DEBUG_PORTS:M${PKGORIGIN}}
1357 .include "${PORTSDIR}/Mk/bsd.options.mk"
1359 # Multiple make jobs support
1360 .if defined(DISABLE_MAKE_JOBS) || defined(MAKE_JOBS_UNSAFE)
1364 .if defined(MAKE_JOBS_NUMBER)
1365 _MAKE_JOBS_NUMBER:= ${MAKE_JOBS_NUMBER}
1367 _MAKE_JOBS_NUMBER!= ${SYSCTL} -n hw.ncpu
1369 .if defined(MAKE_JOBS_NUMBER_LIMIT) && ( ${MAKE_JOBS_NUMBER_LIMIT} < ${_MAKE_JOBS_NUMBER} )
1370 MAKE_JOBS_NUMBER= ${MAKE_JOBS_NUMBER_LIMIT}
1372 MAKE_JOBS_NUMBER= ${_MAKE_JOBS_NUMBER}
1374 _MAKE_JOBS?= -j${MAKE_JOBS_NUMBER}
1375 BUILD_FAIL_MESSAGE+= Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to the maintainer.
1378 # Start of pre-makefile section.
1379 .if !defined(AFTERPORTMK) && !defined(INOPTIONSMK)
1381 .include "${PORTSDIR}/Mk/bsd.sanity.mk"
1385 .if defined(PORTVERSION)
1386 .if ${PORTVERSION:M*[-_,]*}x != x
1387 IGNORE= PORTVERSION ${PORTVERSION} may not contain '-' '_' or ','
1389 DISTVERSION?= ${PORTVERSION:S/:/::/g}
1390 .elif defined(DISTVERSION)
1391 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}
1395 .if ${PORTREVISION} != 0
1396 _SUF1= _${PORTREVISION}
1400 .if ${PORTEPOCH} != 0
1401 _SUF2= ,${PORTEPOCH}
1404 PKGVERSION= ${PORTVERSION:C/[-_,]/./g}${_SUF1}${_SUF2}
1405 PKGNAME= ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}-${PKGVERSION}
1406 DISTNAME?= ${PORTNAME}-${DISTVERSIONPREFIX}${DISTVERSION:C/:(.)/\1/g}${DISTVERSIONSUFFIX}
1408 INDEXFILE?= INDEX-${DFLYVERSION:C/([0-9]*)[0-9]{5}/\1/}
1410 DOCSDIR?= ${PREFIX}/share/doc/${PORTNAME}
1411 EXAMPLESDIR?= ${PREFIX}/share/examples/${PORTNAME}
1412 DATADIR?= ${PREFIX}/share/${PORTNAME}
1413 WWWDIR?= ${PREFIX}/www/${PORTNAME}
1414 ETCDIR?= ${PREFIX}/etc/${PORTNAME}
1416 .if defined(USE_LINUX_RPM)
1417 .include "${PORTSDIR}/Mk/bsd.linux-rpm.mk"
1420 .if defined(USE_LINUX_APPS)
1421 .include "${PORTSDIR}/Mk/bsd.linux-apps.mk"
1424 .if defined(USE_XORG) || defined(XORG_CAT)
1425 .include "${PORTSDIR}/Mk/bsd.xorg.mk"
1428 PACKAGES?= /usr/packages
1429 TEMPLATES?= ${PORTSDIR}/Templates
1430 KEYWORDS?= ${PORTSDIR}/Keywords
1432 PATCHDIR?= ${MASTERDIR}/files
1433 FILESDIR?= ${MASTERDIR}/files
1434 SCRIPTDIR?= ${MASTERDIR}/scripts
1435 PKGDIR?= ${MASTERDIR}
1437 .if defined(USE_LINUX_PREFIX)
1438 PREFIX?= ${LINUXBASE}
1441 PREFIX?= ${LOCALBASE}
1444 .if defined(USE_LINUX_PREFIX)
1445 LDCONFIG_CMD?= ${LINUXBASE}/sbin/ldconfig -r ${LINUXBASE}
1448 PKGCOMPATDIR?= ${LOCALBASE}/lib/compat/pkg
1450 .if defined(USE_LOCAL_MK)
1451 .include "${PORTSDIR}/Mk/bsd.local.mk"
1454 .if defined(USE_OPENSSL)
1455 .include "${PORTSDIR}/Mk/bsd.openssl.mk"
1458 .if defined(USE_EMACS)
1459 .include "${PORTSDIR}/Mk/bsd.emacs.mk"
1462 .if defined(USE_GNUSTEP)
1463 .include "${PORTSDIR}/Mk/bsd.gnustep.mk"
1466 .if defined(USE_PHP)
1467 .include "${PORTSDIR}/Mk/bsd.php.mk"
1470 .if defined(USE_PYTHON) || defined(USE_PYTHON_BUILD) || defined(USE_PYTHON_RUN)
1471 .include "${PORTSDIR}/Mk/bsd.python.mk"
1474 .if defined(USE_EFL) || defined(WANT_EFL) || defined(USE_EFL_ESMART)
1475 .include "${PORTSDIR}/Mk/bsd.efl.mk"
1478 .if defined(USE_FPC) || defined(WANT_FPC_BASE) || defined(WANT_FPC_ALL)
1479 .include "${PORTSDIR}/Mk/bsd.fpc.mk"
1482 .if defined(USE_JAVA)
1483 .include "${PORTSDIR}/Mk/bsd.java.mk"
1486 .if defined(USE_RUBY) || defined(USE_LIBRUBY)
1487 .include "${PORTSDIR}/Mk/bsd.ruby.mk"
1490 .if defined(USE_OCAML)
1491 .include "${PORTSDIR}/Mk/bsd.ocaml.mk"
1494 .if defined(USE_APACHE) || defined(USE_APACHE_BUILD) || defined(USE_APACHE_RUN)
1495 .include "${PORTSDIR}/Mk/bsd.apache.mk"
1498 .if defined(USE_QT4) || defined(USE_QT5)
1499 .include "${PORTSDIR}/Mk/bsd.qt.mk"
1502 .if defined(USE_TEX)
1503 .include "${PORTSDIR}/Mk/bsd.tex.mk"
1506 .if defined(USE_DRUPAL)
1507 .include "${PORTSDIR}/Mk/bsd.drupal.mk"
1510 .if defined(WANT_GECKO) || defined(USE_GECKO)
1511 .include "${PORTSDIR}/Mk/bsd.gecko.mk"
1514 .if defined(WANT_GNOME) || defined(USE_GNOME) || defined(INSTALLS_ICONS)
1515 .include "${PORTSDIR}/Mk/bsd.gnome.mk"
1518 .if defined(USE_MATE)
1519 .include "${PORTSDIR}/Mk/bsd.mate.mk"
1522 .if defined(WANT_LUA) || defined(USE_LUA) || defined(USE_LUA_NOT)
1523 .include "${PORTSDIR}/Mk/bsd.lua.mk"
1526 .if defined(WANT_WX) || defined(USE_WX) || defined(USE_WX_NOT)
1527 .include "${PORTSDIR}/Mk/bsd.wx.mk"
1530 .if defined(WANT_GSTREAMER) || defined(USE_GSTREAMER) || defined(USE_GSTREAMER1)
1531 .include "${PORTSDIR}/Mk/bsd.gstreamer.mk"
1534 .if defined(USE_SDL) || defined(WANT_SDL)
1535 .include "${PORTSDIR}/Mk/bsd.sdl.mk"
1538 .if defined(USE_XFCE)
1539 .include "${PORTSDIR}/Mk/bsd.xfce.mk"
1542 .if defined(USE_KDE4) || defined(KDE4_BUILDENV)
1543 .include "${PORTSDIR}/Mk/bsd.kde4.mk"
1546 .include "${PORTSDIR}/Mk/bsd.pbi.mk"
1548 .if defined(USE_GMAKE)
1552 .if defined(USE_DOS2UNIX)
1553 .if ${USE_DOS2UNIX:tu}=="YES"
1556 .if ${USE_DOS2UNIX:M*/*}
1557 DOS2UNIX_FILES+= ${USE_DOS2UNIX}
1559 DOS2UNIX_GLOB+= ${USE_DOS2UNIX}
1573 ${_f}_ARGS:= ${f:C/^[^\:]*\://g}
1575 .include "${USESDIR}/${_f}.mk"
1578 .if defined(USE_BZIP2)
1579 EXTRACT_SUFX?= .tar.bz2
1580 .elif defined(USE_XZ)
1581 EXTRACT_SUFX?= .tar.xz
1583 EXTRACT_SUFX?= .tar.gz
1586 # You can force skipping these test by defining IGNORE_PATH_CHECKS
1587 .if !defined(IGNORE_PATH_CHECKS)
1590 @${ECHO_MSG} "PREFIX must be defined as an absolute path so that when 'make'"
1591 @${ECHO_MSG} "is invoked in the work area PREFIX points to the right place."
1596 # Location of mounted CDROM(s) to search for files
1597 CD_MOUNTPTS?= /cdrom ${CD_MOUNTPT}
1599 # Owner and group of the WWW user
1604 # End of pre-makefile section.
1606 # Start of post-makefile section.
1607 .if !defined(BEFOREPORTMK) && !defined(INOPTIONSMK)
1609 .if defined(_POSTMKINCLUDED)
1610 DEV_ERROR+= "${PKGNAME}: Makefile error: you cannot include bsd.port[.post].mk twice"
1614 _POSTMKINCLUDED= yes
1616 WRKDIR?= ${WRKDIRPREFIX}/${.CURDIR:H:T}/${.CURDIR:T}/work
1617 .if !defined(IGNORE_MASTER_SITE_GITHUB) && defined(USE_GITHUB)
1618 WRKSRC?= ${WRKDIR}/${GH_ACCOUNT}-${GH_PROJECT}-${GH_COMMIT}
1620 .if defined(NO_WRKSUBDIR)
1623 WRKSRC?= ${WRKDIR}/${DISTNAME}
1625 .if defined(WRKSRC_SUBDIR)
1626 WRKSRC:= ${WRKSRC}/${WRKSRC_SUBDIR}
1629 PATCH_WRKSRC?= ${WRKSRC}
1630 CONFIGURE_WRKSRC?= ${WRKSRC}
1631 BUILD_WRKSRC?= ${WRKSRC}
1632 INSTALL_WRKSRC?=${WRKSRC}
1634 PLIST_SUB+= OSREL=${OSREL} PREFIX=%D LOCALBASE=${LOCALBASE}
1635 SUB_LIST+= PREFIX=${PREFIX} LOCALBASE=${LOCALBASE} \
1636 DATADIR=${DATADIR} DOCSDIR=${DOCSDIR} EXAMPLESDIR=${EXAMPLESDIR} \
1637 WWWDIR=${WWWDIR} ETCDIR=${ETCDIR}
1639 PLIST_REINPLACE+= dirrmtry stopdaemon rmtry
1640 PLIST_REINPLACE_DIRRMTRY=s!^@dirrmtry \(.*\)!@unexec rmdir "%D/\1" 2>/dev/null || true!
1641 PLIST_REINPLACE_RMTRY=s!^@rmtry \(.*\)!@unexec rm -f %D/\1 2>/dev/null || true!
1642 PLIST_REINPLACE_STOPDAEMON=s!^@stopdaemon \(.*\)!@unexec %D/etc/rc.d/\1 forcestop 2>/dev/null || true!
1644 # kludge to strip trailing whitespace from CFLAGS;
1645 # sub-configure will not # survive double space
1646 # remove -O from /usr/share/mk/sys.mk and replace with -O2
1647 CFLAGS:= ${CFLAGS:C/ $//:N-O}
1650 .if defined(WITHOUT_CPU_CFLAGS)
1651 .if defined(_CPUCFLAGS)
1652 .if !empty(_CPUCFLAGS)
1653 CFLAGS:= ${CFLAGS:C/${_CPUCFLAGS}//}
1658 # Reset value from bsd.own.mk.
1659 .if defined(WITH_DEBUG) && !defined(WITHOUT_DEBUG)
1661 MAKE_ENV+= DONTSTRIP=yes
1664 CFLAGS:= ${CFLAGS:N-O*:N-fno-strict*} ${DEBUG_FLAGS}
1665 .if defined(INSTALL_TARGET)
1666 INSTALL_TARGET:= ${INSTALL_TARGET:S/^install-strip$/install/g}
1670 .if defined(WITH_SSP) || defined(WITH_SSP_PORTS)
1671 .include "${PORTSDIR}/Mk/bsd.ssp.mk"
1674 .if defined(NOPORTDOCS)
1675 PLIST_SUB+= PORTDOCS="@comment "
1677 PLIST_SUB+= PORTDOCS=""
1680 .if defined(NOPORTEXAMPLES)
1681 PLIST_SUB+= PORTEXAMPLES="@comment "
1683 PLIST_SUB+= PORTEXAMPLES=""
1686 .if defined(NOPORTDATA)
1687 PLIST_SUB+= PORTDATA="@comment "
1689 PLIST_SUB+= PORTDATA=""
1692 CONFIGURE_SHELL?= ${SH}
1695 CONFIGURE_ENV+= SHELL=${SH} CONFIG_SHELL=${SH}
1696 MAKE_ENV+= SHELL=${SH} NO_LINT=YES
1698 .if defined(MANCOMPRESSED)
1699 .if ${MANCOMPRESSED} != yes && ${MANCOMPRESSED} != no && \
1700 ${MANCOMPRESSED} != maybe
1702 @${ECHO_MSG} "${PKGNAME}: Makefile error: value of MANCOMPRESSED (is \"${MANCOMPRESSED}\") can only be \"yes\", \"no\" or \"maybe\"".
1709 .if defined(PATCHFILES)
1710 .if ${PATCHFILES:M*.zip}x != x
1711 PATCH_DEPENDS+= ${LOCALBASE}/bin/unzip:${PORTSDIR}/archivers/unzip
1715 # Check the compatibility layer for amd64/ia64
1717 .if ${ARCH} == "amd64" || ${ARCH} =="ia64"
1718 .if exists(/usr/lib32)
1719 HAVE_COMPAT_IA32_LIBS?= YES
1721 .if !defined(HAVE_COMPAT_IA32_KERN)
1722 HAVE_COMPAT_IA32_KERN!= if ${SYSCTL} -n compat.ia32.maxvmem >/dev/null 2>&1; then echo YES; fi; echo
1723 .if empty(HAVE_COMPAT_IA32_KERN)
1724 .undef HAVE_COMPAT_IA32_KERN
1729 .if defined(IA32_BINARY_PORT) && ${ARCH} != "i386"
1730 .if ${ARCH} == "amd64" || ${ARCH} == "ia64"
1731 .if !defined(HAVE_COMPAT_IA32_KERN)
1732 IGNORE= requires a kernel with compiled-in IA32 compatibility
1733 .elif !defined(HAVE_COMPAT_IA32_LIBS)
1734 IGNORE= requires 32-bit libraries installed under /usr/lib32
1739 IGNORE= requires i386 (or compatible) platform to run
1744 PLIST_SUB+= LIB32DIR=${LIB32DIR}
1746 PKGNG_ORIGIN?= ports-mgmt/pkg
1747 .if defined(WITH_PKGNG)
1748 .if ${WITH_PKGNG} == devel
1749 PKGNG_ORIGIN= ports-mgmt/pkg-devel
1751 .if !defined(PKG_DEPENDS)
1752 .if !defined(CLEAN_FETCH_ENV)
1753 PKG_DEPENDS+= ${LOCALBASE}/sbin/pkg:${PORTSDIR}/${PKGNG_ORIGIN}
1758 .if defined(USE_GCC)
1759 .include "${PORTSDIR}/Mk/bsd.gcc.mk"
1761 . if !defined(USE_GNUSTEP)
1762 CONFIGURE_ENV+= CCVER=gcc47
1763 MAKE_ENV+= CCVER=gcc47
1767 .if defined(USE_BINUTILS) && !defined(DISABLE_BINUTILS)
1768 BUILD_DEPENDS+= ${LOCALBASE}/bin/as:${PORTSDIR}/devel/binutils
1769 BINUTILS?= ADDR2LINE AR AS CPPFILT GPROF LD NM OBJCOPY OBJDUMP RANLIB \
1770 READELF SIZE STRINGS
1771 BINUTILS_NO_MAKE_ENV?=
1772 . for b in ${BINUTILS}
1773 ${b}= ${LOCALBASE}/bin/${b:C/PP/++/:tl}
1774 . if defined(GNU_CONFIGURE) || defined(BINUTILS_CONFIGURE)
1775 CONFIGURE_ENV+= ${b}="${${b}}"
1777 . if ${BINUTILS_NO_MAKE_ENV:M${b}} == ""
1778 MAKE_ENV+= ${b}="${${b}}"
1783 .if defined(USE_OPENLDAP) || defined(WANT_OPENLDAP_VER)
1784 .include "${PORTSDIR}/Mk/bsd.ldap.mk"
1787 .if defined(USE_RC_SUBR) && ${USE_RC_SUBR:tu} != "YES"
1788 SUB_FILES+= ${USE_RC_SUBR}
1791 .if defined(USE_RCORDER)
1792 SUB_FILES+= ${USE_RCORDER}
1795 .if defined(USE_LDCONFIG) && ${USE_LDCONFIG:tl} == "yes"
1796 USE_LDCONFIG= ${PREFIX}/lib
1798 .if defined(USE_LDCONFIG32) && ${USE_LDCONFIG32:tl} == "yes"
1799 IGNORE= has USE_LDCONFIG32 set to yes, which is not correct
1802 .if defined(USE_LINUX_PREFIX) && defined(USE_LDCONFIG)
1803 # we need ${LINUXBASE}/sbin/ldconfig
1807 .if defined(USE_LINUX)
1809 . if !defined(LINUX_OSRELEASE)
1810 LINUX_OSRELEASE!= ${ECHO_CMD} `${SYSCTL} -n compat.linux.osrelease 2>/dev/null`
1813 # install(1) also does a brandelf on strip, so don't strip with FreeBSD tools.
1815 . if exists(${LINUXBASE}/usr/bin/strip)
1816 STRIP_CMD= ${LINUXBASE}/usr/bin/strip
1821 # Allow the user to specify another linux_base version.
1822 . if defined(OVERRIDE_LINUX_BASE_PORT)
1823 . if ${USE_LINUX:tl} == yes
1824 USE_LINUX= ${OVERRIDE_LINUX_BASE_PORT}
1828 # NOTE: when you update the default linux_base version (case "yes"),
1829 # don't forget to update the Handbook!
1831 . if exists(${PORTSDIR}/emulators/linux_base-${USE_LINUX})
1832 LINUX_BASE_PORT= ${LINUXBASE}/bin/sh:${PORTSDIR}/emulators/linux_base-${USE_LINUX}
1834 . if ${USE_LINUX:tl} == "yes"
1835 LINUX_BASE_PORT= ${LINUXBASE}/etc/fedora-release:${PORTSDIR}/emulators/linux_base-f10
1837 IGNORE= cannot be built: there is no emulators/linux_base-${USE_LINUX}, perhaps wrong use of USE_LINUX or OVERRIDE_LINUX_BASE_PORT
1841 RUN_DEPENDS+= ${LINUX_BASE_PORT}
1844 .if defined(USE_DISPLAY)
1848 PKG_IGNORE_DEPENDS?= 'this_port_does_not_exist'
1850 _GL_glesv2_LIB_DEPENDS= libGLESv2.so:${PORTSDIR}/graphics/libglesv2
1851 _GL_egl_LIB_DEPENDS= libEGL.so:${PORTSDIR}/graphics/libEGL
1852 _GL_gl_LIB_DEPENDS= libGL.so:${PORTSDIR}/graphics/libGL
1853 _GL_gl_USE_XORG= glproto dri2proto
1854 _GL_glew_LIB_DEPENDS= libGLEW.so:${PORTSDIR}/graphics/glew
1855 _GL_glu_LIB_DEPENDS= libGLU.so:${PORTSDIR}/graphics/libGLU
1856 _GL_glu_USE_XORG= glproto dri2proto
1857 _GL_glw_LIB_DEPENDS= libGLw.so:${PORTSDIR}/graphics/libGLw
1858 _GL_glut_LIB_DEPENDS= libglut.so:${PORTSDIR}/graphics/freeglut
1861 . if ${USE_GL:tl} == "yes"
1864 . for _component in ${USE_GL}
1865 . if !defined(_GL_${_component}_LIB_DEPENDS) && \
1866 !defined(_GL_${_component}_RUN_DEPENDS)
1867 IGNORE= uses unknown GL component
1869 USE_XORG+= ${_GL_${_component}_USE_XORG}
1870 BUILD_DEPENDS+= ${_GL_${_component}_BUILD_DEPENDS}
1871 LIB_DEPENDS+= ${_GL_${_component}_LIB_DEPENDS}
1872 RUN_DEPENDS+= ${_GL_${_component}_RUN_DEPENDS}
1877 .if !defined(NO_STAGE)
1878 .include "${PORTSDIR}/Mk/bsd.stage.mk"
1880 # Ignore STAGEDIR if set from make.conf
1882 # From command line it is impossible to undefined so we must raise an error
1883 .if defined(STAGEDIR)
1884 IGNORE= Do not define STAGEDIR in command line
1888 .if defined(WITH_PKGNG)
1889 .include "${PORTSDIR}/Mk/bsd.pkgng.mk"
1892 .if defined(USE_LOCAL_MK)
1893 .include "${PORTSDIR}/Mk/bsd.local.mk"
1896 .if defined(USE_XORG) || defined(XORG_CAT)
1897 .include "${PORTSDIR}/Mk/bsd.xorg.mk"
1900 .if defined(USE_MYSQL) || defined(WANT_MYSQL_VER) || \
1901 defined(USE_PGSQL) || defined(WANT_PGSQL_VER) || \
1902 defined(USE_BDB) || defined(USE_SQLITE) || defined(USE_FIREBIRD)
1903 .include "${PORTSDIR}/Mk/bsd.database.mk"
1906 .if defined(WANT_GSTREAMER) || defined(USE_GSTREAMER) || defined(USE_GSTREAMER1)
1907 .include "${PORTSDIR}/Mk/bsd.gstreamer.mk"
1910 .if defined(USE_EFL) || defined(WANT_EFL) || defined(USE_EFL_ESMART)
1911 .include "${PORTSDIR}/Mk/bsd.efl.mk"
1914 .if defined(USE_JAVA)
1915 .include "${PORTSDIR}/Mk/bsd.java.mk"
1918 .if defined(USE_OCAML)
1919 .include "${PORTSDIR}/Mk/bsd.ocaml.mk"
1922 .if defined(USE_LINUX_RPM)
1923 .include "${PORTSDIR}/Mk/bsd.linux-rpm.mk"
1926 .if defined(USE_LINUX_APPS)
1927 .include "${PORTSDIR}/Mk/bsd.linux-apps.mk"
1930 .if defined(USE_QT4) || defined(USE_QT5)
1931 .include "${PORTSDIR}/Mk/bsd.qt.mk"
1934 .if defined(USE_SCONS)
1935 .include "${PORTSDIR}/Mk/bsd.scons.mk"
1938 .if defined(USE_SDL) || defined(WANT_SDL)
1939 .include "${PORTSDIR}/Mk/bsd.sdl.mk"
1942 .if defined(USE_PHP)
1943 .include "${PORTSDIR}/Mk/bsd.php.mk"
1946 .if defined(USE_PYTHON)
1947 .include "${PORTSDIR}/Mk/bsd.python.mk"
1950 .if defined(USE_LUA) || defined(USE_LUA_NOT)
1951 .include "${PORTSDIR}/Mk/bsd.lua.mk"
1954 .if defined(USE_WX) || defined(USE_WX_NOT)
1955 .include "${PORTSDIR}/Mk/bsd.wx.mk"
1958 .if defined(USE_APACHE) || defined(USE_APACHE_BUILD) || defined(USE_APACHE_RUN)
1959 .include "${PORTSDIR}/Mk/bsd.apache.mk"
1962 .if defined(USE_AUTOTOOLS)
1963 .include "${PORTSDIR}/Mk/bsd.autotools.mk"
1966 .if defined(USE_FPC) || defined(WANT_FPC_BASE) || defined(WANT_FPC_ALL)
1967 .include "${PORTSDIR}/Mk/bsd.fpc.mk"
1970 .if defined(WANT_GECKO) || defined(USE_GECKO)
1971 .include "${PORTSDIR}/Mk/bsd.gecko.mk"
1974 .if defined(WANT_GNOME) || defined(USE_GNOME)
1975 .include "${PORTSDIR}/Mk/bsd.gnome.mk"
1978 .if defined(USE_MATE)
1979 .include "${PORTSDIR}/Mk/bsd.mate.mk"
1982 .if defined(USE_XFCE)
1983 .include "${PORTSDIR}/Mk/bsd.xfce.mk"
1986 .if defined(USE_KDE4)
1987 .include "${PORTSDIR}/Mk/bsd.kde4.mk"
1990 .if exists(${PORTSDIR}/Makefile.inc)
1991 .include "${PORTSDIR}/Makefile.inc"
1996 .for f in ${_USES_POST}
1999 ${_f}_ARGS:= ${f:C/^[^\:]*\://g}
2001 .include "${USESDIR}/${_f}.mk"
2004 .if defined(USE_XORG)
2005 # Add explicit X options to avoid problems with false positives in configure
2006 .if defined(GNU_CONFIGURE)
2007 CONFIGURE_ARGS+=--x-libraries=${LOCALBASE}/lib --x-includes=${LOCALBASE}/include
2011 # Set the default for the installation of Postscript(TM)-
2012 # compatible functionality.
2013 .if !defined(USE_GHOSTSCRIPT)
2014 . if defined(USE_GHOSTSCRIPT_BUILD)
2015 _USE_GHOSTSCRIPT= ${USE_GHOSTSCRIPT_BUILD}
2016 . elif defined(USE_GHOSTSCRIPT_RUN)
2017 _USE_GHOSTSCRIPT= ${USE_GHOSTSCRIPT_RUN}
2020 _USE_GHOSTSCRIPT= ${USE_GHOSTSCRIPT}
2023 .if defined(WITH_GHOSTSCRIPT_VER) && !empty(WITH_GHOSTSCRIPT_VER:M[789])
2024 _USE_GHOSTSCRIPT_DEFAULT_VER= ${WITH_GHOSTSCRIPT_VER}
2026 _USE_GHOSTSCRIPT_DEFAULT_VER= 9
2029 .if defined(_USE_GHOSTSCRIPT)
2030 . if !defined(WITHOUT_X11)
2031 _USE_GHOSTSCRIPT_PKGNAME_SUFFIX=
2033 _USE_GHOSTSCRIPT_PKGNAME_SUFFIX=-nox11
2035 . if !empty(_USE_GHOSTSCRIPT:M[789])
2036 _USE_GHOSTSCRIPT_VER=${_USE_GHOSTSCRIPT:M[789]}
2038 _USE_GHOSTSCRIPT_VER=${_USE_GHOSTSCRIPT_DEFAULT_VER}
2041 _USE_GHOSTSCRIPT_VER=${_USE_GHOSTSCRIPT_DEFAULT_VER}
2045 .if defined(_USE_GHOSTSCRIPT) && defined(WITH_GHOSTSCRIPT_VER)
2046 . if empty(WITH_GHOSTSCRIPT_VER:M[789])
2047 . error You set an invalid value "${WITH_GHOSTSCRIPT_VER}" in WITH_GHOSTSCRIPT_VER. Abort.
2048 . elif ${_USE_GHOSTSCRIPT_VER} != ${WITH_GHOSTSCRIPT_VER}
2049 . error You set WITH_GHOSTSCRIPT_VER as ${WITH_GHOSTSCRIPT_VER} but ${PKGNAME} requires print/ghostscript${_USE_GHOSTSCRIPT_VER}. Abort.
2053 GHOSTSCRIPT_PORT?= print/ghostscript${_USE_GHOSTSCRIPT_VER}${_USE_GHOSTSCRIPT_PKGNAME_SUFFIX}
2055 # Set up the ghostscript dependencies.
2056 .if defined(USE_GHOSTSCRIPT) || defined(USE_GHOSTSCRIPT_BUILD)
2057 BUILD_DEPENDS+= gs:${PORTSDIR}/${GHOSTSCRIPT_PORT}
2059 .if defined(USE_GHOSTSCRIPT) || defined(USE_GHOSTSCRIPT_RUN)
2060 RUN_DEPENDS+= gs:${PORTSDIR}/${GHOSTSCRIPT_PORT}
2063 # Macro for doing in-place file editing using regexps
2064 REINPLACE_ARGS?= -i.bak
2065 REINPLACE_CMD?= ${SED} ${REINPLACE_ARGS}
2067 # Names of cookies used to skip already completed stages
2068 EXTRACT_COOKIE?= ${WRKDIR}/.extract_done.${PORTNAME}.${PREFIX:S/\//_/g}
2069 CONFIGURE_COOKIE?= ${WRKDIR}/.configure_done.${PORTNAME}.${PREFIX:S/\//_/g}
2070 INSTALL_COOKIE?= ${WRKDIR}/.install_done.${PORTNAME}.${PREFIX:S/\//_/g}
2071 BUILD_COOKIE?= ${WRKDIR}/.build_done.${PORTNAME}.${PREFIX:S/\//_/g}
2072 PATCH_COOKIE?= ${WRKDIR}/.patch_done.${PORTNAME}.${PREFIX:S/\//_/g}
2073 PACKAGE_COOKIE?= ${WRKDIR}/.package_done.${PORTNAME}.${PREFIX:S/\//_/g}
2074 STAGE_COOKIE?= ${WRKDIR}/.stage_done.${PORTNAME}.${PREFIX:S/\//_/g}
2076 # How to do nothing. Override if you, for some strange reason, would rather
2080 # Use this as the first operand to always build dependency.
2081 NONEXISTENT?= /nonexistent
2083 CHECKSUM_ALGORITHMS?= sha256
2085 DISTINFO_FILE?= ${MASTERDIR}/distinfo
2089 MAKE_CMD?= /usr/bin/make
2090 MAKE_ENV+= PREFIX=${PREFIX} \
2091 LOCALBASE=${LOCALBASE} \
2092 LIBDIR="${LIBDIR}" \
2093 CC="${CC}" CFLAGS="${CFLAGS}" \
2094 CPP="${CPP}" CPPFLAGS="${CPPFLAGS}" \
2095 LDFLAGS="${LDFLAGS}" \
2096 CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" \
2097 MANPREFIX="${MANPREFIX}"
2099 # Add -fno-strict-aliasing to CFLAGS with optimization level -O2 or higher.
2100 # gcc 4.x enable strict aliasing optimization with -O2 which is known to break
2102 .if !defined(WITHOUT_NO_STRICT_ALIASING)
2104 .if !empty(CFLAGS:M-O[23s]) && empty(CFLAGS:M-fno-strict-aliasing)
2105 CFLAGS+= -fno-strict-aliasing
2110 .if defined(USE_CSTD)
2111 CFLAGS:= ${CFLAGS:N-std=*} -std=${USE_CSTD}
2114 .if defined(CFLAGS_${ARCH})
2115 CFLAGS+= ${CFLAGS_${ARCH}}
2118 .if defined(USE_CXXSTD)
2119 CXXFLAGS:= ${CXXFLAGS:N-std=*} -std=${USE_CXXSTD}
2122 .if defined(CXXFLAGS_${ARCH})
2123 CXXFLAGS+= ${CXXFLAGS_${ARCH}}
2127 # Support NO_CCACHE for common setups, require WITH_CCACHE_BUILD, and
2128 # don't use if ccache already set in CC
2129 .if !defined(NO_CCACHE) && defined(WITH_CCACHE_BUILD) && !${CC:M*ccache*} && \
2130 !defined(NO_BUILD) && !defined(NOCCACHE)
2131 # Avoid depends loops between pkg and ccache
2132 . if !${.CURDIR:M*/devel/ccache} && !${.CURDIR:M*/ports-mgmt/pkg}
2133 BUILD_DEPENDS+= ${LOCALBASE}/bin/ccache:${PORTSDIR}/devel/ccache
2136 _CCACHE_PATH= ${LOCALBASE}/libexec/ccache
2138 # Prepend the ccache dir into the PATH and setup ccache env
2139 PATH:= ${_CCACHE_PATH}:${PATH}
2140 .if !${MAKE_ENV:MPATH=*} && !${CONFIGURE_ENV:MPATH=*}
2141 MAKE_ENV+= PATH=${PATH}
2142 CONFIGURE_ENV+= PATH=${PATH}
2145 . if defined(CCACHE_DIR)
2146 MAKE_ENV+= CCACHE_DIR="${CCACHE_DIR}"
2147 CONFIGURE_ENV+= CCACHE_DIR="${CCACHE_DIR}"
2152 PTHREAD_LIBS?= -pthread
2154 FETCH_ENV?= SSL_NO_VERIFY_PEER=1 SSL_NO_VERIFY_HOSTNAME=1
2155 FETCH_BINARY?= /usr/bin/fetch
2158 .if !defined(DISABLE_SIZE)
2159 FETCH_BEFORE_ARGS+= $${CKSIZE:+-S $$CKSIZE}
2161 FETCH_CMD?= ${FETCH_BINARY} ${FETCH_ARGS}
2163 .if defined(RANDOMIZE_MASTER_SITES)
2164 .if exists(/usr/games/random)
2165 RANDOM_CMD?= /usr/games/random
2166 RANDOM_ARGS?= "-w -f -"
2167 _RANDOMIZE_SITES= " |${RANDOM_CMD} ${RANDOM_ARGS}"
2171 TOUCH?= /usr/bin/touch
2174 DISTORIG?= .bak.orig
2175 PATCH?= /usr/bin/patch
2177 PATCH_DIST_STRIP?= -p0
2178 .if defined(PATCH_DEBUG)
2179 PATCH_DEBUG_TMP= yes
2180 PATCH_ARGS?= -d ${PATCH_WRKSRC} -E ${PATCH_STRIP}
2181 PATCH_DIST_ARGS?= --suffix ${DISTORIG} -d ${PATCH_WRKSRC} -E ${PATCH_DIST_STRIP}
2184 PATCH_ARGS?= -d ${PATCH_WRKSRC} --forward --quiet -E ${PATCH_STRIP}
2185 PATCH_DIST_ARGS?= --suffix ${DISTORIG} -d ${PATCH_WRKSRC} --forward --quiet -E ${PATCH_DIST_STRIP}
2188 PATCH_SILENT= PATCH_SILENT=yes
2191 PATCH_ARGS+= --batch
2192 PATCH_DIST_ARGS+= --batch
2195 # Prevent breakage with VERSION_CONTROL=numbered
2196 PATCH_ARGS+= -V simple
2198 .if defined(PATCH_CHECK_ONLY)
2200 PATCH_DIST_ARGS+= -C
2203 .if ${PATCH} == "/usr/bin/patch"
2204 PATCH_ARGS+= --suffix .orig
2205 PATCH_DIST_ARGS+= --suffix .orig
2210 # EXTRACT_SUFX is defined in .pre.mk section
2211 EXTRACT_CMD?= ${TAR}
2212 EXTRACT_BEFORE_ARGS?= -xf
2213 .if defined(EXTRACT_PRESERVE_OWNERSHIP)
2214 EXTRACT_AFTER_ARGS?=
2216 EXTRACT_AFTER_ARGS?= --no-same-owner --no-same-permissions
2219 # Figure out where the local mtree file is
2220 .if !defined(MTREE_FILE) && !defined(NO_MTREE)
2221 .if ${PREFIX} == /usr
2222 MTREE_FILE= /etc/mtree/BSD.usr.dist
2224 MTREE_FILE= ${PORTSDIR}/Templates/BSD.local.dist
2226 MTREE_FILE_DEFAULT=yes
2228 MTREE_CMD?= /usr/sbin/mtree
2229 MTREE_ARGS?= -U ${MTREE_FOLLOWS_SYMLINKS} -f ${MTREE_FILE} -d -e -p
2231 READLINK_CMD?= /usr/bin/readlink
2233 # Determine whether or not we can use rootly owner/group functions.
2235 _BINOWNGRP= -o ${BINOWN} -g ${BINGRP}
2236 _SHROWNGRP= -o ${SHAREOWN} -g ${SHAREGRP}
2237 _MANOWNGRP= -o ${MANOWN} -g ${MANGRP}
2244 # A few aliases for *-install targets
2246 ${INSTALL} ${COPY} ${STRIP} ${_BINOWNGRP} -m ${BINMODE}
2248 ${INSTALL} ${COPY} ${_BINOWNGRP} -m ${BINMODE}
2250 ${INSTALL} ${COPY} ${STRIP} ${_SHROWNGRP} -m ${SHAREMODE}
2252 ${INSTALL} ${COPY} ${_BINOWNGRP} -m ${BINMODE}
2254 ${INSTALL} ${COPY} ${_SHROWNGRP} -m ${SHAREMODE}
2256 ${INSTALL} ${COPY} ${_MANOWNGRP} -m ${MANMODE}
2258 INSTALL_MACROS= BSD_INSTALL_PROGRAM="${INSTALL_PROGRAM}" \
2259 BSD_INSTALL_LIB="${INSTALL_LIB}" \
2260 BSD_INSTALL_SCRIPT="${INSTALL_SCRIPT}" \
2261 BSD_INSTALL_DATA="${INSTALL_DATA}" \
2262 BSD_INSTALL_MAN="${INSTALL_MAN}"
2263 MAKE_ENV+= ${INSTALL_MACROS}
2264 SCRIPTS_ENV+= ${INSTALL_MACROS}
2266 # Macro for copying entire directory tree with correct permissions
2268 COPYTREE_BIN= ${SH} -c '(${FIND} -d $$0 $$2 | ${CPIO} -dumpl $$1 >/dev/null \
2270 ${CHOWN} -Rh ${BINOWN}:${BINGRP} $$1 && \
2271 ${FIND} -d $$0 $$2 -type d -exec chmod 755 $$1/{} \; && \
2272 ${FIND} -d $$0 $$2 -type f -exec chmod ${BINMODE} $$1/{} \;' --
2273 COPYTREE_SHARE= ${SH} -c '(${FIND} -d $$0 $$2 | ${CPIO} -dumpl $$1 >/dev/null \
2275 ${CHOWN} -Rh ${SHAREOWN}:${SHAREGRP} $$1 && \
2276 ${FIND} -d $$0 $$2 -type d -exec chmod 755 $$1/{} \; && \
2277 ${FIND} -d $$0 $$2 -type f -exec chmod ${SHAREMODE} $$1/{} \;' --
2279 COPYTREE_BIN= ${SH} -c '(${FIND} -d $$0 $$2 | ${CPIO} -dumpl $$1 >/dev/null \
2281 ${FIND} -d $$0 $$2 -type d -exec chmod 755 $$1/{} \; && \
2282 ${FIND} -d $$0 $$2 -type f -exec chmod ${BINMODE} $$1/{} \;' --
2283 COPYTREE_SHARE= ${SH} -c '(${FIND} -d $$0 $$2 | ${CPIO} -dumpl $$1 >/dev/null \
2285 ${FIND} -d $$0 $$2 -type d -exec chmod 755 $$1/{} \; && \
2286 ${FIND} -d $$0 $$2 -type f -exec chmod ${SHAREMODE} $$1/{} \;' --
2289 # The user can override the NO_PACKAGE by specifying this from
2290 # the make command line
2291 .if defined(FORCE_PACKAGE)
2295 DESCR?= ${PKGDIR}/pkg-descr
2296 PLIST?= ${PKGDIR}/pkg-plist
2297 PKGHELP?= ${PKGDIR}/pkg-help
2298 PKGINSTALL?= ${PKGDIR}/pkg-install
2299 PKGDEINSTALL?= ${PKGDIR}/pkg-deinstall
2300 PKGREQ?= ${PKGDIR}/pkg-req
2301 PKGMESSAGE?= ${PKGDIR}/pkg-message
2303 TMPPLIST?= ${WRKDIR}/.PLIST.mktmp
2304 TMPPLIST_SORT?= ${WRKDIR}/.PLIST.mktmp.sorted
2305 TMPGUCMD?= ${WRKDIR}/.PLIST.gucmd
2307 .if !defined(PKG_ARGS)
2308 PKG_ARGS= -v -c -${COMMENT:Q} -d ${DESCR} -f ${TMPPLIST} -p ${PREFIX} -P "`cd ${.CURDIR} && ${MAKE} actual-package-depends | ${GREP} -v -E ${PKG_IGNORE_DEPENDS} | ${SORT} -u -t : -k 2`" ${EXTRA_PKG_ARGS} $${_LATE_PKG_ARGS}
2309 .if !defined(NO_MTREE)
2310 PKG_ARGS+= -m ${MTREE_FILE}
2312 .if defined(PKGORIGIN)
2313 PKG_ARGS+= -o ${PKGORIGIN}
2315 .if defined(CONFLICTS) && !defined(DISABLE_CONFLICTS)
2316 PKG_ARGS+= -C "${CONFLICTS}"
2318 .if defined(CONFLICTS_INSTALL) && !defined(DISABLE_CONFLICTS)
2319 PKG_ARGS+= -C "${CONFLICTS_INSTALL}"
2322 .if defined(PKG_NOCOMPRESS)
2325 .if defined(WITH_PKGNG)
2331 # where pkg_add records its dirty deeds.
2332 PKG_DBDIR?= /var/db/pkg
2335 INSTALL_TARGET?= install
2336 INSTALL_TARGET+= ${LATE_INSTALL_ARGS}
2338 # Integrate with the license auditing framework
2339 .if !defined (DISABLE_LICENSES)
2340 .include "${PORTSDIR}/Mk/bsd.licenses.mk"
2343 # Popular master sites
2344 .include "${PORTSDIR}/Mk/bsd.sites.mk"
2346 # Empty declaration to avoid "variable MASTER_SITES recursive" error
2349 _MASTER_SITES_DEFAULT?=
2350 _PATCH_SITES_DEFAULT?=
2352 # Feed internal _{MASTER,PATCH}_SITES_n where n is a group designation
2353 # as per grouping rules (:something)
2354 # Organize _{MASTER,PATCH}_SITES_{DEFAULT,[^/:]+} according to grouping
2355 # rules (:something)
2356 .for _S in ${MASTER_SITES}
2357 _S_TEMP= ${_S:S/^${_S:C@/?:[^/:]+$@/@}//:S/^://}
2358 . if !empty(_S_TEMP)
2359 . for _group in ${_S_TEMP:S/,/ /g}
2361 . if ${_G_TEMP} == all || ${_G_TEMP} == ALL || ${_G_TEMP} == default
2363 @${ECHO_MSG} "Makefile error: the words all, ALL and default are reserved and cannot be"
2364 @${ECHO_MSG} "used in group definitions. Please fix your MASTER_SITES"
2367 _MASTER_SITES_${_group}+= ${_S:C@^(.*/):[^/:]+$@\1@}
2370 _MASTER_SITES_DEFAULT+= ${_S:C@^(.*/):[^/:]+$@\1@}
2373 .for _S in ${PATCH_SITES}
2374 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://}
2375 . if !empty(_S_TEMP)
2376 . for _group in ${_S_TEMP:S/,/ /g}
2378 . if ${_G_TEMP} == all || ${_G_TEMP} == ALL || ${_G_TEMP} == default
2380 @${ECHO_MSG} "The words all, ALL and default are reserved and cannot be"
2381 @${ECHO_MSG} "used in group definitions. Please fix your PATCH_SITES"
2384 _PATCH_SITES_${_group}+= ${_S:C@^(.*/):[^/:]+$@\1@}
2387 _PATCH_SITES_DEFAULT+= ${_S:C@^(.*/):[^/:]+$@\1@}
2391 # Feed internal _{MASTER,PATCH}_SITE_SUBDIR_n where n is a group designation
2392 # as per grouping rules (:something)
2393 # Organize _{MASTER,PATCH}_SITE_SUBDIR_{DEFAULT,[^/:]+} according to grouping
2394 # rules (:something)
2395 .for _S in ${MASTER_SITE_SUBDIR}
2396 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://}
2397 . if !empty(_S_TEMP)
2398 . for _group in ${_S_TEMP:S/,/ /g}
2400 . if ${_G_TEMP} == all || ${_G_TEMP} == ALL || ${_G_TEMP} == default
2402 @${ECHO_MSG} "Makefile error: the words all, ALL and default are reserved and cannot be"
2403 @${ECHO_MSG} "used in group definitions. Please fix your MASTER_SITE_SUBDIR"
2406 . if defined(_MASTER_SITES_${_group})
2407 _MASTER_SITE_SUBDIR_${_group}+= ${_S:C@^(.*)/:[^/:]+$@\1@}
2411 . if defined(_MASTER_SITES_DEFAULT)
2412 _MASTER_SITE_SUBDIR_DEFAULT+= ${_S:C@^(.*)/:[^/:]+$@\1@}
2416 .for _S in ${PATCH_SITE_SUBDIR}
2417 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://}
2418 . if !empty(_S_TEMP)
2419 . for _group in ${_S_TEMP:S/,/ /g}
2421 . if ${_G_TEMP} == all || ${_G_TEMP} == ALL || ${_G_TEMP} == default
2423 @${ECHO_MSG} "Makefile error: the words all, ALL and default are reserved and cannot be"
2424 @${ECHO_MSG} "used in group definitions. Please fix your PATCH_SITE_SUBDIR"
2427 . if defined(_PATCH_SITES_${_group})
2428 _PATCH_SITE_SUBDIR_${_group}+= ${_S:C@^(.*)/:[^/:]+$@\1@}
2432 . if defined(_PATCH_SITES_DEFAULT)
2433 _PATCH_SITE_SUBDIR_DEFAULT+= ${_S:C@^(.*)/:[^/:]+$@\1@}
2438 # Substitute subdirectory names
2439 # XXX simpler/faster solution but not the best space wise, suggestions please
2440 .for _S in ${MASTER_SITES}
2441 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://}
2442 . if !empty(_S_TEMP)
2443 . for _group in ${_S_TEMP:S/,/ /g}
2444 . if !defined(_MASTER_SITE_SUBDIR_${_group})
2445 MASTER_SITES_TMP= ${_MASTER_SITES_${_group}:S^%SUBDIR%/^^}
2447 _S_TEMP_TEMP= ${_MASTER_SITES_${_group}:M*%SUBDIR%/*}
2448 . if empty(_S_TEMP_TEMP)
2449 MASTER_SITES_TMP= ${_MASTER_SITES_${_group}}
2452 . for site in ${_MASTER_SITES_${_group}}
2453 _S_TEMP_TEMP= ${site:M*%SUBDIR%/*}
2454 . if empty(_S_TEMP_TEMP)
2455 MASTER_SITES_TMP+= ${site}
2457 . for dir in ${_MASTER_SITE_SUBDIR_${_group}}
2458 MASTER_SITES_TMP+= ${site:S^%SUBDIR%^\${dir}^}
2464 _MASTER_SITES_${_group}:= ${MASTER_SITES_TMP}
2468 .if defined(_MASTER_SITE_SUBDIR_DEFAULT)
2469 _S_TEMP= ${_MASTER_SITES_DEFAULT:M*%SUBDIR%/*}
2471 MASTER_SITES_TMP= ${_MASTER_SITES_DEFAULT}
2474 . for site in ${_MASTER_SITES_DEFAULT}
2475 _S_TEMP_TEMP= ${site:M*%SUBDIR%/*}
2476 . if empty(_S_TEMP_TEMP)
2477 MASTER_SITES_TMP+= ${site}
2479 . for dir in ${_MASTER_SITE_SUBDIR_DEFAULT}
2480 MASTER_SITES_TMP+= ${site:S^%SUBDIR%^\${dir}^}
2486 MASTER_SITES_TMP= ${_MASTER_SITES_DEFAULT:S^%SUBDIR%/^^}
2488 _MASTER_SITES_DEFAULT:= ${MASTER_SITES_TMP}
2490 .for _S in ${PATCH_SITES}
2491 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://}
2492 . if !empty(_S_TEMP)
2493 . for _group in ${_S_TEMP:S/,/ /g}
2494 . if !defined(_PATCH_SITE_SUBDIR_${_group})
2495 PATCH_SITES_TMP= ${_PATCH_SITES_${_group}:S^%SUBDIR%/^^}
2497 _S_TEMP_TEMP= ${_PATCH_SITES_${_group}:M*%SUBDIR%/*}
2498 . if empty(_S_TEMP_TEMP)
2499 PATCH_SITES_TMP= ${_PATCH_SITES_${_group}}
2502 . for site in ${_PATCH_SITES_${_group}}
2503 _S_TEMP_TEMP= ${site:M*%SUBDIR%/*}
2504 . if empty(_S_TEMP_TEMP)
2505 PATCH_SITES_TMP+= ${site}
2507 . for dir in ${_PATCH_SITE_SUBDIR_${_group}}
2508 PATCH_SITES_TMP+= ${site:S^%SUBDIR%^\${dir}^}
2514 _PATCH_SITES_${_group}:= ${PATCH_SITES_TMP}
2518 .if defined(_PATCH_SITE_SUBDIR_DEFAULT)
2519 _S_TEMP= ${_PATCH_SITES_DEFAULT:M*%SUBDIR%/*}
2521 PATCH_SITES_TMP= ${_PATCH_SITES_DEFAULT}
2524 . for site in ${_PATCH_SITES_DEFAULT}
2525 _S_TEMP_TEMP= ${site:M*%SUBDIR%/*}
2526 . if empty(_S_TEMP_TEMP)
2527 PATCH_SITES_TMP+= ${site}
2529 . for dir in ${_PATCH_SITE_SUBDIR_DEFAULT}
2530 PATCH_SITES_TMP+= ${site:S^%SUBDIR%^\${dir}^}
2536 PATCH_SITES_TMP= ${_PATCH_SITES_DEFAULT:S^%SUBDIR%/^^}
2538 _PATCH_SITES_DEFAULT:= ${PATCH_SITES_TMP}
2541 # The primary backup site.
2542 MASTER_SITE_BACKUP?= \
2543 ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/
2544 MASTER_SITE_BACKUP:= ${MASTER_SITE_BACKUP:S^\${DIST_SUBDIR}/^^}
2546 # If the user has MASTER_SITE_FREEBSD set, go to the FreeBSD repository
2547 # for everything, but don't search it twice by appending it to the end.
2548 .if defined(MASTER_SITE_FREEBSD)
2549 _MASTER_SITE_OVERRIDE:= ${MASTER_SITE_BACKUP}
2550 _MASTER_SITE_BACKUP:= # empty
2552 _MASTER_SITE_OVERRIDE= ${MASTER_SITE_OVERRIDE}
2553 _MASTER_SITE_BACKUP= ${MASTER_SITE_BACKUP}
2556 # Search CDROM first if mounted, symlink instead of copy if
2557 # FETCH_SYMLINK_DISTFILES is set
2558 .for MOUNTPT in ${CD_MOUNTPTS}
2559 .if exists(${MOUNTPT}/ports/distfiles)
2560 _MASTER_SITE_OVERRIDE:= file:${MOUNTPT}/ports/distfiles/${DIST_SUBDIR}/ ${_MASTER_SITE_OVERRIDE}
2561 .if defined(FETCH_SYMLINK_DISTFILES)
2562 FETCH_BEFORE_ARGS+= -l
2569 # Organize DISTFILES, PATCHFILES, _MASTER_SITES_ALL, _PATCH_SITES_ALL
2570 # according to grouping rules (:something)
2571 DISTFILES?= ${DISTNAME}${EXTRACT_SUFX}
2572 _MASTER_SITES_ALL= ${_MASTER_SITES_DEFAULT}
2573 _PATCH_SITES_ALL= ${_PATCH_SITES_DEFAULT}
2575 .for _D in ${DISTFILES}
2576 _D_TEMP= ${_D:S/^${_D:C/:[^:]+$//}//}
2577 . if !empty(_D_TEMP)
2578 . for _group in ${_D_TEMP:S/^://:S/,/ /g}
2579 . if !defined(_MASTER_SITES_${_group})
2580 _G_TEMP_TEMP= ${_G_TEMP:M/${_group}/}
2581 . if empty(_G_TEMP_TEMP)
2583 _MASTER_SITES_ALL+= ${_MASTER_SITES_${_group}}
2587 _DISTFILES+= ${_D:C/:[^:]+$//}
2593 .for _P in ${PATCHFILES}
2594 _P_TEMP= ${_P:C/:[^-:][^:]*$//}
2595 _P_groups= ${_P:S/^${_P:C/:[^:]+$//}//:S/^://}
2596 _P_file= ${_P_TEMP:C/:-[^:]+$//}
2597 _P_strip= ${_P_TEMP:S/^${_P_TEMP:C/:-[^:]*$//}//:S/^://}
2598 . if !empty(_P_groups)
2599 . for _group in ${_P_groups:S/,/ /g}
2600 . if !defined(_PATCH_SITES_${_group})
2601 _G_TEMP_TEMP= ${_G_TEMP:M/${_group}/}
2602 . if empty(_G_TEMP_TEMP)
2604 _PATCH_SITES_ALL+= ${_PATCH_SITES_${_group}}
2609 _PATCHFILES:= ${_PATCHFILES} ${_P_file}
2610 . if !empty(_P_strip)
2611 _PATCH_DIST_STRIP_CASES:= ${_PATCH_DIST_STRIP_CASES} ("${_P_file}") printf %s "${_P_strip}" ;;
2619 ALLFILES?= ${_DISTFILES} ${_PATCHFILES}
2622 # Sort the master site list according to the patterns in MASTER_SORT
2626 MASTER_SORT_REGEX+= ${MASTER_SORT:S|.|\\.|g:S|^|://[^/]*|:S|$|/|}
2628 MASTER_SORT_AWK= BEGIN { RS = " "; ORS = " "; IGNORECASE = 1 ; gl = "${MASTER_SORT_REGEX:S|\\|\\\\|g}"; }
2629 .for srt in ${MASTER_SORT_REGEX}
2630 MASTER_SORT_AWK+= /${srt:S|/|\\/|g}/ { good["${srt:S|\\|\\\\|g}"] = good["${srt:S|\\|\\\\|g}"] " " $$0 ; next; }
2632 MASTER_SORT_AWK+= { rest = rest " " $$0; } END { n=split(gl, gla); for(i=1;i<=n;i++) { print good[gla[i]]; } print rest; }
2634 SORTED_MASTER_SITES_DEFAULT_CMD= cd ${.CURDIR} && ${MAKE} master-sites-DEFAULT
2635 SORTED_PATCH_SITES_DEFAULT_CMD= cd ${.CURDIR} && ${MAKE} patch-sites-DEFAULT
2636 SORTED_MASTER_SITES_ALL_CMD= cd ${.CURDIR} && ${MAKE} master-sites-ALL
2637 SORTED_PATCH_SITES_ALL_CMD= cd ${.CURDIR} && ${MAKE} patch-sites-ALL
2639 # has similar effect to old targets, i.e., access only {MASTER,PATCH}_SITES, not working with the new _n variables
2640 master-sites-DEFAULT:
2641 @${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_MASTER_SITES_DEFAULT}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
2642 patch-sites-DEFAULT:
2643 @${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_PATCH_SITES_DEFAULT}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
2646 # Sort the master site list according to the patterns in MASTER_SORT
2647 # according to grouping rules (:something)
2649 # for use in the fetch targets
2650 .for _S in ${MASTER_SITES}
2651 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//}
2652 . if !empty(_S_TEMP)
2653 . for _group in ${_S_TEMP:S/^://:S/,/ /g}
2654 . if !target(master-sites-${_group})
2655 SORTED_MASTER_SITES_${_group}_CMD= cd ${.CURDIR} && ${MAKE} master-sites-${_group}
2656 master-sites-${_group}:
2657 @${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_MASTER_SITES_${_group}}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
2662 .for _S in ${PATCH_SITES}
2663 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//}
2664 . if !empty(_S_TEMP)
2665 . for _group in ${_S_TEMP:S/^://:S/,/ /g}
2666 . if !target(patch-sites-${_group})
2667 SORTED_PATCH_SITES_${_group}_CMD= cd ${.CURDIR} && ${MAKE} patch-sites-${_group}
2668 patch-sites-${_group}:
2669 @${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_PATCH_SITES_${_group}}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
2676 # Hackery to enable simple fetch targets with several dynamic MASTER_SITES
2678 _MASTER_SITES_ENV= _MASTER_SITES_DEFAULT="${_MASTER_SITES_DEFAULT}"
2679 .for _F in ${DISTFILES}
2680 _F_TEMP= ${_F:S/^${_F:C/:[^:]+$//}//:S/^://}
2681 . if !empty(_F_TEMP)
2682 . for _group in ${_F_TEMP:S/,/ /g}
2683 . if defined(_MASTER_SITES_${_group})
2684 _MASTER_SITES_ENV+= _MASTER_SITES_${_group}="${_MASTER_SITES_${_group}}"
2689 _PATCH_SITES_ENV= _PATCH_SITES_DEFAULT="${_PATCH_SITES_DEFAULT}"
2690 .for _F in ${PATCHFILES}
2691 _F_TEMP= ${_F:S/^${_F:C/:[^-:][^:]*$//}//:S/^://}
2692 . if !empty(_F_TEMP)
2693 . for _group in ${_F_TEMP:S/,/ /g}
2694 . if defined(_PATCH_SITES_${_group})
2695 _PATCH_SITES_ENV+= _PATCH_SITES_${_group}="${_PATCH_SITES_${_group}}"
2702 @${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_MASTER_SITES_ALL}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
2704 @${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_PATCH_SITES_ALL}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
2706 # synonyms, mnemonics
2707 master-sites-all: master-sites-ALL
2708 patch-sites-all: patch-sites-ALL
2709 master-sites-default: master-sites-DEFAULT
2710 patch-sites-default: patch-sites-DEFAULT
2712 # compatibility with old behavior
2713 master-sites: master-sites-DEFAULT
2714 patch-sites: patch-sites-DEFAULT
2716 .if defined(IGNOREFILES)
2717 .if !defined(CKSUMFILES)
2718 . for _f in ${ALLFILES}
2719 . if ! ${IGNOREFILES:M${_f}}
2726 CKSUMFILES= ${ALLFILES}
2729 # List of all files, with ${DIST_SUBDIR} in front. Used for checksum.
2730 .if defined(DIST_SUBDIR)
2731 .if defined(CKSUMFILES) && ${CKSUMFILES}!=""
2732 _CKSUMFILES?= ${CKSUMFILES:S/^/${DIST_SUBDIR}\//}
2734 .if defined(IGNOREFILES) && ${IGNOREFILES}!=""
2735 _IGNOREFILES?= ${IGNOREFILES:S/^/${DIST_SUBDIR}\//}
2738 _CKSUMFILES?= ${CKSUMFILES}
2739 _IGNOREFILES?= ${IGNOREFILES}
2742 # This is what is actually going to be extracted, and is overridable
2744 EXTRACT_ONLY?= ${_DISTFILES}
2746 .if !target(maintainer)
2748 @${ECHO_CMD} "${MAINTAINER}"
2751 .if !defined(CATEGORIES)
2753 @${ECHO_MSG} "${PKGNAME}: Makefile error: CATEGORIES is mandatory."
2757 VALID_CATEGORIES+= accessibility afterstep arabic archivers astro audio \
2758 benchmarks biology cad chinese comms converters databases \
2759 deskutils devel docs dns editors elisp emulators enlightenment finance french ftp \
2760 games geography german gnome gnustep graphics hamradio haskell hebrew hungarian \
2761 ipv6 irc japanese java kde kld korean lang linux lisp \
2762 mail mate math mbone misc multimedia net net-im net-mgmt net-p2p news \
2763 palm parallel pear perl5 plan9 polish portuguese ports-mgmt \
2764 print python ruby rubygems russian \
2765 scheme science security shells spanish sysutils \
2767 ukrainian vietnamese windowmaker www \
2768 x11 x11-clocks x11-drivers x11-fm x11-fonts x11-servers x11-themes \
2769 x11-toolkits x11-wm xfce zope
2772 .for cat in ${CATEGORIES}
2773 . if empty(VALID_CATEGORIES:M${cat})
2774 @${ECHO_MSG} "${PKGNAME}: Makefile error: category ${cat} not in list of valid categories."; \
2780 PKGREPOSITORYSUBDIR?= All
2781 PKGREPOSITORY?= ${PACKAGES}/${PKGREPOSITORYSUBDIR}
2782 .if exists(${PACKAGES})
2783 PKGFILE?= ${PKGREPOSITORY}/${PKGNAME}${PKG_SUFX}
2785 PKGFILE?= ${.CURDIR}/${PKGNAME}${PKG_SUFX}
2788 # The "latest version" link -- ${PKGNAME} minus everthing after the last '-'
2789 PKGLATESTREPOSITORY?= ${PACKAGES}/Latest
2790 PKGBASE?= ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}
2791 LATEST_LINK?= ${PKGBASE}
2792 PKGLATESTFILE= ${PKGLATESTREPOSITORY}/${LATEST_LINK}${PKG_SUFX}
2794 CONFIGURE_SCRIPT?= configure
2795 CONFIGURE_TARGET?= ${ARCH}-dports-dragonfly${OSREL}
2796 CONFIGURE_TARGET:= ${CONFIGURE_TARGET:S/--build=//}
2797 CONFIGURE_LOG?= config.log
2799 # A default message to print if do-configure fails.
2800 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)."
2802 .if defined(GNU_CONFIGURE)
2803 # Maximum command line length
2804 .if !defined(CONFIGURE_MAX_CMD_LEN)
2805 CONFIGURE_MAX_CMD_LEN!= ${SYSCTL} -n kern.argmax
2807 GNU_CONFIGURE_PREFIX?= ${PREFIX}
2808 GNU_CONFIGURE_MANPREFIX?= ${MANPREFIX}
2809 CONFIG_SITE?= ${PORTSDIR}/Templates/config.site
2810 CONFIGURE_ARGS+= --prefix=${GNU_CONFIGURE_PREFIX} $${_LATE_CONFIGURE_ARGS}
2811 .if defined(X_BUILD_FOR)
2812 CONFIGURE_ARGS+= --host=${X_BUILD_FOR}
2814 CONFIGURE_ENV+= CONFIG_SITE=${CONFIG_SITE} lt_cv_sys_max_cmd_len=${CONFIGURE_MAX_CMD_LEN}
2817 SET_LATE_CONFIGURE_ARGS= \
2818 _LATE_CONFIGURE_ARGS="" ; \
2819 if [ ! -z "`./${CONFIGURE_SCRIPT} --help 2>&1 | ${GREP} -- '--mandir'`" ]; then \
2820 _LATE_CONFIGURE_ARGS="$${_LATE_CONFIGURE_ARGS} --mandir=${GNU_CONFIGURE_MANPREFIX}/man" ; \
2822 if [ ! -z "`./${CONFIGURE_SCRIPT} --help 2>&1 | ${GREP} -- '--infodir'`" ]; then \
2823 _LATE_CONFIGURE_ARGS="$${_LATE_CONFIGURE_ARGS} --infodir=${GNU_CONFIGURE_PREFIX}/${INFO_PATH}/${INFO_SUBDIR}" ; \
2825 if [ -z "`./${CONFIGURE_SCRIPT} --version 2>&1 | ${EGREP} -i '(autoconf.*2\.13|Unrecognized option)'`" ]; then \
2826 _LATE_CONFIGURE_ARGS="$${_LATE_CONFIGURE_ARGS} --build=${CONFIGURE_TARGET}" ; \
2828 _LATE_CONFIGURE_ARGS="$${_LATE_CONFIGURE_ARGS} ${CONFIGURE_TARGET}" ; \
2832 # Passed to most of script invocations
2833 SCRIPTS_ENV+= CURDIR=${MASTERDIR} DISTDIR=${DISTDIR} \
2834 WRKDIR=${WRKDIR} WRKSRC=${WRKSRC} PATCHDIR=${PATCHDIR} \
2835 SCRIPTDIR=${SCRIPTDIR} FILESDIR=${FILESDIR} \
2836 DFLY_PATCHDIR=${DFLY_PATCHDIR} \
2837 DFLY_FILESDIR=${DFLY_FILESDIR} \
2838 PORTSDIR=${PORTSDIR} PREFIX=${PREFIX} LOCALBASE=${LOCALBASE}
2841 SCRIPTS_ENV+= BATCH=yes
2844 .if ${PREFIX} == /usr
2845 MANPREFIX?= /usr/share
2847 MANPREFIX?= ${PREFIX}
2850 MANDIRS+= ${MANPREFIX}/man
2851 .for sect in 1 2 3 4 5 6 7 8 9
2852 MAN${sect}PREFIX?= ${MANPREFIX}
2854 MANLPREFIX?= ${MANPREFIX}
2855 MANNPREFIX?= ${MANPREFIX}
2857 MANLANG?= "" # english only by default
2859 .if !defined(NO_MANCOMPRESS)
2863 .if (defined(MLINKS) || defined(_MLINKS_PREPEND)) && !defined(_MLINKS)
2865 .if defined(.PARSEDIR)
2866 _MLINKS= ${_MLINKS_PREPEND} \
2867 ${MANLANG:S,^,man/,:S,/"",,:@m@${MLINKS:@p@${MAN${p:E:C/(.).*/\1/g}PREFIX}/$m/man${p:E:C/(.).*/\1/g}/$p${MANEXT}@}@}
2869 __pmlinks!= ${ECHO_CMD} '${MLINKS:S/ / /}' | ${AWK} \
2870 '{ if (NF % 2 != 0) { print "broken"; exit; } \
2871 for (i=1; i<=NF; i++) { \
2872 if ($$i ~ /^-$$/ && i != 1 && i % 2 != 0) \
2873 { $$i = $$(i-2); printf " " $$i " "; } \
2874 else if ($$i ~ /^[^ ]+\.[1-9ln][^. ]*$$/ || $$i ~ /^\//) \
2875 printf " " $$i " "; \
2877 { print "broken"; exit; } \
2879 }' | ${SED} -e 's
\b \([^/ ][^ ]*\.\(.\)[^. ]*\)
\b $${MAN\2PREFIX}/___LANG___/man\2/\1${MANEXT}
\bg' -e 's/ /
\b/g' -e 's/MANlPREFIX/MANLPREFIX/g' -e 's/MANnPREFIX/MANNPREFIX/g'
2880 .if ${__pmlinks:Mbroken} == "broken"
2882 @${ECHO_MSG} "${PKGNAME}: Makefile error: unable to parse MLINKS."
2885 _MLINKS= ${_MLINKS_PREPEND}
2887 .for lang in ${MANLANG:S%^%man/%:S%^man/""$%man%}
2888 .for ___pmlinks in ${__pmlinks}
2889 .for __lang in ${lang}
2890 _MLINKS+= ${___pmlinks:S/
\b/ /g:S/___LANG___/${__lang}/}
2897 .for ___tpmlinks in ${_MLINKS}
2898 .if ${_COUNT} == "1"
2899 _TMLINKS+= ${___tpmlinks}
2906 .for manlang in ${MANLANG:S%^%man/%:S%^man/""$%man%}
2908 .for sect in 1 2 3 4 5 6 7 8 9 L N
2909 # MAN${sect} is for man pages installed for all languages in MANLANG for a given
2911 .if defined(MAN${sect})
2912 _MANPAGES+= ${MAN${sect}:S%^%${MAN${sect}PREFIX}/${manlang}/man${sect:tl}/%}
2915 # Language specific MAN${sect} variables are for man pages installed in that
2916 # language, but not necessarily all languages in MANLANG.
2917 .if defined(MAN${sect}_${manlang:S%^man/%%:tu})
2918 _MANPAGES+= ${MAN${sect}_${manlang:S%^man/%%:tu}:S%^%${MAN${sect}PREFIX}/${manlang}/man${sect:tl}/%}
2925 # Special case for English, since it is defined with "" in MANLANG rather than
2926 # a language name and does not have man pages installed in a lang subdirectory
2927 # of MAN${sect}PREFIX.
2928 .for sect in 1 2 3 4 5 6 7 8 9 L N
2929 .if defined(MAN${sect}_EN)
2930 _MANPAGES+= ${MAN${sect}_EN:S%^%${MAN${sect}PREFIX}/man/man${sect:tl}/%}
2934 .if !defined(_TMLINKS)
2938 .if defined(_MANPAGES)
2940 .if defined(NO_MANCOMPRESS)
2941 __MANPAGES:= ${_MANPAGES:S%^${PREFIX}/%%}
2943 __MANPAGES:= ${_MANPAGES:S%^${PREFIX}/%%:S%$%.gz%}
2946 .if ${MANCOMPRESSED} == "yes"
2947 _MANPAGES:= ${_MANPAGES:S%$%.gz%}
2952 .if ${PREFIX} == /usr
2953 INFO_PATH?= share/info
2959 . for D in ${INFO:H}
2962 . if !defined(INFO_SUBDIR)
2964 . elif ${INFO_SUBDIR} != ${RD}
2965 BROKEN= only one subdirectory in INFO is allowed
2972 DOCSDIR_REL?= ${DOCSDIR:S,^${PREFIX}/,,}
2973 EXAMPLESDIR_REL?= ${EXAMPLESDIR:S,^${PREFIX}/,,}
2974 DATADIR_REL?= ${DATADIR:S,^${PREFIX}/,,}
2975 WWWDIR_REL?= ${WWWDIR:S,^${PREFIX}/,,}
2976 ETCDIR_REL?= ${ETCDIR:S,^${PREFIX}/,,}
2978 PLIST_SUB+= DOCSDIR="${DOCSDIR_REL}" \
2979 EXAMPLESDIR="${EXAMPLESDIR_REL}" \
2980 DATADIR="${DATADIR_REL}" \
2981 WWWDIR="${WWWDIR_REL}" \
2982 ETCDIR="${ETCDIR_REL}"
2984 DESKTOPDIR?= ${PREFIX}/share/applications
2985 _DESKTOPDIR_REL= ${DESKTOPDIR:S,^${PREFIX}/,,}/
2987 .if ${_DESKTOPDIR_REL} == ${DESKTOPDIR}/
2988 # DESKTOPDIR is not beneath PREFIX
2994 ################################################################
2995 # Many ways to disable a port.
2997 # If we're in BATCH mode and the port is interactive, or we're
2998 # in interactive mode and the port is non-interactive, skip all
2999 # the important targets. The reason we have two modes is that
3000 # one might want to leave a build in BATCH mode running
3001 # overnight, then come back in the morning and do _only_ the
3002 # interactive ones that required your intervention.
3004 # Ignore ports that can't be resold if building for a CDROM.
3006 # Don't build a port if it's restricted and we don't want to get
3009 # Don't build a port if it's broken, unless we're running a parallel
3010 # build (in case it's fixed).
3012 # Don't build a port if it's forbidden for whatever reason.
3014 # Don't build a port if the system is too old.
3015 ################################################################
3017 # Check the machine architectures
3018 .if defined(ONLY_FOR_ARCHS)
3019 .for __ARCH in ${ONLY_FOR_ARCHS:S/amd64/x86_64/}
3020 .if ${ARCH:M${__ARCH}} != ""
3028 .if defined(NOT_FOR_ARCHS)
3029 .for __NARCH in ${NOT_FOR_ARCHS:S/amd64/x86_64/}
3030 .if ${ARCH:M${__NARCH}} != ""
3036 .if !defined(__ARCH_OK)
3037 .if defined(ONLY_FOR_ARCHS)
3038 IGNORE= is only for ${ONLY_FOR_ARCHS:S/amd64/x86_64/},
3039 .else # defined(NOT_FOR_ARCHS)
3040 IGNORE= does not run on ${NOT_FOR_ARCHS:S/amd64/x86_64/},
3042 IGNORE+= while you are running ${ARCH}
3044 .if defined(ONLY_FOR_ARCHS_REASON_${ARCH})
3045 IGNORE+= (reason: ${ONLY_FOR_ARCHS_REASON_${ARCH}})
3046 .elif defined(ONLY_FOR_ARCHS_REASON)
3047 IGNORE+= (reason: ${ONLY_FOR_ARCHS_REASON})
3050 .if defined(NOT_FOR_ARCHS_REASON_${ARCH})
3051 IGNORE+= (reason: ${NOT_FOR_ARCHS_REASON_${ARCH}})
3052 .elif defined(NOT_FOR_ARCHS_REASON)
3053 IGNORE+= (reason: ${NOT_FOR_ARCHS_REASON})
3058 # Check the user interaction and legal issues
3059 .if !defined(NO_IGNORE)
3060 .if (defined(IS_INTERACTIVE) && defined(BATCH))
3061 IGNORE= is an interactive port
3062 .elif (!defined(IS_INTERACTIVE) && defined(INTERACTIVE))
3063 IGNORE= is not an interactive port
3064 .elif (defined(NO_CDROM) && defined(FOR_CDROM))
3065 IGNORE= may not be placed on a CDROM: ${NO_CDROM}
3066 .elif (defined(RESTRICTED) && defined(NO_RESTRICTED))
3067 IGNORE= is restricted: ${RESTRICTED}
3068 .elif defined(BROKEN)
3069 .if !defined(TRYBROKEN)
3070 IGNORE= is marked as broken: ${BROKEN}
3072 .elif defined(BROKEN_${ARCH})
3073 .if !defined(TRYBROKEN)
3074 IGNORE= is marked as broken on ${ARCH}: ${BROKEN_${ARCH}}
3076 .elif defined(FORBIDDEN)
3077 IGNORE= is forbidden: ${FORBIDDEN}
3080 # Define the text to be output to LEGAL
3081 .if defined(LEGAL_TEXT)
3082 LEGAL= ${LEGAL_TEXT}
3083 .elif defined(RESTRICTED)
3084 LEGAL= ${RESTRICTED}
3085 .elif defined(NO_CDROM)
3087 .elif defined(NO_PACKAGE) && ! defined(LEGAL_PACKAGE)
3088 LEGAL= ${NO_PACKAGE}
3091 .if (defined(MANUAL_PACKAGE_BUILD) && defined(PACKAGE_BUILDING))
3092 IGNORE= has to be built manually: ${MANUAL_PACKAGE_BUILD}
3098 .if defined(IGNORE_SILENT)
3099 IGNORECMD= ${DO_NADA}
3101 IGNORECMD= ${ECHO_MSG} "===> ${PKGNAME} "${IGNORE:Q}.;exit 1
3104 _TARGETS= check-sanity fetch checksum extract patch configure all build install reinstall package
3105 .if !defined(NO_STAGE)
3106 _TARGETS+= stage restage
3108 .for target in ${_TARGETS}
3109 .if !target(${target})
3112 .if defined(INSTALLS_DEPENDS)
3122 .if defined(IGNORE) || defined(NO_PACKAGE)
3123 ignorelist: package-name
3129 .if defined(IGNORE) || defined(NO_PACKAGE)
3132 @${ECHO_CMD} "${PKGNAME}|IGNORE: "${IGNORE:Q}
3134 @${ECHO_CMD} "${PKGNAME}|NO_PACKAGE: "${NO_PACKAGE:Q}
3141 ################################################################
3142 # Clean directories for ftp or CDROM.
3143 ################################################################
3145 .if !defined(LICENSE)
3147 .if defined(RESTRICTED)
3148 clean-restricted: delete-distfiles delete-package
3149 clean-restricted-list: delete-distfiles-list delete-package-list
3150 RESTRICTED_FILES?= ${_DISTFILES} ${_PATCHFILES}
3153 clean-restricted-list:
3156 .if defined(NO_CDROM)
3157 clean-for-cdrom: delete-distfiles delete-package
3158 clean-for-cdrom-list: delete-distfiles-list delete-package-list
3159 RESTRICTED_FILES?= ${_DISTFILES} ${_PATCHFILES}
3162 clean-for-cdrom-list:
3165 .endif # !defined(LICENSE)
3167 .if defined(ALL_HOOK)
3169 @cd ${.CURDIR} && ${SETENV} CURDIR=${.CURDIR} DISTNAME=${DISTNAME} \
3170 DISTDIR=${DISTDIR} WRKDIR=${WRKDIR} WRKSRC=${WRKSRC} \
3171 PATCHDIR=${PATCHDIR} SCRIPTDIR=${SCRIPTDIR} \
3172 FILESDIR=${FILESDIR} PORTSDIR=${PORTSDIR} PREFIX=${PREFIX} \
3173 DFLY_PATCHDIR=${DFLY_PATCHDIR} DFLY_FILESDIR=${DFLY_FILESDIR} \
3174 BUILD_DEPENDS="${BUILD_DEPENDS}" RUN_DEPENDS="${RUN_DEPENDS}" \
3175 CONFLICTS="${CONFLICTS}" \
3181 .if !defined(DEPENDS_TARGET)
3182 .if defined(DEPENDS_PRECLEAN)
3183 DEPENDS_TARGET= clean
3184 DEPENDS_ARGS= NOCLEANDEPENDS=yes
3187 DEPENDS_TARGET+= reinstall
3189 DEPENDS_TARGET+= install
3191 .if defined(DEPENDS_CLEAN)
3192 DEPENDS_TARGET+= clean
3193 DEPENDS_ARGS+= NOCLEANDEPENDS=yes
3197 ################################################################
3199 # Do preliminary work to detect if we need to run the config
3202 ################################################################
3203 .if ((!defined(OPTIONS_DEFINE) && !defined(OPTIONS_SINGLE) && !defined(OPTIONS_MULTI)) \
3204 && !defined(OPTIONS_GROUP) && !defined(OPTIONS_RADIO) \
3205 || defined(CONFIG_DONE_${UNIQUENAME:tu}) || \
3206 defined(PACKAGE_BUILDING) || defined(BATCH))
3210 ################################################################
3211 # The following are used to create easy dummy targets for
3212 # disabling some bit of default target behavior you don't want.
3213 # They still check to see if the target exists, and if so don't
3214 # do anything, since you might want to set this globally for a
3215 # group of ports in a Makefile.inc, but still be able to
3216 # override from an individual Makefile.
3217 ################################################################
3220 .if defined(NO_CHECKSUM) && !target(checksum)
3226 .if defined(NO_BUILD) && !target(build)
3228 @${TOUCH} ${TOUCH_FLAGS} ${BUILD_COOKIE}
3231 # Disable staging. Be non-fatal here as some scripts may just call it as a
3232 # matter of correctness in their ordering.
3233 .if defined(NO_STAGE) && !target(stage)
3235 @${ECHO_MSG} "===> This port does not yet support staging"
3239 .if defined(NO_INSTALL) && !target(do-install)
3245 .if defined(NO_PACKAGE) && !target(package)
3247 .if defined(IGNORE_SILENT)
3250 @${ECHO_MSG} "===> ${PKGNAME} may not be packaged: "${NO_PACKAGE:Q}.
3255 .if defined(NO_DESCRIBE) && !target(describe)
3260 ################################################################
3261 # More standard targets start here.
3263 # These are the body of the build/install framework. If you are
3264 # not happy with the default actions, and you can't solve it by
3265 # adding pre-* or post-* targets/scripts, override these.
3266 ################################################################
3273 .if defined(TRYBROKEN) && defined(BROKEN)
3274 buildanyway-message:
3275 @${ECHO_MSG} "Trying build of ${PKGNAME} even though it is marked BROKEN."
3279 .if defined(GNOME_OPTION_MSG) && (!defined(PACKAGE_BUILDING) || !defined(BATCH))
3280 @for m in ${GNOME_OPTION_MSG}; do \
3286 .if defined(_OPTIONS_READ)
3287 @${ECHO_MSG} "===> Found saved configuration for ${_OPTIONS_READ}"
3291 # Warn user about deprecated packages. Advisory only.
3293 .if !target(check-deprecated)
3295 .if defined(DEPRECATED)
3296 @${ECHO_MSG} "===> NOTICE:"
3298 @${ECHO_MSG} "This port is deprecated; you may wish to reconsider installing it:"
3300 @${ECHO_MSG} ${DEPRECATED:Q}.
3302 .if defined(EXPIRATION_DATE)
3303 @${ECHO_MSG} "It is scheduled to be removed on or after ${EXPIRATION_DATE}."
3309 # Check if the port is listed in the vulnerability database
3311 .if defined(WITH_PKGNG)
3312 AUDITFILE?= ${PKG_DBDIR}/vuln.xml
3313 _EXTRACT_AUDITFILE= ${CAT} "${AUDITFILE}"
3315 AUDITFILE?= /var/db/portaudit/auditfile.tbz
3316 _EXTRACT_AUDITFILE= ${TAR} -jxOf "${AUDITFILE}" auditfile
3320 .if !defined(DISABLE_VULNERABILITIES) && !defined(PACKAGE_BUILDING)
3321 @if [ -f "${AUDITFILE}" ]; then \
3322 if [ -n "${WITH_PKGNG}" ]; then \
3323 vlist=`${PKG_BIN} audit "${PKGNAME}"`; \
3324 elif [ -x "${LOCALBASE}/sbin/portaudit" ]; then \
3325 vlist=`${LOCALBASE}/sbin/portaudit -X 14 "${PKGNAME}" \
3326 2>&1 | grep -vE '^[0-9]+ problem\(s\) found.' \
3328 if [ -n "$$vlist" ]; then \
3329 vlist=`${LOCALBASE}/sbin/portaudit -X 14 "${PKGNAME}" \
3330 2>&1 | grep -vE '^[0-9]+ problem\(s\) found.' \
3334 ${ECHO_MSG} "===> portaudit database exists, however, portaudit is not installed!"; \
3336 if [ -n "$$vlist" ]; then \
3337 ${ECHO_MSG} "===> ${PKGNAME} has known vulnerabilities:"; \
3338 ${ECHO_MSG} "$$vlist"; \
3339 ${ECHO_MSG} "=> Please update your ports tree and try again."; \
3345 # set alg to any of SIZE, SHA256 (or any other checksum algorithm):
3346 DISTINFO_DATA?= if [ \( -n "${DISABLE_SIZE}" -a -n "${NO_CHECKSUM}" \) -o ! -f "${DISTINFO_FILE}" ]; then exit; fi; \
3347 DIR=${DIST_SUBDIR}; ${AWK} -v alg=$$alg -v file=$${DIR:+$$DIR/}$${file} \
3348 '$$1 == alg && $$2 == "(" file ")" {print $$4}' ${DISTINFO_FILE}
3352 .if !target(do-fetch)
3354 @${MKDIR} ${_DISTDIR}
3356 ${_MASTER_SITES_ENV} ; \
3357 for _file in ${DISTFILES}; do \
3358 file=$${_file%%:*}; \
3359 if [ $$_file = $$file ]; then \
3362 select=`${ECHO_CMD} $${_file##*:} | ${SED} -e 's/,/ /g'` ; \
3364 force_fetch=false; \
3365 filebasename=$${file##*/}; \
3366 for afile in ${FORCE_FETCH}; do \
3367 afile=$${afile##*/}; \
3368 if [ "x$$afile" = "x$$filebasename" ]; then \
3372 if [ ! -f $$file -a ! -f $$filebasename -o "$$force_fetch" = "true" ]; then \
3373 if [ -L $$file -o -L $$filebasename ]; then \
3374 ${ECHO_MSG} "=> ${_DISTDIR}/$$file is a broken symlink."; \
3375 ${ECHO_MSG} "=> Perhaps a filesystem (most likely a CD) isn't mounted?"; \
3376 ${ECHO_MSG} "=> Please correct this problem and try again."; \
3379 if [ -f ${DISTINFO_FILE} -a "x${NO_CHECKSUM}" = "x" ]; then \
3380 _sha256sum=`alg=SHA256; ${DISTINFO_DATA}`; \
3381 if [ -z "$$_sha256sum" ]; then \
3382 ${ECHO_MSG} "=> $${DIR:+$$DIR/}$$file is not in ${DISTINFO_FILE}."; \
3383 ${ECHO_MSG} "=> Either ${DISTINFO_FILE} is out of date, or"; \
3384 ${ECHO_MSG} "=> $${DIR:+$$DIR/}$$file is spelled incorrectly."; \
3388 ${ECHO_MSG} "=> $$file doesn't seem to exist in ${_DISTDIR}."; \
3389 if [ ! -w ${DISTDIR} ]; then \
3390 ${ECHO_MSG} "=> ${DISTDIR} is not writable by you; cannot fetch."; \
3393 if [ ! -z "$$select" ] ; then \
3394 __MASTER_SITES_TMP= ; \
3395 for group in $$select; do \
3396 if [ ! -z \$${_MASTER_SITES_$${group}} ] ; then \
3397 eval ___MASTER_SITES_TMP="\$${_MASTER_SITES_$${group}}" ; \
3398 __MASTER_SITES_TMP="$${__MASTER_SITES_TMP} $${___MASTER_SITES_TMP}" ; \
3401 ___MASTER_SITES_TMP= ; \
3402 SORTED_MASTER_SITES_CMD_TMP="${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} $${__MASTER_SITES_TMP} | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}" ; \
3404 SORTED_MASTER_SITES_CMD_TMP="${SORTED_MASTER_SITES_DEFAULT_CMD}" ; \
3406 sites_remaining=0; \
3407 sites="`eval $$SORTED_MASTER_SITES_CMD_TMP ${_RANDOMIZE_SITES}`"; \
3408 for site in $${sites}; do \
3409 sites_remaining=$$(($${sites_remaining} + 1)); \
3411 for site in $${sites}; do \
3412 sites_remaining=$$(($${sites_remaining} - 1)); \
3413 ${ECHO_MSG} "=> Attempting to fetch $${site}$${file}"; \
3414 CKSIZE=`alg=SIZE; ${DISTINFO_DATA}`; \
3416 */*) ${MKDIR} $${file%/*}; \
3417 args="-o $${file} $${site}$${file}";; \
3418 *) args=$${site}$${file};; \
3420 if ${SETENV} ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${args} ${FETCH_AFTER_ARGS}; then \
3421 actual_size=`stat -f %z "$${file}"`; \
3422 if [ -n "${DISABLE_SIZE}" ] || [ -z "$${CKSIZE}" ] || [ $${actual_size} -eq $${CKSIZE} ]; then \
3425 ${ECHO_MSG} "=> Fetched file size mismatch (expected $${CKSIZE}, actual $${actual_size})"; \
3426 if [ $${sites_remaining} -gt 1 ]; then \
3427 ${ECHO_MSG} "=> Trying next site"; \
3428 ${RM} -f $${file}; \
3433 ${ECHO_MSG} "=> Couldn't fetch it - please try to retrieve this";\
3434 ${ECHO_MSG} "=> port manually into ${_DISTDIR} and try again."; \
3438 .if defined(PATCHFILES)
3440 ${_PATCH_SITES_ENV} ; \
3441 for _file in ${PATCHFILES}; do \
3442 file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^-:][^:]*$$//'` ; \
3443 select=`${ECHO_CMD} $${_file#$${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` ; \
3444 file=`${ECHO_CMD} $$file | ${SED} -E -e 's/:-[^:]+$$//'` ; \
3445 force_fetch=false; \
3446 filebasename=$${file##*/}; \
3447 for afile in ${FORCE_FETCH}; do \
3448 afile=$${afile##*/}; \
3449 if [ "x$$afile" = "x$$filebasename" ]; then \
3453 if [ ! -f $$file -a ! -f $$filebasename -o "$$force_fetch" = "true" ]; then \
3454 if [ -L $$file -o -L $${file##*/} ]; then \
3455 ${ECHO_MSG} "=> ${_DISTDIR}/$$file is a broken symlink."; \
3456 ${ECHO_MSG} "=> Perhaps a filesystem (most likely a CD) isn't mounted?"; \
3457 ${ECHO_MSG} "=> Please correct this problem and try again."; \
3460 ${ECHO_MSG} "=> $$file doesn't seem to exist in ${_DISTDIR}."; \
3461 if [ ! -z "$$select" ] ; then \
3462 __PATCH_SITES_TMP= ; \
3463 for group in $$select; do \
3464 if [ ! -z \$${_PATCH_SITES_$${group}} ] ; then \
3465 eval ___PATCH_SITES_TMP="\$${_PATCH_SITES_$${group}}" ; \
3466 __PATCH_SITES_TMP="$${__PATCH_SITES_TMP} $${___PATCH_SITES_TMP}" ; \
3469 ___PATCH_SITES_TMP= ; \
3470 SORTED_PATCH_SITES_CMD_TMP="${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} $${__PATCH_SITES_TMP} | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}" ; \
3472 SORTED_PATCH_SITES_CMD_TMP="${SORTED_PATCH_SITES_DEFAULT_CMD}" ; \
3474 sites_remaining=0; \
3475 sites="`eval $$SORTED_PATCH_SITES_CMD_TMP`"; \
3476 for site in $${sites}; do \
3477 sites_remaining=$$(($${sites_remaining} + 1)); \
3479 for site in $${sites}; do \
3480 sites_remaining=$$(($${sites_remaining} - 1)); \
3481 ${ECHO_MSG} "=> Attempting to fetch $${site}$${file}"; \
3482 CKSIZE=`alg=SIZE; ${DISTINFO_DATA}`; \
3484 */*) ${MKDIR} $${file%/*}; \
3485 args="-o $${file} $${site}$${file}";; \
3486 *) args=$${site}$${file};; \
3488 if ${SETENV} ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${args} ${FETCH_AFTER_ARGS}; then \
3489 actual_size=`stat -f %z "$${file}"`; \
3490 if [ -n "${DISABLE_SIZE}" ] || [ -z "$${CKSIZE}" ] || [ $${actual_size} -eq $${CKSIZE} ]; then \
3493 ${ECHO_MSG} "=> Fetched file size mismatch (expected $${CKSIZE}, actual $${actual_size})"; \
3494 if [ $${sites_remaining} -gt 1 ]; then \
3495 ${ECHO_MSG} "=> Trying next site"; \
3496 ${RM} -f $${file}; \
3501 ${ECHO_MSG} "=> Couldn't fetch it - please try to retrieve this";\
3502 ${ECHO_MSG} "=> port manually into ${_DISTDIR} and try again."; \
3511 .if !target(do-extract)
3513 @${RM} -rf ${WRKDIR}
3515 @for file in ${EXTRACT_ONLY}; do \
3516 if ! (cd ${WRKDIR} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/$$file ${EXTRACT_AFTER_ARGS});\
3521 .if !defined(EXTRACT_PRESERVE_OWNERSHIP)
3522 @if [ ${UID} = 0 ]; then \
3523 ${CHMOD} -R ug-s ${WRKDIR}; \
3524 ${CHOWN} -R 0:0 ${WRKDIR}; \
3531 .if !target(do-patch)
3533 .if defined(PATCHFILES)
3534 @${ECHO_MSG} "===> Applying distribution patches for ${PKGNAME}"
3537 patch_dist_strip () { \
3539 ${_PATCH_DIST_STRIP_CASES} \
3542 for i in ${_PATCHFILES}; do \
3543 if [ ${PATCH_DEBUG_TMP} = yes ]; then \
3544 ${ECHO_MSG} "===> Applying distribution patch $$i" ; \
3547 *.Z|*.gz) ${GZCAT} $$i ;; \
3548 *.bz2) ${BZCAT} $$i ;; \
3549 *.xz) ${XZCAT} $$i ;; \
3551 esac | ${PATCH} ${PATCH_DIST_ARGS} `patch_dist_strip $$i` ; \
3554 .if defined(EXTRA_PATCHES)
3556 for i in ${EXTRA_PATCHES}; do \
3557 ${ECHO_MSG} "===> Applying extra patch $$i" ; \
3559 *.Z|*.gz) ${GZCAT} $$i ;; \
3560 *.bz2) ${BZCAT} $$i ;; \
3561 *.xz) ${XZCAT} $$i ;; \
3563 esac | ${PATCH} ${PATCH_ARGS} ; \
3567 if [ -d ${PATCHDIR} ]; then \
3568 if [ "`${ECHO_CMD} ${PATCHDIR}/patch-*`" != "${PATCHDIR}/patch-*" ]; then \
3569 ${ECHO_MSG} "===> Applying ports patches for ${PKGNAME}" ; \
3570 PATCHES_APPLIED="" ; \
3571 for i in ${PATCHDIR}/patch-*; do \
3573 *.orig|*.rej|*~|*,v) \
3574 ${ECHO_MSG} "===> Ignoring patchfile $$i" ; \
3577 if [ ${PATCH_DEBUG_TMP} = yes ]; then \
3578 ${ECHO_MSG} "===> Applying ${OPSYS} patch $$i" ; \
3580 if ${PATCH} ${PATCH_ARGS} < $$i ; then \
3581 PATCHES_APPLIED="$$PATCHES_APPLIED $$i" ; \
3583 ${ECHO_MSG} `${ECHO_CMD} "=> Patch $$i failed to apply cleanly." | ${SED} "s|${PATCHDIR}/||"` ; \
3584 if [ x"$$PATCHES_APPLIED" != x"" -a ${PATCH_SILENT} != "yes" ]; then \
3585 ${ECHO_MSG} `${ECHO_CMD} "=> Patch(es) $$PATCHES_APPLIED applied cleanly." | ${SED} "s|${PATCHDIR}/||g"` ; \
3594 @set -e ; if [ -d ${DFLY_PATCHDIR} ]; then \
3595 if [ "`${ECHO_CMD} ${DFLY_PATCHDIR}/patch-*`" != "${DFLY_PATCHDIR}/patch-*" ]; then \
3596 ${ECHO_MSG} "===> Applying ${OPSYS} patches for ${PKGNAME}" ; \
3597 PATCHES_APPLIED="" ; \
3598 for i in ${DFLY_PATCHDIR}/patch-*; do \
3600 *.orig|*.rej|*~|*,v) \
3601 ${ECHO_MSG} "===> Ignoring patchfile $$i" ; \
3604 if [ ${PATCH_DEBUG_TMP} = yes ]; then \
3605 ${ECHO_MSG} "===> Applying ${OPSYS} patch $$i" ; \
3607 if ${PATCH} ${PATCH_ARGS} < $$i ; then \
3608 PATCHES_APPLIED="$$PATCHES_APPLIED $$i" ; \
3610 ${ECHO_MSG} `${ECHO_CMD} "=> Patch $$i failed to apply cleanly." | ${SED} "s|${DFLY_PATCHDIR}/||"` ; \
3611 if [ x"$$PATCHES_APPLIED" != x"" ]; then \
3612 ${ECHO_MSG} `${ECHO_CMD} "=> Patch(es) $$PATCHES_APPLIED applied cleanly." | ${SED} "s|${DFLY_PATCHDIR}/||g"` ; \
3623 .if !target(run-autotools-fixup)
3624 run-autotools-fixup:
3625 # Work around an issue where FreeBSD 10.0 is detected as FreeBSD 1.x.
3626 .if ${OSVERSION} >= 1000000 && !defined(WITHOUT_FBSD10_FIX)
3627 -@for f in `${FIND} ${WRKDIR} -type f \( -name config.libpath -o \
3628 -name config.rpath -o -name configure -o -name libtool.m4 -o \
3629 -name ltconfig -o -name libtool -o -name aclocal.m4 -o \
3630 -name acinclude.m4 \)` ; do \
3631 ${SED} -i.fbsd10bak \
3632 -e 's|freebsd1\*)|freebsd1.\*)|g' \
3633 -e 's|freebsd\[12\]\*)|freebsd[12].*)|g' \
3634 -e 's|freebsd\[123\]\*)|freebsd[123].*)|g' \
3635 -e 's|freebsd\[\[12\]\]\*)|freebsd[[12]].*)|g' \
3636 -e 's|freebsd\[\[123\]\]\*)|freebsd[[123]].*)|g' \
3638 ${TOUCH} ${TOUCH_FLAGS} -mr $${f}.fbsd10bak $${f} ; \
3639 ${RM} -f $${f}.fbsd10bak ; \
3640 ${ECHO_MSG} "===> FreeBSD 10 autotools fix applied to $${f}"; \
3647 .if !target(do-configure)
3649 @if [ -f ${SCRIPTDIR}/configure ]; then \
3650 cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \
3651 ${SCRIPTDIR}/configure; \
3653 .if defined(GNU_CONFIGURE)
3654 @CONFIG_GUESS_DIRS=$$(${FIND} ${WRKDIR} -name config.guess -o -name config.sub \
3655 | ${XARGS} -n 1 ${DIRNAME}); \
3656 for _D in $${CONFIG_GUESS_DIRS}; do \
3657 ${CP} -f ${TEMPLATES}/config.guess $${_D}/config.guess; \
3658 ${CHMOD} a+rx $${_D}/config.guess; \
3659 ${CP} -f ${TEMPLATES}/config.sub $${_D}/config.sub; \
3660 ${CHMOD} a+rx $${_D}/config.sub; \
3663 .if defined(HAS_CONFIGURE)
3664 @(cd ${CONFIGURE_WRKSRC} && \
3665 ${SET_LATE_CONFIGURE_ARGS} \
3666 if ! ${SETENV} CC="${CC}" CPP="${CPP}" CXX="${CXX}" \
3667 CFLAGS="${CFLAGS}" CPPFLAGS="${CPPFLAGS}" CXXFLAGS="${CXXFLAGS}" \
3668 LDFLAGS="${LDFLAGS}" \
3669 INSTALL="/usr/bin/install -c ${_BINOWNGRP}" \
3670 INSTALL_DATA="${INSTALL_DATA}" \
3671 INSTALL_LIB="${INSTALL_LIB}" \
3672 INSTALL_PROGRAM="${INSTALL_PROGRAM}" \
3673 INSTALL_SCRIPT="${INSTALL_SCRIPT}" \
3674 ${CONFIGURE_ENV} ./${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS}; then \
3675 ${ECHO_MSG} "===> Script \"${CONFIGURE_SCRIPT}\" failed unexpectedly."; \
3676 (${ECHO_CMD} ${CONFIGURE_FAIL_MESSAGE}) | ${FMT} 75 79 ; \
3683 # XXX: ${MAKE_ARGS:N${DESTDIRNAME}=*} would be easier but it is not valid with the old fmake
3684 .if !target(do-build)
3686 @(cd ${BUILD_WRKSRC}; if ! ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_FLAGS} ${MAKEFILE} ${_MAKE_JOBS} ${MAKE_ARGS:C,^${DESTDIRNAME}=.*,,g} ${ALL_TARGET}; then \
3687 if [ -n "${BUILD_FAIL_MESSAGE}" ] ; then \
3688 ${ECHO_MSG} "===> Compilation failed unexpectedly."; \
3689 (${ECHO_CMD} "${BUILD_FAIL_MESSAGE}") | ${FMT} 75 79 ; \
3697 .if !target(check-conflicts)
3698 check-conflicts: check-build-conflicts check-install-conflicts
3701 .if !target(check-build-conflicts)
3702 check-build-conflicts:
3703 .if ( defined(CONFLICTS) || defined(CONFLICTS_BUILD) ) && !defined(DISABLE_CONFLICTS) && !defined(DEFER_CONFLICTS_CHECK)
3704 @found=`${PKG_INFO} -I ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_BUILD:C/.+/'&'/} 2>/dev/null | ${AWK} '{print $$1}'`; \
3706 for entry in $${found}; do \
3707 if ${PKG_INFO} -e $${entry} ; then \
3708 prfx=`${PKG_INFO} -q -p "$${entry}" 2> /dev/null | ${SED} -ne '1s/^@cwd //p'`; \
3709 orgn=`${PKG_INFO} -q -o "$${entry}" 2> /dev/null`; \
3710 if [ "/${PREFIX}" = "/$${prfx}" -a "/${PKGORIGIN}" != "/$${orgn}" ]; then \
3711 conflicts_with="$${conflicts_with} $${entry}"; \
3715 if [ -n "$${conflicts_with}" ]; then \
3717 ${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \
3718 for entry in $${conflicts_with}; do \
3719 ${ECHO_MSG} " $${entry}"; \
3722 ${ECHO_MSG} " They will not build together."; \
3723 ${ECHO_MSG} " Please remove them first with pkg_delete(1)."; \
3729 .if !target(identify-install-conflicts)
3730 identify-install-conflicts:
3731 .if ( defined(CONFLICTS) || defined(CONFLICTS_INSTALL) ) && !defined(DISABLE_CONFLICTS)
3732 @found=`${PKG_INFO} -I ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_INSTALL:C/.+/'&'/} 2>/dev/null | ${AWK} '{print $$1}'`; \
3734 for entry in $${found}; do \
3735 if ${PKG_INFO} -e $${entry} ; then \
3736 prfx=`${PKG_INFO} -q -p "$${entry}" 2> /dev/null | ${SED} -ne '1s/^@cwd //p'`; \
3737 orgn=`${PKG_INFO} -q -o "$${entry}" 2> /dev/null`; \
3738 if [ "/${PREFIX}" = "/$${prfx}" -a "/${PKGORIGIN}" != "/$${orgn}" ]; then \
3739 conflicts_with="$${conflicts_with} $${entry}"; \
3743 if [ -n "$${conflicts_with}" ]; then \
3745 ${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \
3746 for entry in $${conflicts_with}; do \
3747 ${ECHO_MSG} " $${entry}"; \
3750 ${ECHO_MSG} " They install files into the same place."; \
3751 ${ECHO_MSG} " You may want to stop build with Ctrl + C."; \
3757 .if !target(check-install-conflicts)
3758 check-install-conflicts:
3759 .if ( defined(CONFLICTS) || defined(CONFLICTS_INSTALL) || ( defined(CONFLICTS_BUILD) && defined(DEFER_CONFLICTS_CHECK) ) ) && !defined(DISABLE_CONFLICTS)
3760 .if defined(DEFER_CONFLICTS_CHECK)
3761 @found=`${PKG_INFO} -I ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_BUILD:C/.+/'&'/} ${CONFLICTS_INSTALL:C/.+/'&'/} 2>/dev/null | ${AWK} '{print $$1}'`; \
3763 for entry in $${found}; do \
3764 if ${PKG_INFO} -e $${entry} ; then \
3765 prfx=`${PKG_INFO} -q -p "$${entry}" 2> /dev/null | ${SED} -ne '1s/^@cwd //p'`; \
3766 orgn=`${PKG_INFO} -q -o "$${entry}" 2> /dev/null`; \
3767 if [ "/${PREFIX}" = "/$${prfx}" -a "/${PKGORIGIN}" != "/$${orgn}" ]; then \
3768 conflicts_with="$${conflicts_with} $${entry}"; \
3772 if [ -n "$${conflicts_with}" ]; then \
3774 ${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \
3775 for entry in $${conflicts_with}; do \
3776 ${ECHO_MSG} " $${entry}"; \
3779 ${ECHO_MSG} " Please remove them first with pkg_delete(1)."; \
3783 @found=`${PKG_INFO} -I ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_INSTALL:C/.+/'&'/} 2>/dev/null | ${AWK} '{print $$1}'`; \
3785 for entry in $${found}; do \
3786 if ${PKG_INFO} -e $${entry} ; then \
3787 prfx=`${PKG_INFO} -q -p "$${entry}" 2> /dev/null | ${SED} -ne '1s/^@cwd //p'`; \
3788 orgn=`${PKG_INFO} -q -o "$${entry}" 2> /dev/null`; \
3789 if [ "/${PREFIX}" = "/$${prfx}" -a "/${PKGORIGIN}" != "/$${orgn}" ]; then \
3790 conflicts_with="$${conflicts_with} $${entry}"; \
3794 if [ -n "$${conflicts_with}" ]; then \
3796 ${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \
3797 for entry in $${conflicts_with}; do \
3798 ${ECHO_MSG} " $${entry}"; \
3801 ${ECHO_MSG} " They install files into the same place."; \
3802 ${ECHO_MSG} " Please remove them first with pkg_delete(1)."; \
3805 .endif # defined(DEFER_CONFLICTS_CHECK)
3811 .if !target(do-install)
3813 @(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET})
3818 .if !target(do-package)
3819 do-package: ${TMPPLIST}
3820 @if [ -d ${PACKAGES} ]; then \
3821 if [ ! -d ${PKGREPOSITORY} ]; then \
3822 if ! ${MKDIR} ${PKGREPOSITORY}; then \
3823 ${ECHO_MSG} "=> Can't create directory ${PKGREPOSITORY}."; \
3828 .if defined(NO_STAGE)
3829 @if ${PKG_CMD} -b ${PKGNAME} ${PKGFILE}; then \
3830 if [ -d ${PACKAGES} ]; then \
3831 cd ${.CURDIR} && eval ${MAKE} package-links; \
3834 cd ${.CURDIR} && eval ${MAKE} delete-package; \
3838 @_LATE_PKG_ARGS=""; \
3839 if [ -f ${PKGINSTALL} ]; then \
3840 _LATE_PKG_ARGS="$${_LATE_PKG_ARGS} -i ${PKGINSTALL}"; \
3842 if [ -f ${PKGDEINSTALL} ]; then \
3843 _LATE_PKG_ARGS="$${_LATE_PKG_ARGS} -k ${PKGDEINSTALL}"; \
3845 if [ -f ${PKGREQ} ]; then \
3846 _LATE_PKG_ARGS="$${_LATE_PKG_ARGS} -r ${PKGREQ}"; \
3848 if [ -f ${PKGMESSAGE} ]; then \
3849 _LATE_PKG_ARGS="$${_LATE_PKG_ARGS} -D ${PKGMESSAGE}"; \
3851 ${MKDIR} ${WRKDIR}/pkg; \
3852 if ${PKG_CMD} -S ${STAGEDIR} ${PKG_ARGS} ${WRKDIR}/pkg/${PKGNAME}${PKG_SUFX}; then \
3853 if [ -d ${PKGREPOSITORY} -a -w ${PKGREPOSITORY} ]; then \
3854 ${LN} -f ${WRKDIR}/pkg/${PKGNAME}${PKG_SUFX} ${PKGFILE} 2>/dev/null || \
3855 ${CP} -af ${WRKDIR}/pkg/${PKGNAME}${PKG_SUFX} ${PKGFILE}; \
3856 cd ${.CURDIR} && eval ${MAKE} package-links; \
3859 cd ${.CURDIR} && eval ${MAKE} delete-package; \
3865 # Some support rules for do-package
3867 .if !target(package-links)
3868 package-links: delete-package-links
3869 @for cat in ${CATEGORIES}; do \
3870 if [ ! -d ${PACKAGES}/$$cat ]; then \
3871 if ! ${MKDIR} ${PACKAGES}/$$cat; then \
3872 ${ECHO_MSG} "=> Can't create directory ${PACKAGES}/$$cat."; \
3876 ${LN} -sf `${ECHO_CMD} $$cat | ${SED} -e 'sa[^/]*a..ag'`/${PKGREPOSITORYSUBDIR}/${PKGNAME}${PKG_SUFX} ${PACKAGES}/$$cat; \
3878 .if !defined(NO_LATEST_LINK)
3879 @if [ ! -d ${PKGLATESTREPOSITORY} ]; then \
3880 if ! ${MKDIR} ${PKGLATESTREPOSITORY}; then \
3881 ${ECHO_MSG} "=> Can't create directory ${PKGLATESTREPOSITORY}."; \
3885 @${LN} -s ../${PKGREPOSITORYSUBDIR}/${PKGNAME}${PKG_SUFX} ${PKGLATESTFILE}
3889 .if !target(delete-package-links)
3890 delete-package-links:
3891 @for cat in ${CATEGORIES}; do \
3892 ${RM} -f ${PACKAGES}/$$cat/${PKGNAME}${PKG_SUFX}; \
3894 .if !defined(NO_LATEST_LINK)
3895 @${RM} -f ${PKGLATESTFILE}
3899 .if !target(delete-package)
3900 delete-package: delete-package-links
3901 . if defined(NO_STAGE)
3902 @${RM} -f ${PKGFILE}
3904 # When staging, the package may only be in the workdir if not root
3905 @${RM} -f ${PKGFILE} ${WRKDIR}/pkg/${PKGNAME}${PKG_SUFX} 2>/dev/null || :
3909 .if !target(delete-package-links-list)
3910 delete-package-links-list:
3911 @for cat in ${CATEGORIES}; do \
3912 ${ECHO_CMD} ${RM} -f ${PACKAGES}/$$cat/${PKGNAME}${PKG_SUFX}; \
3914 .if !defined(NO_LATEST_LINK)
3915 @${ECHO_CMD} ${RM} -f ${PKGLATESTFILE}
3919 .if !target(delete-package-list)
3920 delete-package-list: delete-package-links-list
3921 @${ECHO_CMD} "[ -f ${PKGFILE} ] && (${ECHO_CMD} deleting ${PKGFILE}; ${RM} -f ${PKGFILE})"
3924 # Used if !defined(NO_STAGE) during install, or manually to install package
3925 # from local repository.
3926 .if !target(install-package)
3927 .if defined(FORCE_PKG_REGISTER)
3928 _INSTALL_PKG_ARGS= -f
3930 .if defined(INSTALLS_DEPENDS) && defined(WITH_PKGNG)
3931 _INSTALL_PKG_ARGS+= -A
3934 @if [ -f "${WRKDIR}/pkg/${PKGNAME}${PKG_SUFX}" ]; then \
3935 _pkgfile="${WRKDIR}/pkg/${PKGNAME}${PKG_SUFX}"; \
3937 _pkgfile="${PKGFILE}"; \
3939 ${PKG_ADD} ${_INSTALL_PKG_ARGS} $${_pkgfile}
3943 # Utility targets follow
3945 .if !target(check-already-installed)
3946 .if !defined(NO_PKG_REGISTER) && !defined(FORCE_PKG_REGISTER)
3947 check-already-installed: ${TMPPLIST_SORT}
3948 @${ECHO_MSG} "===> Checking if ${PKGORIGIN} already installed"; \
3949 ${MKDIR} ${PKG_DBDIR}; \
3950 already_installed=`${PKG_INFO} -q -O ${PKGORIGIN}`; \
3951 if [ -n "$${already_installed}" ]; then \
3952 for p in $${already_installed}; do \
3953 prfx=`${PKG_INFO} -q -p $${p} 2> /dev/null | ${SED} -ne '1s|^@cwd ||p'`; \
3954 if [ "x${PREFIX}" = "x$${prfx}" ]; then \
3955 df=`${PKG_INFO} -q -f $${p} 2> /dev/null | ${GREP} -v "^@" | ${SORT} -u | ${COMM} -12 - ${TMPPLIST_SORT}`; \
3956 if [ -n "$${df}" ]; then \
3957 found_package=$${p}; \
3963 if [ -d ${PKG_DBDIR}/${PKGNAME} -o -n "$${found_package}" ]; then \
3964 if [ -d ${PKG_DBDIR}/${PKGNAME} ]; then \
3965 ${ECHO_CMD} "===> ${PKGNAME} is already installed"; \
3967 ${ECHO_CMD} "===> An older version of ${PKGORIGIN} is already installed ($${found_package})"; \
3969 ${ECHO_MSG} " You may wish to \`\`make deinstall'' and install this port again"; \
3970 ${ECHO_MSG} " by \`\`make reinstall'' to upgrade it properly."; \
3971 ${ECHO_MSG} " If you really wish to overwrite the old port of ${PKGORIGIN}"; \
3972 ${ECHO_MSG} " without deleting it first, set the variable \"FORCE_PKG_REGISTER\""; \
3973 ${ECHO_MSG} " in your environment or the \"make install\" command line."; \
3979 .if !target(check-umask)
3981 @if [ `${SH} -c umask` != 0022 ]; then \
3982 ${ECHO_MSG} "===> Warning: your umask is \"`${SH} -c umask`"\".; \
3983 ${ECHO_MSG} " If this is not desired, set it to an appropriate value"; \
3984 ${ECHO_MSG} " and install this port again by \`\`make reinstall''."; \
3988 .if !target(install-mtree)
3991 @if [ ${UID} != 0 ]; then \
3992 if [ -w ${PREFIX}/ ]; then \
3993 ${ECHO_MSG} "Warning: not superuser, you may get some errors during installation."; \
3995 ${ECHO_MSG} "Error: ${PREFIX}/ not writable."; \
3999 .if !defined(NO_MTREE)
4000 @if [ ${UID} = 0 ]; then \
4001 if [ ! -f ${MTREE_FILE} ]; then \
4002 ${ECHO_MSG} "Error: mtree file \"${MTREE_FILE}\" is missing."; \
4003 ${ECHO_MSG} "Copy it from a suitable location (e.g., ${SRC_BASE}/etc/mtree) and try again."; \
4006 ${MTREE_CMD} ${MTREE_ARGS} ${PREFIX}/ >/dev/null; \
4007 if [ ${PREFIX} = ${LOCALBASE} -a "${MTREE_FILE_DEFAULT}" = "yes" ]; then \
4008 cd ${PREFIX}/share/nls; \
4009 for link in POSIX en_US.US-ASCII; \
4011 if [ x"`${READLINK_CMD} $${link}`" != x"C" ]; \
4013 ${LN} -shf C $${link}; \
4019 ${ECHO_MSG} "Warning: not superuser, can't run mtree."; \
4020 ${ECHO_MSG} "You may want to become root and try again to ensure correct permissions."; \
4025 .if !target(install-ldconfig-file)
4026 install-ldconfig-file:
4027 .if defined(USE_LDCONFIG) || defined(USE_LDCONFIG32)
4028 .if defined(USE_LDCONFIG)
4029 .if defined(USE_LINUX_PREFIX)
4030 .if defined(NO_STAGE)
4031 @${ECHO_MSG} "===> Running linux ldconfig"
4035 .if defined(NO_STAGE)
4036 .if !defined(INSTALL_AS_USER)
4037 @${ECHO_MSG} "===> Running ldconfig"
4038 ${LDCONFIG} -m ${USE_LDCONFIG}
4040 @${ECHO_MSG} "===> Running ldconfig (errors are ignored)"
4041 -${LDCONFIG} -m ${USE_LDCONFIG}
4044 .if ${USE_LDCONFIG} != "${PREFIX}/lib" && !defined(INSTALL_AS_USER)
4045 @${ECHO_MSG} "===> Installing ldconfig configuration file"
4046 .if defined(NO_LDCONFIG_MTREE)
4047 @${MKDIR} ${STAGEDIR}${PREFIX}/${LDCONFIG_DIR}
4049 @${ECHO_CMD} ${USE_LDCONFIG} | ${TR} ' ' '\n' \
4050 > ${STAGEDIR}${PREFIX}/${LDCONFIG_DIR}/${UNIQUENAME}
4051 @${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST}
4052 @${ECHO_CMD} ${LDCONFIG_DIR}/${UNIQUENAME} >> ${TMPPLIST}
4053 .if defined(NO_LDCONFIG_MTREE)
4054 @${ECHO_CMD} "@unexec rmdir ${LDCONFIG_DIR} >/dev/null 2>&1 || true" >> ${TMPPLIST}
4059 .if defined(USE_LDCONFIG32)
4060 .if defined(NO_STAGE)
4061 .if !defined(INSTALL_AS_USER)
4062 @${ECHO_MSG} "===> Running ldconfig"
4063 ${LDCONFIG} -32 -m ${USE_LDCONFIG32}
4065 @${ECHO_MSG} "===> Running ldconfig (errors are ignored)"
4066 -${LDCONFIG} -32 -m ${USE_LDCONFIG32}
4069 .if !defined(INSTALL_AS_USER)
4070 @${ECHO_MSG} "===> Installing 32-bit ldconfig configuration file"
4071 .if defined(NO_LDCONFIG_MTREE)
4072 @${MKDIR} ${STAGEDIR}${PREFIX}/${LDCONFIG_32DIR}
4074 @${ECHO_CMD} ${USE_LDCONFIG32} | ${TR} ' ' '\n' \
4075 > ${STAGEDIR}${PREFIX}/${LDCONFIG32_DIR}/${UNIQUENAME}
4076 @${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST}
4077 @${ECHO_CMD} ${LDCONFIG32_DIR}/${UNIQUENAME} >> ${TMPPLIST}
4078 .if defined(NO_LDCONFIG_MTREE)
4079 @${ECHO_CMD} "@unexec rmdir ${LDCONFIG32_DIR} >/dev/null 2>&1" >> ${TMPPLIST}
4083 .if defined(INSTALLS_SHLIB)
4084 @${ECHO_MSG} "INSTALLS_SHLIB is deprecated. Use USE_LDCONFIG instead."
4089 .if !target(create-users-groups)
4090 .if defined(GROUPS) || defined(USERS)
4091 .if defined(WITH_PKGNG)
4092 _UG_OUTPUT= ${WRKDIR}/users-groups.sh
4093 PKGPREINSTALL+= ${_UG_OUTPUT}
4095 _UG_OUTPUT= /dev/null
4098 .if defined(GROUPS) || defined(USERS)
4099 create-users-groups:
4101 .for _file in ${GID_FILES}
4102 .if !exists(${_file})
4103 @${ECHO_CMD} "** ${_file} doesn't exist. Exiting."; exit 1
4106 .if defined(WITH_PKGNG)
4107 @${RM} -f ${_UG_OUTPUT} || ${TRUE}
4109 @${ECHO_MSG} "===> Creating users and/or groups."
4110 .if defined(WITH_PKGNG)
4111 @${ECHO_CMD} "echo \"===> Creating users and/or groups.\"" >> ${_UG_OUTPUT}
4113 @${ECHO_CMD} "@exec echo \"===> Creating users and/or groups.\"" >> ${TMPPLIST}
4115 .for _group in ${GROUPS}
4117 @if ! ${GREP} -h ^${_group}: ${GID_FILES} >/dev/null 2>&1; then \
4118 ${ECHO_CMD} "** Cannot find any information about group \`${_group}' in ${GID_FILES}."; \
4121 @IFS=":"; ${GREP} -h ^${_group}: ${GID_FILES} | head -n 1 | while read group foo gid members; do \
4122 gid=$$(($$gid+${GID_OFFSET})); \
4123 if [ "${NO_STAGE}" = "yes" ]; then \
4124 if ! ${PW} groupshow $$group >/dev/null 2>&1; then \
4125 ${ECHO_MSG} "Creating group \`$$group' with gid \`$$gid'."; \
4126 ${PW} groupadd $$group -g $$gid; \
4128 ${ECHO_MSG} "Using existing group \`$$group'."; \
4131 if [ -z "${WITH_PKGNG}" ]; then \
4132 ${ECHO_CMD} "@exec if ! ${PW} groupshow $$group >/dev/null 2>&1; then \
4133 echo \"Creating group '$$group' with gid '$$gid'.\"; \
4134 ${PW} groupadd $$group -g $$gid; else echo \"Using existing group '$$group'.\"; fi" >> ${TMPPLIST}; \
4136 ${ECHO_CMD} -e "if ! ${PW} groupshow $$group >/dev/null 2>&1; then \n \
4137 echo \"Creating group '$$group' with gid '$$gid'.\" \n \
4138 ${PW} groupadd $$group -g $$gid; else echo \"Using existing group '$$group'.\"\nfi" >> ${_UG_OUTPUT}; \
4144 .for _file in ${UID_FILES}
4145 .if !exists(${_file})
4146 @${ECHO_CMD} "** ${_file} doesn't exist. Exiting."; exit 1
4149 .for _user in ${USERS}
4150 # _bgpd:*:130:130:BGP Daemon:/var/empty:/sbin/nologin
4151 @if ! ${GREP} -h ^${_user}: ${UID_FILES} >/dev/null 2>&1; then \
4152 ${ECHO_CMD} "** Cannot find any information about user \`${_user}' in ${UID_FILES}."; \
4155 @IFS=":"; ${GREP} -h ^${_user}: ${UID_FILES} | head -n 1 | while read login passwd uid gid class change expire gecos homedir shell; do \
4156 uid=$$(($$uid+${UID_OFFSET})); \
4157 gid=$$(($$gid+${GID_OFFSET})); \
4158 class="$${class:+-L }$$class"; \
4159 homedir=$$(echo $$homedir | sed "s|^/usr/local|${PREFIX}|"); \
4160 if [ "${NO_STAGE}" = "yes" ]; then \
4161 if ! ${PW} usershow $$login >/dev/null 2>&1; then \
4162 ${ECHO_MSG} "Creating user \`$$login' with uid \`$$uid'."; \
4163 eval ${PW} useradd $$login -u $$uid -g $$gid $$class -c \"$$gecos\" -d $$homedir -s $$shell; \
4164 case $$homedir in /nonexistent|/var/empty) ;; *) ${INSTALL} -d -g $$gid -o $$uid $$homedir;; esac; \
4166 ${ECHO_MSG} "Using existing user \`$$login'."; \
4169 if [ -z "${WITH_PKGNG}" ]; then \
4170 ${ECHO_CMD} "@exec if ! ${PW} usershow $$login >/dev/null 2>&1; then \
4171 echo \"Creating user '$$login' with uid '$$uid'.\"; \
4172 ${PW} useradd $$login -u $$uid -g $$gid $$class -c \"$$gecos\" -d $$homedir -s $$shell; \
4173 else echo \"Using existing user '$$login'.\"; fi" >> ${TMPPLIST}; \
4175 ${ECHO_CMD} -e "if ! ${PW} usershow $$login >/dev/null 2>&1; then \n \
4176 echo \"Creating user '$$login' with uid '$$uid'.\" \n \
4177 ${PW} useradd $$login -u $$uid -g $$gid $$class -c \"$$gecos\" -d $$homedir -s $$shell \n \
4178 else \necho \"Using existing user '$$login'.\" \nfi" >> ${_UG_OUTPUT}; \
4180 case $$homedir in /nonexistent|/var/empty) ;; *) ${ECHO_CMD} "@exec ${INSTALL} -d -g $$gid -o $$uid $$homedir" >> ${TMPPLIST};; esac; \
4184 .for _group in ${GROUPS}
4185 # mail:*:6:postfix,clamav
4186 @IFS=":"; ${GREP} -h ^${_group}: ${GID_FILES} | head -n 1 | while read group foo gid members; do \
4187 gid=$$(($$gid+${GID_OFFSET})); \
4188 IFS=","; for _login in $$members; do \
4189 for _user in ${USERS}; do \
4190 if [ "x$${_user}" = "x$${_login}" ]; then \
4191 if [ "${NO_STAGE}" = "yes" ]; then \
4192 if ! ${PW} groupshow ${_group} | ${GREP} -qw $${_login}; then \
4193 ${ECHO_MSG} "Adding user \`$${_login}' to group \`${_group}'."; \
4194 ${PW} groupmod ${_group} -m $${_login}; \
4197 if [ -z "${WITH_PKGNG}" ]; then \
4198 ${ECHO_CMD} "@exec if ! ${PW} groupshow ${_group} | ${GREP} -qw $${_login}; then \
4199 echo \"Adding user '$${_login}' to group '${_group}'.\"; \
4200 ${PW} groupmod ${_group} -m $${_login}; fi" >> ${TMPPLIST}; \
4202 ${ECHO_CMD} -e "if ! ${PW} groupshow ${_group} | ${GREP} -qw $${_login}; then \n \
4203 echo \"Adding user '$${_login}' to group '${_group}'.\" \n \
4204 ${PW} groupmod ${_group} -m $${_login} \nfi" >> ${_UG_OUTPUT}; \
4213 .for _user in ${USERS}
4214 @if [ ! ${USERS_BLACKLIST:M${_user}} ]; then \
4215 ${ECHO_CMD} "@unexec if ${PW} usershow ${_user} >/dev/null 2>&1; then \
4216 echo \"==> You should manually remove the \\\"${_user}\\\" user. \"; fi" >> ${TMPPLIST}; \
4225 # XXX Make sure the commands to create group(s)
4226 # and user(s) are the first in pkg-plist
4227 .if !target(fix-plist-sequence)
4228 fix-plist-sequence: ${TMPPLIST}
4229 .if !defined(WITH_PKGNG) && (defined(GROUPS) || defined(USERS))
4230 @${ECHO_CMD} "===> Correct pkg-plist sequence to create group(s) and user(s)"
4231 @${EGREP} -e '^@exec echo.*Creating users and' -e '^@exec.*${PW}' -e '^@exec ${INSTALL} -d -g' ${TMPPLIST} > ${TMPGUCMD}
4232 @${EGREP} -v -e '^@exec echo.*Creating users and' -e '^@exec.*${PW}' -e '^@exec ${INSTALL} -d -g' ${TMPPLIST} >> ${TMPGUCMD}
4233 @${MV} -f ${TMPGUCMD} ${TMPPLIST}
4235 .if !defined(WITH_PKGNG)
4236 @${ECHO_CMD} "@exec echo pkg_install EOL is scheduled for 2014-09-01. Please consider migrating to pkgng" >> ${TMPPLIST}
4237 @${ECHO_CMD} "@exec echo http://blogs.freebsdish.org/portmgr/2014/02/03/time-to-bid-farewell-to-the-old-pkg_-tools/" >> ${TMPPLIST}
4241 .if !defined(DISABLE_SECURITY_CHECK)
4242 .if !target(security-check)
4246 # 2. accept()/recvfrom() which indicates network listening capability
4247 # 3. insecure functions (gets/mktemp/tempnam/[XXX])
4248 # 4. startup scripts, in conjunction with 2.
4249 # 5. world-writable files/dirs
4251 -@${RM} -f ${WRKDIR}/.PLIST.setuid ${WRKDIR}/.PLIST.writable ${WRKDIR}/.PLIST.objdump; \
4252 ${AWK} -v prefix='${PREFIX}' ' \
4253 match($$0, /^@cwd /) { prefix = substr($$0, RSTART + RLENGTH); if (prefix == "/") prefix=""; next; } \
4255 /^\// { print; next; } \
4256 { print prefix "/" $$0; } \
4257 ' ${TMPPLIST} > ${WRKDIR}/.PLIST.flattened; \
4258 ${TR} '\n' '\0' < ${WRKDIR}/.PLIST.flattened \
4259 | ${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; \
4260 ${TR} '\n' '\0' < ${WRKDIR}/.PLIST.flattened \
4261 | ${XARGS} -0 -J % ${FIND} % -prune -perm -0002 \! -type l 2> /dev/null > ${WRKDIR}/.PLIST.writable; \
4262 ${TR} '\n' '\0' < ${WRKDIR}/.PLIST.flattened \
4263 | ${XARGS} -0 -J % ${FIND} % -prune ! -type l -type f -print0 2> /dev/null \
4264 | ${XARGS} -0 -n 1 ${OBJDUMP} -R 2> /dev/null > ${WRKDIR}/.PLIST.objdump; \
4266 ! ${AWK} -v audit="$${PORTS_AUDIT}" -f ${PORTSDIR}/Tools/scripts/security-check.awk \
4267 ${WRKDIR}/.PLIST.flattened ${WRKDIR}/.PLIST.objdump ${WRKDIR}/.PLIST.setuid ${WRKDIR}/.PLIST.writable; \
4269 www_site=$$(cd ${.CURDIR} && ${MAKE} www-site); \
4270 if [ ! -z "$${www_site}" ]; then \
4272 ${ECHO_MSG} " For more information, and contact details about the security"; \
4273 ${ECHO_MSG} " status of this software, see the following webpage: "; \
4274 ${ECHO_MSG} "$${www_site}"; \
4278 .else # i.e. defined(DISABLE_SECURITY_CHECK)
4280 @${ECHO_MSG} " WARNING: Security check has been disabled."
4281 .endif # !defined(DISABLE_SECURITY_CHECK)
4283 ################################################################
4284 # Skeleton targets start here
4286 # You shouldn't have to change these. Either add the pre-* or
4287 # post-* targets/scripts or redefine the do-* targets. These
4288 # targets don't do anything other than checking for cookies and
4289 # call the necessary targets/scripts.
4290 ################################################################
4293 @${ECHO_MSG} "===> Extracting for ${PKGNAME}"
4295 @${ECHO_MSG} "===> Patching for ${PKGNAME}"
4297 @${ECHO_MSG} "===> Configuring for ${PKGNAME}"
4299 @${ECHO_MSG} "===> Building for ${PKGNAME}"
4301 @${ECHO_MSG} "===> Staging for ${PKGNAME}"
4303 @${ECHO_MSG} "===> Installing for ${PKGNAME}"
4305 @${ECHO_MSG} "===> Building package for ${PKGNAME}"
4307 # Empty pre-* and post-* targets
4309 .for stage in pre post
4310 .for name in pkg check-sanity fetch extract patch configure build stage install package
4312 .if exists(${SCRIPTDIR}/${stage}-${name})
4313 .if !target(${stage}-${name}-script)
4314 ${stage}-${name}-script:
4315 @ cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \
4316 ${SCRIPTDIR}/${.TARGET:S/-script$//}
4323 .if !target(pretty-print-www-site)
4324 pretty-print-www-site:
4325 @www_site=$$(cd ${.CURDIR} && ${MAKE} www-site); \
4326 if [ -n "$${www_site}" ]; then \
4327 ${ECHO_MSG} -n " and/or visit the "; \
4328 ${ECHO_MSG} -n "<a href=\"$${www_site}\">web site</a>"; \
4329 ${ECHO_MSG} " for further information"; \
4333 ################################################################
4334 # Some more targets supplied for users' convenience
4335 ################################################################
4339 # Special target to verify patches
4341 .if !target(checkpatch)
4343 @cd ${.CURDIR} && ${MAKE} ${PATCH_SILENT} PATCH_CHECK_ONLY=yes ${_PATCH_DEP} ${_PATCH_REAL_SEQ}
4348 # Special target to re-run install
4350 .if !target(reinstall)
4352 @${RM} -f ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
4353 @cd ${.CURDIR} && DEPENDS_TARGET="${DEPENDS_TARGET}" ${MAKE} -DFORCE_PKG_REGISTER install
4356 .if !target(restage)
4358 @${RM} -rf ${STAGEDIR} ${STAGE_COOKIE} ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
4359 @cd ${.CURDIR} && ${MAKE} stage
4364 # Special target to remove installation
4366 .if !target(deinstall)
4368 .if ${UID} != 0 && !defined(INSTALL_AS_USER)
4369 @${ECHO_MSG} "===> Switching to root credentials for '${.TARGET}' target"
4371 ${SU_CMD} "${MAKE} ${.TARGET}"
4372 @${ECHO_MSG} "===> Returning to user credentials"
4374 @${ECHO_MSG} "===> Deinstalling for ${PKGORIGIN}"
4375 @found_names=`${PKG_INFO} -q -O ${PKGORIGIN}`; \
4376 for p in $${found_names}; do \
4377 check_name=`${ECHO_CMD} $${p} | ${SED} -e 's/-[^-]*$$//'`; \
4378 if [ "$${check_name}" = "${PKGBASE}" ]; then \
4379 prfx=`${PKG_INFO} -q -p $${p} 2> /dev/null | ${SED} -ne '1s|^@cwd ||p'`; \
4380 if [ "x${PREFIX}" = "x$${prfx}" ]; then \
4381 ${ECHO_MSG} "===> Deinstalling $${p}"; \
4382 ${PKG_DELETE} -f $${p}; \
4384 ${ECHO_MSG} "===> $${p} has a different PREFIX: $${prfx}, skipping"; \
4388 if [ -z "$${found_names}" ]; then \
4389 ${ECHO_MSG} "===> ${PKGBASE} not installed, skipping"; \
4391 @${RM} -f ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
4397 # Special target to remove installation of all ports of the same origin
4399 .if !target(deinstall-all)
4401 .if ${UID} != 0 && !defined(INSTALL_AS_USER)
4402 @${ECHO_MSG} "===> Switching to root credentials for '${.TARGET}' target"
4404 ${SU_CMD} "${MAKE} ${.TARGET}"
4405 @${ECHO_MSG} "===> Returning to user credentials"
4407 @${ECHO_MSG} "===> Deinstalling for ${PKGORIGIN}"
4408 @deinstall_names=`${PKG_INFO} -q -O ${PKGORIGIN}`; \
4409 for oldpkgorigin in $$(${GREP} "|${PKGORIGIN}|" ${PORTSDIR}/MOVED | ${CUT} -f 1 -d '|' | ${SORT} -u); do \
4410 deinstall_names="$${deinstall_names} $$(${PKG_INFO} -q -O $${oldpkgorigin})"; \
4412 if [ -n "$${deinstall_names}" ]; then \
4413 for d in $${deinstall_names}; do \
4414 ${ECHO_MSG} "===> Deinstalling $${d}"; \
4415 ${PKG_DELETE} -f $${d}; \
4418 ${ECHO_MSG} "===> ${PKGORIGIN} not installed, skipping"; \
4420 ${RM} -f ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
4426 .if !target(do-clean)
4428 .if !defined(NO_STAGE) && defined(NEED_ROOT) && ${UID} != 0 && !defined(INSTALL_AS_USER) && exists(${STAGE_COOKIE})
4429 @${ECHO_MSG} "===> Switching to root credentials for '${.TARGET}' target"
4431 ${SU_CMD} "${MAKE} ${.TARGET}"
4432 @${ECHO_MSG} "===> Returning to user credentials"
4434 @if [ -d ${WRKDIR} ]; then \
4435 if [ -w ${WRKDIR} ]; then \
4436 ${RM} -rf ${WRKDIR}; \
4438 ${ECHO_MSG} "===> ${WRKDIR} not writable, skipping"; \
4446 .if !defined(NOCLEANDEPENDS)
4447 @cd ${.CURDIR} && ${MAKE} limited-clean-depends
4449 @${ECHO_MSG} "===> Cleaning for ${PKGNAME}"
4450 .if target(pre-clean)
4451 @cd ${.CURDIR} && ${MAKE} pre-clean
4453 @cd ${.CURDIR} && ${MAKE} do-clean
4454 .if target(post-clean)
4455 @cd ${.CURDIR} && ${MAKE} post-clean
4459 .if !target(pre-distclean)
4464 .if !target(distclean)
4465 distclean: pre-distclean clean
4466 @cd ${.CURDIR} && ${MAKE} delete-distfiles RESTRICTED_FILES="${_DISTFILES} ${_PATCHFILES}"
4469 .if !target(delete-distfiles)
4471 @${ECHO_MSG} "===> Deleting distfiles for ${PKGNAME}"
4472 @(if [ "X${RESTRICTED_FILES}" != "X" -a -d ${_DISTDIR} ]; then \
4474 for file in ${RESTRICTED_FILES}; do \
4475 ${RM} -f $${file}; \
4477 if [ "$${dir}" != "$${file}" ]; then \
4478 ${RMDIR} -p $${dir} >/dev/null 2>&1 || :; \
4482 .if defined(DIST_SUBDIR)
4483 -@${RMDIR} ${_DISTDIR} >/dev/null 2>&1 || ${TRUE}
4487 .if !target(delete-distfiles-list)
4488 delete-distfiles-list:
4489 @${ECHO_CMD} "# ${PKGNAME}"
4490 @if [ "X${RESTRICTED_FILES}" != "X" ]; then \
4491 for file in ${RESTRICTED_FILES}; do \
4492 ${ECHO_CMD} "[ -f ${_DISTDIR}/$$file ] && (${ECHO_CMD} deleting ${_DISTDIR}/$$file; ${RM} -f ${_DISTDIR}/$$file)"; \
4494 if [ "$${dir}" != "$${file}" ]; then \
4495 ${ECHO_CMD} "(cd ${_DISTDIR} && ${RMDIR} -p $${dir} 2>/dev/null)"; \
4499 .if defined(DIST_SUBDIR)
4500 @${ECHO_CMD} "${RMDIR} ${_DISTDIR} 2>/dev/null || ${TRUE}"
4504 # Prints out a list of files to fetch (useful to do a batch fetch)
4506 .if !target(fetch-list)
4508 @${MKDIR} ${_DISTDIR}
4510 ${_MASTER_SITES_ENV} ; \
4511 for _file in ${DISTFILES}; do \
4512 file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^:]+$$//'` ; \
4513 select=`${ECHO_CMD} $${_file#$${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` ; \
4514 if [ ! -f $$file -a ! -f $${file##*/} ]; then \
4515 if [ ! -z "$$select" ] ; then \
4516 __MASTER_SITES_TMP= ; \
4517 for group in $$select; do \
4518 if [ ! -z \$${_MASTER_SITES_$${group}} ] ; then \
4519 eval ___MASTER_SITES_TMP=\$${_MASTER_SITES_$${group}} ; \
4520 __MASTER_SITES_TMP="$${__MASTER_SITES_TMP} $${___MASTER_SITES_TMP}" ; \
4523 ___MASTER_SITES_TMP= ; \
4524 SORTED_MASTER_SITES_CMD_TMP="${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} $${__MASTER_SITES_TMP} | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}" ; \
4526 SORTED_MASTER_SITES_CMD_TMP="${SORTED_MASTER_SITES_DEFAULT_CMD}" ; \
4528 for site in `eval $$SORTED_MASTER_SITES_CMD_TMP ${_RANDOMIZE_SITES}`; do \
4529 if [ ! -z "`${ECHO_CMD} ${NOFETCHFILES} | ${GREP} -w $${file}`" ]; then \
4530 if [ -z "`${ECHO_CMD} ${MASTER_SITE_OVERRIDE} | ${GREP} -w $${site}`" ]; then \
4534 DIR=${DIST_SUBDIR};\
4535 CKSIZE=`alg=SIZE; ${DISTINFO_DATA}`; \
4537 */*) args="-o $${file} $${site}$${file}";; \
4538 *) args=$${site}$${file};; \
4540 ${ECHO_CMD} -n ${SETENV} ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${args} "${FETCH_AFTER_ARGS}" '|| ' ; \
4542 ${ECHO_CMD} "${ECHO_CMD} $${file} not fetched" ; \
4545 .if defined(PATCHFILES)
4547 ${_PATCH_SITES_ENV} ; \
4548 for _file in ${PATCHFILES}; do \
4549 file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^-:][^:]*$$//'` ; \
4550 select=`${ECHO_CMD} $${_file#$${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` ; \
4551 file=`${ECHO_CMD} $$file | ${SED} -E -e 's/:-[^:]+$$//'` ; \
4552 if [ ! -f $$file -a ! -f $${file##*/} ]; then \
4553 if [ ! -z "$$select" ] ; then \
4554 __PATCH_SITES_TMP= ; \
4555 for group in $$select; do \
4556 if [ ! -z \$${_PATCH_SITES_$${group}} ] ; then \
4557 eval ___PATCH_SITES_TMP=\$${_PATCH_SITES_$${group}} ; \
4558 __PATCH_SITES_TMP="$${__PATCH_SITES_TMP} $${___PATCH_SITES_TMP}" ; \
4561 ___PATCH_SITES_TMP= ; \
4562 SORTED_PATCH_SITES_CMD_TMP="${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} $${__PATCH_SITES_TMP} | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}" ; \
4564 SORTED_PATCH_SITES_CMD_TMP="${SORTED_PATCH_SITES_DEFAULT_CMD}" ; \
4566 for site in `eval $$SORTED_PATCH_SITES_CMD_TMP ${_RANDOMIZE_SITES}`; do \
4567 CKSIZE=`alg=SIZE; ${DISTINFO_DATA}`; \
4569 */*) args="-o $${file} $${site}$${file}";; \
4570 *) args=$${site}$${file};; \
4572 ${ECHO_CMD} -n ${SETENV} ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${args} "${FETCH_AFTER_ARGS}" '|| ' ; \
4574 ${ECHO_CMD} "${ECHO_CMD} $${file} not fetched" ; \
4580 .if !target(fetch-url-list-int)
4582 @${MKDIR} ${_DISTDIR}
4584 ${_MASTER_SITES_ENV}; \
4585 for _file in ${DISTFILES}; do \
4586 file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^:]+$$//'` ; \
4587 fileptn=`${ECHO_CMD} $$file | ${SED} 's|/|\\\\/|g;s/\./\\\\./g;s/\+/\\\\+/g;s/\?/\\\\?/g'` ; \
4588 select=`${ECHO_CMD} $${_file#$${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` ; \
4589 if [ ! -z "${LISTALL}" -o ! -f $$file -a ! -f $${file##*/} ]; then \
4590 if [ ! -z "$$select" ] ; then \
4591 __MASTER_SITES_TMP= ; \
4592 for group in $$select; do \
4593 if [ ! -z \$${_MASTER_SITES_$${group}} ] ; then \
4594 eval ___MASTER_SITES_TMP=\$${_MASTER_SITES_$${group}} ; \
4595 __MASTER_SITES_TMP="$${__MASTER_SITES_TMP} $${___MASTER_SITES_TMP}" ; \
4598 ___MASTER_SITES_TMP= ; \
4599 SORTED_MASTER_SITES_CMD_TMP="${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} $${__MASTER_SITES_TMP} | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}" ; \
4601 SORTED_MASTER_SITES_CMD_TMP="${SORTED_MASTER_SITES_DEFAULT_CMD}" ; \
4603 for site in `eval $$SORTED_MASTER_SITES_CMD_TMP ${_RANDOMIZE_SITES}`; do \
4605 */*) args="-o $${file} $${site}$${file}";; \
4606 *) args=$${site}$${file};; \
4608 ${ECHO_CMD} $${args} ; \
4612 .if defined(PATCHFILES)
4614 ${_PATCH_SITES_ENV} ; \
4615 for _file in ${PATCHFILES}; do \
4616 file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^-:][^:]*$$//'` ; \
4617 select=`${ECHO_CMD} $${_file#$${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` ; \
4618 file=`${ECHO_CMD} $$file | ${SED} -E -e 's/:-[^:]+$$//'` ; \
4619 fileptn=`${ECHO_CMD} $$file | ${SED} 's|/|\\\\/|g;s/\./\\\\./g;s/\+/\\\\+/g;s/\?/\\\\?/g'` ; \
4620 if [ ! -z "${LISTALL}" -o ! -f $$file -a ! -f $${file##*/} ]; then \
4621 if [ ! -z "$$select" ] ; then \
4622 __PATCH_SITES_TMP= ; \
4623 for group in $$select; do \
4624 if [ ! -z \$${_PATCH_SITES_$${group}} ] ; then \
4625 eval ___PATCH_SITES_TMP=\$${_PATCH_SITES_$${group}} ; \
4626 __PATCH_SITES_TMP="$${__PATCH_SITES_TMP} $${___PATCH_SITES_TMP}" ; \
4629 ___PATCH_SITES_TMP= ; \
4630 SORTED_PATCH_SITES_CMD_TMP="${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} $${__PATCH_SITES_TMP} | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}" ; \
4632 SORTED_PATCH_SITES_CMD_TMP="${SORTED_PATCH_SITES_DEFAULT_CMD}" ; \
4634 for site in `eval $$SORTED_PATCH_SITES_CMD_TMP ${_RANDOMIZE_SITES}`; do \
4636 */*) args="-o $${file} $${site}$${file}";; \
4637 *) args=$${site}$${file};; \
4639 ${ECHO_CMD} $${args} ; \
4646 .if !target(fetch-urlall-list)
4648 @cd ${.CURDIR} && LISTALL=yes ${MAKE} fetch-url-list-int
4651 .if !target(fetch-url-list)
4653 @cd ${.CURDIR} && ${MAKE} fetch-url-list-int
4656 # Generates patches.
4659 @toedit=`PATCH_WRKSRC=${PATCH_WRKSRC} \
4660 PATCHDIR=${PATCHDIR} \
4661 PATCH_LIST=${PATCHDIR}/patch-* \
4662 DIFF_ARGS=${DIFF_ARGS} \
4663 DISTORIG=${DISTORIG} \
4664 ${SH} ${PORTSDIR}/Tools/scripts/update-patches`; \
4665 case $$toedit in "");; \
4666 *) ${ECHO_CMD} -n 'edit patches: '; read i; \
4667 cd ${PATCHDIR} && $${VISUAL:-$${EDIT:-/usr/bin/vi}} $$toedit;; esac
4669 # Checksumming utilities
4671 check-checksum-algorithms:
4675 for alg in ${CHECKSUM_ALGORITHMS:tu}; do \
4676 eval alg_executable=\$$$$alg; \
4677 if [ -z "$$alg_executable" ]; then \
4678 ${ECHO_MSG} "Checksum algorithm $$alg: Couldn't find the executable."; \
4679 ${ECHO_MSG} "Set $$alg=/path/to/$$alg in /etc/make.conf and try again."; \
4687 .if !target(makesum)
4688 makesum: check-checksum-algorithms
4689 @cd ${.CURDIR} && ${MAKE} fetch NO_CHECKSUM=yes \
4691 @if [ -f ${DISTINFO_FILE} ]; then ${CAT} /dev/null > ${DISTINFO_FILE}; fi
4697 for file in ${_CKSUMFILES}; do \
4698 for alg in ${CHECKSUM_ALGORITHMS:tu}; do \
4699 eval alg_executable=\$$$$alg; \
4701 if [ $$alg_executable != "NO" ]; then \
4702 $$alg_executable $$file >> ${DISTINFO_FILE}; \
4705 ${ECHO_CMD} "SIZE ($$file) = `${STAT} -f \"%z\" $$file`" >> ${DISTINFO_FILE}; \
4708 @for file in ${_IGNOREFILES}; do \
4709 for alg in ${CHECKSUM_ALGORITHMS:tu}; do \
4710 ${ECHO_CMD} "$$alg ($$file) = IGNORE" >> ${DISTINFO_FILE}; \
4715 .if !target(checksum)
4716 checksum: fetch check-checksum-algorithms
4719 if [ -f ${DISTINFO_FILE} ]; then \
4720 cd ${DISTDIR}; OK="";\
4721 for file in ${_CKSUMFILES}; do \
4723 _file=$${file#${DIST_SUBDIR}/*}; \
4724 for alg in ${CHECKSUM_ALGORITHMS:tu}; do \
4726 eval alg_executable=\$$$$alg; \
4728 if [ $$alg_executable != "NO" ]; then \
4729 MKSUM=`$$alg_executable < $$file`; \
4730 CKSUM=`file=$$_file; ${DISTINFO_DATA}`; \
4735 if [ $$ignore = "false" -a -z "$$CKSUM" ]; then \
4736 ${ECHO_MSG} "=> No $$alg checksum recorded for $$file."; \
4740 if [ "$$CKSUM" = "IGNORE" ]; then \
4741 ${ECHO_MSG} "=> $$alg Checksum for $$file is set to IGNORE in distinfo file even though"; \
4742 ${ECHO_MSG} " the file is not in the "'$$'"{IGNOREFILES} list."; \
4747 if [ $$ignore = "false" ]; then \
4749 for chksum in $$CKSUM; do \
4750 if [ "$$chksum" = "$$MKSUM" ]; then \
4755 if [ $$match = "true" ]; then \
4756 ${ECHO_MSG} "=> $$alg Checksum OK for $$file."; \
4759 ${ECHO_MSG} "=> $$alg Checksum mismatch for $$file."; \
4760 refetchlist="$$refetchlist$$file "; \
4761 OK="$${OK:-retry}"; \
4762 [ "$${OK}" = "retry" -a ${FETCH_REGET} -gt 0 ] && ${RM} -f $${file}; \
4768 if [ $$ignored = "true" ]; then \
4769 ${ECHO_MSG} "=> No suitable checksum found for $$file."; \
4775 for file in ${_IGNOREFILES}; do \
4776 _file=$${file#${DIST_SUBDIR}/*}; \
4778 alreadymatched="false"; \
4779 for alg in ${CHECKSUM_ALGORITHMS:tu}; do \
4781 eval alg_executable=\$$$$alg; \
4783 if [ $$alg_executable != "NO" ]; then \
4784 CKSUM=`file=$$_file; ${DISTINFO_DATA}`; \
4789 if [ $$ignore = "false" ]; then \
4790 if [ -z "$$CKSUM" ]; then \
4791 ${ECHO_MSG} "=> No $$alg checksum for $$file recorded (expected IGNORE)"; \
4792 OK="$$alreadymatched"; \
4793 elif [ $$CKSUM != "IGNORE" ]; then \
4794 ${ECHO_MSG} "=> $$alg Checksum for $$file is not set to IGNORE in distinfo file even though"; \
4795 ${ECHO_MSG} " the file is in the "'$$'"{IGNOREFILES} list."; \
4799 alreadymatched="true"; \
4804 if ( [ $$ignored = "true" ]) ; then \
4805 ${ECHO_MSG} "=> No suitable checksum found for $$file."; \
4811 if [ "$${OK:=true}" = "retry" ] && [ ${FETCH_REGET} -gt 0 ]; then \
4812 ${ECHO_MSG} "===> Refetch for ${FETCH_REGET} more times files: $$refetchlist"; \
4813 if ( cd ${.CURDIR} && \
4814 ${MAKE} ${.MAKEFLAGS} FORCE_FETCH="$$refetchlist" FETCH_REGET="`${EXPR} ${FETCH_REGET} - 1`" fetch); then \
4815 if ( cd ${.CURDIR} && \
4816 ${MAKE} ${.MAKEFLAGS} FETCH_REGET="`${EXPR} ${FETCH_REGET} - 1`" checksum ); then \
4822 if [ "$$OK" != "true" -a ${FETCH_REGET} -eq 0 ]; then \
4823 ${ECHO_MSG} "===> Giving up on fetching files: $$refetchlist"; \
4824 ${ECHO_MSG} "Make sure the Makefile and distinfo file (${DISTINFO_FILE})"; \
4825 ${ECHO_MSG} "are up to date. If you are absolutely sure you want to override this"; \
4826 ${ECHO_MSG} "check, type \"make NO_CHECKSUM=yes [other args]\"."; \
4829 if [ "$$OK" != "true" ]; then \
4832 elif [ -n "${_CKSUMFILES:M*}" ]; then \
4833 ${ECHO_MSG} "=> No checksum file (${DISTINFO_FILE})."; \
4837 ################################################################
4838 # The special package-building targets
4839 # You probably won't need to touch these
4840 ################################################################
4842 # Nobody should want to override this unless PKGNAME is simply bogus.
4844 .if !target(package-name)
4846 @${ECHO_CMD} ${PKGNAME}
4849 # Build a package but don't check the package cookie
4851 .if !target(repackage)
4852 repackage: pre-repackage package
4855 @${RM} -f ${PACKAGE_COOKIE}
4858 # Build a package but don't check the cookie for installation, also don't
4859 # install package cookie
4861 .if !target(package-noinstall)
4863 .if defined(NO_STAGE)
4865 @cd ${.CURDIR} && ${MAKE} ${_PACKAGE_REAL_SEQ}
4866 @${RM} -f ${TMPPLIST}
4867 -@${RMDIR} ${WRKDIR}
4869 @cd ${.CURDIR} && ${MAKE} package
4873 ################################################################
4874 # Dependency checking
4875 ################################################################
4877 .if !target(depends)
4878 depends: pkg-depends extract-depends patch-depends lib-depends fetch-depends build-depends run-depends
4880 .if defined(ALWAYS_BUILD_DEPENDS)
4887 if [ -n "${USE_PACKAGE_DEPENDS}" -o -n "${USE_PACKAGE_DEPENDS_ONLY}" ]; then \
4888 subpkgfile=`(cd $$dir; ${MAKE} $$depends_args -V '$${PKGFILE}')`; \
4889 subpkgname=$${subpkgfile%-*} ; \
4890 subpkgname=$${subpkgname\#\#*/} ; \
4891 if [ -r "$${subpkgfile}" -a "$$target" = "${DEPENDS_TARGET}" ]; then \
4892 ${ECHO_MSG} "===> Installing existing package $${subpkgfile}"; \
4893 if [ -n "${WITH_PKGNG}" -a $${subpkgname} = "pkg" ]; then \
4894 [ -d ${WRKDIR} ] || ${MKDIR} ${WRKDIR} ; \
4895 ${TAR} -xf $${subpkgfile} -C ${WRKDIR} -s ",/.*/,,g" "*/pkg-static" ; \
4896 ${WRKDIR}/pkg-static add $${subpkgfile}; \
4897 ${RM} -f ${WRKDIR}/pkg-static; \
4899 if [ -n "${WITH_PKGNG}" ]; then \
4902 ${PKG_ADD} $${_pkg_add_a} $${subpkgfile}; \
4904 elif [ -n "${USE_PACKAGE_DEPENDS_ONLY}" -a "$${target}" = "${DEPENDS_TARGET}" ]; then \
4905 ${ECHO_MSG} "===> ${PKGNAME} depends on package: $${subpkgfile} - not found"; \
4906 ${ECHO_MSG} "===> USE_PACKAGE_DEPENDS_ONLY set - not building missing dependency from source"; \
4909 (cd $$dir; ${MAKE} -DINSTALLS_DEPENDS $$target $$depends_args) ; \
4912 (cd $$dir; ${MAKE} -DINSTALLS_DEPENDS $$target $$depends_args) ; \
4914 ${ECHO_MSG} "===> Returning to build of ${PKGNAME}";
4916 .for deptype in PKG EXTRACT PATCH FETCH BUILD RUN
4917 ${deptype:tl}-depends:
4918 .if defined(${deptype}_DEPENDS)
4919 .if !defined(NO_DEPENDS)
4920 @set -e ; for i in `${ECHO_CMD} "${${deptype}_DEPENDS}"`; do \
4922 if [ -z "$$prog" ]; then \
4923 ${ECHO_MSG} "Error: there is an empty port dependency in ${deptype}_DEPENDS."; \
4926 dir=`${ECHO_CMD} $$i | ${SED} -e 's/[^:]*://'`; \
4927 if ${EXPR} "$$dir" : '.*:' > /dev/null; then \
4928 target=$${dir##*:}; \
4930 if [ X${DEPENDS_PRECLEAN} != "X" ]; then \
4931 target="clean $$target"; \
4932 depends_args="$$depends_args NOCLEANDEPENDS=yes"; \
4934 if [ X${DEPENDS_CLEAN} != "X" ]; then \
4935 target="$$target clean"; \
4936 depends_args="$$depends_args NOCLEANDEPENDS=yes"; \
4939 target="${DEPENDS_TARGET}"; \
4940 depends_args="${DEPENDS_ARGS}"; \
4942 if ${EXPR} "$$prog" : \\/ >/dev/null; then \
4943 if [ -e "$$prog" ]; then \
4944 if [ "$$prog" = "${NONEXISTENT}" ]; then \
4945 ${ECHO_MSG} "Error: ${NONEXISTENT} exists. Please remove it, and restart the build."; \
4948 ${ECHO_MSG} "===> ${PKGNAME} depends on file: $$prog - found"; \
4949 if [ ${_DEPEND_ALWAYS} = 1 ]; then \
4950 ${ECHO_MSG} " (but building it anyway)"; \
4957 ${ECHO_MSG} "===> ${PKGNAME} depends on file: $$prog - not found"; \
4962 *\>*|*\<*|*=*) pkg=yes;; \
4965 if [ "$$pkg" != "" ]; then \
4966 if ${PKG_INFO} "$$prog" > /dev/null 2>&1 ; then \
4967 ${ECHO_MSG} "===> ${PKGNAME} depends on package: $$prog - found"; \
4968 if [ ${_DEPEND_ALWAYS} = 1 ]; then \
4969 ${ECHO_MSG} " (but building it anyway)"; \
4975 ${ECHO_MSG} "===> ${PKGNAME} depends on package: $$prog - not found"; \
4978 if [ $$notfound != 0 ]; then \
4979 inverse_dep=`${ECHO_CMD} $$prog | ${SED} \
4980 -e 's/<=/=gt=/; s/</=ge=/; s/>=/=lt=/; s/>/=le=/' \
4981 -e 's/=gt=/>/; s/=ge=/>=/; s/=lt=/</; s/=le=/<=/'`; \
4982 pkg_info=`${PKG_INFO} -E "$$inverse_dep" || ${TRUE}`; \
4983 if [ "$$pkg_info" != "" ]; then \
4984 ${ECHO_MSG} "===> Found $$pkg_info, but you need to upgrade to $$prog."; \
4988 elif ${WHICH} "$$prog" > /dev/null 2>&1 ; then \
4989 ${ECHO_MSG} "===> ${PKGNAME} depends on executable: $$prog - found"; \
4990 if [ ${_DEPEND_ALWAYS} = 1 ]; then \
4991 ${ECHO_MSG} " (but building it anyway)"; \
4997 ${ECHO_MSG} "===> ${PKGNAME} depends on executable: $$prog - not found"; \
5001 if [ $$notfound != 0 ]; then \
5002 ${ECHO_MSG} "===> Verifying $$target for $$prog in $$dir"; \
5003 if [ ! -d "$$dir" ]; then \
5004 ${ECHO_MSG} " => No directory for $$prog. Skipping.."; \
5006 ${_INSTALL_DEPENDS} \
5017 .if defined(LIB_DEPENDS) && !defined(NO_DEPENDS)
5019 for i in ${LIB_DEPENDS:M*.so*\:*}; do \
5022 target="${DEPENDS_TARGET}"; \
5023 depends_args="${DEPENDS_ARGS}"; \
5024 ${ECHO_MSG} -n "===> ${PKGNAME} depends on shared library: $${lib}" ; \
5026 dirs="${LIB_DIRS} `${CAT} ${LOCALBASE}/libdata/ldconfig/* 2>/dev/null || : `" ; \
5027 for libdir in $$dirs; do \
5028 test -f $${libdir}/$${lib} || continue; \
5029 if [ -x /usr/bin/file ]; then \
5030 _LIB_FILE=`realpath $${libdir}/$${lib}`; \
5031 [ `file -b -L --mime-type $${_LIB_FILE}` = "application/x-sharedlib" ] || continue ; \
5034 ${ECHO_MSG} " - found"; \
5036 if [ $${found} -eq 0 ]; then \
5037 ${ECHO_MSG} " - not found"; \
5038 ${ECHO_MSG} "===> Verifying for $$lib in $$dir"; \
5039 if [ ! -d "$$dir" ] ; then \
5040 ${ECHO_MSG} " => No directory for $$lib. Skipping.."; \
5042 ${_INSTALL_DEPENDS} \
5046 @set -e ; for i in ${LIB_DEPENDS:N*.so*\:*}; do \
5048 pattern="`${ECHO_CMD} $$lib | ${SED} -E -e 's/\./\\\\./g' -e 's/(\\\\)?\+/\\\\+/g'`"\
5051 if ${TEST} $$dir = $$target; then \
5052 target="${DEPENDS_TARGET}"; \
5053 depends_args="${DEPENDS_ARGS}"; \
5057 ${ECHO_MSG} -n "===> ${PKGNAME} depends on shared library: $$lib"; \
5058 if ${LDCONFIG} ${_LDCONFIG_FLAGS} -r | ${GREP} -vwF -e "${PKGCOMPATDIR}" | ${GREP} -qwE -e "-l$$pattern"; then \
5059 ${ECHO_MSG} " - found"; \
5060 if [ ${_DEPEND_ALWAYS} = 1 ]; then \
5061 ${ECHO_MSG} " (but building it anyway)"; \
5067 ${ECHO_MSG} " - not found"; \
5070 if [ $$notfound != 0 ]; then \
5071 ${ECHO_MSG} "===> Verifying $$target for $$lib in $$dir"; \
5072 if [ ! -d "$$dir" ]; then \
5073 ${ECHO_MSG} " => No directory for $$lib. Skipping.."; \
5075 ${_INSTALL_DEPENDS} \
5076 if ! ${LDCONFIG} ${_LDCONFIG_FLAGS} -r | ${GREP} -vwF -e "${PKGCOMPATDIR}" | ${GREP} -qwE -e "-l$$pattern"; then \
5077 ${ECHO_MSG} "Error: shared library \"$$lib\" does not exist"; \
5087 # Dependency lists: both build and runtime, recursive. Print out directory names.
5089 _UNIFIED_DEPENDS=${PKG_DEPENDS} ${EXTRACT_DEPENDS} ${PATCH_DEPENDS} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS} ${RUN_DEPENDS}
5090 _DEPEND_DIRS= ${_UNIFIED_DEPENDS:C,^[^:]*:([^:]*).*$,\1,}
5091 _DEPEND_SPECIALS= ${_UNIFIED_DEPENDS:M*\:*\:*:C,^[^:]*:([^:]*):.*$,\1,}
5094 @${ALL-DEPENDS-LIST}
5097 L="${_DEPEND_DIRS}"; \
5099 while [ -n "$$L" ]; do \
5103 $$d\ *|*\ $$d\ *|*\ $$d) \
5106 checked="$$checked $$d"; \
5107 if [ ! -d $$d ]; then \
5108 ${ECHO_MSG} "${PKGNAME}: \"$$d\" non-existent -- dependency list incomplete" >&2; \
5112 if ! children=$$(cd $$d && ${MAKE} -V '$${_DEPEND_DIRS}'); then\
5113 ${ECHO_MSG} "${PKGNAME}: \"$$d\" erroneous -- dependency list incomplete" >&2; \
5116 for child in $$children; do \
5117 case "$$checked $$l" in \
5118 $$child\ *|*\ $$child\ *|*\ $$child) \
5127 CLEAN-DEPENDS-FULL= \
5128 L="${_DEPEND_DIRS}"; \
5130 while [ -n "$$L" ]; do \
5134 $$d\ *|*\ $$d\ *|*\ $$d) \
5137 checked="$$checked $$d"; \
5138 if [ ! -d $$d ]; then \
5139 ${ECHO_MSG} "${PKGNAME}: \"$$d\" non-existent -- dependency list incomplete" >&2; \
5142 if ! children=$$(cd $$d && ${MAKE} -V '$${WRKDIR}' -V '$${_DEPEND_DIRS}'); then \
5143 ${ECHO_MSG} "${PKGNAME}: \"$$d\" erroneous -- dependency list incomplete" >&2; \
5147 for child in $$children; do \
5150 if [ -d $$child ]; then \
5155 case "$$checked $$l" in \
5156 $$child\ *|*\ $$child\ *|*\ $$child) \
5166 CLEAN-DEPENDS-LIMITED= \
5167 L="${_DEPEND_DIRS}"; \
5169 while [ -n "$$L" ]; do \
5173 $$d\ *|*\ $$d\ *|*\ $$d) \
5176 checked="$$checked $$d"; \
5177 if [ ! -d $$d ]; then \
5178 ${ECHO_MSG} "${PKGNAME}: \"$$d\" non-existent -- dependency list incomplete" >&2; \
5181 if ! children=$$(cd $$d && ${MAKE} -V '$${WRKDIR}' -V '$${_DEPEND_DIRS}'); then \
5182 ${ECHO_MSG} "${PKGNAME}: \"$$d\" erroneous -- dependency list incomplete" >&2; \
5186 for child in $$children; do \
5189 if [ ! -d $$child ]; then \
5195 case "$$checked $$l" in \
5196 $$child\ *|*\ $$child\ *|*\ $$child) \
5206 .if !target(clean-depends)
5208 @for dir in $$(${CLEAN-DEPENDS-FULL}); do \
5209 (cd $$dir; ${MAKE} NOCLEANDEPENDS=yes clean); \
5213 .if !target(limited-clean-depends)
5214 limited-clean-depends:
5215 @for dir in $$(${CLEAN-DEPENDS-LIMITED}); do \
5216 (cd $$dir; ${MAKE} NOCLEANDEPENDS=yes clean); \
5220 .if !target(deinstall-depends)
5222 @for dir in $$(${ALL-DEPENDS-LIST}); do \
5223 (cd $$dir; ${MAKE} deinstall); \
5227 .if !target(fetch-specials)
5229 @${ECHO_MSG} "===> Fetching all distfiles required by ${PKGNAME} for building"
5230 @for dir in ${_DEPEND_SPECIALS}; do \
5231 (cd $$dir; ${MAKE} fetch); \
5235 .if !target(fetch-recursive)
5237 @${ECHO_MSG} "===> Fetching all distfiles for ${PKGNAME} and dependencies"
5238 @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \
5239 (cd $$dir; ${MAKE} fetch); \
5243 .if !target(fetch-recursive-list)
5244 fetch-recursive-list:
5245 @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \
5246 (cd $$dir; ${MAKE} fetch-list); \
5250 # Used by fetch-required and fetch-required list, this script looks
5251 # at each of the dependencies. If 3 items are specified in the tuple,
5252 # such as foo:${PORTSDIR}/graphics/foo:extract, the first item (foo)
5253 # is examined. Only if it begins with a / and does not exist on the
5254 # file-system will ``make targ'' proceed.
5255 # For more usual (dual-item) dependency tuples, the ``make targ''
5256 # proceeds, if the exact package, which the directory WOULD'VE installed,
5257 # is not yet installed.
5258 # This is the exact behaviour of the old code, and it may need
5259 # revisiting. For example, the entire first case seems dubious, and in
5260 # the second case we, probably, should be satisfied with _any_ (earlier)
5261 # package, with the same origin as that of the dir.
5264 FETCH_LIST?= for i in $$deps; do \
5265 prog=$${i%%:*}; dir=$${i\#*:}; \
5267 *:*) if [ $$prog != $${prog\#/} -o ! -e $$prog ]; then \
5272 *) if [ -d ${PKG_DBDIR}/$$(cd $$dir; ${MAKE} -V '$${PKGNAME}') ]; then \
5276 echo cd $$dir; cd $$dir; ${MAKE} $$targ; \
5279 .if !target(fetch-required)
5280 fetch-required: fetch
5281 .if defined(NO_DEPENDS)
5282 @${ECHO_MSG} "===> NO_DEPENDS is set, not fetching any other distfiles for ${PKGNAME}"
5284 @${ECHO_MSG} "===> Fetching all required distfiles for ${PKGNAME} and dependencies"
5285 .for deptype in PKG EXTRACT PATCH FETCH BUILD RUN
5286 .if defined(${deptype}_DEPENDS)
5287 @targ=fetch; deps="${${deptype}_DEPENDS}"; ${FETCH_LIST}
5294 .if !target(fetch-required-list)
5295 fetch-required-list: fetch-list
5296 .if !defined(NO_DEPENDS)
5297 .for deptype in PKG EXTRACT PATCH FETCH BUILD RUN
5298 .if defined(${deptype}_DEPENDS)
5299 @targ=fetch-list; deps="${${deptype}_DEPENDS}"; ${FETCH_LIST}
5305 .if !target(checksum-recursive)
5307 @${ECHO_MSG} "===> Fetching and checking checksums for ${PKGNAME} and dependencies"
5308 @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \
5309 (cd $$dir; ${MAKE} checksum); \
5313 # Dependency lists: build and runtime. Print out directory names.
5316 .if defined(PKG_DEPENDS) || defined(EXTRACT_DEPENDS) || defined(PATCH_DEPENDS) || defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || defined(LIB_DEPENDS)
5317 @${BUILD-DEPENDS-LIST}
5320 BUILD-DEPENDS-LIST= \
5321 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 \
5322 if [ -d $$dir ]; then \
5323 ${ECHO_CMD} $$dir; \
5325 ${ECHO_MSG} "${PKGNAME}: \"$$dir\" non-existent -- dependency list incomplete" >&2; \
5330 .if defined(LIB_DEPENDS) || defined(RUN_DEPENDS)
5331 @${RUN-DEPENDS-LIST}
5335 for dir in $$(${ECHO_CMD} "${_LIB_RUN_DEPENDS:C,.*:([^:]*).*,\1,}" | ${SED} -e 'y/ /\n/' | ${SORT} -u); do \
5336 if [ -d $$dir ]; then \
5337 ${ECHO_CMD} $$dir; \
5339 ${ECHO_MSG} "${PKGNAME}: \"$$dir\" non-existent -- dependency list incomplete" >&2; \
5343 # Package (recursive runtime) dependency list. Print out both directory names
5344 # and package names.
5346 package-depends-list:
5347 .if defined(CHILD_DEPENDS) || defined(LIB_DEPENDS) || defined(RUN_DEPENDS)
5348 @${PACKAGE-DEPENDS-LIST}
5351 _LIB_RUN_DEPENDS= ${LIB_DEPENDS} ${RUN_DEPENDS}
5352 PACKAGE-DEPENDS-LIST?= \
5353 if [ "${CHILD_DEPENDS}" ]; then \
5354 installed=$$(${PKG_INFO} -qO ${PKGORIGIN} 2>/dev/null || \
5356 if [ "$$installed" ]; then \
5359 if [ -z "$$installed" ]; then \
5360 installed="${PKGNAME}"; \
5362 for pkgname in $$installed; do \
5363 ${ECHO_CMD} "$$pkgname ${.CURDIR} ${PKGORIGIN}"; \
5366 checked="${PARENT_CHECKED}"; \
5367 for dir in ${_LIB_RUN_DEPENDS:C,[^:]*:([^:]*):?.*,\1,}; do \
5368 dir=$$(${REALPATH} $$dir); \
5369 if [ -d $$dir ]; then \
5371 $$dir|$$dir\ *|*\ $$dir|*\ $$dir\ *) continue;; \
5373 childout=$$(cd $$dir; ${MAKE} CHILD_DEPENDS=yes PARENT_CHECKED="$$checked" package-depends-list); \
5374 set -- $$childout; \
5376 while [ $$\# != 0 ]; do \
5377 childdir="$$childdir $$2"; \
5378 ${ECHO_CMD} "$$1 $$2 $$3"; \
5381 checked="$$dir $$childdir $$checked"; \
5383 ${ECHO_MSG} "${PKGNAME}: \"$$dir\" non-existent -- dependency list incomplete" >&2; \
5387 ACTUAL-PACKAGE-DEPENDS?= \
5388 if [ "${_LIB_RUN_DEPENDS}" != " " ]; then \
5389 origins=$$(for pkgname in ${PKG_DBDIR}/*; do \
5390 if [ -e $$pkgname/+CONTENTS ]; then \
5391 ${ECHO_CMD} $${pkgname\#\#*/}; \
5392 ${SED} -n -e "s/@comment ORIGIN://p" $$pkgname/+CONTENTS; \
5395 for dir in ${_LIB_RUN_DEPENDS:C,[^:]*:([^:]*):?.*,\1,}; do \
5396 tmp=$${dir\#${PORTSDIR}/}; \
5397 if [ "$$tmp" = "$$dir" ]; then \
5399 dir=$${tmp\#\#*/}/$${dir\#\#*/}; \
5404 while [ $$\# -gt 1 ]; do \
5405 if [ ! -d "${PORTSDIR}/$$2" ]; then \
5409 if [ "$$dir" = "$$2" ]; then \
5410 ${ECHO_CMD} $$1:$$dir; \
5411 if [ -e ${PKG_DBDIR}/$$1/+CONTENTS -a -z "${EXPLICIT_PACKAGE_DEPENDS}" ]; then \
5412 packagelist="$$packagelist ${PKG_DBDIR}/$$1/+CONTENTS"; \
5419 [ -z "$$packagelist" ] || ${AWK} -F '( |:)' 'BEGIN { pkgname="broken_contents" } /@pkgdep / { pkgname=$$2 } /@comment DEPORIGIN:/ { printf "%s:%s\n", pkgname, $$3; pkgname="broken_contents" }' $$packagelist; \
5422 # Print out package names.
5425 @${PACKAGE-DEPENDS-LIST} | ${AWK} '{print $$1":"$$3}'
5427 actual-package-depends:
5428 @${ACTUAL-PACKAGE-DEPENDS}
5430 # Build packages for port and dependencies
5432 package-recursive: package
5433 @for dir in $$(${ALL-DEPENDS-LIST}); do \
5434 (cd $$dir; ${MAKE} package-noinstall); \
5437 # Show missing dependencies
5439 @_origins=$$(${PKG_INFO} -aoq); \
5440 for dir in $$(${ALL-DEPENDS-LIST}); do \
5441 _origin=$${dir##${PORTSDIR}/}; \
5442 if ! $$(${ECHO_CMD} $${_origins} | ${GREP} -q $${_origin}); then \
5443 ${ECHO_CMD} $${_origin}; \
5447 ################################################################
5448 # Everything after here are internal targets and really
5449 # shouldn't be touched by anybody but the release engineers.
5450 ################################################################
5452 # This target generates an index entry suitable for aggregation into
5453 # a large index. Format is:
5455 # distribution-name|port-path|installation-prefix|comment| \
5456 # description-file|maintainer|categories|extract-depends| \
5457 # patch-depends|fetch-depends|build-depends|run-depends|www site
5459 # If this ever changes, portmgr should contact the portsnap maintainer
5460 # first to avoid gratuitous breakage.
5462 . if !target(describe)
5463 _EXTRACT_DEPENDS=${EXTRACT_DEPENDS:C/^[^ :]+:([^ :]+)(:[^ :]+)?/\1/:O:u}
5464 _PATCH_DEPENDS=${PATCH_DEPENDS:C/^[^ :]+:([^ :]+)(:[^ :]+)?/\1/:O:u}
5465 _FETCH_DEPENDS=${FETCH_DEPENDS:C/^[^ :]+:([^ :]+)(:[^ :]+)?/\1/:O:u}
5466 _LIB_DEPENDS=${LIB_DEPENDS:C/^[^ :]+:([^ :]+)(:[^ :]+)?/\1/:O:u}
5467 _BUILD_DEPENDS=${BUILD_DEPENDS:C/^[^ :]+:([^ :]+)(:[^ :]+)?/\1/:O:u} ${_LIB_DEPENDS}
5468 _RUN_DEPENDS=${RUN_DEPENDS:C/^[^ :]+:([^ :]+)(:[^ :]+)?/\1/:O:u} ${_LIB_DEPENDS}
5469 . if exists(${DESCR})
5475 . if defined(BUILDING_INDEX) && defined(INDEX_PORTS)
5476 INDEX_OUT=${INDEX_TMPDIR}/${INDEXFILE}.desc.aggr
5478 INDEX_OUT=/dev/stdout
5482 @(${ECHO_CMD} -n "${PKGNAME}|${.CURDIR}|${PREFIX}|"; \
5483 ${ECHO_CMD} -n ${COMMENT:Q}; \
5484 ${ECHO_CMD} -n "|${_DESCR}|${MAINTAINER}|${CATEGORIES}|${_EXTRACT_DEPENDS}|${_PATCH_DEPENDS}|${_FETCH_DEPENDS}|${_BUILD_DEPENDS:O:u}|${_RUN_DEPENDS:O:u}|"; \
5485 while read one two discard; do \
5487 WWW:) case "$$two" in \
5488 https://*|http://*|ftp://*) ${ECHO_CMD} -n "$$two" ;; \
5489 *) ${ECHO_CMD} -n "http://$$two" ;; \
5494 done < ${DESCR}; ${ECHO_CMD}) >>${INDEX_OUT}
5498 .if exists(${DESCR})
5499 @${AWK} '$$1 ~ /^WWW:/ {print $$2}' ${DESCR} | ${HEAD} -1
5504 .if !target(readmes)
5510 @${RM} -f ${.CURDIR}/README.html
5511 @cd ${.CURDIR} && ${MAKE} ${.CURDIR}/README.html
5514 ${.CURDIR}/README.html:
5515 @${ECHO_MSG} "===> Creating README.html for ${PKGNAME}"
5516 @${SED} -e 's|%%PORT%%|'$$(${ECHO_CMD} ${.CURDIR} | \
5517 ${SED} -e 's|.*/\([^/]*/[^/]*\)$$|\1|')'|g' \
5518 -e 's|%%PKG%%|${PKGNAME}|g' \
5519 -e 's|%%COMMENT%%|'"$$(${ECHO_CMD} ${COMMENT:Q})"'|' \
5520 -e '/%%COMMENT%%/d' \
5521 -e 's|%%DESCR%%|'"$$(${ECHO_CMD} ${DESCR} | \
5522 ${SED} -e 's|${.CURDIR}/||')"'|' \
5523 -e 's|%%EMAIL%%|'"$$(${ECHO_CMD} "${MAINTAINER}" | \
5524 ${SED} -e 's/([^)]*)//;s/.*<//;s/>.*//')"'|g' \
5525 -e 's|%%MAINTAINER%%|${MAINTAINER}|g' \
5526 -e 's|%%WEBSITE%%|'"$$(cd ${.CURDIR} && eval ${MAKE} pretty-print-www-site)"'|' \
5527 -e 's|%%BUILD_DEPENDS%%|'"$$(cd ${.CURDIR} && eval ${MAKE} pretty-print-build-depends-list)"'|' \
5528 -e 's|%%RUN_DEPENDS%%|'"$$(cd ${.CURDIR} && eval ${MAKE} pretty-print-run-depends-list)"'|' \
5529 -e 's|%%TOP%%|'"$$(${ECHO_CMD} ${CATEGORIES} | \
5530 ${SED} -e 's| .*||' -e 's|[^/]*|..|g')"'/..|' \
5531 ${TEMPLATES}/README.port >> ${.TARGET}
5533 # The following two targets require an up-to-date INDEX in ${PORTSDIR}
5535 _PRETTY_PRINT_DEPENDS_LIST=\
5536 if [ ! -r ${INDEXDIR}/${INDEXFILE} ] ; then \
5537 ${ECHO_MSG} "${.TARGET} requires an INDEX file (${INDEXFILE}). Please run make index or make fetchindex."; \
5539 target=${.TARGET:C/pretty-print-(.*)-depends-list/\1/} ; \
5540 if [ "$$target" = "build" ] ; then fldnum=8 ; else fldnum=9 ; fi; \
5541 ${ECHO_MSG} -n 'This port requires package(s) "' ; \
5542 ${ECHO_MSG} -n `${AWK} -F\| "\\$$1 ~ /^${PKGNAME}/ {print \\$$$${fldnum};}" ${INDEXDIR}/${INDEXFILE}` ; \
5543 ${ECHO_MSG} "\" to $$target."; \
5547 .if !target(pretty-print-build-depends-list)
5548 pretty-print-build-depends-list:
5549 .if defined(PKG_DEPENDS) || defined(EXTRACT_DEPENDS) || defined(PATCH_DEPENDS) || \
5550 defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || defined(LIB_DEPENDS)
5551 @${_PRETTY_PRINT_DEPENDS_LIST}
5555 .if !target(pretty-print-run-depends-list)
5556 pretty-print-run-depends-list:
5557 .if defined(RUN_DEPENDS) || defined(LIB_DEPENDS)
5558 @${_PRETTY_PRINT_DEPENDS_LIST}
5562 _SUB_LIST_TEMP= ${SUB_LIST:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/}
5563 .if !target(apply-slist)
5565 .if defined(SUB_FILES)
5566 .for file in ${SUB_FILES}
5567 .if exists(${FILESDIR}/${file}.in)
5568 @${SED} ${_SUB_LIST_TEMP} -e '/^@comment /d' ${FILESDIR}/${file}.in > ${WRKDIR}/${file}
5569 .elif exists(${DFLY_FILESDIR}/${file}.in)
5570 @${SED} ${_SUB_LIST_TEMP} -e '/^@comment /d' ${DFLY_FILESDIR}/${file}.in > ${WRKDIR}/${file}
5572 @${ECHO_MSG} "** Checked ${FILESDIR}:"; \
5573 @${ECHO_MSG} "** Checked ${DFLY_FILESDIR}:"; \
5574 @${ECHO_MSG} "** Missing ${file}.in for ${PKGNAME}."; \
5578 .for i in pkg-message pkg-install pkg-deinstall pkg-req
5579 .if ${SUB_FILES:M${i}*}!=""
5580 ${i:S/-//:tu}= ${WRKDIR}/${SUB_FILES:M${i}*}
5586 # Generate packing list. Also tests to make sure all required package
5589 .if !target(generate-plist)
5591 @${ECHO_MSG} "===> Generating temporary packing list"
5592 @${MKDIR} `${DIRNAME} ${TMPPLIST}`
5593 @if [ ! -f ${DESCR} ]; then ${ECHO_MSG} "** Missing pkg-descr for ${PKGNAME}."; exit 1; fi
5594 .if defined(NO_STAGE) || defined(NEED_ROOT)
5597 @${ECHO_CMD} -e "@owner root\n@group wheel" >${TMPPLIST}
5599 @for file in ${PLIST_FILES}; do \
5600 ${ECHO_CMD} $${file} | ${SED} ${PLIST_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} >> ${TMPPLIST}; \
5602 .if defined(NO_STAGE)
5603 @for man in ${__MANPAGES}; do \
5604 ${ECHO_CMD} $${man} >> ${TMPPLIST}; \
5606 .for _PREFIX in ${PREFIX}
5607 .if ${_TMLINKS:M${_PREFIX}*}x != x
5608 @for i in ${_TMLINKS:M${_PREFIX}*:S|^${_PREFIX}/||}; do \
5609 ${ECHO_CMD} "$$i" >> ${TMPPLIST}; \
5612 .if ${_TMLINKS:N${_PREFIX}*}x != x
5613 @${ECHO_CMD} @cwd / >> ${TMPPLIST}
5614 @for i in ${_TMLINKS:N${_PREFIX}*:S|^/||}; do \
5615 ${ECHO_CMD} "$$i" >> ${TMPPLIST}; \
5617 @${ECHO_CMD} '@cwd ${PREFIX}' >> ${TMPPLIST}
5621 @if [ -f ${PLIST} ]; then \
5622 ${SED} ${PLIST_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} ${PLIST} >> ${TMPPLIST}; \
5625 .for dir in ${PLIST_DIRS}
5626 @${ECHO_CMD} ${dir} | ${SED} ${PLIST_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} -e 's,^,@dirrm ,' >> ${TMPPLIST}
5628 .for dir in ${PLIST_DIRSTRY}
5629 @${ECHO_CMD} ${dir} | ${SED} ${PLIST_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} -e 's,^,@dirrmtry ,' >> ${TMPPLIST}
5632 .for reinplace in ${PLIST_REINPLACE}
5633 .if defined(PLIST_REINPLACE_${reinplace:tu})
5634 @${SED} -i "" -e '${PLIST_REINPLACE_${reinplace:tu}}' ${TMPPLIST}
5638 .if defined(USE_LINUX_PREFIX)
5639 .if defined(USE_LDCONFIG)
5640 @${ECHO_CMD} "@exec ${LDCONFIG_CMD}" >> ${TMPPLIST}
5641 @${ECHO_CMD} "@unexec ${LDCONFIG_CMD}" >> ${TMPPLIST}
5644 .if defined(USE_LDCONFIG)
5645 .if !defined(INSTALL_AS_USER)
5646 @${ECHO_CMD} "@exec ${LDCONFIG} -m ${USE_LDCONFIG}" >> ${TMPPLIST}
5647 @${ECHO_CMD} "@unexec ${LDCONFIG} -R" >> ${TMPPLIST}
5649 @${ECHO_CMD} "@exec ${LDCONFIG} -m ${USE_LDCONFIG} || ${TRUE}" >> ${TMPPLIST}
5650 @${ECHO_CMD} "@unexec ${LDCONFIG} -R || ${TRUE}" >> ${TMPPLIST}
5653 .if defined(USE_LDCONFIG32)
5654 .if !defined(INSTALL_AS_USER)
5655 @${ECHO_CMD} "@exec ${LDCONFIG} -32 -m ${USE_LDCONFIG32}" >> ${TMPPLIST}
5656 @${ECHO_CMD} "@unexec ${LDCONFIG} -32 -R" >> ${TMPPLIST}
5658 @${ECHO_CMD} "@exec ${LDCONFIG} -32 -m ${USE_LDCONFIG32} || ${TRUE}" >> ${TMPPLIST}
5659 @${ECHO_CMD} "@unexec ${LDCONFIG} -32 -R || ${TRUE}" >> ${TMPPLIST}
5663 .if !defined(WITH_PKGNG)
5664 @cd ${.CURDIR} && { ${MAKE} pretty-print-config | fold -sw 120 | ${SED} -e 's/^/@comment OPTIONS:/'; } >> ${TMPPLIST}
5665 @${AWK} -f ${KEYWORDS}/pkg_install.awk ${TMPPLIST} > ${TMPPLIST}.keyword && \
5666 ${MV} -f ${TMPPLIST}.keyword ${TMPPLIST}
5671 @cd ${.CURDIR} && ${MAKE} generate-plist
5673 ${TMPPLIST_SORT}: ${TMPPLIST}
5674 @${SORT} -u ${TMPPLIST} >${TMPPLIST_SORT}
5676 .if !target(add-plist-docs)
5677 .if defined(PORTDOCS) && !defined(NOPORTDOCS)
5679 @if ${EGREP} -qe '^@cw?d' ${TMPPLIST} && \
5680 [ "`${SED} -En -e '/^@cw?d[ ]*/s,,,p' ${TMPPLIST} | ${TAIL} -n 1`" != "${PREFIX}" ]; then \
5681 ${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST}; \
5683 .for x in ${PORTDOCS}
5684 @if ${ECHO_CMD} "${x}"| ${AWK} '$$1 ~ /(\*|\||\[|\]|\?|\{|\}|\$$)/ { exit 1};'; then \
5685 if [ ! -e ${STAGEDIR}${DOCSDIR}/${x} ]; then \
5686 ${ECHO_CMD} ${DOCSDIR_REL}/${x} >> ${TMPPLIST}; \
5689 @${FIND} -P ${PORTDOCS:S/^/${STAGEDIR}${DOCSDIR}\//} ! -type d 2>/dev/null | \
5690 ${SED} -ne 's,^${STAGEDIR}${PREFIX}/,,p' >> ${TMPPLIST}
5691 @${FIND} -P -d ${PORTDOCS:S/^/${STAGEDIR}${DOCSDIR}\//} -type d 2>/dev/null | \
5692 ${SED} -ne 's,^${STAGEDIR}${PREFIX}/,@dirrm ,p' >> ${TMPPLIST}
5693 @${ECHO_CMD} "@dirrm ${DOCSDIR_REL}" >> ${TMPPLIST}
5697 .if !target(add-plist-examples)
5698 .if defined(PORTEXAMPLES) && !defined(NOPORTEXAMPLES)
5700 @if ${EGREP} -qe '^@cw?d' ${TMPPLIST} && \
5701 [ "`${SED} -En -e '/^@cw?d[ ]*/s,,,p' ${TMPPLIST} | ${TAIL} -n 1`" != "${PREFIX}" ]; then \
5702 ${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST}; \
5704 .for x in ${PORTEXAMPLES}
5705 @if ${ECHO_CMD} "${x}"| ${AWK} '$$1 ~ /(\*|\||\[|\]|\?|\{|\}|\$$)/ { exit 1};'; then \
5706 if [ ! -e ${STAGEDIR}${EXAMPLESDIR}/${x} ]; then \
5707 ${ECHO_CMD} ${EXAMPLESDIR}/${x} | \
5708 ${SED} -e 's,^${PREFIX}/,,' >> ${TMPPLIST}; \
5711 @${FIND} -P ${PORTEXAMPLES:S/^/${STAGEDIR}${EXAMPLESDIR}\//} ! -type d 2>/dev/null | \
5712 ${SED} -ne 's,^${STAGEDIR}${PREFIX}/,,p' >> ${TMPPLIST}
5713 @${FIND} -P -d ${PORTEXAMPLES:S/^/${STAGEDIR}${EXAMPLESDIR}\//} -type d 2>/dev/null | \
5714 ${SED} -ne 's,^${STAGEDIR}${PREFIX}/,@dirrm ,p' >> ${TMPPLIST}
5715 @${ECHO_CMD} "@dirrm ${EXAMPLESDIR_REL}" >> ${TMPPLIST}
5719 .if !target(add-plist-data)
5720 .if defined(PORTDATA) && !defined(NOPORTDATA)
5722 @if ${EGREP} -qe '^@cw?d' ${TMPPLIST} && \
5723 [ "`${SED} -En -e '/^@cw?d[ ]*/s,,,p' ${TMPPLIST} | ${TAIL} -n 1`" != "${PREFIX}" ]; then \
5724 ${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST}; \
5726 .for x in ${PORTDATA}
5727 @if ${ECHO_CMD} "${x}"| ${AWK} '$$1 ~ /(\*|\||\[|\]|\?|\{|\}|\$$)/ { exit 1};'; then \
5728 if [ ! -e ${STAGEDIR}${DATADIR}/${x} ]; then \
5729 ${ECHO_CMD} ${DATADIR}/${x} | \
5730 ${SED} -e 's,^${PREFIX}/,,' >> ${TMPPLIST}; \
5733 @${FIND} -P ${PORTDATA:S/^/${STAGEDIR}${DATADIR}\//} ! -type d 2>/dev/null | \
5734 ${SED} -ne 's,^${STAGEDIR}${PREFIX}/,,p' >> ${TMPPLIST}
5735 @${FIND} -P -d ${PORTDATA:S/^/${STAGEDIR}${DATADIR}\//} -type d 2>/dev/null | \
5736 ${SED} -ne 's,^${STAGEDIR}${PREFIX}/,@dirrm ,p' >> ${TMPPLIST}
5737 @${ECHO_CMD} "@dirrm ${DATADIR_REL}" >> ${TMPPLIST}
5741 .if !target(add-plist-buildinfo)
5742 add-plist-buildinfo:
5743 .if defined(PACKAGE_BUILDING)
5744 @${ECHO_CMD} "@comment Build details: ${BUILDHOST}|${JAIL}|${BUILD}|${PORTSTREE}|${BUILDDATE}" >> ${TMPPLIST}
5748 .if !target(add-plist-info)
5751 # Process GNU INFO files at package install/deinstall time
5753 .if defined(NO_STAGE)
5754 install-info --quiet ${PREFIX}/${INFO_PATH}/$i.info ${PREFIX}/${INFO_PATH}/dir
5756 .if !defined(WITH_PKGNG)
5757 @${ECHO_CMD} "@unexec install-info --quiet --delete %D/${INFO_PATH}/$i.info %D/${INFO_PATH}/dir" \
5759 @${ECHO_CMD} "@unexec [ \`info -d %D/${INFO_PATH} --output - 2>/dev/null | grep -c '^*'\` -eq 1 ] && rm -f %D/${INFO_PATH}/dir || :"\
5761 @${LS} ${STAGEDIR}${PREFIX}/${INFO_PATH}/$i.info* | ${SED} -e s:${STAGEDIR}${PREFIX}/::g >> ${TMPPLIST}
5762 @${ECHO_CMD} "@exec install-info --quiet %D/${INFO_PATH}/$i.info %D/${INFO_PATH}/dir" \
5765 @${LS} ${STAGEDIR}${PREFIX}/${INFO_PATH}/$i.info* 2>/dev/null | ${SED} -e s:${STAGEDIR}${PREFIX}/:@info\ :g >> ${TMPPLIST}
5768 .if defined(INFO_SUBDIR)
5769 .if !defined(WITH_PKGNG)
5770 @${ECHO_CMD} "@unexec ${RMDIR} %D/${INFO_PATH}/${INFO_SUBDIR} 2> /dev/null || true" >> ${TMPPLIST}
5772 @${ECHO_CMD} "@dirrmtry ${INFO_PATH}/${INFO_SUBDIR}" >> ${TMPPLIST}
5775 .if (${PREFIX} != "/usr")
5776 @${ECHO_CMD} "@unexec if [ -f %D/${INFO_PATH}/dir ]; then if sed -e '1,/Menu:/d' %D/${INFO_PATH}/dir | grep -q '^[*] '; then true; else rm %D/${INFO_PATH}/dir; fi; fi" >> ${TMPPLIST}
5777 .if (${PREFIX} != ${LOCALBASE} && ${PREFIX} != ${LINUXBASE})
5778 @${ECHO_CMD} "@unexec rmdir %D/${INFO_PATH} 2>/dev/null || true" >> ${TMPPLIST}
5784 # If we're installing into a non-standard PREFIX, we need to remove that directory at
5786 .if !target(add-plist-post)
5787 .if (${PREFIX} != ${LOCALBASE} && ${PREFIX} != ${LINUXBASE} && \
5788 ${PREFIX} != "/usr" && !defined(NO_PREFIX_RMDIR))
5790 @${ECHO_CMD} "@unexec rmdir %D 2> /dev/null || true" >> ${TMPPLIST}
5794 .if !target(install-rc-script)
5795 .if defined(USE_RCORDER) || defined(USE_RC_SUBR) && ${USE_RC_SUBR:tu} != "YES"
5797 .if defined(USE_RCORDER)
5798 @${ECHO_MSG} "===> Staging early rc.d startup script(s)"
5799 @${ECHO_CMD} "@cwd /" >> ${TMPPLIST}
5800 @for i in ${USE_RCORDER}; do \
5801 ${INSTALL_SCRIPT} ${WRKDIR}/$${i} ${STAGEDIR}/etc/rc.d/$${i%.sh}; \
5802 ${ECHO_CMD} "etc/rc.d/$${i%.sh}" >> ${TMPPLIST}; \
5804 @${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST}
5806 .if defined(USE_RC_SUBR) && ${USE_RC_SUBR:tu} != "YES"
5807 @${ECHO_MSG} "===> Staging rc.d startup script(s)"
5808 @${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST}
5809 @for i in ${USE_RC_SUBR}; do \
5810 ${INSTALL_SCRIPT} ${WRKDIR}/$${i} ${STAGEDIR}${PREFIX}/etc/rc.d/$${i%.sh}; \
5811 ${ECHO_CMD} "etc/rc.d/$${i%.sh}" >> ${TMPPLIST}; \
5817 # Compress (or uncompress) and symlink manpages.
5818 .if !target(compress-man)
5819 .if defined(_MANPAGES) || defined(_MLINKS)
5821 .if ${MANCOMPRESSED} == yes && defined(NO_MANCOMPRESS)
5822 @${ECHO_MSG} "===> Uncompressing manual pages for ${PKGNAME}"
5823 @_manpages='${_MANPAGES:S/'/'\''/g}' && [ "$${_manpages}" != "" ] && ( eval ${GUNZIP_CMD} $${_manpages} ) || ${TRUE}
5824 .elif ${MANCOMPRESSED} == no && !defined(NO_MANCOMPRESS)
5825 @${ECHO_MSG} "===> Compressing manual pages for ${PKGNAME}"
5826 @_manpages='${_MANPAGES:S/'/'\''/g}' && [ "$${_manpages}" != "" ] && ( eval ${GZIP_CMD} $${_manpages} ) || ${TRUE}
5828 .if defined(_MLINKS)
5829 @set -- ${_MLINKS}; \
5831 [ $$# -eq 0 ] && break || ${TRUE}; \
5832 ${RM} -f $${2%.gz}; ${RM} -f $$2.gz; \
5833 ${LN} -fs `${ECHO_CMD} $$1 $$2 | ${AWK} '{ \
5834 z=split($$1, a, /\//); x=split($$2, b, /\//); \
5835 while (a[i] == b[i]) i++; \
5836 for (q=i; q<x; q++) printf "../"; \
5837 for (; i<z; i++) printf a[i] "/"; printf a[z]; }'` $$2; \
5844 # Fake installation of package so that user can pkg_delete it later.
5845 # Also, make sure that an installed port is recognized correctly in
5846 # accordance to the @pkgdep directive in the packing lists
5848 .if !target(fake-pkg)
5849 .if !defined(NO_PKG_REGISTER)
5851 @if [ ! -d ${PKG_DBDIR} ]; then ${RM} -f ${PKG_DBDIR}; ${MKDIR} ${PKG_DBDIR}; fi
5852 @${RM} -f /tmp/${PKGNAME}-required-by
5853 .if defined(FORCE_PKG_REGISTER)
5854 @if [ -e ${PKG_DBDIR}/${PKGNAME}/+REQUIRED_BY ]; then \
5855 ${CP} ${PKG_DBDIR}/${PKGNAME}/+REQUIRED_BY /tmp/${PKGNAME}-required-by; \
5857 @${RM} -rf ${PKG_DBDIR}/${PKGNAME}
5859 @if [ ! -d ${PKG_DBDIR}/${PKGNAME} ]; then \
5860 ${ECHO_MSG} "===> Registering installation for ${PKGNAME}"; \
5861 ${MKDIR} ${PKG_DBDIR}/${PKGNAME}; \
5862 ${PKG_CMD} ${PKG_ARGS} -O ${PKGFILE} > ${PKG_DBDIR}/${PKGNAME}/+CONTENTS; \
5863 ${CP} ${DESCR} ${PKG_DBDIR}/${PKGNAME}/+DESC; \
5864 ${ECHO_CMD} ${COMMENT:Q} > ${PKG_DBDIR}/${PKGNAME}/+COMMENT; \
5865 if [ -f ${PKGINSTALL} ]; then \
5866 ${CP} ${PKGINSTALL} ${PKG_DBDIR}/${PKGNAME}/+INSTALL; \
5868 if [ -f ${PKGDEINSTALL} ]; then \
5869 ${CP} ${PKGDEINSTALL} ${PKG_DBDIR}/${PKGNAME}/+DEINSTALL; \
5871 if [ -f ${PKGREQ} ]; then \
5872 ${CP} ${PKGREQ} ${PKG_DBDIR}/${PKGNAME}/+REQUIRE; \
5874 if [ -f ${PKGMESSAGE} ]; then \
5875 ${CP} ${PKGMESSAGE} ${PKG_DBDIR}/${PKGNAME}/+DISPLAY; \
5876 ${ECHO_CMD} "@display +DISPLAY" >> ${PKG_DBDIR}/${PKGNAME}/+CONTENTS; \
5878 for dep in `${PKG_INFO} -qf ${PKGNAME} | ${AWK} '/^@pkgdep / {print $$2}' | ${SORT} -u`; do \
5879 if [ -d ${PKG_DBDIR}/$$dep -a -z `${ECHO_CMD} $$dep | ${GREP} -E ${PKG_IGNORE_DEPENDS}` ]; then \
5880 if ! ${GREP} ^${PKGNAME}$$ ${PKG_DBDIR}/$$dep/+REQUIRED_BY \
5881 >/dev/null 2>&1; then \
5882 ${ECHO_CMD} ${PKGNAME} >> ${PKG_DBDIR}/$$dep/+REQUIRED_BY; \
5887 .if !defined(NO_MTREE)
5888 @if [ -f ${MTREE_FILE} ]; then \
5889 ${CP} ${MTREE_FILE} ${PKG_DBDIR}/${PKGNAME}/+MTREE_DIRS; \
5892 @if [ -e /tmp/${PKGNAME}-required-by ]; then \
5893 ${CAT} /tmp/${PKGNAME}-required-by >> ${PKG_DBDIR}/${PKGNAME}/+REQUIRED_BY; \
5894 ${RM} -f /tmp/${PKGNAME}-required-by; \
5899 # Depend is generally meaningless for arbitrary ports, but if someone wants
5900 # one they can override this. This is just to catch people who've gotten into
5901 # the habit of typing `make depend all install' as a matter of course.
5907 # Same goes for tags
5912 .if !defined(NOPRECIOUSMAKEVARS)
5913 # These won't change, so we can pass them through the environment
5915 ARCH="${ARCH:S/"/"'"'"/g:S/\$/\$\$/g:S/\\/\\\\/g}" \
5916 OPSYS="${OPSYS:S/"/"'"'"/g:S/\$/\$\$/g:S/\\/\\\\/g}" \
5917 OSREL="${OSREL:S/"/"'"'"/g:S/\$/\$\$/g:S/\\/\\\\/g}" \
5918 OSVERSION="${OSVERSION:S/"/"'"'"/g:S/\$/\$\$/g:S/\\/\\\\/g}" \
5919 DFLYVERSION="${DFLYVERSION:Q}" \
5920 SYSTEMVERSION="${SYSTEMVERSION:S/"/"'"'"/g:S/\$/\$\$/g:S/\\/\\\\/g}"
5923 .if !target(pre-check-config)
5925 .for single in ${OPTIONS_SINGLE}
5926 . for opt in ${OPTIONS_SINGLE_${single}}
5927 . if empty(ALL_OPTIONS:M${single}) || !empty(PORT_OPTIONS:M${single})
5928 . if !empty(PORT_OPTIONS:M${opt})
5929 . if defined(OPTFOUND)
5930 OPTIONS_WRONG_SINGLE+= ${single}
5936 # if conditional and if the condition is unchecked, remove opt from the list of
5938 PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}}
5942 . if !defined(OPTFOUND) && !defined(OPTNOCHECK)
5943 OPTIONS_WRONG_SINGLE+= ${single}
5950 .for radio in ${OPTIONS_RADIO}
5951 . for opt in ${OPTIONS_RADIO_${radio}}
5952 . if !empty(PORT_OPTIONS:M${opt})
5953 . if defined(OPTFOUND)
5954 OPTIONS_WRONG_RADIO+= ${radio}
5963 .for multi in ${OPTIONS_MULTI}
5964 . for opt in ${OPTIONS_MULTI_${multi}}
5965 . if empty(ALL_OPTIONS:M${multi}) || !empty(PORT_OPTIONS:M${multi})
5966 . if !empty(PORT_OPTIONS:M${opt})
5970 # if conditional and if the condition is unchecked, remove opt from the list of
5972 PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}}
5976 . if !defined(OPTFOUND) && !defined(OPTNOCHECK)
5977 OPTIONS_WRONG_MULTI+= ${multi}
5984 .endif #pre-check-config
5986 .if !target(_check-config)
5987 _check-config: pre-check-config
5988 .for multi in ${OPTIONS_WRONG_MULTI}
5989 @${ECHO_MSG} "====> You must check at least one option in the ${multi} multi"
5991 .for single in ${OPTIONS_WRONG_SINGLE}
5992 @${ECHO_MSG} "====> You must select one and only one option from the ${single} single"
5994 .for radio in ${OPTIONS_WRONG_RADIO}
5995 @${ECHO_MSG} "====> You cannot select multiple options from the ${radio} radio"
5997 .if !empty(OPTIONS_WRONG_MULTI) || !empty(OPTIONS_WRONG_SINGLE) || !empty(OPTIONS_WRONG_RADIO)
5998 _CHECK_CONFIG_ERROR= true
6000 .endif # _check-config
6002 .if !target(check-config)
6003 check-config: _check-config
6004 .if !empty(_CHECK_CONFIG_ERROR)
6007 .endif # check-config
6009 .if !target(sanity-config)
6010 sanity-config: _check-config
6011 .if !empty(_CHECK_CONFIG_ERROR)
6012 @echo -n "Config is invalid. Re-edit? [Y/n] "; \
6018 cd ${.CURDIR} && ${MAKE} config
6020 .endif # sanity-config
6022 .if !target(pre-config)
6024 D4P_ENV= PKGNAME="${PKGNAME}" \
6025 PORT_OPTIONS="${PORT_OPTIONS}" \
6026 ALL_OPTIONS="${ALL_OPTIONS}" \
6027 OPTIONS_MULTI="${OPTIONS_MULTI}" \
6028 OPTIONS_SINGLE="${OPTIONS_SINGLE}" \
6029 OPTIONS_RADIO="${OPTIONS_RADIO}" \
6030 OPTIONS_GROUP="${OPTIONS_GROUP}" \
6031 NEW_OPTIONS="${NEW_OPTIONS}" \
6032 DIALOG4PORTS="${DIALOG4PORTS}" \
6033 PREFIX="${PREFIX}" \
6034 LOCALBASE="${LOCALBASE}" \
6035 PORTSDIR="${PORTSDIR}" \
6037 D4PHEIGHT="${D4PHEIGHT}" \
6038 D4PWIDTH="${D4PWIDTH}" \
6039 D4PFULLSCREEN="${D4PFULLSCREEN}"
6040 .if exists(${PKGHELP})
6041 D4P_ENV+= PKGHELP="${PKGHELP}"
6043 .for opt in ${ALL_OPTIONS}
6044 D4P_ENV+= ${opt}_DESC=""${${opt}_DESC:Q}""
6046 .for otype in MULTI GROUP SINGLE RADIO
6047 . for m in ${OPTIONS_${otype}}
6048 D4P_ENV+= OPTIONS_${otype}_${m}="${OPTIONS_${otype}_${m}}" \
6049 ${m}_DESC=""${${m}_DESC:Q}""
6050 . for opt in ${OPTIONS_${otype}_${m}}
6051 D4P_ENV+= ${opt}_DESC=""${${opt}_DESC:Q}""
6060 .if !target(do-config)
6062 .if empty(ALL_OPTIONS) && empty(OPTIONS_SINGLE) && empty(OPTIONS_MULTI) && empty(OPTIONS_RADIO) && empty(OPTIONS_GROUP)
6063 @${ECHO_MSG} "===> No options to configure"
6065 .if ${UID} != 0 && !defined(INSTALL_AS_USER)
6066 @optionsdir=${OPTIONS_FILE}; optionsdir=$${optionsdir%/*}; \
6067 oldoptionsdir=${OPTIONSFILE}; oldoptionsdir=$${oldoptionsdir%/*}; \
6068 ${ECHO_MSG} "===> Switching to root credentials to create $${optionsdir}"; \
6069 (${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\"") || \
6070 (${ECHO_MSG} "===> Cannot create $${optionsdir}, check permissions"; exit 1); \
6071 ${ECHO_MSG} "===> Returning to user credentials"
6073 @optionsdir=${OPTIONS_FILE}; optionsdir=$${optionsdir%/*}; \
6074 oldoptionsdir=${OPTIONSFILE}; oldoptionsdir=$${oldoptionsdir%/*}; \
6075 if [ -d $${oldoptionsdir} -a ! -d $${optionsdir} ]; then \
6076 ${MV} $${oldoptionsdir} $${optionsdir}; \
6077 elif [ -d $${oldoptionsdir} -a -d $${optionsdir} ]; then \
6078 ${RM} -rf $${oldoptionsdir} ; \
6080 ${MKDIR} $${optionsdir} 2> /dev/null || \
6081 (${ECHO_MSG} "===> Cannot create $${optionsdir}, check permissions"; exit 1)
6083 @TMPOPTIONSFILE=$$(mktemp -t portoptions); \
6084 trap "${RM} -f $${TMPOPTIONSFILE}; exit 1" 1 2 3 5 10 13 15; \
6085 ${SETENV} ${D4P_ENV} ${SH} ${SCRIPTSDIR}/dialog4ports.sh $${TMPOPTIONSFILE} || { \
6086 ${RM} -f $${TMPOPTIONSFILE}; \
6087 ${ECHO_MSG} "===> Options unchanged"; \
6091 if [ ! -e $${TMPOPTIONSFILE} ]; then \
6092 ${ECHO_MSG} "===> No user-specified options to save for ${PKGNAME}"; \
6095 SELOPTIONS=$$(${CAT} $${TMPOPTIONSFILE}); \
6096 ${RM} -f $${TMPOPTIONSFILE}; \
6097 TMPOPTIONSFILE=$$(mktemp -t portoptions); \
6098 trap "${RM} -f $${TMPOPTIONSFILE}; exit 1" 1 2 3 5 10 13 15; \
6099 ${ECHO_CMD} "# This file is auto-generated by 'make config'." > $${TMPOPTIONSFILE}; \
6100 ${ECHO_CMD} "# Options for ${PKGNAME}" >> $${TMPOPTIONSFILE}; \
6101 ${ECHO_CMD} "_OPTIONS_READ=${PKGNAME}" >> $${TMPOPTIONSFILE}; \
6102 ${ECHO_CMD} "_FILE_COMPLETE_OPTIONS_LIST=${COMPLETE_OPTIONS_LIST}" >> $${TMPOPTIONSFILE}; \
6103 for i in ${COMPLETE_OPTIONS_LIST}; do \
6104 if ${ECHO_CMD} $${SELOPTIONS} | ${GREP} -qw $${i}; then \
6105 ${ECHO_CMD} "OPTIONS_FILE_SET+=$${i}" >> $${TMPOPTIONSFILE}; \
6107 ${ECHO_CMD} "OPTIONS_FILE_UNSET+=$${i}" >> $${TMPOPTIONSFILE}; \
6110 if [ ${UID} != 0 -a "x${INSTALL_AS_USER}" = "x" ]; then \
6111 ${ECHO_MSG} "===> Switching to root credentials to write ${OPTIONS_FILE}"; \
6112 ${SU_CMD} "${CAT} $${TMPOPTIONSFILE} > ${OPTIONS_FILE}"; \
6113 ${ECHO_MSG} "===> Returning to user credentials"; \
6115 ${CAT} $${TMPOPTIONSFILE} > ${OPTIONS_FILE}; \
6117 ${RM} -f $${TMPOPTIONSFILE}
6118 @cd ${.CURDIR} && ${MAKE} sanity-config
6123 .if !defined(NO_DIALOG)
6124 config: pre-config do-config
6127 @${ECHO_MSG} "===> Skipping 'config' as NO_DIALOG is defined"
6131 .if !target(config-recursive)
6133 @${ECHO_MSG} "===> Setting user-specified options for ${PKGNAME} and dependencies";
6134 @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \
6135 (cd $$dir; ${MAKE} config-conditional); \
6137 .endif # config-recursive
6139 .if !target(config-conditional)
6141 .if !empty(NEW_OPTIONS)
6142 @cd ${.CURDIR} && ${MAKE} config;
6144 .endif # config-conditional
6146 .if !target(showconfig)
6147 .include "${PORTSDIR}/Mk/bsd.options.desc.mk"
6148 MULTI_EOL= : you have to choose at least one of them
6149 SINGLE_EOL= : you have to select exactly one of them
6150 RADIO_EOL= : you can only select none or one of them
6152 .if !empty(COMPLETE_OPTIONS_LIST)
6153 @${ECHO_MSG} "===> The following configuration options are available for ${PKGNAME}":
6154 .for opt in ${ALL_OPTIONS}
6155 @[ -z "${PORT_OPTIONS:M${opt}}" ] || match="on" ; ${ECHO_MSG} -n " ${opt}=$${match:-off}"
6156 . if !empty(${opt}_DESC)
6157 @${ECHO_MSG} -n ": "${${opt}_DESC:Q}
6162 #multi and conditional multis
6163 .for otype in MULTI GROUP SINGLE RADIO
6164 . for m in ${OPTIONS_${otype}}
6165 . if empty(${m}_DESC)
6166 @${ECHO_MSG} "====> Options available for the ${otype:tl} ${m}${${otype}_EOL}"
6168 @${ECHO_MSG} "====> ${${m}_DESC}${${otype}_EOL}"
6170 . for opt in ${OPTIONS_${otype}_${m}}
6171 @[ -z "${PORT_OPTIONS:M${opt}}" ] || match="on" ; ${ECHO_MSG} -n " ${opt}=$${match:-off}"
6172 . if !empty(${opt}_DESC)
6173 @${ECHO_MSG} -n ": "${${opt}_DESC:Q}
6183 @${ECHO_MSG} "===> Use 'make config' to modify these settings"
6187 .if !target(showconfig-recursive)
6188 showconfig-recursive:
6189 @${ECHO_MSG} "===> The following configuration options are available for ${PKGNAME} and dependencies";
6190 @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \
6191 (cd $$dir; ${MAKE} showconfig); \
6193 .endif # showconfig-recursive
6195 .if !target(rmconfig)
6197 .if exists(${OPTIONSFILE})
6198 -@${ECHO_MSG} "===> Removing user-configured options for ${PKGNAME}"; \
6199 optionsdir=${OPTIONSFILE}; optionsdir=$${optionsdir%/*}; \
6200 if [ ${UID} != 0 -a "x${INSTALL_AS_USER}" = "x" ]; then \
6201 ${ECHO_MSG} "===> Switching to root credentials to remove ${OPTIONSFILE} and $${optionsdir}"; \
6202 ${SU_CMD} "${RM} -f ${OPTIONSFILE} ; \
6203 ${RMDIR} $${optionsdir}"; \
6204 ${ECHO_MSG} "===> Returning to user credentials"; \
6206 ${RM} -f ${OPTIONSFILE}; \
6207 ${RMDIR} $${optionsdir} 2>/dev/null || return 0; \
6210 .if exists(${OPTIONS_FILE})
6211 -@${ECHO_MSG} "===> Removing user-configured options for ${PKGNAME}"; \
6212 optionsdir=${OPTIONS_FILE}; optionsdir=$${optionsdir%/*}; \
6213 if [ ${UID} != 0 -a "x${INSTALL_AS_USER}" = "x" ]; then \
6214 ${ECHO_MSG} "===> Switching to root credentials to remove ${OPTIONS_FILE} and $${optionsdir}"; \
6215 ${SU_CMD} "${RM} -f ${OPTIONS_FILE} ; \
6216 ${RMDIR} $${optionsdir}"; \
6217 ${ECHO_MSG} "===> Returning to user credentials"; \
6219 ${RM} -f ${OPTIONS_FILE}; \
6220 ${RMDIR} $${optionsdir} 2>/dev/null || return 0; \
6223 @${ECHO_MSG} "===> No user-specified options configured for ${PKGNAME}"
6227 .if !target(rmconfig-recursive)
6229 @${ECHO_MSG} "===> Removing user-specified options for ${PKGNAME} and dependencies";
6230 @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \
6231 (cd $$dir; ${MAKE} rmconfig); \
6233 .endif # rmconfig-recursive
6235 .if !target(pretty-print-config)
6244 pretty-print-config:
6245 .for opt in ${ALL_OPTIONS}
6246 @[ -z "${PORT_OPTIONS:M${opt}}" ] || match="+" ; ${ECHO_MSG} -n "$${match:--}${opt} "
6248 .for otype in MULTI GROUP SINGLE RADIO
6249 . for m in ${OPTIONS_${otype}}
6250 @${ECHO_MSG} -n "${m}${${otype}_START} "
6251 . for opt in ${OPTIONS_${otype}_${m}}
6252 @[ -z "${PORT_OPTIONS:M${opt}}" ] || match="+" ; ${ECHO_MSG} -n "$${match:--}${opt} "
6254 @${ECHO_MSG} -n "${${otype}_END} "
6261 .endif # pretty-print-config
6265 for native_category in ${CATEGORIES}; do \
6267 case $$native_category in \
6268 accessibility) c="Utility Accessibility" ;; \
6269 archivers) c="Utility Archiving" ;; \
6270 astro) c="Education Science Astronomy" ;; \
6271 audio) c="AudioVideo Audio" ;; \
6272 benchmarks) c="System" ;; \
6273 biology) c="Education Science Biology" ;; \
6274 cad) c="Graphics Engineering" ;; \
6275 comms) c="Utility" ;; \
6276 converters) c="Utility" ;; \
6277 databases) c="Office Database" ;; \
6278 deskutils) c="Utility" ;; \
6279 devel) c="Development" ;; \
6280 dns) c="Network" ;; \
6281 elisp) c="Development" ;; \
6282 editors) c="Utility" ;; \
6283 emulators) c="System Emulator" ;; \
6284 finance) c="Office Finance" ;; \
6285 ftp) c="Network FileTransfer" ;; \
6286 games) c="Game" ;; \
6287 geography) c="Education Science Geography" ;; \
6288 gnome) c="GNOME GTK" ;; \
6289 graphics) c="Graphics" ;; \
6290 hamradio) c="HamRadio" ;; \
6291 haskell) c="Development" ;; \
6292 irc) c="Network IRCClient" ;; \
6293 java) c="Development Java" ;; \
6294 kde) c="KDE Qt" ;; \
6295 lang) c="Development" ;; \
6296 lisp) c="Development" ;; \
6297 mail) c="Office Email" ;; \
6298 mate) c="MATE GTK" ;; \
6299 math) c="Education Science Math" ;; \
6300 mbone) c="Network AudioVideo" ;; \
6301 multimedia) c="AudioVideo" ;; \
6302 net) c="Network" ;; \
6303 net-im) c="Network InstantMessaging" ;; \
6304 net-mgmt) c="Network" ;; \
6305 net-p2p) c="Network P2P" ;; \
6306 news) c="Network News" ;; \
6307 palm) c="Office PDA" ;; \
6308 parallel) c="ParallelComputing" ;; \
6309 pear) c="Development WebDevelopment" ;; \
6310 perl5) c="Development" ;; \
6311 python) c="Development" ;; \
6312 ruby) c="Development" ;; \
6313 rubygems) c="Development" ;; \
6314 scheme) c="Development" ;; \
6315 science) c="Science Education" ;; \
6316 security) c="System Security" ;; \
6317 shells) c="System Shell" ;; \
6318 sysutils) c="System" ;; \
6319 tcl*|tk*) c="Development" ;; \
6320 textproc) c="Utility TextTools" ;; \
6321 www) c="Network" ;; \
6322 x11-clocks) c="Utility Clock" ;; \
6323 x11-fm) c="System FileManager" ;; \
6324 xfce) c="GTK XFCE" ;; \
6325 zope) c="Development WebDevelopment" ;; \
6327 if [ -n "$$c" ]; then \
6328 categories="$$categories $$c"; \
6331 if [ -n "$$categories" ]; then \
6332 for c in $$categories; do ${ECHO_MSG} "$$c"; done \
6333 | ${SORT} -u | ${TR} '\n' ';'; \
6337 # http://standards.freedesktop.org/menu-spec/menu-spec-latest.html
6338 DESKTOP_CATEGORIES_MAIN= AudioVideo Audio Video Development Education \
6339 Game Graphics Network Office Science Settings System Utility
6340 DESKTOP_CATEGORIES_ADDITIONAL= Building Debugger IDE GUIDesigner Profiling \
6341 RevisionControl Translation Calendar ContactManagement Database \
6342 Dictionary Chart Email Finance FlowChart PDA ProjectManagement \
6343 Presentation Spreadsheet WordProcessor 2DGraphics VectorGraphics \
6344 RasterGraphics 3DGraphics Scanning OCR Photography Publishing Viewer \
6345 TextTools DesktopSettings HardwareSettings Printing PackageManager \
6346 Dialup InstantMessaging Chat IRCClient Feed FileTransfer HamRadio News \
6347 P2P RemoteAccess Telephony TelephonyTools VideoConference WebBrowser \
6348 WebDevelopment Midi Mixer Sequencer Tuner TV AudioVideoEditing Player \
6349 Recorder DiscBurning ActionGame AdventureGame ArcadeGame BoardGame \
6350 BlocksGame CardGame KidsGame LogicGame RolePlaying Shooter Simulation \
6351 SportsGame StrategyGame Art Construction Music Languages \
6352 ArtificialIntelligence Astronomy Biology Chemistry ComputerScience \
6353 DataVisualization Economy Electricity Geography Geology Geoscience \
6354 History Humanities ImageProcessing Literature Maps Math \
6355 NumericalAnalysis MedicalSoftware Physics Robotics Spirituality Sports \
6356 ParallelComputing Amusement Archiving Compression Electronics Emulator \
6357 Engineering FileTools FileManager TerminalEmulator Filesystem Monitor \
6358 Security Accessibility Calculator Clock TextEditor Documentation Adult \
6359 Core KDE GNOME MATE XFCE GTK Qt Motif Java ConsoleOnly
6360 DESKTOP_CATEGORIES_RESERVED= Screensaver TrayIcon Applet Shell
6362 VALID_DESKTOP_CATEGORIES+= ${DESKTOP_CATEGORIES_MAIN} \
6363 ${DESKTOP_CATEGORIES_ADDITIONAL} \
6364 ${DESKTOP_CATEGORIES_RESERVED}
6366 .if defined(DESKTOP_ENTRIES)
6367 check-desktop-entries:
6368 @set -- ${DESKTOP_ENTRIES} XXX; \
6369 if [ `${EXPR} \( $$# - 1 \) % 6` -ne 0 ]; then \
6370 ${ECHO_MSG} "${PKGNAME}: Makefile error: the DESKTOP_ENTRIES list must contain one or more groups of 6 elements"; \
6374 while [ $$# -gt 6 ]; do \
6376 if [ -n "$$4" ]; then \
6377 entry="$$entry ($$4)"; \
6378 elif [ -n "$$1" ]; then \
6379 entry="$$entry ($$1)"; \
6381 if [ -z "$$1" ]; then \
6382 ${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 1 (Name) is empty"; \
6385 if ${ECHO_CMD} "$$3" | ${GREP} -iq '.\(png\|svg\|xpm\)$$'; then \
6386 if ! ${ECHO_CMD} "$$3" | ${GREP} -iq '^/'; then \
6387 ${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"; \
6390 if [ -z "$$4" ]; then \
6391 ${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 4 (Exec) is empty"; \
6394 if [ -n "$$5" ]; then \
6395 for c in `${ECHO_CMD} "$$5" | ${TR} ';' ' '`; do \
6396 if ! ${ECHO_CMD} ${VALID_DESKTOP_CATEGORIES} | ${GREP} -wq $$c; then \
6397 ${ECHO_CMD} "${PKGNAME}: Makefile warning: in desktop entry $$entry: category $$c is not a valid desktop category"; \
6400 if ! ${ECHO_CMD} "$$5" | ${GREP} -q "`${ECHO_CMD} ${DESKTOP_CATEGORIES_MAIN} | ${SED} -E 's,[[:blank:]]+,\\\|,g'`"; then \
6401 ${ECHO_CMD} "${PKGNAME}: Makefile warning: in desktop entry $$entry: field 5 (Categories) must contain at least one main desktop category (make -VDESKTOP_CATEGORIES_MAIN)"; \
6403 if ! ${ECHO_CMD} "$$5" | ${GREP} -q ';$$'; then \
6404 ${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 5 (Categories) does not end with a semicolon"; \
6408 if [ -z "`cd ${.CURDIR} && ${MAKE} desktop-categories`" ]; then \
6409 ${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 5 (Categories) is empty and could not be deduced from the CATEGORIES variable"; \
6413 if [ "x$$6" != "xtrue" ] && [ "x$$6" != "xfalse" ] && [ "x$$6" != "x" ]; then \
6414 ${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 6 (StartupNotify) is not \"true\", \"false\" or \"\"(empty)"; \
6418 num=`${EXPR} $$num + 1`; \
6422 .if !target(install-desktop-entries)
6423 .if defined(DESKTOP_ENTRIES)
6424 install-desktop-entries:
6425 @set -- ${DESKTOP_ENTRIES} XXX; \
6426 if [ -z "${_DESKTOPDIR_REL}" ]; then \
6427 ${ECHO_CMD} "@cwd ${DESKTOPDIR}" >> ${TMPPLIST}; \
6429 while [ $$# -gt 6 ]; do \
6430 filename="`${ECHO_CMD} "$$4" | ${SED} -e 's,^/,,g;s,[/ ],_,g;s,[^_[:alnum:]],,g'`.desktop"; \
6431 pathname="${STAGEDIR}${DESKTOPDIR}/$$filename"; \
6433 if [ -z "$$categories" ]; then \
6434 categories="`cd ${.CURDIR} && ${MAKE} desktop-categories`"; \
6436 ${ECHO_CMD} "${_DESKTOPDIR_REL}$$filename" >> ${TMPPLIST}; \
6437 ${ECHO_CMD} "[Desktop Entry]" > $$pathname; \
6438 ${ECHO_CMD} "Type=Application" >> $$pathname; \
6439 ${ECHO_CMD} "Version=1.0" >> $$pathname; \
6440 ${ECHO_CMD} "Name=$$1" >> $$pathname; \
6442 if [ -z "$$2" ]; then \
6443 comment="`cd ${.CURDIR} && ${MAKE} -VCOMMENT`"; \
6445 ${ECHO_CMD} "GenericName=$$comment" >> $$pathname; \
6446 ${ECHO_CMD} "Comment=$$comment" >> $$pathname; \
6447 if [ -n "$$3" ]; then \
6448 ${ECHO_CMD} "Icon=$$3" >> $$pathname; \
6450 ${ECHO_CMD} "Exec=$$4" >> $$pathname; \
6451 ${ECHO_CMD} "Categories=$$categories" >> $$pathname; \
6452 if [ -n "$$6" ]; then \
6453 ${ECHO_CMD} "StartupNotify=$$6" >> $$pathname; \
6457 if [ -z "${_DESKTOPDIR_REL}" ]; then \
6458 ${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST}; \
6463 .if defined(WARNING)
6466 @${ECHO_MSG} "/!\\ WARNING /!\\"
6467 .for m in ${WARNING}
6471 @sleep ${WARNING_WAIT}
6474 .if defined(DEVELOPER)
6475 .if defined(DEV_WARNING)
6476 DEV_WARNING_WAIT?= 10
6478 @${ECHO_MSG} "/!\\ ${PKGNAME}: Makefile warnings, please consider fixing /!\\"
6480 .for m in ${DEV_WARNING}
6484 @sleep ${DEV_WARNING_WAIT}
6487 .if defined(DEV_ERROR)
6489 @${ECHO_MSG} "/!\\ ${PKGNAME}: Makefile errors /!\\"
6491 .for m in ${DEV_ERROR}
6499 # Please note that the order of the following targets is important, and
6500 # should not be modified.
6502 _TARGETS_STAGES= SANITY PKG FETCH EXTRACT PATCH CONFIGURE BUILD INSTALL PACKAGE
6503 .if !defined(NO_STAGE)
6504 _TARGETS_STAGES+= STAGE
6507 # Define the SEQ of actions to take when each target is ran, and which targets
6508 # it depends on before running its SEQ.
6510 _SANITY_SEQ= post-chroot pre-everything check-makefile \
6511 show-warnings show-dev-warnings show-dev-errors \
6512 check-categories check-makevars check-desktop-entries \
6513 check-depends identify-install-conflicts check-deprecated \
6514 check-vulnerable check-license check-config buildanyway-message \
6517 _PKG_DEP= check-sanity
6518 _PKG_SEQ= pkg-depends
6520 _FETCH_SEQ= fetch-depends pre-fetch pre-fetch-script \
6521 do-fetch fetch-specials post-fetch post-fetch-script
6523 _EXTRACT_SEQ= check-build-conflicts extract-message checksum extract-depends \
6524 pre-extract pre-extract-script do-extract \
6525 post-extract post-extract-script
6527 _PATCH_SEQ= ask-license patch-message patch-depends pathfix-pre-patch dos2unix fix-shebang \
6529 pre-patch-script do-patch charsetfix-post-patch post-patch post-patch-script
6530 _CONFIGURE_DEP= patch
6531 _CONFIGURE_SEQ= build-depends lib-depends configure-message run-autotools-fixup \
6532 configure-autotools pre-configure pre-configure-script \
6533 run-autotools patch-libtool do-configure post-configure \
6534 post-configure-script
6535 _BUILD_DEP= configure
6536 _BUILD_SEQ= build-message pre-build pre-build-script do-build \
6537 post-build post-build-script
6538 .if !defined(NO_STAGE)
6541 _STAGE_SEQ= stage-message stage-dir run-depends lib-depends apply-slist pre-install generate-plist \
6543 .if defined(NEED_ROOT)
6544 _STAGE_SUSEQ= create-users-groups do-install desktop-file-post-install kmod-post-install \
6545 shared-mime-post-install webplugin-post-install \
6546 post-install post-install-script move-uniquefiles post-stage compress-man \
6547 install-rc-script install-ldconfig-file install-license \
6548 install-desktop-entries add-plist-info add-plist-docs add-plist-examples \
6549 add-plist-data add-plist-post move-uniquefiles-plist fix-plist-sequence
6550 .if defined(DEVELOPER)
6551 _STAGE_SUSEQ+= stage-qa
6554 _STAGE_SEQ+= create-users-groups do-install desktop-file-post-install kmod-post-install \
6555 shared-mime-post-install webplugin-post-install post-install post-install-script \
6556 move-uniquefiles post-stage compress-man install-rc-script install-ldconfig-file \
6557 install-license install-desktop-entries add-plist-info add-plist-docs \
6558 add-plist-examples add-plist-data add-plist-post move-uniquefiles-plist \
6560 .if defined(DEVELOPER)
6561 _STAGE_SEQ+= stage-qa
6564 .if defined(WITH_PKGNG)
6566 _INSTALL_SEQ= install-message run-depends lib-depends check-already-installed
6567 _INSTALL_SUSEQ= fake-pkg security-check
6570 _PACKAGE_SEQ= package-message pre-package pre-package-script do-package post-package-script
6575 _PACKAGE_SEQ= package-message pre-package pre-package-script do-package post-package-script
6577 _INSTALL_DEP= package
6578 _INSTALL_SEQ= install-message run-depends lib-depends check-already-installed
6579 _INSTALL_SUSEQ= install-package security-check
6585 _INSTALL_SEQ= install-message check-install-conflicts run-depends lib-depends apply-slist pre-install \
6586 pre-install-script generate-plist check-already-installed
6587 _INSTALL_SUSEQ= check-umask install-mtree pre-su-install \
6588 pre-su-install-script create-users-groups do-install \
6589 install-desktop-entries install-license install-rc-script \
6590 desktop-file-post-install kmod-post-install shared-mime-post-install webplugin-post-install \
6591 post-install post-install-script add-plist-buildinfo \
6592 add-plist-info add-plist-docs add-plist-examples \
6593 add-plist-data add-plist-post fix-plist-sequence \
6594 compress-man install-ldconfig-file fake-pkg security-check
6595 _PACKAGE_DEP= install
6596 _PACKAGE_SEQ= package-message pre-package pre-package-script \
6597 do-package post-package-script
6600 # Enforce order for -jN builds
6602 .for _t in ${_TARGETS_STAGES}
6603 . for s in ${_${_t}_SEQ}
6605 . if ! ${NOTPHONY:M${s}}
6606 _PHONY_TARGETS+= ${s}
6608 _${_t}_REAL_SEQ+= ${s}
6611 . for s in ${_${_t}_SUSEQ}
6613 . if ! ${NOTPHONY:M${s}}
6614 _PHONY_TARGETS+= ${s}
6616 _${_t}_REAL_SUSEQ+= ${s}
6619 .ORDER: ${_${_t}_DEP} ${_${_t}_REAL_SEQ}
6622 # Define all of the main targets which depend on a sequence of other targets.
6623 # See above *_SEQ and *_DEP. The _DEP will run before this defined target is
6624 # ran. The _SEQ will run as this target once _DEP is satisfied.
6626 .for target in extract patch configure build stage install package
6628 # Check if config dialog needs to show and execute it if needed. If is it not
6629 # needed (_OPTIONS_OK), then just depend on the cookie which is defined later
6630 # to depend on the *_DEP and execute the *_SEQ.
6631 # If options are required, execute config-conditional and then re-execute the
6632 # target noting that config is no longer needed.
6633 .if !target(${target}) && defined(_OPTIONS_OK)
6634 _PHONY_TARGETS+= ${target}
6635 ${target}: ${${target:tu}_COOKIE}
6636 .elif !target(${target})
6637 ${target}: config-conditional
6638 @cd ${.CURDIR} && ${MAKE} CONFIG_DONE_${UNIQUENAME:tu}=1 ${${target:tu}_COOKIE}
6639 .elif target(${target}) && defined(IGNORE)
6642 .if !exists(${${target:tu}_COOKIE})
6644 # Define the real target behavior. Depend on the target's *_DEP. Execute
6645 # the target's *_SEQ. Also handle su and USE_SUBMAKE needs.
6646 .if ${UID} != 0 && defined(_${target:tu}_REAL_SUSEQ) && !defined(INSTALL_AS_USER)
6647 . if defined(USE_SUBMAKE)
6648 ${${target:tu}_COOKIE}: ${_${target:tu}_DEP}
6649 @cd ${.CURDIR} && ${MAKE} ${_${target:tu}_REAL_SEQ}
6650 . else # !USE_SUBMAKE
6651 ${${target:tu}_COOKIE}: ${_${target:tu}_DEP} ${_${target:tu}_REAL_SEQ}
6652 . endif # USE_SUBMAKE
6653 @${ECHO_MSG} "===> Switching to root credentials for '${target}' target"
6655 ${SU_CMD} "${MAKE} ${_${target:tu}_REAL_SUSEQ}"
6656 @${ECHO_MSG} "===> Returning to user credentials"
6657 @${TOUCH} ${TOUCH_FLAGS} ${.TARGET}
6658 .else # No SU needed
6659 . if defined(USE_SUBMAKE)
6660 ${${target:tu}_COOKIE}: ${_${target:tu}_DEP}
6662 ${MAKE} ${_${target:tu}_REAL_SEQ} ${_${target:tu}_REAL_SUSEQ}
6663 @${TOUCH} ${TOUCH_FLAGS} ${.TARGET}
6664 . else # !USE_SUBMAKE
6665 ${${target:tu}_COOKIE}: ${_${target:tu}_DEP} ${_${target:tu}_REAL_SEQ} ${_${target:tu}_REAL_SUSEQ}
6666 @${TOUCH} ${TOUCH_FLAGS} ${.TARGET}
6667 . endif # USE_SUBMAKE
6670 .else # exists(cookie)
6671 ${${target:tu}_COOKIE}::
6672 @if [ -e ${.TARGET} ]; then \
6675 cd ${.CURDIR} && ${MAKE} ${.TARGET}; \
6677 .endif # !exists(cookie)
6679 .endfor # foreach(targets)
6681 .PHONY: ${_PHONY_TARGETS} check-sanity fetch pkg
6683 .if !target(check-sanity)
6684 check-sanity: ${_SANITY_REAL_SEQ}
6688 fetch: ${_FETCH_DEP} ${_FETCH_REAL_SEQ}
6692 pkg: ${_PKG_DEP} ${_PKG_REAL_SEQ}
6696 # End of post-makefile section.
6699 # End of the DESTDIR if statement