The built in (binary) CPack FreeBSD (pkg) generator (Unix only)

Variables specific to CPack FreeBSD (pkg) generator

CPackFreeBSD may be used to create pkg(8) packages – these may be used on FreeBSD, DragonflyBSD, NetBSD, OpenBSD, but also on Linux or OSX, depending on the installed package-management tools – using CPack.

CPackFreeBSD is a CPack generator and uses the CPACK_XXX variables used by CPack. It tries to re-use packaging information that may already be specified for Debian packages for the CPackDeb generator. it also tries to re-use RPM packaging information when Debian does not specify.

CPackFreeBSD generator should work on any host with libpkg installed. The packages it produces are specific to the host architecture and ABI.

CPackFreeBSD sets package-metadata through CPACK_FREEBSD_XXX variables. CPackFreeBSD, unlike CPackDeb, does not specially support componentized packages; a single package is created from all the software artifacts created through CMake.

All of the variables can be set specifically for FreeBSD packaging in the CPackConfig file or in CMakeLists.txt, but most of them have defaults that use general settings (e.g. CMAKE_PROJECT_NAME) or Debian-specific variables when those make sense (e.g. the homepage of an upstream project is usually unchanged by the flavor of packaging). When there is no Debian information to fall back on, but the RPM packaging has it, fall back to the RPM information (e.g. package license).


Sets the package name (in the package manifest, but also affects the output filename).

  • Mandatory: YES

  • Default:


Sets the package comment. This is the short description displayed by pkg(8) in standard “pkg info” output.


Sets the package description. This is the long description of the package, given by “pkg info” with a specific package as argument.


The URL of the web site for this package, preferably (when applicable) the site from which the original source can be obtained and any additional upstream documentation or information may be found.

  • Mandatory: YES

  • Default:


The license, or licenses, which apply to this software package. This must be one or more license-identifiers that pkg recognizes as acceptable license identifiers (e.g. “GPLv2”).


This variable is only of importance if there is more than one license. The default is “single”, which is only applicable to a single license. Other acceptable values are determined by pkg – those are “dual” or “multi” – meaning choice (OR) or simultaneous (AND) application of the licenses.

  • Mandatory: NO

  • Default: single


The FreeBSD maintainer (e.g. of this package.

  • Mandatory: YES

  • Default: none


The origin (ports label) of this package; for packages built by CPack outside of the ports system this is of less importance. The default puts the package somewhere under misc/, as a stopgap.

  • Mandatory: YES

  • Default: misc/<package name>


The ports categories where this package lives (if it were to be built from ports). If none is set a single category is determined based on the package origin.

  • Mandatory: YES

  • Default: derived from ORIGIN


A list of package origins that should be added as package dependencies. These are in the form <category>/<packagename>, e.g. x11/libkonq. No version information needs to be provided (this is not included in the manifest).

  • Mandatory: NO

  • Default: empty