PACKAGES(7)

NAME
packages - NetBSD user package variables

DESCRIPTION
This manual page describes the variables that users of the NetBSD packages system can set to alter the configuration of the package system, and individual packages.

COMMON VARIABLES
This section documents variables that typically apply to all packages. Many of these may be set in make.conf(5).

ARCH
    The architecture, as returned by “uname -m”. See uname(1).

OPSYS
    The operating system name, as returned by “uname -s”.

DISTDIR
    Where to get gzip'd, tarballed copies of original sources. The default is ${PKGSRCDIR}/distfiles.

MASTER_SITE_BACKUP
    Backup location(s) for distribution files and patch files if not found locally and ${MASTER_SITES}/${PATCH_SITES}. The Defaults are ftp://ftp.netbsd.org/pub/NetBSD/packages/distfiles/${DIST_SUBDIR}/ and ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/.

MASTER_SITE_OVERRIDE
    If set, override the MASTER_SITES setting with this value.

PACKAGES
    A top level directory where all packages go (rather than going locally to each package). The default is ${PKGSRCDIR}/packages.

GMAKE
    Set to path of GNU make if not in $PATH (default: gmake).

XMKMF
    Set to path of “xmkmf” if not in $PATH (default: xmkmf -a).

WRKOBJDIR
    A 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 arch.

PACKAGE SPECIFIC VARIABLES
This section documents variables that typically apply to an individual package. Non-Boolean variables without defaults are *mandatory*.

ONLY_FOR_ARCHS
    If set, it lists the values of MACHINE_ARCH (basic NetBSD CPU types) that the package will build under. It can be a glob-style wildcard.

NOT_FOR_ARCHS
    If set, it lists the values of MACHINE_ARCH (basic NetBSD CPU types) that the package will not build under. It can be a glob-style wildcard.

MAINTAINER
    The e-mail address of the contact person for this package. The default is packages@NetBSD.ORG.

CATEGORIES
    A list of descriptive categories into which this package falls.

MASTER_SITES
    Primary location(s) for distribution files if not found locally.

MASTER_SITE_SUBDIR
    Directory that “%SUBDIR%” in MASTER_SITES is replaced by.

PATCH_SITES
    Primary location(s) for distribution patch files (see It PATCHFILES below) if not found locally.

PATCH_SITE_SUBDIR
    Directory that “%SUBDIR%” in PATCH_SITES is replaced by.

WRKDIR
    A temporary working directory that gets *clobbered* on clean. The default is ${.CURDIR}/work.

WRKSRC
    A subdirectory of ${WRKDIR} where the distribution actually unpacks to. The default is ${WRKDIR}/${DISTNAME} unless NO_WRKSUBDIR is set, in which case simply ${WRKDIR}.

DISTNAME
    Name of package or distribution.

DISTFILES
    Name(s) of archive file(s) containing distribution. The default is ${DISTNAME}${EXTRACT_SUFX}.

PATCHFILES
    Name(s) of additional files that contain distribution patches There is no default. Make will look for them at PATCH_SITES (see above). They will automatically be uncompressed before patching if the names end with “.gz” or “.Z”.

DIST_SUBDIR
    Suffix to ${DISTDIR}. If set, all ${DISTFILES} and ${PATCHFILES} will be put in this subdirectory of ${DISTDIR}.

ALLFILES
    All of ${DISTFILES} and ${PATCHFILES}.

MIRROR_DISTFILE
    Whether the distfile is redistributable without restrictions. Defaults to “yes”, set this to “no” if restrictions exist.

IGNOREFILES
    If some of the ${ALLFILES} are not checksum-able, set this variable to their names.

PKGNAME
    Name of the package file to create if the ${DISTNAME} isn't really relevant for the package. The default is ${DISTNAME}.

EXTRACT_ONLY
    If defined, a subset of ${DISTFILES} you want to actually extract.

PATCHDIR
    A directory containing any additional patches you made to package this software. The default is ${.CURDIR}/patches.

