8.5 Customizing the Environment

It is possible to export environment variables on a global, per-Jail, per-PortsTree, and/or per-Build basis. This is done by creating a file named GLOBAL, jail.{JAIL}, portstree.{PORTSTREE}, or build.{BUILD} respectively, and placing it in ${pb}/scripts/etc/env/.

For example, if you want a particular Build (e.g. 9.2-Perl56) to use Perl 5.6.2 instead of Perl 5.8.x, create a file named build.9.2-Perl56 in ${pb}/scripts/etc/env/ that contains the following:


Likewise, if you want to enable debugging for a particular PortsTree (e.g. "FreeBSD-debug"), create the following portstree.FreeBSD-debug in ${pb}/scripts/etc/env/:

CFLAGS="-O -g -pipe"

Note: Bear in mind that these files are parsed by sh(1), and therefore are not as forgiving as make(1) when it comes to whitespace. Do not insert tab characters after the = symbol.