PKG_COMP.CONF(5)

NAME
pkg_comp.conf - configuration file format for the pkg_comp tool

DESCRIPTION
Configuration files for pkg_comp(8) are plain shell scripts that define a set of recognized variables and can optionally fill in a set of hooks provided as shell functions.

  Configuration variables
As scripts, configuration files can perform any magic they desire to deduce the value of configuration variables.

The following variables configure general settings:

AUTO_PACKAGES
    Whitespace-separated list of package names that will be automatically built by the ‘auto’ command unless package names are provided on the command line. This is akin to pbulk's “limited list” file contents, specifying the subset of packages that are interesting for this automated build.

    The packages to build can be provided either as bare names, such as ‘tmux’, or as category/package pairs, such as ‘misc/tmux’.

SANDBOX_CONFFILE
    Absolute path to a file in the host that contains the sandboxctl(8) configuration to use for the build of packages.

    The contents of this file are slightly different than what sandboxctl(8) accepts. In particular, if you want to define sandboxctl(8)'s own post_create_hook() and post_mount_hook() hooks, you must define pkg_comp_post_create_hook() and pkg_comp_post_mount_hook() instead. Any changes to the former two will be discarded.

    Default: not defined.

The following variables configure how to fetch pkgsrc from a version control system:

CVS_ROOT
    Location of the CVS root from which to check out or update the pkgsrc module.

    This variable is only used if FETCH_VCS is set to ‘cvs’.

    Default: ‘:ext:anoncvs@anoncvs.NetBSD.org:/cvsroot’.

CVS_TAG
    CVS tag to use during checkouts or updates of the pkgsrc module.

    This variable is only used if FETCH_VCS is set to ‘cvs’.

    Default: not defined.

FETCH_VCS
    Determines the version control system to use to fetch the pkgsrc tree. Can be one of ‘cvs’ or ‘git’. The requested tool must be installed on the system.

    Default: ‘cvs’.

GIT_BRANCH
    Git branch to use during clones or updates of the pkgsrc working copy.

    This variable is only used if FETCH_VCS is set to ‘git’.

    Default: ‘trunk’.

GIT_URL
    Git remote URL specification to use during clones or updates of the pkgsrc working copy.

    This variable is only used if FETCH_VCS is set to ‘git’.

    Default: ‘https://github.com/NetBSD/pkgsrc.git’.

The following variables configure the pkgsrc environment on the host (i.e. outside of the sandbox):

DISTDIR
    Absolute path to the directory in the host that holds the distribution files for pkgsrc (i.e. all the source files downloaded during the build of packages).

    This directory is mounted read-write within the sandbox to allow reuse of the immutable distribution files across rebuilds of the sandbox.

    Default: /usr/pkgsrc/distfiles.

PACKAGES
    Absolute path to the directory in the host that will hold the built binary packages and bootstrap kit for the target environment.

    Default: /usr/pkgsrc/packages.

PBULK_LOG
    Absolute path to the directory in the host that will hold the logs of the pbulk build. The contents of this directory are wiped at the beginning of each build.

    Default: /usr/pkgsrc/packages/log.

PBULK_PACKAGES
    Absolute path to the directory in the host that will hold the built binary packages and bootstrap kit for the pbulk installation in the sandbox.

    It does not make much sense to use these files outside of the sandbox because they are hardcoded to match the internal needs of pkg_comp(8) (e.g. the paths used in these binary packages are not customizable). However, pkg_comp(8) will reuse these files on subsequent rebuilds of the sandbox for speed, so you may want to keep them around.

    Default: /usr/pkgsrc/packages/pbulk.

PKGSRCDIR
    Absolute path to the directory in the host that contains or will contain the pkgsrc tree.

    If you want pkg_comp(8) to perform an update of this directory before every build, you will need write access to it. Otherwise, you can use a read-only directory.

    Default: /usr/pkgsrc.

UPDATE_SOURCES
    Whether to perform an update of the source tree before every build or not.

    Default: ‘true’.

The following variables configure the pkgsrc environment within the sandbox (i.e. how the packages will be built):

EXTRA_MKCONF
    Absolute path to an optional file in the host that contains additional mk.conf(5) contents to use for the build of packages within the sandbox. You can use this to configure settings like ACCEPTABLE_LICENSES or PKG_DEFAULT_OPTIONS.

    Default: not defined.

LOCALBASE
    Absolute path to the directory where the packages will be installed.

    Default: /usr/pkg.

NJOBS
    Number of make(1) jobs to use during the build of packages.

    Default: number of CPUs in the machine.

PKG_DBDIR
    Absolute path to the directory where pkg_add(8) et. al. will maintain the database of installed directories.

    Default: /usr/pkg/libdata/pkgdb.

PKG_DEVELOPER
    Enables development of pkgsrc packages within the sandbox via the ‘sandbox-shell’ subcommand. This causes this same variable to be set in mk.conf(5) and mounts pkgsrc in read/write mode.

    Default: no.

SYSCONFDIR
    Absolute path to the directory in which to install managed configuration files.

    Default: /etc.

VARBASE
    Absolute path to the directory that holds mutable data.

    Default: /var.

  Hooks
Hooks are user-provided routines invoked at particular points during the build process. These are defined as shell functions and have access to the configuration variables in the file. Hooks must return a success error code and they cannot contain unprotected shell commands. In other words, they are run under a shell configured with ‘set -e’.

The following hooks can be defined:

post_fetch_hook()
    Function executed right after all source trees have been updated by the ‘fetch’ command.

SEE ALSO
sandbox.conf(5), pkg_comp(8)