SCRIPTDIR
    A directory containing any auxiliary scripts. The default is ${.CURDIR}/scripts.

FILESDIR
    A directory containing any miscellaneous additional files. The default is ${.CURDIR}/files.

PKGDIR
    A direction containing any package creation files. The default is ${.CURDIR}/pkg.

PKG_DBDIR
    Where package installation is recorded. The default is /var/db/pkg.

FORCE_PKG_REGISTER
    If set, it will overwrite any existing package registration information in ${PKG_DBDIR}/${PKGNAME}.

NO_MTREE
    If set, will not invoke mtree from bsd.pkg.mk from the “install” target.

MTREE_FILE
    The name of the mtree file. The default is /etc/mtree/BSD.x11.dist if USE_IMAKE or USE_X11BASE is set, or /etc/mtree/BSD.pkg.dist otherwise.

USE_X11
    Instructs the package system that the package will use headers and libraries from X11BASE and so a check must be made that these are available. If they are not, an IGNORE message will be displayed, and the package will not be built.

PLIST_SRC
    Which file(s) to use to build ${PLIST}. Either ${PKGDIR}/PLIST or ${PKGDIR}/PLIST-mi plus ${PKGDIR}/PLIST-md.shared or ${PKGDIR}/PLIST-md.static, if not set otherwise.

INSTALL_FILE
    The name of a script which will be invoked when installing binary packages. If there is a file called ${PKGDIR}/INSTALL, that file will be used.

DEINSTALL_FILE
    The name of a script which will be invoked when de-installing binary packages. If there is a file called ${PKGDIR}/DEINSTALL, that file will be used.

REQ_FILE
    The name of a script that is invoked before installation and de-installation to ensure things are available. If there is a file called ${PKGDIR}/REQ, that file will be used.

MESSAGE_FILE
    The name of a file which will be displayed when installing binary packages. If there is a file called ${PKGDIR}/MESSAGE, that file will be used.

NO_BUILD
    Use a dummy (do-nothing) build target.

NO_CONFIGURE
    Use a dummy (do-nothing) configure target.

NO_CDROM
    Package may not go on CDROM. Set this string to reason.

NO_DESCRIBE
    Use a dummy (do-nothing) describe target.

NO_EXTRACT
    Use a dummy (do-nothing) extract target.

NO_INSTALL
    Use a dummy (do-nothing) install target.

NO_PACKAGE
    Use a dummy (do-nothing) package target.

NO_PKG_REGISTER
    Don't register a package install as a package.

NO_WRKSUBDIR
    Assume package unpacks directly into ${WRKDIR}.

NO_WRKDIR
    There's no work directory at all; package does this someplace else.

NO_DEPENDS
    Don't verify build of dependencies.

NOCLEANDEPENDS
    Don't clean dependent packages

BROKEN
    Package is broken. Set this string to the reason why.

RESTRICTED
    Package is restricted. Set this string to the reason why.

LICENCE
    The package has a non-standard licence, such as shareware, or non-commercial-use only. This string should be set to the type of licence the package has, like "shareware", or "non-commercial-use". If LICENCE is set, the ACCEPTABLE_LICENCES variable will be searched, if set, for a string matching the licence.

PASSIVE_FETCH
    Uses passive ftp(1) to retrieve distribution files.

USE_LIBTOOL
    Says that the package uses libtool to manage building of libraries and shared objects, where applicable.

USE_GMAKE
    Says that the package uses gmake.

USE_PERL5
    Says that the package uses perl5 for building and running.

USE_IMAKE
    Says that the package uses imake.

USE_X11BASE
    Says that the package installs itself into the X11 base directory ${X11BASE}.

USE_GTEXINFO
    Says that the package uses gtexinfo.

USE_MOTIF
    Says that the package uses Motif (it will use lesstif if Motif is unavailable)

NO_INSTALL_MANPAGES
    For imake packages that don't like the install.man target.

HAS_CONFIGURE
    Says that the package has its own configure script.

GNU_CONFIGURE
    Set if you are using GNU configure (optional).

