.Dd September 27, 2026 .Dt MKPKG.CONF 5 .Os .Sh NAME .Nm mkpkg.conf .Nd build and install configuration .Sh SYNOPSIS .Pa /etc/mkpkg.conf .Sh DESCRIPTION .Nm is read in three ways. .Ic mkpkg -g names another file for the first two. .Bl -bullet .It The .Fn shell , .Fn build and .Fn post_build hooks of a .Xr MAKEPKG 5 source it as a shell script, after .Ev PKG , .Ev SRC and the other variables of .Xr mkpkg 8 are exported, so it may refer to them. .Fn extract and .Fn patch do not source it. This is where compilers, flags and other build environment are set. .It .Xr mkpkg 8 reads the .Ev MKPKG_* settings below itself, without a shell. Their values must be literal: quotes and a trailing comment are removed, but nothing is expanded. A leading .Ic export is allowed. .It .Xr addpkg 8 reads .Ev IGNORE_NEW . .El .Sh BUILD ENVIRONMENT Anything a shell script can set. The shipped file sets, among others: .Bl -tag -width PKG_CONFIG_PATH .It Ev CC , CXX The compilers, .Li clang and .Li clang++ . .It Ev CFLAGS , CXXFLAGS , CPPFLAGS , LDFLAGS Compiler and linker flags. .It Ev PKG_CONFIG_PATH Where .Ic pkgconf looks. .It Ev MAKEFLAGS Flags for .Xr make 1 , such as .Li -j$(nproc) . .It Ev CARGO_HOME , GOPATH Caches for cargo and Go, set below .Ev SRC so they are part of the work directory. .El .Sh MKPKG SETTINGS .Bl -tag -width Ds .It Ev MKPKG_SOURCE_DIR Directory for downloaded sources, exported to the hooks as .Ev PKGMK_SOURCE_DIR . Default: the port directory. .It Ev MKPKG_PACKAGE_DIR Directory for built packages. Default: the port directory. .It Ev MKPKG_WORK_DIR Work directory. Default: .Pa work in the port directory. An absolute path that does not end in .Pa /work , such as .Pa /dev/shm , is a place for work directories: each build uses its own .Pa mkpkg_ Ns Ar pid below it. .It Ev MKPKG_TMP_DIR A directory the full lockbox may write to; see .Xr lockbox 7 . Default: .Pa /dev/shm . .It Ev MKPKG_SECRET_KEY The .Xr signify 1 secret key to sign ports with. Only port maintainers need it. Default: .Pa /etc/ports/keys/rawnix.sec . .It Ev MKPKG_COMPRESSION_MODE Package compression: .Li gz , .Li xz , .Li zst , .Li bz2 or .Li lz . It is also the file name extension. Parallel compressors are used when installed: .Ic pigz for .Li gz , lbzip2 or pbzip2 for .Li bz2 , plzip for .Li lz ; .Li xz and .Li zst use all threads. Default: .Li gz . .It Ev MKPKG_IGNORE_CHECKSUMS Like .Ic mkpkg -ic . .It Ev MKPKG_IGNORE_FOOTPRINT Like .Ic mkpkg -if . .It Ev MKPKG_IGNORE_SIGNATURE Like .Ic mkpkg -is . .It Ev MKPKG_NO_STRIP Do not strip binaries. .El .Pp The last four are on for .Li yes or .Li 1 , and off otherwise. .Sh INSTALL SETTINGS .Bl -tag -width Ds .It Ev IGNORE_NEW If .Li yes , .Xr addpkg 8 installs a package that has files its .Pa .footprint does not list. Otherwise it refuses. Default: .Li no . .El .Sh FILES .Bl -tag -width Ds -compact .It Pa /etc/mkpkg.conf This file. .El .Sh EXAMPLES .Bd -literal -offset indent export CC=clang export CXX=clang++ export CFLAGS="-O2 -pipe -march=x86-64-v3 -fstack-protector-strong" export CXXFLAGS="$CFLAGS" export LDFLAGS="-Wl,-O1 -Wl,--as-needed" export MAKEFLAGS="-j$(nproc)" export CARGO_HOME="$SRC/.cargo" # build in RAM MKPKG_WORK_DIR=/dev/shm MKPKG_COMPRESSION_MODE=zst IGNORE_NEW=no .Ed .Sh SEE ALSO .Xr MAKEPKG 5 , .Xr addpkg 8 , .Xr mkpkg 8 .Sh CAVEATS An unknown .Ev MKPKG_COMPRESSION_MODE is compressed with gzip but still used as the extension.