PBULK-BUILD(1)

NAME
pbulk-build - build all packages specified in input file

SYNOPSIS
pbulk-build -s [host:]port
pbulk-build [-v] -c [host:]port -b build_script
pbulk-build [-I start_script] [-r report_file] [-v] -m [host:]port input success error
pbulk-build [-r report_file] [-v] -b build_script input success error

DESCRIPTION
pbulk-build builds all packages specified in an input file.

Supported options are:

-b build_script
    Use build_script for building the packages. See BUILD SCRIPT FORMAT for details.

-c [host:]port
    Obtain jobs from master running on the given port (or host:port). If used with -v, print the name of the package to build to stdout.

-I start_script
    Run start_script after opening the socket and wait for completion before entering build loop.

-m [host:]port
    Enter master mode. The master binds to port (or host:port) and waits for clients to connect and build individual packages.

-s [host:]port
    Query the master running on the given port (or host:port) for the current number of successful, open, and failed builds.

-r report_file
    Write name of each package, the result of its build, whether the package belongs to the restricted subset and the size of the subtree to report_file at the end of the build.

-v  Be more verbose. Details depend on the other flags used with it.
In normal mode (neither -c, -m, nor -s specified) and master mode (-m), pbulk-build reads the resolved tree scan from input. It then writes successful builds to success and failing builds to error. If either success or error exists at start-up, they are read and the build continues where they left off. If -v is specified once, pbulk-build prints the start of each build and the result. If -v is specified twice, each begin and end message is prefixed with the current time.

  BUILD SCRIPT FORMAT
The build_script is given information about one package which it should build. It should return 0 on success or any other value for an error. The build_script gets the information in a number of variables provided on standard input. The variables are provided in the format
    VARIABLE=value
The following variables are provided as of February 2023:

PKGNAME
    Name of the package including the version number, e.g. “pbulk-0.54”.

PKG_LOCATION
    Path to the package below pkgsrc, e.g. “pkgtools/pbulk”.

ALL_DEPENDS
    All dependencies of the package in one line, as determined by the dependency resolution step, in the following format:
        digest>=20211023:../../pkgtools/digest libtool-base>=2.4.2nb9:../../devel/libtool-base ...

PKG_SKIP_REASON
    A string containing the reason if the package should be skipped. Usually an empty string.

PKG_FAIL_REASON
    A string containing the reason if the package failed the dependency resolution or is broken for another reason. Usually an empty string.

NO_BIN_ON_FTP
    A string containing the reason why the binary package may not be uploaded to ftp.NetBSD.org. Usually an empty string.

RESTRICTED
    A string containing the reason why the binary package may not be distributed.

CATEGORIES
    Categories to which the package belongs, as specified in its Makefile.

MAINTAINER
    Maintainer of the package, as specified in its Makefile.

USE_DESTDIR
    DESTDIR method this package supports. Now almost exclusively “user-destdir”.

BOOTSTRAP_PKG
    If this package is used during pkgsrc bootstrap (as specified in its Makefile). Usually empty.

USERGROUP_PHASE
    The phase of the build process during which the user and/or group needed by this package need to be available.

SCAN_DEPENDS
    List of files (in a single line) read during the dependency scanning step. Can be used to identify if a package needs to be updated because on of these files changed compared to the previous build. Example:
        /usr/pkgsrc/pkgtools/pbulk/../../mk/tools/tools.NetBSD.mk /usr/share/mk/bsd.host.mk /usr/share/mk/bsd.own.mk /usr/share/mk/sys.mk Makefile options.mk

MULTI_VERSION
    For some languages or databases (or similar), pkgsrc contains multiple major versions at the same time, and supports building a single package against more than one of these. This variable contains a list of variables (in a single line) to determine which of these versions this particular package should be built against. Example:
        MULTI_VERSION= PYTHON_VERSION_REQD=311 LUA_VERSION_REQD=52
    means to build against Python 3.11 and Lua 5.2. This variable is missing completely for packages that do not provide multi-package support.

DEPENDS
    PKGNAME's of the packages this package depends on (including their version number). Example:
        DEPENDS=digest-20220214 libtool-base-2.4.7nb1

PBULK_WEIGHT
    Numeric build priority of the package. If this variable is not present, a value of 100 is assumed.

    The effective weight of a package is the sum of the weights of the package itself and all packages transitively depending on it. If two packages are buildable at the same time, the package with the higher effective weight is built first.
These items correspond to the output of
    make pbulk-index-item
run in the package directory with the additional variables PKG_LOCATION and DEPENDS computed by the pbulk scan phase.