CONFIGURE_SCRIPT
    Name of configure script, defaults to configure.

CONFIGURE_ARGS
    Pass these args to configure if ${HAS_CONFIGURE} is set.

CONFIGURE_ENV
    Pass these env (shell-like) to configure if ${HAS_CONFIGURE} is set.

SCRIPTS_ENV
    Additional environment variables passed to scripts in ${SCRIPTDIR} executed by bsd.pkg.mk.

MAKE_ENV
    Additional environment variables passed to sub-make in build stage.

CFLAGS
    Any CFLAGS you wish passed to the configure script and/or sub-make in build stage.

LDFLAGS
    Any LDFLAGS you wish passed to the configure script and/or sub-make in build stage. LDFLAGS is pre-loaded with rpath settings for ELF machines depending on the setting of USE_X11 or USE_MOTIF. If you do not wish to override these settings, use LDFLAGS+=.

MAKE_ENV
    Additional environment variables passed to sub-make in build stage.

IS_INTERACTIVE
    Set this if your package needs to interact with the user during a build. User can then decide to skip this package by setting ${BATCH}, or compiling only the interactive package by setting ${INTERACTIVE}.

FETCH_DEPENDS
    A list of “path:dir” pairs of other package this package depends in the “fetch” stage. “path” is the name of a file if it starts with a slash (/), an executable otherwise. make will test for the existence (if it is a full pathname) or search for it in your $PATH (if it is an executable) and go into “dir” to do a “make all install” if it's not found.

BUILD_DEPENDS
    A list of “path:dir” pairs of other package this package depends to build (between the “extract” and “build” stages, inclusive). The test done to determine the existence of the dependency is the same as FETCH_DEPENDS.

RUN_DEPENDS
    A list of “path:dir” pairs of other packages this package depends to run. The test done to determine the existence of the dependency is the same as FETCH_DEPENDS. This will be checked during the “install” stage and the name of the dependency will be put into the package as well.

LIB_DEPENDS
    This definition is deprecated, and is no longer used in the packages collection. It should be replaced by a simple “DEPENDS” definition.

DEPENDS
    A list of prerequisite packages. The format of this entry is “pkgname:dir”. If the “pkgname” package is not installed, then it will be built and installed from the source package in “dir”.

CONFLICTS
    A list of other ports this package conflicts with. Use this for packages that install identical set of files. The format of this entry is “pkgname”.

EXTRACT_CMD
    Command for extracting archive. The default is tar(1).

EXTRACT_SUFX
    Suffix for archive names. The default is “.tar.gz”.

EXTRACT_BEFORE_ARGS
    Arguments to ${EXTRACT_CMD} before the filename argument. The default is “-xzf”.

EXTRACT_AFTER_ARGS
    Arguments to ${EXTRACT_CMD} following the filename argument. There is no default.

FETCH_CMD
    Full path to ftp/http command if not in $PATH. The default is /usr/bin/ftp.

NO_IGNORE
    Set this to “YES” (most probably in a “make fetch” in ${PKGSRCDIR}) if you want to fetch all distfiles, even for packages not built due to limitation by absent X or Motif.

