Configuring pkgsrc General configuration In this section, you can find some variables that apply to all pkgsrc packages. The preferred method of setting these variables is by setting them in /etc/mk.conf. LOCALBASE: Where packages will be installed. The default is /usr/pkg. Do not mix binary packages with different LOCALBASEs! CROSSBASE: Where cross category packages will be installed. The default is ${LOCALBASE}/cross. X11BASE: Where X11 is installed on the system. The default is /usr/X11R6. DISTDIR: Where to store the downloaded copies of the original source distributions used for building pkgsrc packages. The default is ${PKGSRCDIR}/distfiles. MASTER_SITE_OVERRIDE: If set, override the packages' MASTER_SITES with this value. MASTER_SITE_BACKUP: Backup location(s) for distribution files and patch files if not found locally or in ${MASTER_SITES} or ${PATCH_SITES} respectively. The defaults are ftp://ftp.NetBSD.org/pub/NetBSD/packages/distfiles/${DIST_SUBDIR}/ and ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/. BINPKG_SITES: List of sites carrying binary pkgs. Variables affecting the build process XXX PACKAGES: The top level directory for the binary packages. The default is ${PKGSRCDIR}/packages. WRKOBJDIR: The top level directory where, if defined, the separate working directories will get created, and symbolically linked to from ${WRKDIR} (see below). This is useful for building packages on several architectures, then ${PKGSRCDIR} can be NFS-mounted while ${WRKOBJDIR} is local to every architecture. (It should be noted that PKGSRCDIR should not be set by the user — it is an internal definition which refers to the root of the pkgsrc tree. It is possible to have many pkgsrc tree instances.) LOCALPATCHES: Directory for local patches that aren't part of pkgsrc. See for more information. rel and arch are replaced with OS release (2.0, etc.) and architecture (mipsel, etc.). PKGMAKECONF: Location of the mk.conf file used by a package's BSD-style Makefile. If this is not set, MAKECONF is set to /dev/null to avoid picking up settings used by builds in /usr/src. Developer/advanced settings XXX PKG_DEVELOPER: Run some sanity checks that package developers want: make sure patches apply with zero fuzz run check-shlibs to see that all binaries will find their shared libs. PKG_DEBUG_LEVEL: The level of debugging output which is displayed whilst making and installing the package. The default value for this is 0, which will not display the commands as they are executed (normal, default, quiet operation); the value 1 will display all shell commands before their invocation, and the value 2 will display both the shell commands before their invocation, and their actual execution progress with set -x will be displayed. Selecting Build Options Some packages have build time options, usually to select between different dependencies, enable optional support for big dependencies or enable experimental features. To see which options, if any, a package supports, and which options are mutually exclusive, run make show-options, for example: The following options are supported by this package: ssl Enable SSL support. Exactly one of the following gecko options is required: firefox Use firefox as gecko rendering engine. mozilla Use mozilla as gecko rendering engine. At most one of the following database options may be selected: mysql Enable support for MySQL database. pgsql Enable support for PostgreSQL database. These options are enabled by default: firefox These options are currently enabled: mozilla ssl The following variables can be defined in /etc/mk.conf to select which options to enable for a package: PKG_DEFAULT_OPTIONS, which can be used to select or disable options for all packages that support them, and PKG_OPTIONS.pkgbase, which can be used to select or disable options specifically for package pkgbase. Options listed in these variables are selected, options preceded by - are disabled. The following settings are consulted in the order given, and the last setting that selects or disables an option is used: the default options as suggested by the package maintainer the options implied by the settings of legacy variables (see below) PKG_DEFAULT_OPTIONS PKG_OPTIONS.pkgbase For groups of mutually exclusive options, the last option selected is used, all others are automatically disabled. If an option of the group is explicitly disabled, the previously selected option, if any, is used. It is an error if no option from a required group of options is selected, and building the package will fail. Before the options framework was introduced, build options were selected by setting a variable in /etc/mk.conf for each option. To ease transition to the options framework for the user, these legacy variables are converted to the appropriate options setting automatically. A warning is issued to prompt the user to update /etc/mk.conf to use the options framework directly. Support for these legacy variables will be removed eventually.