Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (OpenBSD-5.7)
Apropos / Subsearch:
optional field

BSD.PORT.MK(5)              BSD File Formats Manual             BSD.PORT.MK(5)

     bsd.port.mk -- ports tree master Makefile fragment

     .include <&lt;bsd.port.mk>&gt;

     bsd.port.mk holds all the standard routines used by the ports tree.  Some
     variables and targets are for its internal use only.  The rest is docu-
     mented here.

     bsd.port.mk also uses quite a few helper scripts.  Those live under
     ${PORTSDIR}/infrastructure/bin, and they do have manpages under

     Other BSD variants, as well as older versions of bsd.port.mk, include
     other targets and variables.  Conversion methods are outlined here.

     Most variables and targets are documented, with very few exceptions.

     This documentation covers the current targets, variables and paths used
     by bsd.port.mk.  There is a separate section covering the fake framework,
     a section explaining flavors and multi-packages, and a section covering
     the generation of package information.

     It ends with sections on obsolete constructs that a porter may need when
     converting from other ports systems.

     Binary package details are mostly covered in pkg_create(1) for the pack-
     ing-list details, and in pkg_add(1) for the installation semantics.

     Selected common user activity such as the building of every package in
     the system is covered by ports(7) instead.  packages(7) provides an over-
     view of the result.

                   Print all dependencies for a port in order to build it, run
                   it, build and run it, or to run regression tests.  The out-
                   put is formatted as package specification pairs, in a form
                   suitable for tsort(1).

                   Print all dependencies a package depends upon for building,
                   running, or both, as a list of package names, sorted by
                   dependency order with tsort(1), most dependent port first.

                   Print a list of first level package specifications a port
                   depends as build dependencies, library dependencies, test
                   dependencies or run dependencies.

                   User convenience target that displays the result of
                   full-{build,run}-depends in a more readable way.

                   Most standard targets can be specialized according to a
                   given port's needs.  If defined, the pre-* hook will be
                   invoked before running the normal action; the do-* hook
                   will be invoked instead of the normal action; the post-*
                   hook will be invoked after the normal action.  Specializa-
                   tion hooks exist for build, configure, distpatch, extract,
                   fake, install, patch, test.  See individual targets for

     addsum        Complete the ${CHECKSUM_FILE} record of checksums with
                   files that have been added since makesum.  Complain if any-
                   thing does not match.

                   Process the full LIB_DEPENDS list into a form suitable for
                   pkg_create(1), see print-package-args.

     build, all    Default target.  Build the port.  Essentially invoke

                   env -i ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} \
                           -f ${MAKE_FILE} ${ALL_TARGET}

                   Verify the ports mentioned in BUILD_DEPENDS, by checking
                   the corresponding packages are actually installed, and
                   install the missing ports by recursing through the ports
                   tree.  Deprecated, see prepare.

                   Introspection target.  Verify from the ports tree, without
                   building anything, that the current subpackage will regis-
                   ter okay (see PLIST_DB).

                   Apply check-register to all subpackages of the current

     checkpatch    Debugging version of the patch target that simulates invok-
                   ing patch(1).

     checksum      Check distribution archives and distribution patches con-
                   trol sum against the results recorded in ${CHECKSUM_FILE},
                   using the message digest (checksum) utilities listed in
                   ${PREFERRED_CIPHERS}.  All the files needed to recreate a
                   port should be in ${CHECKSUMFILES} and checksummed.  Invok-
                   ing checksum with REFETCH=true will try to fetch a version
                   with the correct checksum from the OpenBSD main archive
                   site in the case of a checksum mismatch.  NO_CHECKSUM can
                   be used to avoid all checksumming steps.

     clean         Clean ports contents.  By default, it will clean the work
                   directory.  It can be invoked as make clean='[depends build
                   bulk work fake flavors dist install sub package packages

                   work      Clean work directory.

                   bulk      Clean bulk cookie.

                   build     Clean the WRKBUILD directory (only useful if
                             SEPARATE_BUILD is set).

                   depends   Recurse into dependencies.

                   dist      Clean distribution files.

                   fake      Clean fake installation directory.

                   flavors   Clean all work directories.

                   install   Uninstall package.

                   package   Remove all copies of package file.

                   plist     Remove registered packing lists of all subpack-

                   sub       With install or package, clean subpackages as

                   packages  Shorthand for `sub package'.

                   all       Shorthand for `work flavors packages plist'.

                   Shorthand for make clean=depends.

     configure     Configure the port.  Might be a void operation.  Unless
                   overridden, configure creates the ${WRKBUILD} directory
                   (see SEPARATE_BUILD), and runs whatever configuration meth-
                   ods are recorded in CONFIGURE_STYLE.

     depends       Check all the port's dependencies, that is: build-depends,
                   lib-depends, run-depends, test-depends.

     describe      Prints a one-line index entry of the port, suitable for

     distclean     Shorthand for make clean=dist.

     distpatch     Apply distribution patches only.  See patch and PATCH_CASES
                   for details.

     dump-vars     Dump the values of all relevant variables in a port,
                   prepended with the port's FULLPKGPATH.

     extract       Extract the distribution files under ${WRKDIR} (but see
                   EXTRACT_ONLY and NO_DEPENDS).  Refer to EXTRACT_CASES for a
                   complete description.  Do not use pre-extract and
                   do-extract hooks.

     fake          Do a fake port installation, that is, simulate the port
                   installation under ${WRKINST}.  There is no do-fake and
                   post-fake hooks.  fake actually uses pre-fake, pre-install,
                   do-install and post-install.  Override pre-install,
                   do-install, or post-install to change behavior.  Do not
                   touch pre-fake unless you really know what you are doing.
                   Described in a separate section below ("THE FAKE

                   Check WANTLIB against the list of installed packages and
                   libraries in the ports tree.  See print-package-args.

     fetch         Fetch the distribution files and patchfiles, using
                   ${FETCH_CMD}.  Each file of the DISTFILES and PATCHFILES
                   lists is retrieved, if necessary, from the list of sites in

                   If a filename ends with a ':0' to ':9' extension, it will
                   be retrieved from MASTER_SITES0 to MASTER_SITES9 instead.
                   After stripping that extension if necessary, if the entry
                   parses as 'filename{url}sufx' it will be fetched as urlsufx
                   instead, yet still stored as filenamesufx.

                   Transfers in progress will be stored as filenamesufx.part.

                   The ports framework uses ${DISTDIR}/${DIST_SUBDIR} (aliased
                   to ${FULLDISTDIR}) to cache the ports distribution files
                   and patch files.  Note that this framework is also used by
                   mirroring scripts, which will also retrieve SUPDISTFILES,
                   to fill with supplementary distribution files which are not
                   needed for every configuration.

                   Note that fetching a significant number of distfiles, or
                   fetching all distfiles relevant to a port and dependencies
                   is better accomplished using dpb(1) with the -F option.

                   Use of {pre,do,post}-fetch hooks is forbidden, as this
                   would make mirroring of distfiles very complicated.  See

     fetch-all     also fetches SUPDISTFILES, for use with e.g., makesum.

     index         Top-level target, see ports(7).

     install       Install the package after building.  See the description of
                   "THE FAKE FRAMEWORK" for the non-intuitive details of the
                   way {pre,do,post}-install hooks are actually used by the
                   ports tree.

     install-all   Install all packages in a multi-packages port.

     lib-depends   Verify that the library dependencies a port needs are actu-
                   ally there, by checking the library specifications.

                   Filter LIB_DEPENDS to keep only entries required by
                   WANTLIB, and output a list of dependencies suitable for
                   pkg_create(1), see print-package-args.

                   Verify that the LIB_DEPENDS and WANTLIB are accurate for
                   the port.  See port-lib-depends-check, which is quicker.

                   Check that PERMIT_PACKAGE_* settings match: if any depen-
                   dency has a more restrictive setting, warn about it.  This
                   warning is advisory, because the automated license checking
                   cannot figure out which ports were used only for building
                   and did not taint the current port.

                   Create symbolic links in other directories that correspond
                   to the port's CATEGORIES.  Note that this does not affect
                   bulk package building, since those links don't appear in
                   the upper-level Makefiles.  See also unlink-categories.

     lock          Manually obtain a lock on a given directory.  Output must
                   be used to update environment variables.  The lock can be
                   released with unlock.  Seldom used, see ports(7) for

     makesum       Create the ${CHECKSUM_FILE} list of recorded checksums by
                   running the cryptographic fingerprint sha256 on ${MAKESUM-
                   FILES}.  That normally includes ${DISTFILES}, ${SUPDIST-
                   FILES} and ${PATCHFILES}.  NO_CHECKSUM can be used to avoid
                   all checksumming steps.

                   Verify that makewhatis(8) can do a correct job with the
                   port's manpages.

     mirror-maker  Top-level target, see mirroring-ports(7).

                   Debug target: generate the mirror-maker makefile fragment
                   and use it to fetch files, see mirroring-ports(7).

                   Degenerate form of lib-depends-args that does not do any-
                   thing.  See print-package-args.

                   Degenerate form of wantlib-args that does not do anything.
                   See print-package-args.

     package       Build a port package (or packages in a MULTI_PACKAGES case)
                   from the fake installation.  Involves creating packaging
                   information from templates (see COMMENT, SUBST_VARS among
                   others) and invoking pkg_create(1) for each package in the
                   MULTI_PACKAGES list.  If the repository already contains
                   up-to-date packages, they are not rebuilt.  If PLIST_DB is
                   set, the resulting packaging information is compared with
                   existing stuff, and saved if new, with loud complaints if
                   it changed without a REVISION bump.  Arch-independent pack-
                   ages are created in ${PACKAGE_REPOSITORY}/no-arch, and
                   copied into ${PACKAGE_REPOSITORY}/${MACHINE_ARCH}/all as
                   needed.  If ${PERMIT_PACKAGE_FTP} is set to 'Yes', copies
                   built packages into ${PACKAGE_REPOSI-
                   TORY}/${MACHINE_ARCH}/ftp, using hard links if possible.
                   If ${PERMIT_PACKAGE_CDROM} is set to 'Yes', copies built
                   packages into ${PACKAGE_REPOSITORY}/${MACHINE_ARCH}/cdrom,
                   using hard links if possible.

     patch         Apply distribution and OpenBSD specific patches.  Because
                   of historical accident, patch does not follow the exact
                   same scheme other standard targets do.  Namely, patch
                   invokes pre-patch (if defined), do-patch, and post-patch,
                   but the default do-patch target invokes distpatch directly.
                   So, if the do-patch target is overridden, it should still
                   begin by calling make distpatch, before applying OpenBSD
                   specific patches.  Accordingly, the exact sequence of hooks
                   is: pre-patch, do-distpatch, post-distpatch, do-patch,
                   post-patch.  If ${PATCHDIR} exists, the files described
                   under PATCH_LIST will be applied under WRKDIST.  See also
                   REORDER_DEPENDENCIES for possible post-patch clean-up.

     peek-ftp      Connect to the first site in MASTER_SITES, in the right
                   directory, and leaves user at ftp(1)'s prompt.

     pkglocatedb   Top-level target, see ports(7).

                   Verify that the LIB_DEPENDS and WANTLIB hold all shared
                   libraries used for every package in the port.  See
                   library-specs(7).  This makes use of
                   print-plist-with-depends to avoid actually building the
                   packages, it only needs the completion of the fake stage,
                   and thus is quicker than lib-depends-check, unless you
                   already have all binary packages.

                   Resolve WANTLIB against the ports tree itself and system
                   libraries, without looking at built or installed packages,
                   and writes a list of options suitable for pkg-create(1).
                   See print-package-args.

     prepare       Prepare a port for building, by checking and installing all
                   required dependencies, constructed from LIB_DEPENDS and
                   BUILD_DEPENDS.  In MULTI_PACKAGES setups, see "Flavors and

                   Print all dependency-related information that will be
                   passed as parameters to pkg_create(1), e.g., -W wantlib and
                   -P depends lines.

                   Those parameters are generated by run-depends-args for
                   RUN_DEPENDENCIES handling, a form of lib-depends-args for
                   LIB_DEPENDS and WANTLIB interaction, and a form of
                   wantlib-args for WANTLIB resolution.

                   Variables lib_depends_args and wantlib_args control the
                   exact behavior: lib_depends_args is normally set to
                   lib-depends-args, but will be set to all-lib-depends-args
                   by port-lib-depends-check, in order to have access to the
                   full list of LIB_DEPENDS for figuring out missing WANTLIB.
                   wantlib_args is normally set to wantlib-args but it may be
                   set to port-wantlib-args for introspection purposes, to
                   fake-wantlib-args to avoid some checks, or to
                   no-wantlib-args to avoid expensive WANTLIB checks entirely.

                   Print the update signature, as computed using information
                   from the ports tree, in the same format used for
                   pkg_info(1) -S.

     print-plist   Generate and print a package packing-list from the static
                   information present in the port.

                   Iterate over print-plist for all subpackages in a given

                   Iterate over print-plist-with-depends for all subpackages
                   in a given port.

                   Generate and print package contents from the static infor-
                   mation present in the port.  In contrast with print-plist,
                   the package contents only consists of files, all tagged
                   with category markers such as @file.  See pkg_create(1).

                   Generate and print the list of static and dynamic libraries
                   present in the port.  See pkg_create(1).

                   Like print-plist-libs, but slower.  It also handles
                   LIB_DEPENDS, RUN_DEPENDS, and WANTLIB, so that the packing-
                   list has complete dependency information.

                   Like print-plist, but slower.  It also handles LIB_DEPENDS,
                   RUN_DEPENDS, and WANTLIB, so that the packing-list is com-

     rebuild       Force rebuild of the port.

     reinstall     Force reinstallation of a port, by first cleaning the old
                   installation.  Seldom needed, as update will often do the
                   right thing.

     repackage     Rebuild the packages of a port after removing existing

     run-depends   Verify the ports mentioned in RUN_DEPENDS, by checking the
                   corresponding packages are actually installed, and install
                   the missing ports by recursing through the ports tree.
                   Invoked right before installing the package.

                   Process RUN_DEPENDS and outputs a list of dependencies
                   suitable for pkg_create(1), see print-package-args.

     show          Invoked as make show=name, show the contents of ${name}.
                   Invoked as make show="name1 name2 ...", show the contents
                   of ${name1} ${name2} ..., one variable value per line.
                   Mostly used from recursive makes, or to know the contents
                   of another port's variables without guessing wrongly.

                   Print the size of ${WRKINST}.  Used by some options of
                   dpb(1), suitable for BULK_TARGETS.

                   Print the list of actual installed packages found out by

                   Print the list of actual installed packages found out by
                   prepare and test-depends.

                   Print the list of pkgpath(7) for all ports that will be
                   affected by the current port changing.  Works by walking
                   the list of dependencies, in reverse.

                   Print all running dependencies for a port, one per-line,
                   without duplicates.

     subpackage    Build a port package.  Exactly like package, but affects
                   only one single subpackage in multi-packages ports.

     show-size     Prints the size of the work directory.  Used by some
                   options of dpb(1), suitable for BULK_TARGETS.

     subupdate     Update an existing installation to a newer package, exactly
                   like update, but affects only one single subpackage in
                   multi-packages ports.

     test          Run regression tests for the port.  Essentially depend on a
                   correct build and invoke

                   env -i ${ALL_TEST_ENV} ${MAKE_PROGRAM} ${ALL_TEST_FLAGS} \
                           -f ${MAKE_FILE} ${TEST_TARGET} ${TEST_LOG}

                   If a port needs some other ports installed to run regres-
                   sion tests, use TEST_DEPENDS.  If a port needs special con-
                   figuration or build options to enable regression testing,
                   define a 'test' FLAVOR.

     test-depends  Verify packages needed for regression tests, using the same
                   scheme as build-depends.  Only invoked when regression
                   tests are run, or explicitly through depends.

                   Remove symbolic links in other directories that correspond
                   to the port's CATEGORIES.  See also link-categories.

     unlock        Manually release a lock on a given directory.  See lock.

                   Create or update patches for a port, using
                   update-patches(1), which invokes diff(1) between file and
                   file.orig, based on file.orig existence.  In order to gen-
                   erate a patch, the original file needs to be named
                   file.orig and file edited.  After the target is invoked,
                   the patches are placed under the patches/ directory.  It
                   moves existing patches from patch-file to patch-file.orig

     update        Update an existing installation to a newer package: scan
                   the installation for a package with the same FULLPKGPATH,
                   and update it using 'pkg_add -r' if a newer package is
                   available.  In multi-packages ports, all relevant packages
                   are updated.  See UPDATE_COOKIES_DIR and FORCE_UPDATE as

                   Update an installed package or perform a fresh installa-
                   tion, by using 'pkg_add -r'.  Handles one single package in
                   multi-packages ports.  See UPDATE_COOKIES_DIR and
                   FORCE_UPDATE as well.

                   Update installed packages or perform a fresh installation,
                   by using 'pkg_add -r'.  Handles all packages in multi-pack-
                   ages ports.  See UPDATE_COOKIES_DIR and FORCE_UPDATE as

     update-plist  Update the packing lists for a port, using the fake instal-
                   lation and the existing packing lists.  update-plist should
                   produce mostly correct PLIST, PFRAG.shared and
                   PFRAG.no-shared files, handling shared libraries, GNU
                   info(1) files, setuid files, and empty directories.  It
                   moves existing files to PLIST.orig, PFRAG.shared.orig and
                   PFRAG.no-shared.orig.  If the generated lists include files
                   and directories that shouldn't be included, comment these
                   like this:

                   @comment unwanted-file
                   @comment unwanted-dir/

                   Subsequent calls to update-plist will automatically recog-
                   nize and handle such lines correctly.

                   update-plist may not handle flavor and multi-packages situ-
                   ations correctly yet, so beware.

     verbose-show  Similar to show, except that it prefixes each value with
                   the variable name, e.g.  VAR=value.  Also note that it does
                   not show undefined variables, contrary to show which out-
                   puts blank lines for these.

     wantlib-args  Call port-wantlib-args and fake-wantlib-args and compare
                   the results, errors out in case of discrepancies.  See

     Note that some variables are marked as 'User-settings', which means that
     individual ports should not modify them, and that some variables are
     marked as 'read-only', which means that they shouldn't ever be changed.
     In a MULTI_PACKAGES setup, some variables have settings specific to a
     given subpackage.  See "Flavors and multi-packages".

     show          Invoked as make show=name, show the contents of ${name}.
                   Invoked as make show="name1 name2 ...", show the contents
                   of ${name1} ${name2} ..., one variable value per line.

                   Flags passed to ${MAKE} invocations during the fake
                   process.  Equals ${MAKE_FLAGS} ${DESTDIRNAME}=${WRKINST}
                   ${FAKE_FLAGS}.  Read-only.

     ALL_TEST_ENV  Environment passed to test.  Equals ${MAKE_ENV}
                   ${TEST_ENV}.  Read-only.

                   Flags passed to ${MAKE} invocations during test.  Equals
                   ${MAKE_FLAGS} ${TEST_FLAGS}.  Read-only.

     ALL_TARGET    Target used to build software.  Default is 'all'.  Can be
                   set to empty, to yield a package's default target.

     APM_ARCHS     Set to the list of apm(4) architectures.  Read-only.  Use
                   with ONLY_FOR_ARCHS.

     ARCH          Current machine architecture.  Read-only.

     AUTOCONF      Location of the autoconf binary if needed.  Defaults to
                   autoconf (though autoreconf might be more appropriate).

     AUTOCONF_DIR  Where to invoke autoconf if ${CONFIGURE_STYLE} includes
                   autoconf.  Defaults to ${WRKSRC}.

                   Starting with OpenBSD 3.3, several versions of autoconf may
                   coexist peacefully.  The main autoconf script is a shell
                   wrapper in the devel/metaauto package, and similarly for
                   automake.  Setting AUTOCONF_VERSION along with
                   CONFIGURE_STYLE set to autoconf is the correct way to spec-
                   ify which one to use.  AUTOCONF_VERSION defaults to 2.13.
                   If autoconf must be run manually, MODGNU_AUTOCONF_DEPENDS
                   can be used to specify what packages to depend upon.

     AUTOHEADER    Location of the autoheader binary.  Defaults to autoheader.

                   Several versions of automake may coexist peacefully.
                   AUTOMAKE_VERSION must be set before trying to run automake.
                   Defaults to 1.4.  Note that even if CONFIGURE_STYLE
                   includes automake, automake should still be run manually
                   during the right configure stage.

     AUTOUPDATE    Location of the autoupdate binary.  Defaults to autoupdate.

     BASE_PKGPATH  Full pkgpath(7) to the current port, taking flavors into
                   account.  See also BUILD_PKGPATH, which also includes
                   pseudo-flavors.  Read-only.

                   User settings.  Base location for system-wide state direc-
                   tory.  Defaults to ${VARBASE}.  See LOCALSTATEDIR.

                   User settings.  Base location for system-wide configuration
                   files.  Defaults to /etc.  See SYSCONFDIR.

     BATCH         User-settings.  Set to 'Yes' to avoid ports that require
                   user-interaction.  Use in conjunction with INTERACTIVE to
                   simplify bulk-package builds.  (See IGNORE).

     BE_ARCHS      Set to the list of big-endian architectures.  Read-only.
                   Use with NOT_FOR_ARCHS and ONLY_FOR_ARCHS.

                   The actual list of packages that will be built, once archi-
                   tecture problems and pseudo-flavors have been taken into
                   account.  See "Flavors and multi-packages".

     BROKEN        Define only for broken ports, set to reason the port is
                   broken.  See also NO_IGNORE, TRY_BROKEN.

                   Define only for ports broken on a given architecture.  Dis-
                   tinct from ONLY_FOR_ARCHS and NOT_FOR_ARCHS, which are used
                   to mark ports for which support for some architectures does
                   not exist at all, or is completely obsolete.

                   Macros passed to make and configure invocations.  Set based
                   on corresponding INSTALL_* variables.

                   List of other ports the current port needs to build cor-
                   rectly.  Each item has the form
                   '[pkgspec:]pkgpath[:target]'.  'target' defaults to
                   'install'.  The package installed must conform to the
                   'pkgspec', which is by default obtained from the dependent
                   'pkgpath' (see PKGSPEC).  If no installation is involved,
                   the infrastructure will still check that the directory
                   would provide a package conforming to the 'pkgspec'.
                   'pkgpath' is set relative to ${PORTSDIR}, see pkgpath(7)
                   for details.  Build dependencies are checked before the
                   extract stage during prepare.

                   Build dependencies with a patch, configure or build target
                   will be processed in a subdirectory of the working direc-
                   tory, specifically, in ${WRKDIR}/some/directory, with
                   some/directory the directory part of the 'pkgpath'.

     BUILD_ONCE    User settings.  Defaults to 'No'.  Set to 'Yes' during bulk

                   When BUILD_ONCE is set to 'Yes', all PSEUDO_FLAVORS match-
                   ing 'no_*' will be disabled, unless the special pseudo-fla-
                   vor 'bootstrap' is also set.

                   This is a bulk build optimisation, automatically set by
                   dpb(1): to avoid rebuilding the same package several times,
                   a full bulk build will strip most ports of pseudo-packages
                   variations that remove subpackages.

                   For instance, an individual package may depend on
                   databases/db/v4,no_java,no_tcl, to avoid bringing a jdk in
                   during a quick build.  Nevertheless, during a full bulk
                   build, databases/db/v4 will only be built once, as the
                   pseudo-flavor will be automatically removed.

                   However, the extra 'bootstrap' rule is needed to take build
                   cycles into account.  For instance, the devel/dconf,-editor
                   subpackage depends on most of GNOME, which in turn requires
                   devel/dconf,-main to build.  So devel/dconf has
                   PSEUDO_FLAVORS = no_editor bootstrap and the GNOME build
                   first builds devel/dconf,no_editor,bootstrap,-main which is
                   later used to rebuild devel/dconf.

                   Full pkgpath(7) to the current port, taking flavors and
                   pseudo-flavors into account.  See also BASE_PKGPATH, which
                   doesn't include pseudo-flavors.  Mostly useful to write
                   dependencies for subpackages like this:
                   LIB_DEPENDS-foo=${BUILD_PKGPATH} and avoid starting to
                   build a package with some other flavor combination.  See
                   pkgpath(7) on the subject of 'pkgpath normalisation'.

     BULK          User settings.  If set to 'Yes', all successful package
                   builds and installations will clean their working directo-
                   ries, after invoking any targets mentioned in BULK_TARGETS,
                   and commands mentioned in BULK_DO.  Can be set on a
                   per-${PKGPATH} basis.  For instance, setting
                   BULK_misc/screen=No will override any BULK=Yes passed on
                   the command line.  If set to 'Auto', it will apply to
                   dependencies, but not to the current port itself.  See
                   BULK_COOKIES_DIR.  Defaults to 'Auto'.

                   User settings.  Used to store cookies for successful bulk-
                   package builds, defaults to

     BULK_DO       Commands to run after each bulk package build before clean-
                   ing up the working directory.  Empty defaults.  Can be set
                   on a per-${PKGPATH} basis, e.g., BULK_DO_${PKGPATH}=...

     BULK_FLAGS    Flags to pass to build each target in BULK_TARGETS.

     BULK_TARGETS  Targets to run after each bulk package build before clean-
                   ing up the working directory.  Empty defaults.  Can be set
                   on a per-${PKGPATH} basis, e.g., BULK_TARGETS_${PKG-

     BZIP2         Name of the bzip2 binary.

     CATEGORIES    List of descriptive categories into which this port falls.
                   Mandatory.  One entry must match the current pkgpath:
                   devel/gmake must belong to the 'devel' category.  See
                   link-categories, unlink-categories.

     CCACHE_DIR    Sets the cache directory used when USE_CCACHE is set to
                   yes.  Defaults to ${WRKOBJDIR}/.ccache.

     CCACHE_ENV    Sets additional environment variables when USE_CCACHE is
                   set to yes.  For instance, to enable verbose logging, set

     CDIAGFLAGS    Flags appended to CFLAGS if WARNINGS is set.

     CDROM_SITE    Path to a local source that holds distribution files (usu-
                   ally a CD-ROM or other similar media), used to retrieve
                   distribution files before going to the network.  Defaults
                   to empty, set to /cdrom/distfiles/${DIST_SUBDIR} to check
                   that path.  Distribution files are still copied or linked
                   (see FETCH_SYMLINK_DISTFILES) into DISTDIR if they are
                   found under CDROM_SITE.

     CFLAGS        Default flags passed to the compiler for building.  Many
                   ports ignore it.  See also COPTS, CDIAGFLAGS.

                   User settings.  If set to 'Yes', every package build will
                   verify that shared libraries are correctly registered.
                   This is essentially the same as running make
                   lib-depends-check after each package build.  Defaults to
                   'No', as this can be a big performance hit.

                   List of all files that need to be retrieved by fetch, with
                   DIST_SUBDIR prepended and with the master site selection
                   extension removed.  Read-only.  See also MAKESUMFILES.

                   Location for this port's checksums, used by addsum,
                   checksum, and makesum.  Defaults to distinfo.

                   User settings.  Choose whether or not to checksum packages
                   while building.  Deposits result in
                   Can be set to 'Yes' to compute a checksum for all packages,
                   'cdrom' to compute it only for PERMIT_PACKAGE_CDROM pack-
                   ages or to 'ftp' to compute it only for PERMIT_PACKAGE_FTP
                   packages.  Defaults to 'no', which does not compute a
                   checksum at all.

     CLEANDEPENDS  If set to 'Yes', 'make clean' will also clean dependencies.
                   Can be overridden on a per-${PKGPATH} basis, by setting

     COMMENT       Short, one line description of the port, used for the pack-
                   age, and in the INDEX.

     COMMENT-foo   Same as COMMENT but used for sub package -foo in a multi-
                   package setup.

                   Same as COMMENT but used for a flavored package, if the
                   non-flavored comment is inappropriate.

                   Same as COMMENT but used for a sub-, flavored package.

     COMES_WITH    The first release where the port was made part of the stan-
                   dard distribution.  If the current OpenBSD version is >=
                   this version then a notice will be displayed instead of the
                   port being built.

                   Used when CONFIGURE_STYLE=gnu, or with MODULES += gnu.
                   List of config.site fragments that will speed up gnu-con-
                   figure, and prevent it from preferring various gnu pro-
                   grams, unless BUILD_DEPENDS explicitly ask for them.  Read-
                   only, available for debugging purposes.

                   Arguments to pass to configure script.  Defaults are empty,
                   except for GNU-style configure, where prefix and sysconfdir
                   are set.

                   Basic environment passed to configure script (path and
                   libtool setup).  GNU-style configure adds a lot more vari-

                   Set to name of script invoked by configure target, if
                   appropriate.  Should be either an absolute path, or rela-
                   tive to ${WRKSRC}.

                   Set by default to --enable-shared or --disable-shared,
                   depending on whether the architecture supports shared
                   libraries.  Should be appended to CONFIGURE_ARGS, for ports
                   that build dynamic libraries and whose configure script
                   supports these options.

                   Set to style of configuration that needs to happen.

                   If 'perl', assume perl(1) ExtUtils::MakeMaker(3p) style.
                   Add 'modbuild', to enable perl(1) Module::Build(3p) or
                   'modinst' for Module::Install(3p) style.

                   If 'gnu', assume GNU configure style.  Add 'dest' if port
                   does not handle DESTDIR correctly, and needs to be config-
                   ured to add DESTDIR to prefixes (see also DESTDIRNAME).
                   Add 'old' if port is an older autoconf port that does not
                   recognize --sysconfdir.  Add 'autoconf' if autoconf needs
                   to be rerun first, but set 'no-autoheader' to prevent auto-
                   header from running.  Add 'automake' if automake may need
                   to be rerun.  Otherwise, automake will be explicitly dis-
                   abled.  Note that automake is never run automatically.  In
                   order to use it, CONFIGURE_STYLE should include 'automake'
                   and there should be a {pre,do}-configure target running

                   If 'imake', assume port configures using X11 ports Imake-
                   file framework.  Add 'noman' if port has no man pages the
                   Imakefile should try installing.

                   If 'simple', there is a configure script, but it does not
                   fit the normal GNU configure conventions.

                   Extensions may be defined by specific MODULES.  See
                   port-modules(5) for details.

     COPTS         User settings.  Supplementary options appended to ${CFLAGS}
                   for building.  Since most ports ignore the COPTS conven-
                   tion, they are actually told to use ${CFLAGS} ${COPTS} as

     CXXDIAGFLAGS  Flags appended to CXXFLAGS if WARNINGS is set.

     CXXFLAGS      Default flags passed to the C++ compiler for building.
                   Many ports ignore it.

     CXXOPTS       User settings.  Supplementary options appended to
                   ${CXXFLAGS} for building.


     DESTDIRNAME   Name of variable to set to ${WRKINST} while faking.  Usu-
                   ally DESTDIR.  To be used in the rare cases where a port
                   heeds DESTDIR in a few directories and needs to be config-
                   ured with 'gnu dest', so that those few directories do not
                   get in the way.

     DISTDIR       User settings.  Directory where all ports distribution
                   files and patchfiles are stashed.  Defaults to
                   ${PORTSDIR}/distfiles.  Override if distribution files are
                   stored elsewhere.  Always use FULLDISTDIR to refer to
                   ports' distribution files location, as it takes an eventual
                   DIST_SUBDIR into account.

     DISTFILES     The main port's distribution files (the actual software
                   source, except for binary-only ports).  Will be retrieved
                   from the MASTER_SITES (see fetch), checksummed and
                   extracted (see checksum, extract).  DISTFILES normally
                   holds a list of files, possibly with ':0' to ':9' appended
                   to select a different MASTER_SITES.

                   Each entry may optionally be of the form
                   'filename{url}sufx' to deal with sites that only offer ar-
                   chives as weird urls, doing the transfer of urlsufx into
                   result file filenamesufx.  For instance, if

                   DISTFILES = minetest-{minetest/archive/}${V}${EXTRACT_SUFX}

                   then fetch will retrieve from url
                   'minetest/archive/${V}${EXTRACT_SUFX}' into

                   If ${DISTFILES} varies depending on FLAVORS or architec-
                   ture, use SUPDISTFILES to ensure distfiles mirroring and
                   makesum proper operation.

     DISTNAME      Name used to identify the port.  See DISTFILES and PKGNAME.

     DISTORIG      Suffix used by distpatch to rename original files.
                   Defaults to .bak.orig.  Distinct from .orig to avoid con-
                   fusing update-patches.

     DIST_SUBDIR   Optional subdirectory of ${DISTDIR} where the current
                   port's distribution files and patchfiles will be located.
                   See target fetch.

     DPB           Set by the distributed ports builder to only get the infor-
                   mation it needs from dump-vars.

     ECHO_MSG      User settings.  Used to display '===> Configuring for foo'
                   and similar informative messages.  Override to turn off,
                   for instance.

     ECHO_REORDER  User settings.  Set it to 'echo' to see
                   REORDER_DEPENDENCIES actions.  Silent by default.

     EPOCH         Epoch number of the current package.  Defaults to empty (no
                   need for numbering changes), then numbering starts at 0.
                   Gets automatically incorporated into FULLPKGNAME as
                   'v${EPOCH}' to form a full package-name conforming to

     ERRORS        List of errors found while parsing the port's Makefile.
                   Display the errors before making any target, and if any
                   error starts with "Fatal:", do not make anything.  For

                         .if !defined(COMMENT)
                         ERRORS+="Fatal: Missing comment"
                   Porter can add to ERRORS, for instance to flag erroneous
                   combinations of FLAVORS (but see ONLY_FOR_ARCHS
                   NOT_FOR_ARCHS and BROKEN for other common issues).

                   In the normal extraction stage (when EXTRACT_ONLY is not
                   empty), this is the contents of a case statement, used to
                   extract files.  Fragments are automatically appended to
                   extract tar, xz and zip archives, so that the default case
                   is more or less equivalent to the following shell fragment:

                   set -e
                   cd ${WRKDIR}
                   for archive in ${EXTRACT_ONLY}
                       case $$archive in
                             xzcat ${FULLDISTDIR}/$$archive| tar xf -;;
                             lunzip -c ${FULLDISTDIR}/$$archive| tar xf -;;
                             unzip -q ${FULLDISTDIR}/$$archive -d ${WRKDIR};;
                             bzip2 -dc ${FULLDISTDIR}/$$archive| tar xf -;;
                             gzcat ${FULLDISTDIR}/$$archive | /bin/sh;;
                             /bin/sh ${FULLDISTDIR}/$$archive;;
                             tar xf ${FULLDISTDIR}/$$archive;;
                             gzip -dc ${FULLDISTDIR}/$$archive | tar xf -;;

     EXTRACT_ONLY  Set to the list of distfiles to actually extract if some
                   distfiles should not be extracted during the do-extract
                   stage.  Defaults to all distfiles, can even be set to

     EXTRACT_SUFX  Used to set DISTFILES default value to ${DIST-
                   NAME}${EXTRACT_SUFX}.  Default value is .tar.gz.

     FAKE_FLAGS    Extra flags passed to ${MAKE_PROGRAM} during the fake invo-
                   cation.  Empty by default.  Also see ALL_FAKE_FLAGS.

     FAKE_SETUP    List of environment values normally set during fake invoca-
                   tions.  Exposed so that modules may provide their own
                   do-install.  Read-only, see "THE FAKE FRAMEWORK" for

     FAKE_TARGET   Target built by ${MAKE_PROGRAM} on fake invocation.
                   Defaults to ${INSTALL_TARGET}.

     FAKEOBJDIR    User settings.  If non empty, used as a base for the fake
                   area.  The real fake directory ${WRKINST} is created there.
                   Can be set on a per-${PKGPATH} basis.  For instance, set-
                   ting FAKEOBJDIR_www/mozilla=/tmp/obj will affect only the
                   mozilla port.

     FETCH_CMD     User settings.  Command used to fetch distribution files
                   for this port.  Defaults to ftp(1).  Can be used to go
                   through excessively paranoid firewalls.  Note that
                   FETCH_CMD should support -C and -o dest.

                   Some ports' distfiles cannot be fetched automatically for
                   licensing reasons.  In this case, set FETCH_MANUALLY to a
                   list of strings that will be displayed, one per line, e.g.,

                   FETCH_MANUALLY= "You must fetch foo-1.0.tgz"
                   FETCH_MANUALLY+="from http://www.fubar.com/ manually,"
                   FETCH_MANUALLY+="after reading and agreeing to the license."
                   Behaves like IS_INTERACTIVE if some distribution files are

                   User settings.  If set to 'Yes', the package target will
                   download packages missing from the repository from loca-
                   tions in ${PKG_PATH} and place them into
                   ${PACKAGE_REPOSITORY}/${MACHINE_ARCH}/cache/.  It will only
                   build them if no suitable packages are found.

                   User settings.  Set to 'Yes' to link distribution files off
                   CDROM_SITE instead of copying them.

     FILESDIR      Location of other files related to the current port.
                   Default: files.

     FLAVOR        The port's current options.  Set by the user, and tested by
                   the port to activate wanted functionalities.

     FLAVORS       List of all flavors keywords a port may match.  Used to
                   sort FLAVOR into a canonical order to build the package
                   name, or to select the packing-list, and as a quick valid-
                   ity check.  See also PSEUDO_FLAVORS.

     FLAVOR_EXT    Canonical list of flavors being set for the current build,
                   dash-separated.  See FULLPKGNAME.

     FORCE_UPDATE  User settings.  If set to 'Yes', the update target will
                   always update an installed package, as soon as its signa-
                   ture differs, and all dependencies that install packages
                   will also force an update.  If set to 'hard', the update
                   target will also update installed packages even when the
                   signature did not change.

     FULLDISTDIR   Complete path to directory where ${DISTFILES} and ${PATCH-
                   FILES} will be located, to be used in hand-crafted extrac-
                   tion targets.  Read-only.

     FULLPKGNAME   Full name of the created package, taking flavors into
                   account.  Defaults to ${PKGNAME}${FLAVOR_EXT}.  See also
                   EPOCH and REVISION.

     FULLPKGPATH   Path to the current port's directory, relative to ${PORTS-
                   DIR}, including flavors and subpackages.  See pkgpath(7).

                   List of architectures using gcc 3.3.6, or gcc 4.2.1.  Read-
                   only.  Use with NOT_FOR_ARCHS or ONLY_FOR_ARCHS to limit
                   ports to architectures where they compile.

     GH_*          Support for GitHub-hosted projects.  Leave empty for non
                   hosted projects.  Yields a suitable default for

     GH_ACCOUNT    Account name of the GitHub user hosting the project.

     GH_COMMIT     SHA1 commit id to fetch.  It is good practice to always
                   specify the commit id, even if ${GH_TAGNAME} was specified.

     GH_PROJECT    Name of the project on GitHub.

     GH_TAGNAME    Name of the tag to download.  Setting ${GH_TAGNAME} to mas-
                   ter is invalid and will throw an error.  ${WRKDIST} is
                   auto-generated based on the ${GH_TAGNAME} if specified,
                   otherwise ${GH_COMMIT} will be used to generate ${WRKDIST}.

     GMAKE         Location of the GNU make binary, if needed.  Defaults to

     HOMEPAGE      URL to the homepage of the software, if applicable.

     IGNORE        For ignored ports, set to the reasons for which the port is
                   ignored.  If non-empty, most common targets that do some-
                   thing (e.g., fetch, build, install ...) will be ignored.
                   NO_IGNORE, ONLY_FOR_ARCHS.

                   If set to 'Yes', ignored ports will become fatal errors.

                   If set to 'Yes', do not print anything when ignoring a

                   Macros to use to install a program, a script, data, or a
                   man page (or the corresponding directory), respectively.

                   Target invoked to install the software, during fake instal-
                   lation.  Default is 'install'.

     INTERACTIVE   User settings.  Set to 'Yes' to skip all non-interactive
                   ports.  Used in conjunction with BATCH to simplify bulk-
                   package builds.

                   Set to 'Yes' if port needs human interaction to build.
                   Porters should strive to minimize IS_INTERACTIVE ports, by
                   using FLAVORS for multiple choice ports, and by postponing
                   human intervention to package installation time.

     LE_ARCHS      Set to the list of little-endian architectures.  Read-only.
                   Use with NOT_FOR_ARCHS and ONLY_FOR_ARCHS.

     LIB_DEPENDS   Libraries this port depends upon.  Each item has the form
                   '[pkgspec:]pkgpath'.  Similar to BUILD_DEPENDS and
                   RUN_DEPENDS, but with specific rules: LIB_DEPENDS always
                   turn into BUILD_DEPENDS.

                   On architectures that use dynamic libraries, LIB_DEPENDS is
                   also used as a run-time dependency, and recorded in the
                   package as such, if any of the libraries mentioned in
                   WANTLIB is a shared library that originates within the
                   dependent port.

                   See library-specs(7) for more details.

                   Controls the behavior of pkg_create(1) related targets, see
                   print-package-args for details.

     LIBTOOL       Location of the libtool binary.  Default: /usr/bin/libtool.

                   Arguments to pass to libtool.  If USE_LIBTOOL is set, the
                   environment variable LIBTOOL is set to ${LIBTOOL}

     LOCALBASE     where other ports have already been installed.  Default:

                   Location for this port's state directory, should always be
                   derived from BASELOCALSTATEDIR, which defaults to /var.
                   Passed to gnu configure scripts.

     LOCKDIR       User settings.  Defaults to ${WRKOBJDIR}/locks.  If set,
                   points to a local directory common for all instances of
                   concurrent ports builds.

     LOCK_CMD      Expands to a command that will acquire a lock, namely
                   dolock(1).  See also ports(7).

     LOCK_VERBOSE  User settings.  Defaults to 'No'.  Set to 'Yes' to show
                   every acquire/release lock operation.

     LP64_ARCHS    Set to the list of 64-bit architectures.  Read-only.  Use
                   with NOT_FOR_ARCHS.

     MAINTAINER    E-mail address with full name of the port's maintainer.
                   Defaults to ports@openbsd.org.

     MAKE_ENV      Environment variables passed to make invocations and tests.
                   Sets at least PATH, PREFIX, LOCALBASE, X11BASE, CFLAGS,
                   TRUEPREFIX, DESTDIR, and the BSD_INSTALL_* macros.

     MAKE_FLAGS    Flags used for all make invocations, except for the fake
                   stage, which adds FAKE_FLAGS (see ALL_FAKE_FLAGS) and for
                   the test stage, which adds TEST_FLAGS (see ALL_TEST_FLAGS).

     MAKE_FILE     Name of the Makefile used for ports building.  Defaults to
                   Makefile.  Used after changing directory to ${WRKBUILD}.

     MAKE_PROGRAM  The make program that is used for building the port.  Set
                   to ${MAKE} or ${GMAKE} depending on USE_GMAKE.  Read-only.

                   Introspection variable, see make(1).

     MAKESUMFILES  List of all files that need to be retrieved by fetch-all,
                   with DIST_SUBDIR prepended and with master site selection
                   extension removed.  Read-only.  See also CHECKSUMFILES.

                   User settings.  List of sites to try after normal master
                   sites, or before if MASTER_SITE_OVERRIDE is set to 'Yes'.
                   Normally includes ${MASTER_SITE_OPENBSD} and ${MAS-

                   Lists of standard sites to retrieve files from, refer to

                   User settings.  Set to 'Yes' to retrieve distfiles and
                   patchfiles preferentially from the ${MASTER_SITE_BACKUP}
                   sites.  Defaults to 'No'.

     MASTER_SITES  List of primary locations from which distribution files and
                   patchfiles are retrieved.  See the fetch target for
                   details.  Defaults to ${MASTER_SITES_GITHUB} for GitHub-
                   hosted projects, see GH_*.  See ports(7) for user configu-

                   Supplementary locations from which distribution files and
                   patchfiles are retrieved.

     MESSAGE       File recorded in the package and displayed during installa-
                   tion.  Defaults to ${PKGDIR}/MESSAGE if this file exists.
                   Leave empty if no message is needed.

                   When FETCH_MANUALLY is set, MISSING_FILES will contain the
                   list of missing distfiles or patchfiles that need to be
                   fetched manually.  Read-only.

     MTREE_FILE    mtree(8) specification to check when creating a PLIST with
                   the update-plist target.  MTREE_FILE can hold a list of
                   file names, to which
                   ${PORTSDIR}/infrastructure/db/fake.mtree is always
                   appended.  These specifications are rooted at ${WRKINST},
                   and are subject to SUBST_VARS substitution, to ease
                   ${PREFIX} independence.  This feature is primarily intended
                   for large, interconnected ports, such as the kde suite,
                   where a base package sets up a large, extra directory hier-
                   archy that would make the manual checking of packing lists

                   If a port uses config.guess outside WRKSRC, the directories
                   containing the other copies must be set here.

                   If any files have a Perl shebang line, which needs to be
                   replaced with ``#!/usr/bin/perl'', list them in
                   MODPERL_ADJ_FILES.  File paths here should be relative to
                   WRKSRC.  These files are patched automatically at the end
                   of pre-configure.

                   Shell fragment to patch the Perl interpreter path in exe-
                   cutable scripts.  Used by MODPERL_ADJ_FILES.

                   Normal content of do-build when CONFIGURE_STYLE uses perl.
                   Provided as a separate variable if a port wants to override
                   do-build for its own reasons.

                   Likewise for do-install.

                   Likewise for do-test.

     MODULES       External modules mechanism, documented separately.  Modules
                   such as 'imake' and 'gnu' are normally included automati-
                   cally with the right CONFIGURE_STYLE.  Note that it is pos-
                   sible to CONFIGURE_STYLE = simple, MODULES += gnu to just
                   get the effects of CONFIG_SITE and MODGNU_CONFIG_GUESS_DIRS
                   along with the default TEST_TARGET, in case the normal GNU
                   configure script was wrapped in a separate script that
                   takes different arguments.  See port-modules(5).

                   Set to a list of subpackage extensions for ports that cre-
                   ate multiple packages.  See "Flavors and multi-packages"
                   below.  Especially read the part about ONLY_FOR_ARCHS when
                   some of the packages only exist for some architectures.

     NO_ARCH       Location for arch-independent packages.  Defaults to
                   'no-arch'.  Normally, packages are generated under ${PACK-
                   AGE_REPOSITORY}/${MACHINE_ARCH}, except for packages where
                   PKG_ARCH=*, which end up under ${PACKAGE_REPOSI-

                   List of architectures on which this port does not build.
                   See also ONLY_FOR_ARCHS.  See also SHARED_ONLY.  Do not use
                   instead of SHARED_ONLY without very good reasons.

     NO_BUILD      Set to 'Yes' if port does not need any build stage.

     NO_CCACHE     Set to 'Yes' to prevent ccache from being used when build-
                   ing a certain port, even when USE_CCACHE is set.

     NO_CHECKSUM   User settings.  Set to 'Yes' to avoid checksum, makesum,
                   and addsum actions entirely.  Beware of the full implica-
                   tions of this mechanism, namely that it disables the basic
                   authentication mechanisms of the ports tree entirely.

     NO_DEPENDS    User settings.  Don't verify build of dependencies.  Do not
                   use in any ports Makefile.  This is only meant as a user
                   convenience when, e.g., you just want to browse through a
                   given port's source and do not wish to trigger the build of

     NO_IGNORE     User settings.  If set to 'Yes', avoid ignoring a port for
                   the usual reasons.  Use, for instance, for fetching all
                   distribution files, or for fixing a broken port.  See also
                   IGNORE and TRY_BROKEN.

     NO_TEST       Port does not have any regression tests.  Only set to 'Yes'
                   for ports with no regression test.  It should be left alone
                   for ports with empty regression tests, and for ports with
                   failing tests.  That way, if a subsequent update of a port
                   acquires actual regression tests, they will be picked up

                   Set to the list of platforms that do not support shared
                   libraries.  Read-only.  Use with NOT_FOR_ARCHS.

                   Set to 'Yes' if platform does not support shared libraries.
                   To be tested after including bsd.port.mk, or
                   bsd.port.arch.mk(5), if neither PFRAG.shared nor CONFIG-
                   URE_SHARED are enough.

     NO_SYSTRACE   Port does not build with systrace-enabled build targets.

                   Base name for WRKDIR in the old scheme without WRKOBJDIR.
                   Mostly used as a value for WRKDIR_LINKNAME, e.g.,

                   WRKDIR_LINKNAME = ${OLD_WRKDIR_NAME}

                   in /etc/mk.conf.  Read-only.

                   List of architectures on which this port builds.  Can hold
                   both processor-specific information (e.g., powerpc), and
                   more specific model information (e.g., macppc).  This is
                   subpackage dependent.  Read the corresponding part of
                   "Flavors and multi-packages" if some subpackages should
                   only be built on some architectures.

     OSREV         Revision number of OpenBSD.  Read-only.

                   User settings.  Location for built packages.  Defaults to
                   ${PORTSDIR}/packages.  See package for details.

     PATCH         Command to use to apply all patches.  Defaults to

     PATCHORIG     Suffix used by patch to rename original files, and
                   update-patches to re-generate ${PATCHDIR}/${PATCH_LIST} by
                   looking for files using this suffix.  Defaults to .orig.
                   For a port that already contains .orig files in the ${DIST-
                   FILES}, set this to something else, such as .pat.orig.  See
                   also distpatch, DISTORIG.

     PATCH_CASES   In the normal distpatch stage (when PATCHFILES is not
                   empty), this is the contents of a case statement, used to
                   apply distribution patches.  Fragments are automatically
                   appended to handle gzip'ed, bzip'ed and lzip'ed patches, so
                   that the default case is more or less equivalent to the
                   following shell fragment:

                   set -e
                   cd ${FULLDISTDIR}
                   for patchfile in ${_LIST_PATCHFILES}
                       case $$patchfile in
                             bzip2 -dc $$patchfile | ${PATCH} ${PATCH_DIST_ARGS};;
                             lunzip -c $$patchfile | ${PATCH} ${PATCH_DIST_ARGS};;
                             gzcat $$patchfile | ${PATCH} ${PATCH_DIST_ARGS};;
                             ${PATCH} ${PATCH_DIST_ARGS} <$$patchfile;;

     PATCHDIR      Location for patches applied by patch target.  Default:

     PATCHFILES    Files to fetch from the master sites like DISTFILES, but
                   serving a different purpose, as they hold distribution
                   patches that will be applied at the patch stage.  See also

     PATCH_ARGS    Full list of options used while applying port's patches.

                   Set to 'Yes' by the checkpatch target.  Don't touch unless
                   the default checkpatch target needs to be redefined.  Ide-
                   ally, user-defined patch subtargets ought to test check-
                   patch.  In practice, they don't.

     PATCH_DEBUG   If set to 'Yes', the patch stage will output extra debug

                   Full list of options used while applying distribution

                   Patch option used to strip directory levels while applying
                   distribution patches.  Defaults to -p0 .

     PATCH_LIST    Wildcard pattern of patches to select under ${PATCHDIR}.
                   Defaults to patch-*.  Note that filenames ending in .orig,
                   or ~ are never applied.  Note that PATCH_LIST can hold
                   absolute pathnames, for instance to share patches among
                   similar ports:

                   PATCH_LIST=${PORTSDIR}/x11/kde/libs2/patches/p-* patch-*

     PATCH_STRIP   Patch option used to strip directory levels while applying
                   port's patches.  Defaults to -p0 .

                   Set to 'Yes' if package or distribution files can be
                   allowed on FTP sites or CD-ROM without legal issues.  Set
                   to reason not to otherwise.  PERMIT_* lines in the Makefile
                   should be preceded with a comment explaining details about
                   licensing and patents issues the port may have.  Porters
                   must be very thorough in their checks.  In case of doubt,

                   If PERMIT_PACKAGE_CDROM is set to 'Yes', PERMIT_PACKAGE_FTP
                   and PERMIT_DISTFILES_FTP will default to 'Yes'.

                   If PERMIT_PACKAGE_FTP is set to 'Yes', PERMIT_DISTFILES_FTP
                   will default to 'Yes'.

     PKG_ADD       User settings.  Path to pkg_add(1) command, with possible

     PKG_ARCH      Comma-separated list of architectures on which this package
                   may install.  Defaults to ${MACHINE_ARCH},${ARCH}.  Use *
                   for arch-independent packages.

     PKG_ARGS      Special arguments to pass to pkg_create(1), in addition to
                   the default ones.  For mips64 and pic libraries, see "The
                   generation of package information".

     PKG_CREATE    User settings.  Path to pkg_create(1) command, with possi-
                   ble options.  Signing options should be set separately in

                   Porters switch.  Set to 'Yes' to avoid checking the ports
                   tree when solving WANTLIB (see wantlib-args).  May result
                   in bogus packages that mix @depends lines obtained from the
                   ports tree with @wantlib lines that come from the installed
                   system.  Set to 'Warn' to have the differences printed as a
                   warning instead of an error (the default).

     PKG_DBDIR     User settings.  Path to package installation records.
                   Defaults to /var/db/pkg.

     PKG_DELETE    User settings.  Path to pkg_delete(1) command, with possi-
                   ble options.

     PKG_INFO      User settings.  Path to pkg_info(1) command, with possible

     PKG_TMPDIR    See pkg_add(1).  Normally points to /var/tmp, as per

     PORTHOME      Setting of env variable HOME for most shell invocations.
                   Default will trip ports that try to write into $HOME while

     PORTPATH      Path used by most shell invocations.  Don't override unless
                   really needed.

     PORTSDIR      Root of the ports tree (default: /usr/ports).

                   Path used by dependencies and bsd.port.subdir.mk to look up
                   package specifications.  Defaults to

     PKGDIR        Location for packaging information (packing list, port
                   description, messages).  Default: pkg.

     PKGFILE       Full path to the created package for the given subpackage.

     PKGFILES      Full path to all created packages.  Read-only.

     PKGNAME       Name of the created package.  Default is ${DISTNAME}.  This
                   does not take flavors into account.  See FULLPKGNAME for
                   that.  Specific revisions and epoch changes should be han-
                   dled by REVISION and EPOCH instead.

     PKGNAMES      Read-only.  List of all package names generated by the
                   port, with FLAVORS and MULTI_PACKAGES taken into account.
                   Mostly used as 'make show=PKGNAMES' to verify that bumped
                   package names are correct.

     PKGNAME-foo   Package name for sub-package foo, if the default value of
                   ${PKGNAME}${SUBPACKAGE} is not appropriate.

     PKGPATH       Path to the current port's directory, relative to ${PORTS-
                   DIR}.  Read-only.

     PKGSPEC       Default package spec for using this port as a dependency.
                   Defaults to 'stem-*', derived from the FULLPKGNAME.  Do not
                   override without very good reasons, namely software that
                   coexist as different incompatible versions with the same
                   stem, e.g., already a mess.

     PLIST_DB      User settings.  Directory used to save generated packing-
                   lists, as persistent information.  Packing-lists are pro-
                   cessed by a script, register-plist(1), which complains when
                   packing-lists change without a REVISION bump.  It also
                   knows enough about package version numbers when something
                   in the package or its dependencies goes backward, thus
                   catching EPOCH issues.  This directory is never cleaned
                   during normal operation.  'make clean=plist' should only
                   ever be used during debugging by port maintainers.
                   Defaults to ${PORTSDIR}/plist/${MACHINE_ARCH}.  If set to
                   empty, will not register anything: very much unsafe.

                   EXPERIMENTAL.  Set to 'Yes' to build xenocara through
                   ports.  This is highly experimental and not recommended.

     PORTROACH     Controls the behavior of misc/portroach as documented in
                   detail at
                   fig.txt .

                   List of cryptographic ciphers to use, in order of prefer-
                   ence.  Default is 'sha256'.  The first cipher that matches
                   in ${CHECKSUM_FILE} is verified.

     PREFIX        Base directory for the current port installation.  Usually
                   ${LOCALBASE}, though some ports may elect a location under
                   ${VARBASE}, and some multi-package ports may install under
                   several locations.  Additionally, firmware files generally
                   install under ${BASESYSCONFDIR}.

                   Build settings.  Prevent the prepare stage from installing
                   anything, let it just check dependencies, and handle [:tar-
                   get] dependencies.  Mostly used by dpb(1), which already
                   installs everything before running prepare.

                   User-settings.  Defaults to 'Yes'.  Forces commands like
                   ftp(1) and pkg_create(1) to use their progress-meter even
                   in the absence of a terminal.

     PROPERTIES    List of properties specific to a given machine architec-
                   ture.  Most often obtained through bsd.port.arch.mk(5).
                   These can be checked like this

                         .include <bsd.port.arch.mk>
                         .if ${PROPERTIES:Mapm}
                         # then add build options specific to apm arches
                         .if !${PROPERTIES:Mlp64}
                         # build options specific to lp32 arches
                   For MULTI_PACKAGES setup, use of ONLY_FOR_ARCHS-sub and
                   BUILD_PACKAGES is generally preferred (and simpler).  Pos-
                   sible properties include

                   apm        architecture possesses suspend (apm) support.

                   be         architecture is big-endian.

                   gccN       gccN architecture.

                   elf        elf(5) architecture.

                   le         architecture is little-endian.

                   lp64       lp64 architecture.

                   no_shared  architecture has no shared library support.

                   llvm       there is lang/llvm support on this architecture.

                   mono       there is lang/mono support on this architecture.

                   List of flavors in FLAVOR that are actually pseudo-flavors.
                   Only for introspection purposes.  Read-only.

                   Extra list of flavors that do not register in package
                   names, but are still used to control build logic, and work
                   directory names.  Its only use should be for disabling part
                   of a multi-packages build, for instance:

                   FLAVOR=no_gnome make package

                   Pseudo-flavors should be named as 'no_something' to disable
                   the build of subpackage '-something' (and possibly some
                   others, by restricting BUILD_PACKAGES).  Pseudo-flavors
                   should always be handled through bsd.port.arch.mk(5).  A
                   pseudo-flavor can remove several subpackages through the
                   following construct.

                         # pseudo-flavor no_gui will also remove gtk and gtk3
                         MULTI_PACKAGES = -main -gtk -gtk3 -gui
                         # ...
                         .include <bsd.port.arch.mk>

                         # remove extra build components
                         .if !${BUILD_PACKAGES:M-gui}
                         BUILD_PACKAGES := ${BUILD_PACKAGES:N-gtk:N-gtk3}

                         # normal configure setup, e.g.,
                         .if ${BUILD_PACKAGES:M-gtk}
                         # ...

                   Caveat: creation of a separate working directory is manda-
                   tory for a pseudo-flavor.  If, at a later time, a full
                   build with all subpackages is required, all the work will
                   need to be done again.

                   See also BUILD_ONCE.

     RCDIR         Location for daemon startup scripts.  Defaults to
                   /etc/rc.d.  Do not change.

                   See mirroring-ports(7).

     REFETCH       User settings.  If set to true, checksum will analyze
                   ${CHECKSUM_FILE}, and try retrieving files with the correct
                   checksum off ftp.openbsd.org, in the directory

                   Points to a list of files that specify inter-dependencies
                   for make(1).  If defined, each line of the file is either a
                   comment (starting with #) or a pair of two files:
                   most_recent older.  At the end of post-patch, touch(1) will
                   be used to ensure those files are put in the proper order.
                   The files are assumed to be under ${WRKSRC}.  The notation
                   /file can be used to ask for a recursive search, e.g., to
                   make sure that all Makefile.in are up-to-date.  See
                   ${PORTSDIR}/infrastructure/mk/automake.dep for an example.

                   See ports(7).

                   See ports(7).

     REVISION      Revision number of the current package.  Defaults to empty
                   (very first package), then numbering starts at 0.  Gets
                   automatically incorporated into FULLPKGNAME as
                   'p${REVISION}' to form a full package-name conforming to

     RUN_DEPENDS   Specification of ports this port needs installed to be
                   functional.  Same format as LIB_DEPENDS.  The corresponding
                   packages will be built right before the install stage, and
                   pkg_add(1) will take care of installing them.

                   Many GNU configure ports can be built in a directory dis-
                   tinct from the place they were unpacked.  For some specific
                   ports, this is even mandatory.  Set to 'yes' or 'simple' if
                   this is the case.  The ports infrastructure will generate a
                   separate ${WRKBUILD} directory in which the port will be
                   configured and built.  Wipe ${WRKBUILD} to start anew, but
                   skipping the extract/patch stage.

     SETENV        Normally set to /usr/bin/env -i.  Prepended to every com-
                   mand invocation that requires a clean environment.  Do not

     SHARED_LIBS   List of shared libraries that the port may build, as a list
                   of the form 'libname' 'libversion'.  Used to set variables
                   of the form LIBlibname_VERSION that are then used for sub-
                   stitution by pkg_create(1).  The porter is responsible for
                   making sure the port uses those version numbers when shared
                   libraries are built.

                   The intent is that the OpenBSD ports system must have con-
                   trol over shared library versions because of global changes
                   that may require bumping the major version of every shared
                   library in the system, or simply because the third party
                   programmers do not understand the rules for shared library
                   versions, thus breaking the update mechanism.  For that
                   reason it is advised to set libversion to 0.0 when first
                   importing a port.

                   Porters of software using libtool should make sure
                   MAKE_FLAGS get propagated to the libtool invocations.  This
                   should be enough in most cases.

     SHARED_ONLY   Set to 'Yes' if port can only be built on architectures
                   with shared libraries.

                   User settings.  Set to pkg_create(1) options for signing
                   packages directly during their creation.

     SKIPDIR       See ports(7).

     STATIC_PLIST  Normally set to 'yes'.  Can be set to no for ports that do
                   not have a static plist.  Do not change without a very good
                   reason.  Note that the only good reason to not have a
                   static plist is for ports such as databases/ports-readmes
                   which actually build a bunch of files depending on the cur-
                   rent ports tree.  This breaks all introspection mechanisms
                   within the ports tree, including databases/pkglocatedb
                   which will not include that port.

     STARTAFTER    See ports(7).

     STARTDIR      See ports(7).

     SUBPACKAGE    Set to the subpackage suffix when building a package in a
                   multi-package port.  Read-only.  Used to test for dependen-
                   cies or to adjust the package name.

     SUBST_CMD     A command that can be used to perform SUBST_VARS substitu-
                   tion on arbitrary files.  In normal mode,

                         ${SUBST_CMD} file1 file2 ...

                   will substitute files in place, creating backup copies of
                   them.  In copy mode,

                         ${SUBST_CMD} -c src1 dest1 src2 dest2

                   will copy files over while performing the substitution, as
                   suitable for copying template files over from ${FILESDIR}
                   to ${PREFIX}, for instance.  This uses pkg_subst(1) with
                   suitable parameters.  Read-only.

                   ${SUBST_CMD} can be used like install(1):
                         ${SUBST_CMD} [-g group] [-o owner] [-m mode] file...
                   to set file owner, group and/or mode.

                   Note that SUBST_CMD is not really appropriate when vari-
                   ables have subpackage variations, like PREFIX or
                   FULLPKGNAME.  Use the appropriate SUBST_CMD-sub instead.

                   SUBST_CMD with subpackage-dependent semantics, like pack-
                   ing-list substitution.  It will substitute the right vari-
                   able depending on the desired subpackage, e.g.,
                   SUBST_CMD-foo will substitute the value of FULLPKGNAME-foo
                   for ${FULLPKGNAME}.

                   Specialized versions of SUBST_CMD that use -c and appropri-
                   ate owner/group/mode for data, manpages and programs

     SUBST_VARS    Make variables whose values get substituted to create the
                   actual package information.  Always holds ARCH,
                   TRUEPREFIX, and X11BASE.  The special construct
                   '${FLAVORS}' can be used in the packing-list to specify the
                   current list of dash separated flavors the port is compiled
                   with (useful for cross-dependencies in MULTI_PACKAGES).
                   Add other variables as needed.  Some variable names are
                   prefixed by a ^.  This is only relevant for update-plist,
                   where it means the variable will only be substituted at the
                   beginning of a path.

     SUDO          User settings.  If set to sudo(8) in mk.conf(5), the ports
                   tree will only invoke root's privileges for the parts that
                   really require it.

     SUPDISTFILES  Supplementary files that need to be retrieved under some
                   specific circumstances.  For instance, a port might need
                   architecture-specific files.  SUPDISTFILES should hold a
                   list of all distribution files and patchfiles that are not
                   always needed, so that a mirror will be able to grab all
                   files, or that makesum will work.  Having an overlap
                   between SUPDISTFILES and DISTFILES, PATCHFILES is admissi-
                   ble, and in fact, expected, as it is much simpler to build
                   an error-free list of files to retrieve in that way.  See
                   the xanim port for an example.

     SYSCONFDIR    Location for this port's configuration files, should always
                   be derived from BASESYSCONFDIR, which defaults to /etc.
                   Passed to gnu configure scripts and substituted in PLISTs.

                   Location of the systrace filter file which is the basis for
                   a port's actual systrace policy file.  Defaults to

                   Location of the supplementary systrace filter file which is
                   used when USE_CCACHE is enabled.  Defaults to

                   List of variables used in ${SYSTRACE_FILTER} that will be
                   substituted by their real value when creating the systrace
                   policy file.  Always holds WRKOBJDIR, PORTSDIR, and

     TAR           Name of the tar binary.

     TARGETS       Read-only.  Set to the list of special targets for a port
                   ({pre,do,post}-* and module hooks).  Used by introspection
                   tools such as the sqlports package.

     TEMPLATES     Base location for the templates used in the readmes target.
                   User settings.  Defaults to

     TEST_DEPENDS  See BUILD_DEPENDS for specification.  Test dependencies are
                   only checked if the test stage is invoked.

     TEST_ENV      Additional environment variables passed to tests.  Empty by

     TEST_FLAGS    Extra flags passed to ${MAKE_PROGRAM} to run the regression
                   tests.  Empty by default.

                   Set to 'Yes' if port needs human interaction to run its
                   tests, or set to 'X11' if the tests need an active X11 dis-
                   play to work.

     TEST_LOG      Command used to log the results of regression tests to

     TEST_LOGFILE  Log file containing the results of regression tests.

     TEST_TARGET   Target to run regression tests.  Defaults to 'regress',
                   except for 'perl' and 'gnu' CONFIGURE_STYLE, which default
                   to 'test' and 'check', respectively.

     TRUEPREFIX    Read-only.  Mostly the same as ${PREFIX}, except it never
                   gets ${DESTDIR} prepended during fake.  Refer to "THE FAKE
                   FRAMEWORK" for details.

     TRY_BROKEN    User settings.  If set to 'Yes', don't set IGNORE for
                   BROKEN ports, so that we will attempt to build them.

     UNLOCK_CMD    User settings.  If set, expands to a command that will
                   release a lock.  This lock will reside in ${LOCKDIR}.

     UNMESSAGE     File recorded in the package and displayed during deinstal-
                   lation.  Defaults to ${PKGDIR}/UNMESSAGE if this file
                   exists.  Leave empty if no message is needed.

     UNZIP         Name of the unzip binary.

                   User settings.  Used to store cookies for package updates
                   and defaults to ${PORTSDIR}/update/${MACHINE_ARCH}.  If set
                   to empty, will revert to a file under ${WRKDIR}.

     USE_CCACHE    User settings.  Set to 'Yes' to use ccache when building
                   ports.  Adds a build dependency on devel/ccache, and sets
                   up the build environment so that it is used.

     USE_GMAKE     Set to 'Yes' if GNU make (${GMAKE}) is needed for correct
                   behavior of this port.

     USE_GROFF     Set to 'Yes' to use groff to build manpages.  This sets
                   groff as a build dependency, and also tells pkg_create(1)
                   to format manpages behind the scene using groff while
                   building packages.

     USE_LIBTOOL   Defaults to 'Yes'.  Set to 'gnu' if the base libtool(1) is
                   insufficient and GNU libtool is required.  Set to 'No' to
                   disable the use of libtool(1) entirely; this should not be
                   set under normal circumstances.  Adds dependencies if nec-
                   essary, and passes LIBTOOL environment variable to scripts

     USE_MFS       Set to 'Yes' to build ports under an mfs(8) filesystem.
                   Mostly for use by dpb(1) and not intended to be a user set-
                   ting.  See WRKOBJDIR_MFS for configuration.

     USE_SYSTRACE  User settings.  Set to 'Yes' to protect port building with

     USE_X11       Normally, presence of ${X11BASE} is enforced by default for
                   building ports.  But there is an experimental way to hook
                   the xenocara build into dpb(1), which requires knowing
                   whether a port requires X11 to already be there.

                   The infrastructure mostly sets USE_X11 automatically based
                   on WANTLIB values, there are a few ports (about 20) that
                   require X11 components without any library telltale.

     VARBASE       User settings.  Base location for ports that install stuff
                   outside of ${LOCALBASE}.  Defaults to /var.

     WANTLIB       Extra list of library specifications that a package will
                   need.  May include system and X11 libraries.  See
                   library-specs(7) for more details.

                   As a special extension, WANTLIB may include absolute paths,
                   e.g., ${LOCALBASE}/lib/expat.=4 to distinguish between base
                   libraries and port libraries.  Use with caution, this is
                   very seldom needed.

     wantlib_args  Controls the behavior of pkg_create(1) related targets, see
                   print-package-args for details.

     WARNINGS      User settings.  If set to 'Yes', add CDIAGFLAGS to CFLAGS
                   and CXXDIAGFLAGS to CXXFLAGS.

     WRKBUILD      Subdirectory of ${WRKDIR} where the actual build occurs.
                   Defaults to ${WRKSRC}, unless SEPARATE_BUILD is involved,
                   in which case it is set to an appropriate value.

     WRKCONF       Subdirectory of ${WRKDIR} where the actual configure set
                   occurs.  Defaults to ${WRKBUILD}.

     WRKDIR        Location where all port activity occurs.  Apart from the
                   actual port, may hold all kinds of cookies that checkpoint
                   the port's build.  Read-only.  Note that WRKDIR may be a
                   symbolic link.  During ports building, ${WRKDIR}/bin is put
                   at the front of the PATH.

                   Name of a symbolic link to create within the port directory
                   which will point to the port's ${WRKDIR}.  See

     WRKDIST       Subdirectory of ${WRKDIR} in which the distribution files
                   normally unpack.  Base for all patches.  Defaults to
                   ${WRKDIR}/${DISTNAME}.  Note that WRKDIST may be a symbolic
                   link, if set to ${WRKDIR}.

     WRKSRC        Subdirectory of ${WRKDIR} where the actual source is.  Base
                   for configuration (default: ${WRKDIST}).  Note that WRKSRC
                   may be a symbolic link, if set to ${WRKDIR}.

     WRKINST       Subdirectory of ${WRKDIR} where port normally installs (see
                   fake target).

     WRKOBJDIR     Used as a base for the actual port working directory.
                   Defaults to ${PORTSDIR}/pobj.  The real working directory
                   ${WRKDIR} is created there.  Can be set on a per-${PKGPATH}
                   basis.  For instance, setting WRKOB-
                   JDIR_www/mozilla=/tmp/obj will affect only the mozilla
                   port.  If explicitly unset (WRKOBJDIR=), the working direc-
                   tory is created within the port directory.

                   Alternate location for the port working directory.  The
                   intent is to use an mfs(8) based filesystem for small ports
                   with dpb(1).  Active when USE_MFS is 'Yes'.  Defaults to

     X11BASE       Where X11 has been installed.  Default: /usr/X11R6.

     XAUTHORITY    Points to a suitable authority file for X11 interactive
                   regression tests.  Defaults to ${HOME}/.xauthority.

     XMKMF         Invocation of xmkmf for a CONFIGURE_STYLE=imake port.
                   Defaults to xmkmf -a -DPorts.  The -DPorts is specific to
                   OpenBSD and is always appended.

     YACC          Name of yacc program to pass to GNU-configure, defaults to
                   yacc.  GNU-configure would always try to use bison other-
                   wise, which leads to unreproducible builds.  Set to bison
                   if needed.

     Note that some of these messages are actually emitted by some other
     external commands, but grouped here for convenience: easier to look for
     in dpb(1)'s logs.

     Discovered old directory in ...  This message comes from make-plist(1).
     A directory was found in the PLIST that used to be needed but is no
     longer, because it's now accounted for through dependencies.  Indicates
     the old directory has been removed.

     Error: change in plist between ...  Error message comes from

     Error: duplicate item in packing-list  Error message comes from
     pkg_create(1), and will result from incorrect packing-lists, such as
     including several fragments with the same file, or having incorrect

     Error: Libraries in packing-lists...and libraries from installed packages
     don't match  The ports tree and the installed packages are out-of-sync.
     Mixing library information from both sources might produce packages that
     can't be installed elsewhere.  Cleanest fix is to update the out-of-date
     source (e.g., update the ports tree, or build and install new packages).
     Developers may use PKG_CREATE_NO_CHECKS instead, assuming they understand
     the implications.  See print-package-args (wantlib-args) for details.

     Fatal: can't flavor a SUBDIR  A dependency mentions top_subdir,flavor.
     Flavor would then be ignored, as it is only applied to individual ports.

     Fatal: can't subpackage a SUBDIR  A dependency mentions top_subdir,-sub.
     Subpackage would then be ignored, as it is only applied to individual

     Fatal: flavor should never start with a digit  This would utterly confuse
     pkg_add(1).  See packages-specs(7).

     Fatal: inclusion of <&lt;file>&gt; from <&lt;file>&gt;  bsd.port.mk or bsd.port.subdir.mk
     has been included from a MODULE or from Makefile.inc, resulting in a dou-
     ble inclusion.  This would lead to weird results, such as PKG_ARGS being
     defined twice.

     Fatal: SUBPACKAGES should always begin with -: <&lt;offending list>&gt;  That is
     the only way to differentiate between FLAVOR and SUBPACKAGE in pkgpath(7)

     Fatal: building ports requires correctly installed X11  All file sets of
     the base OS, including xenocara, must be installed before building ports.

     Fatal: /usr/local/lib/X11/app-defaults should exist and be a symlink
     /usr/local/lib/X11/app-defaults is distributed as a symlink in the
     xshare*.tgz file set.  If xenocara was not fully installed before pack-
     ages were added, it may have been created as a directory instead.

     Fatal: the licencing info for <&lt;pkgname>&gt; is incomplete...  Every port must
     have explicit defines of all PERMIT_* values.

     Fatal: Use 'env FLAVOR=flavor make' instead  Arguments specified after
     make(1) are hardcoded for all recursive sub-makes, and very difficult to
     override.  Thus, FLAVOR must be specified in the environment instead.

     Fatal: Use 'env SUBPACKAGE=-sub make' instead  Arguments specified after
     make(1) are hardcoded for all recursive sub-makes, and very difficult to
     override.  Thus, SUBPACKAGE must be specified in the environment instead.

     ldconfig: <&lt;dir>&gt;: No such file or directory  Usually produced by
     pkg_add(1) running ldconfig(8).  Some tools such as GNU libtool will add
     directories living under ${WRKINST} to the shared library path during the
     fake stage.  Of course, ldconfig(8) will later complain after the direc-
     tory no longer exists.  The bogus tool should be fixed to conform to
     OpenBSD usage.

     LIB_DEPENDS <&lt;spec>&gt; not needed for <&lt;FULLPKGPATH>&gt;  There doesn't seem to be
     any WANTLIB to match the given LIB_DEPENDS.  Thus, the LIB_DEPENDS won't
     turn into a @depends line in the created package.  This is often because
     of confusion between LIB_DEPENDS and RUN_DEPENDS: RUN_DEPENDS is needed
     for dlopen'd libraries.

     Might be intentional sometimes, if some compile flavors create static
     binaries, for instance.  Also, will happen for multi-packages, where one
     sets LIB_DEPENDS to have a given build dependency (and corresponding
     WANTLIB for a given SUBPACKAGE).

     See print-package-args (lib-depends-args) for details.

     Warning: FULLPKGNAME-sub defined but not FULLPKGPATH-sub  FULLPKGNAME-sub
     has been explicitly defined by the port, instead of relying on the
     default, but no value of FULLPKGPATH-sub has been given.  This is often
     an error.

     Warning: symlink(s) point to non existent file.  Warning message comes
     from pkg_create(1).  The symlink resides in the fake area, under
     ${WRKINST}.  This is only a warning because the symlink may point to a
     run-time dependency, which obviously won't exist under ${WRKINST} at the
     time make package is run.

     Warning: @option no-default-conflict with no @conflict  Warning message
     comes from pkg_create(1).  Most packages that waive "default-conflict"
     will have explicit conflict markers instead.  Otherwise, the package will
     only conflict with the exact same version, with some possible REVISION
     bumps.  Any other version or FLAVOR won't conflict.  This is generally an
     error, apart from very few ports like devel/autoconf/*.

     groff produced empty result for <&lt;manpage>&gt;...  Warning message comes from
     pkg_create(1).  Manpages are automatically formatted with groff(1) if
     USE_GROFF is set.  The above message denotes an actual problem while for-
     matting the page, which should be addressed.  In the meantime,
     pkg_create(1) still produces a package, but leaves the manpage unformat-
     ted, in the hope that something will be able to make sense of it.

                Common Makefile fragment for a set of ports, included automat-

                Default path to a CD-ROM (or other media) full of distribution

                Cache of all distribution files.

     distinfo   Checksum file.  Holds the output of cksum(1), using ${PRE-
                FERRED_CIPHERS}, for the port's ${DISTFILES} and ${PATCH-
                FILES}, as well as the sizes of these files.

                Cache of normal distribution files for a given port.

                Cache of all distribution files for a given port.

                Description for the port.  Variables such as ${HOMEPAGE} and
                ${MAINTAINER} will be expanded (see SUBST_VARS).  Multi-pack-
                age ports will use DESCR${SUBPACKAGE}.

                OpenBSD specific documentation for a port, that will be
                installed as ${LOCALBASE}/share/doc/pkg-readmes/${FULLPKGNAME}
                at the end of fake.  Variables from SUBST_VARS will be
                expanded.  Multi-package ports will use README${SUBPACKAGE}.

                Startup script for <foo>.  Will be installed as ${RCDIR}/&lt;foo&gt;
                at the end of fake.  Variables from SUBST_VARS will be

                Specification used for populating ${WRKINST} at the start of
                fake.  Use pre-fake if this is incomplete.

                Default setup of ${PACKAGE_REPOSITORY}.

                Location of arch-independent packages.

                Location of all built packages.

                Location of packages retrieved through the network.

                Location of checksums, see CHECKSUM_PACKAGES.

                Location of packages suitable for the CD.

                Location of packages suitable for FTP.

                Default setup of ${BULK_COOKIES_DIR}.

                Default setup of ${UPDATE_COOKIES_DIR}.

                Extra directory used to store local ports before committing
                them.  All depend targets will normally look there after the
                normal lookup fails.  See PORTSDIR_PATH.

                List of additional port specific filters, included automati-

                List of additional port specific policies, included automati-

     The fake target is used to install the port in a private directory first,
     ready for packaging by the package target, so that the actual installa-
     tion will use the package.

     Essentially, fake invokes a real install process after tweaking a few

     fake first creates a skeleton tree under ${WRKINST}, using the mtree(8)
     specification ${PORTSDIR}/infrastructure/db/fake.mtree.

     A pre-fake target may be used to complete that skeleton tree.  For
     instance, a few ports may need supplementary stuff to be present (as it
     would be installed if the port's dependencies were present).

     If {pre,do,post}-install overrides are present, they are used with some
     important changes, listed in FAKE_SETUP:


     Essentially, old install targets work transparently, except for a need to
     change PREFIX to TRUEPREFIX for symbolic links and similar path lookups.
     Specific traditional post install work can be simply removed, as it will
     be taken care of by the package itself (for instance, ldconfig, or tex-
     info's install-info).

     If no do-install override is present, the port is installed using


     Note that this does set both PREFIX and ${DESTDIRNAME}.  If a port's
     Makefile both heeds ${DESTDIRNAME}, and references PREFIX explicitly,
     FAKE_FLAGS may rectify the problem by setting PREFIX=${PREFIX} (which
     will do the right thing, since ${PREFIX} is a make(1) construct which
     will not be seen by the shell).

     ${FAKE_FLAGS} is used to set variables on make(1) command line, which
     will override the port Makefile contents.  Thus, a port that mentions
     DESTDIR= does not need any patch to work with fake.

     Files such as ${PKGDIR}/README* or ${PKGDIR}/*.rc get copied to
     ${WRKINST} at the end of fake (see the FILES section above for details).

     Starting with OpenBSD 2.7, each port can generate distinct packages
     through two orthogonal mechanisms: FLAVORS and MULTI_PACKAGES.

     The current MULTI_PACKAGES mechanism was introduced after OpenBSD 4.0.

     The arch-dependent part was refined after OpenBSD 5.0.

     If a port can be compiled with several options, these options should be
     turned into FLAVORS.  The port maintainer will set FLAVORS to be the list
     of possible options in the Makefile.  When building the port, the package
     builder will set FLAVOR='option1 option2...' to build a specific flavor
     of the port.  The Makefile should test the value of FLAVOR as follows:

           .if ${FLAVOR:Moption1}
           # what to do if option1
           .if ${FLAVOR:Moption2}
           # what to do if option2

     bsd.port.mk takes care of a few details, such as generating a distinct
     work directory for each flavor, or creating a FULLPKGNAME by adding a
     dash separated list of flavors to the base package name.  The order in
     which FLAVOR is specified does not matter: this dash separated list will
     be reordered to match the ordering of FLAVORS.

     It is an error to specify an option in FLAVOR that does not appear in
     FLAVORS, to prevent misspellings.

     In bulk package building, flavors can be specified as a comma separated
     list after the package directory, e.g., SUBDIR+=vim,no_x11 (see

     Finally, package information will use templates with the canonical pack-
     age extension if they are available: if FLAVOR='option1 option2' and both
     COMMENT and COMMENT-option1-option2 are available, COMMENT-
     option1-option2 will be used.

     If one build of a port can generate several distinct packages, set
     MULTI_PACKAGES accordingly.  Each extension of a MULTI_PACKAGES name
     should start with a dash, so that they cannot be confused with FLAVORS.
     In dependency checking and bulk builds, a subpackage can be specified
     after a comma, e.g., SUBDIR+=quake,-server.  MULTI_PACKAGES only affects
     the actual package building step (and the describe step, since a
     MULTI_PACKAGES port will produce several descriptions).

     If MULTI_PACKAGES is set, the packaging stage happens once for every sub-
     package, using subpackage-specific variables.  For instance, if
     MULTI_PACKAGES=-main -lib -server, PKG_ARCH-main, PKG_ARCH-lib and
     PKG_ARCH-server will be used for the subpackages respectively called

     All package information is also derived from templates with SUBPACKAGE
     appended.  In the preceding example, the packing-list template for FULLP-
     KGNAME-lib must be in PLIST-lib.

     The following variables are subpackage dependent: COMMENT, PKG_ARCH,

     The usual non-MULTI_PACKAGES variables are simply used as default values
     for all subpackages.  So, if you set PKG_ARCH=* PKG_ARCH-main=i386 then
     PKG_ARCH-lib and PKG_ARCH-server will both be '*'.

     WANTLIB and LIB_DEPENDS are special.  At the beginning of the build, dur-
     ing prepare, all build dependencies will be checked, which includes
     LIB_DEPENDS, WANTLIB for every subpackage.  As an exception, any
     LIB_DEPENDS-sub that references the current port will be ignored as a
     build dependency, in order to avoid recursion.

     FULLPKGPATH and FULLPKGNAME are special as well.  You must set
     PKGNAME-sub or FULLPKGNAME-sub for each subpackage, but FULLPKGPATH-sub
     is set automatically to the right value.  In very rare cases, one may
     override FULLPKGPATH-sub.  (for instance, if one specific subpackage is
     not affected by option settings that affect other subpackages, e.g., for
     include files packs).

     In terms of using the port, quite a few targets will have a subpackage
     specific subtarget: invoking package is the same as invoking subpackage
     for all subpackages, invoking install-all is the same as invoking install
     for all subpackages, and invoking update is the same as invoking subup-
     date for all subpackages.

     The infrastructure will automatically filter subpackages that are not
     suitable for the current architecture.  Thus, MULTI_PACKAGES should
     always list all subpackages, even things not buildable on the current
     architecture, for indexing purposes.

     Starting with OpenBSD 5.1, bsd.port.arch.mk(5) should be used to simplify
     the handling of MULTI_PACKAGES in arch-dependent setups:

     Make sure MULTI_PACKAGES, ONLY_FOR_ARCHS*, and PSEUDO_FLAVORS are defined
     correctly, then

           .include <bsd.port.arch.mk>

     This will compute BUILD_PACKAGES, the list of actual subpackages to build
     with the current setup, by taking arch constraints and pseudo-flavors
     into account.  Then test BUILD_PACKAGES to set up the right configura-
     tion, e.g., to check if SUBPACKAGE -mono should be built:

           .if ${BUILD_PACKAGES:M-mono}

     The lang/gcc/4.2 or print/poppler ports should provide examples of proper

     Note that dpb(1) will break if all subpackages are not properly listed.

     Starting after OpenBSD 4.1 all package information is processed directly
     by pkg_create(1) from templates in ${PKG_DIR}.

     o   If not overridden by the user, determine which set of templates to
         use, depending on the current SUBPACKAGE and FLAVOR information.  Set
     o   Generate the actual DESCR, and if needed, MESSAGE, UNMESSAGE, from
         the templates in ${DESCR}, ${MESSAGE}, ${UNMESSAGE}, by substituting
         the variables in ${SUBST_VARS}, and by substituting ${FLAVORS} with
         the canonical flavor extension for this port, e.g., if FLAVORS=no_map
         gfx qt2, if FLAVOR=gfx no_map, this is '-no_map-gfx'.
     o   Generate the actual PLIST from the template ${PLIST}, by inserting
         shared/no-shared fragments, merging other fragments, and applying the
         same variable substitutions as other package information.

     Note that ${COMMENT} is currently not substituted, to speed up describe

     To avoid substitution, variables can be escaped as follows: $\{PREFIX}

     Constructs such as the line %%SHARED%% or !%%SHARED%% in the packing-list
     template trigger the inclusion of the ${PKGDIR}/PFRAG.shared${SUBPACKAGE}
     or ${PKGDIR}/PFRAG.no-shared${SUBPACKAGE}.

     Similarly, if FLAVORS lists flav1, then the line %%flav1%% (resp.
     !%%flav1%%) will trigger the inclusion of
     ${PKGDIR}/PFRAG.flav1${SUBPACKAGE} (resp.
     ${PKGDIR}/PFRAG.no-flav1${SUBPACKAGE}) in the packing-list.  Other frag-
     ments can be defined by simply adding -Dfrag=1 or -Dfrag=0 to PKG_ARGS

     If libraries are built using bsd.lib.mk, special care should be taken for
     mips64* architectures, which do not ever build *pic.a files (all mips
     code is pic already).  bsd.port.mk automatically adds -Dno_mips64=1 or
     -Dno_mips64=0 to PKG_ARGS, and the porter only needs to provide the
     appropriate fragment.

     pkg_add(1) now calls ldconfig(8) directly, provided dynamic libraries
     have been annotated with @lib libthingy.so.5.0.  Adding new directories
     to the dynamic loader cache has been deprecated.  It is often better to
     let libraries be visible as a link under ${LOCALBASE}.  Having a separate
     directory is enough to trick ld(1) into grabbing the right version.
     Libraries used only for dlopen(3) do not need to be visible.  Some pro-
     grams will prefer to use rpath to find their own libraries.

     The special update-plist target does a fairly good job of automatically
     generating PLIST and PFRAG.shared fragments.

     If PLIST_DB points to a directory, all packing-lists from packages gener-
     ated by pkg_create(1) during the package stage are saved in that location
     by a script: ${PORTSDIR}/infrastructure/bin/register-plist.  This script
     strips some irrelevant information and normalizes the packing-list some-
     how, and compares it to existing information, looking for relevant
     changes.  Since a package name must always be changed when the packing-
     list changes, any attempt to replace a packing-list of a given name with
     a different packing-list will be flagged as an error.

     In MULTI_PACKAGES mode, there must be separate COMMENT, DESCR, and PLIST
     templates for each SUBPACKAGE (and optional distinct MESSAGE, UNMESSAGE
     files in a similar way).  This contrasts with the FLAVORS situation,
     where all these files will automatically default to the non-flavor ver-
     sion if there is no flavor-specific file around.

     cdrom-packages, ftp-packages
                   Links are now created during the package target.

     depends-list  Renamed into full-build-depends

                   Don't override.  Set EXTRACT_ONLY to nothing and override
                   post-extract instead.

                   These prevented bulk mechanisms from running properly.

                   There is no port that requires special treatment during
                   packaging, as {pre,do,post}-install should take care of
                   every necessity.

     fetch-list, mirror-distfiles, fetch-makefile
                   See mirroring-ports(7) for more efficient and flexible ways
                   to build mirrors.

     obj           Starting with OpenBSD 3.3, using WRKOBJDIR no longer cre-
                   ates a symlink between the current directory and a subdi-
                   rectory of ${WRKOBJDIR}, so obj is no longer applicable.

                   Use print-build-depends and print-run-depends instead.

                   Renamed into print-build-depends

                   Renamed into print-run-depends

                   Renamed into print-update-signature

     readme, readmes
                   replaced by the databases/ports-readmes port, using the
                   Template Toolkit (textproc/p5-Template) instead of hand-
                   coded substitutions.

     BIN_PACKAGES  Old user settings.  The infrastructure always trusts the
                   repository to contain correct packages.  So, if the package
                   name did not change and if it exists in the repository, it
                   will not be rebuilt without manual user action.

     CATn          List of formatted manpages, per section.

     CATPREFIX     Location for storing formatted manpages.  Derived directly
                   from PREFIX.

                   Old user settings.  Base location where packages suitable
                   for a CD-ROM (see PERMIT_PACKAGE_CDROM) will be placed.
                   Now hardwired to

     COMMENT       Used to be the name of the comment file for a package.  It
                   now holds the comment itself.  Some magic has been put in
                   to allow for a seamless transition.

     DESCR_SRC     From NetBSD.  This is DESCR.  OpenBSD does not give a spe-
                   cific name to the generated file.  It is not recommended to
                   try to access it directly.

                   Was used to cobble together the normal extraction command,
                   as ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS}
                   ${EXTRACT_AFTER_ARGS}.  Use EXTRACT_CASES instead.

                   Likewise, use EXTRACT_CASES instead.

     EXTRACT_CMD   Likewise, use EXTRACT_CASES instead.

                   Set FETCH_CMD to point to a script that does any required
                   special treatment instead.

                   Used to specify dependencies that were needed to fetch
                   files.  It is much easier to mirror locally weird distribu-
                   tion files.

     FTP_PACKAGES  User settings.  Base location where packages suitable for
                   FTP (see PERMIT_PACKAGE_FTP) will be placed.  Now hardwired
                   to ${PACKAGE_REPOSITORY}/${MACHINE_ARCH}/ftp.

                   Use CONFIGURE_STYLE instead.

                   Use CONFIGURE_STYLE instead.

     IGNOREFILES   Set to the list of files that can't be checksummed.  All
                   uses of it have led to postponing the correct action: talk-
                   ing to the software author and getting him to provide ver-
                   sioned archives.

     MANn          List of unformatted manpages, per section.

     MANPREFIX     Location for storing unformatted manpages.  Derived
                   directly from PREFIX.

     MASTERDIR     From FreeBSD.  Used to organize a collection of ports that
                   share most files.  OpenBSD uses a single port with flavors
                   or multi-packages to produce package variations instead.

                   Contents were used to replace '%SUBDIR%' in all
                   MASTER_SITES variables.  Since '%SUBDIR%' almost always
                   occur at the end of the directory, the simpler
                   ${VARIABLE:=subdir/} construct is now used instead (taken
                   from NetBSD).

     MD5_FILE      Use CHECKSUM_FILE instead.

                   Use PERMIT_DISTFILES_FTP to determine which files can be
                   mirrored instead.  See mirroring-ports(7).

     NEED_VERSION  Used to set a requirement on a specific revision of
                   bsd.port.mk needed by a port.  No longer needed as
                   bsd.port.mk should always be kept up-to-date.

     NO_CONFIGURE  If ${CONFIGURE_SCRIPT} does not exist, no automatic config-
                   uration will be done anyway.

     NO_DESCRIBE   All ports should generate a description.

     NO_EXTRACT    Set EXTRACT_ONLY= instead.

                   Use CONFIGURE_STYLE instead.

     NO_MTREE      Starting with OpenBSD 2.7, the operating system installa-
                   tion script runs the /usr/local specification globally,
                   instead of embedding it in each package.  So packages no
                   longer record an mtree(8) specification.  Use an explicit
                   '@exec' command if needed.

     NO_PACKAGE    All ports should generate a package, preferably before

     NO_PATCH      The absence of a patches directory does the same.  Use
                   PATCHDIR and PATCH_LIST if patches need to be changed

     NO_WRKDIR     All ports should have a working directory, as this is nec-
                   essary to store cookies and keep state.

     NO_WRKSUBDIR  The same functionality is obtained by setting
                   WRKDIST=${WRKDIR} .

                   Use CLEANDEPENDS instead.

                   FreeBSD ships with compressed man pages, and uses this
                   variable to control that behavior.

     OBJMACHINE    Starting with OpenBSD 3.3, setting WRKOBJDIR creates the
                   whole WRKDIR hierarchy under ${WRKOBJDIR}, so OBJMACHINE is
                   no longer useful.

     OPSYS         The operating system.  This ports tree is only used on

     OPSYS_VER     Use OSREV instead.

     PACKAGES      Base location for packages built, everything is based on
                   PACKAGE_REPOSITORY now.

     PACKAGING     Used to be set during package creation, so that the port
                   would test it to tweak some settings at this point.  All
                   its effects are now achieved through MULTI_PACKAGES.

     PATCH_SITES   PATCHFILES used to be retrieved from a separate site list.
                   For greater flexibility, all files are now retrieved from
                   MASTER_SITES, MASTER_SITES0, ..., MASTER_SITES9, using a
                   ':0' to ':9' extension to the file name, e.g.,




                   The OpenBSD project does not ship distfiles on cdrom.  Con-
                   centrate on real questions instead, make sure
                   PERMIT_PACKAGE_CDROM is set correctly.

     PKG_CMD       replaced by PKG_CREATE.

                   Old user settings.  See PACKAGE_REPOSITORY.

                   Old user settings.  See PACKAGE_REPOSITORY.

     PLIST_SRC     From NetBSD.  This is PLIST.  OpenBSD does not give a spe-
                   cific name to the generated file.  It is not recommended to
                   try to access them directly.

     PKGNAME       Used to refer to the full package name, has been superseded
                   by FULLPKGNAME-foo, for SUBPACKAGE -foo .  PKGNAME now
                   holds the package name, not taking multi-packages or fla-
                   vors into account.  Most ports are not concerned by this

     PLIST_SUBST   From NetBSD and FreeBSD.  Use SUBST_VARS instead.  OpenBSD
                   does not allow general substitutions of the form VAR=value,
                   but uses only a list of variables instead.  Most package
                   files gets transformed, instead of only the packing list.

     RESTRICTED    Port has cryptographic issues.  OpenBSD focuses on
                   PERMIT_PACKAGE_{FTP,CDROM} instead.

     SED_PLIST     Old pipeline for creating packing-lists at the ports level.
                   Necessary functionality has been integrated directly into

     SCRIPTDIR     Old location for scripts related to the current port.
                   There is no reason for the semantic distinction, use
                   FILESDIR for those.

     SCRIPTS_ENV   Used to contain the environment for invoking various
                   scripts.  CONFIGURE_ENV and MAKE_ENV are enough.


     USE_BZIP2     The framework will automatically detect the presence of
                   .tar.bz2 files to extract.  See also BZIP2, EXTRACT_CASES,
                   and EXTRACT_SUFX.

     USE_IMAKE     Use CONFIGURE_STYLE instead.

     USE_ZIP       The framework will automatically detect the presence of
                   .zip files to extract.  See also ZIP, EXTRACT_CASES, and

     VARNAME       Use make show=name instead of make show VARNAME=name.

     WRKPKG        Directory used to build package information from the tem-
                   plates under ${PKGDIR}.  This information is now built on
                   the fly by pkg_create(1).

                Offensive to introspection, makes it impossible to build a
                decent sqlports on a given arch.  Hasn't been used for a long
                time, and there are lots of mechanisms such as PKG_ARGS and
                fragment substitution, or PATCH_LIST to achieve similar

                Likewise, offensive to introspection too.

                Renamed to distinfo to match other BSD, and save directories.

                Identical functionality can be obtained through a
                {pre,do,post}-* target, invoking the script manually if neces-

                No longer invoked automatically.  Just inline the instructions
                in do-configure in the Makefile, or put the script in ${FILES-
                DIR} and invoke it.

                Use COMMENT variable instead.

                Use @unexec annotations in the packing-list instead.

                Use @exec annotations in the packing-list instead.

                Use PFRAG.shared or PFRAG.no-shared instead.  PLIST.noshared
                was too easy to forget when updating ports.

                Use PLIST directly.  Until revision 1.295, bsd.port.mk did not
                substitute variables in the packing list unless this special
                form was used.

                Old requirement script.  Was mostly unused anyway.

                Original location of bsd.port.mk.  The current file lives
                under ${PORTSDIR}/infrastructure/mk/bsd.port.mk, whereas
                /usr/share/mk/bsd.port.mk is just a stub.

                The OpenBSD ports tree focuses on robustness, not on being
                portable to other operating systems.  In any case, portability
                should not need to depend on operating system dependent

                Used by FreeBSD to marshall system configuration files.  All
                OpenBSD system configuration files are located in /etc, or in
                a subdirectory of /etc.

     ftp(1), pkg_add(1), pkg_create(1), OpenBSD::Intro(3p),
     bsd.port.arch.mk(5), mk.conf(5), port-modules(5), library-specs(7),
     mirroring-ports(7), packages-specs(7), pkgpath(7), ports(7)

     The ports mechanism originally came from FreeBSD.  A lot of additions
     were taken from NetBSD over the seminal years.

     Since 1998, the framework has been systematically cleaned-up and reorga-
     nized to remove bugs.  New features have been carefully introduced, try-
     ing hard to avoid inconsistencies.

     FLAVORS, MULTI_PACKAGES and FAKE are OpenBSD improvements.  Most recent
     additions do not come from another BSD.

     LOCALBASE, X11BASE, SYSCONFDIR and PREFIX are not heeded consistently.
     Most of the ports tree will probably fall apart if one tries to build/use
     stuff elsewhere.

BSD                             March 30, 2017                             BSD