__ARCH_OK
    Internal variable set if the package is ok to build on this architecture. Set to “YES” to insist on e.g. fetching all distfiles (for interactive use in ${PKGSRCDIR}, mostly.

ALL_TARGET
    The target to pass to make in the package when building. The default is “all”.

INSTALL_TARGET
    The target to pass to make in the package when installing. The default is “install”.

MOTIF SUPPORT
This section documents variables related to the use and installation of Motif and/or LessTiF.

USE_MOTIF
    Set this in your package if it requires Motif. If Motif is not present on your system, the lesstif package will be installed for you.

MOTIFLIB
    Set automatically to the Motif or Lesstif library name.

PACKAGE DISTFILE REPOSITORIES

The following variables allow to override the default package repositories, they define a space separated list of mirror sites to be used instead of the defaults to retrieve packages from (usually if there's a closer or cheaper site).

‘%SUBDIR%’ and ‘${DIST_SUBDIR}’ are replaced by a package specific strings.

MASTER_SITE_BACKUP
    Backup sites for packages that are maintained in ‘ftp.netbsd.org:/pub/NetBSD/packages/distfiles/${DIST_SUBDIR}’.

MASTER_SITE_GNU
    GNU source mirror.

MASTER_SITE_LOCAL
    Local package source distributions that are maintained in ‘ftp.netbsd.org:/pub/NetBSD/packages/distfiles/LOCAL_PORTS/’.

MASTER_SITE_PERL_CPAN
    Perl CPAN mirror.

MASTER_SITE_TEX_CTAN
    TeX CTAN mirror.

MASTER_SITE_SUNSITE
    sunsite.unc.edu mirror.

MASTER_SITE_XCONTRIB
    X Window System contributed source mirror.

SPECIAL VARIABLES
Variables to change if you want a special behavior:

ECHO_MSG
    Used to print all the “===>” style prompts - override this to turn them off. The default is /bin/echo.

DEPENDS_TARGET
    The target to execute when a package is calling a dependency. The default is “install”.

PATCH_DEBUG
    If set, print out more information about the patches as it attempts to apply them.

PKG_VERBOSE
    If set, print out more information about the automatic manual page handling, and package deletion (see the “install” and “deinstall” targets), and also sets PATCH_DEBUG as well.

INSTALL VARIABLES
This section documents variables that serve as convenient aliases. for your *-install targets.

INSTALL_PROGRAM
    A command to install binary executables. Use these like: “${INSTALL_PROGRAM} ${WRKSRC}/prog ${PREFIX}/bin”.

INSTALL_SCRIPT
    A command to install executable scripts.

INSTALL_DATA
    A command to install sharable data.

INSTALL_MAN
    A command to install manpages (doesn't compress).

INSTALL_PROGRAM_DIR
    Create a directory for storing programs>

INSTALL_SCRIPT_DIR
    Create a directory for storing scripts.

INSTALL_DATA_DIR
    Create a directory for storing arbitrary data.

INSTALL_MAN_DIR
    Create a directory for storing man pages.

MANUAL PAGE VARIABLES
This section docuemnts variables used to configure the way manual pages are installed by this package.

MANCOMPRESSED
    Indicates that the package installs manpages in a compressed form. The default package installs manpages uncompressed.

INFO_FILES
    set to the base names of the info files you wish to be installed in the info dir file. Automatically sets USE_GTEXINFO.

PACKAGE TARGETS
This section documents the default targets and their behaviors. If any target relies on another target for completion (eg, the “install” target relies on the “build” target), then these targets will be executed beforehand.

fetch
    Retrieves ${DISTFILES} and ${PATCHFILES} into ${DISTDIR} as necessary.

fetch-list
    Show list of files that would be retrieved by fetch.

extract
    Unpacks ${DISTFILES} into ${WRKDIR}.

patch
    Apply any provided patches to the source.

configure
    Runs either GNU configure, one or more local configure scripts or nothing, depending on what's available.

build
    Actually compile the sources.

install
    Install the results of a build.

reinstall
    Install the results of a build, ignoring “already installed” flag.

deinstall
    Remove the installation.

package
    Create a binary package other people can use.

describe
    Try to generate a one-line description for each package for use in INDEX files and the like.

checksum
    Use files/md5 to ensure that your distfiles are valid.

makesum
    Generate files/md5 (only do this for your own packages!).

readme
    Create a README.html file describing the category or package

mirror-distfiles
    Mirror the distfile(s) if they are freely redistributable. Setting MIRROR_DISTFILE to “no” in the package Makefile will override the default “yes, and” the distfile will not be fetched.

Default sequence for “all” is: fetch checksum extract patch configure build.

NEVER override the “regular” targets unless you want to open a major can of worms.

HISTORY
This manual page is based upon the comments in the bsd.pkg.mk file, as distributed with NetBSD. The sources to this are far and varied across all free BSD projects.