Using the PBI Builder

From PC-BSD Wiki
Revision as of 12:37, 20 January 2009 by Krismoore (Talk | contribs)

Jump to: navigation, search


Using the PBI Builder Software

This guide is intended to instruct developers, or simply the curious, on how to use the PBI Builder software, which compiles a FreeBSD port, and turns it into a fully-functional PBI file.


Installing the PBI Builder software relatively easy, simply download the tbz package from the [PBI Builder Homepage], and place it somewhere on your system with several GB of free space. Next run these commands (as root):

  # tar xvjpf pbibuild*.tbz
  # ln -s `pwd`/pbi-build /pbi-build

Note: On regular FreeBSD systems, you will need to install "bash" for the builder to function, and link it to /bin/bash. This step is not required on PC-BSD.

 # pkg_add -r bash
 # ln -s /usr/local/bin/bash /bin/bash 

Usage Instructions

Using the PBI builder to convert a port into a PBI is very simple. First, you will need to copy a module directory into the /pbi-build/modules directory. Several examples are provided in /pbi-build/docs/module-examples, or you may copy a module from our [subversion repository]. After you have done this, simply run these commands:

 # cd /pbi-build
 # ./ 

The first time you run the script, it will connect to CVS and download a copy of the ports tree. You may change the cvsup server it uses by editing /pbi-build/conf/ports-supfile. If you wish to update your ports tree, simply run "/pbi-build/cron/". This script may be run from cron to ensure that your ports tree is always up to date.

Advanced Usage

The PBI Builder has a few extra options which you may wish to use during the creation of your PBI.

Selective Module building

When the modules diretory contains many different modules for building, it may be necessary to single out only one of them for creation instead of rebuilding all of them. To single out a module for building simply run ./ with a module name as the first agument:

 # ./ firefox (This will build the module /pbi-build/modules/firefox, ignoring all others for this run)

PBI Build (Without re-compile)

During the creation of a new module, it may become necessary to recreate the PBI file to test new configurations. Often this does not require the complete rebuilding of the port from source. By skipping the source build, a new PBI may be generated within momements. To skip the building simply run the script in /pbi-build/scripts/ as shown:

# cd /pbi-build/scripts
# ./ firefox

This will rebuild the FireFox PBI using the /pbi-buid/modules/firefox configuration, skipping the actual port re-building.

NOTE: This requires that you have a full build of the port already finished in /pbi-build/pbisandbox

The PBI Sandbox

In order to build a port without touching the host system, all creation is done in the /pbi-build/pbisandbox directory. This is a complete buildworld environment, and you may "chroot" into it in order to tweak a port build, or inspect the built contents of a port.

 # chroot /pbi-build/pbisandbox
Personal tools