Non-Flash Banner
PC-BSD is a free operating system with ease of use in mind. Like any modern system, you can listen to your favorite music, watch your movies, work with office documents and install your favorite applications with a setup wizard at a click.
PBI Builder Module HOWTO PDF Print
This guide is intended to help explain how to use the new PBI auto-building server modules.

Modules are publicly available via SVN or on the web at
http://websvn.pcbsd.org/browser/pbibuild/modules

The finished PBI's are uploaded Monday-Friday  to
http://pbibuild.pcbsd.org/

To submit a fix, or request to become apart of the PBI dev team,
please contact Gonzalo at This e-mail address is being protected from spam bots, you need JavaScript enabled to view it or the PBI dev mailing
list at http://lists.pcbsd.org/mailman/listinfo/pbi-dev





-------------------------------------------------------------------------------
About the PBI AutoBuild Server
-------------------------------------------------------------------------------

The PBI-Build server is run by Kris Moore at PC-BSD Software
(kris at [pcbsd].org). The server traverses through the module directory
each night, Monday through Friday, and any ports that are in need of a
rebuild are done at this time. Committers may also schedule a module for
a manual rebuild by toggling a flag in the pbi.conf file.





-------------------------------------------------------------------------------
Module Structure
-------------------------------------------------------------------------------
The module's directory structure is fairly straight forward.

Here's a listing of the files / directories and their description.

pbi.conf    <- The main configuration file for the module.
copy-files     <- Conf file which lists the files / directories you want to
                   copy into your PBI dir
build.sh     <- Runs after the copy-files process if finished,
                   allows you to modify your PBI contents in script form
kmenu-dir    <- Directory of kmenu entries for this PBI, usually cut from
                   a template .pbc file.
mime-dir    <- Directory of mime entries for this PBI, also cut from
                   the template .pbc file.
overlay-dir     <- Directory of the base PBI directory structure. Icons,
                   PBI setup scripts, and most other files not added via
                   "copy-files" or "build.sh" are put here.

-------------------------------------------------------------------------------
The pbi.conf file
-------------------------------------------------------------------------------
This file is the first thing read for each module.
The available variables are explained with the example of "FireFox" below:

# Program Name
# The name of the PBI file being built
PROGNAME="Firefox"

# Program Website
# Website of the program the module is building
PROGWEB="http://www.mozilla.com"

# Program Author
# Who created / maintains the program being built
PROGAUTHOR="The Mozilla Foundation"

# Default Icon
# Relative to overlay-dir, the main icon you want to show up for this PBI
PROGICON="share/pixmaps/FireFox-128.png"

# Port we want to build
# The port the server will track to determine when it's time for a rebuild
PBIPORT="/usr/ports/www/firefox/"

# Set to "Auto or NONE" to have the PBI creator auto-populate libs or not
# This allows you to also use the autolibs/ directory in your overlay-dir as a location for extra
# library files
PROGLIBS="Auto"

# PBI Update URL set to "" or the http:// URL of update checker
# Leave this as update.pbidir.com normally
PBIUPDATE="http://update.pbidir.com"

# Other Ports we need built
# One per line, any additional ports that need to be built for this PBI
OTHERPORT=""

# Enter your custom make options here
# Options that will be put into the make.conf for the build of this port
MAKEOPTS=""

# Build Key - Change this to anything else to trigger a rebuild
#           - The rebuild will take place even if port is still the same ver
BUILDKEY="02"



-------------------------------------------------------------------------------
The copy-files configuration
-------------------------------------------------------------------------------
This file is very straight forward, simply list the files you want to copy
from the installed port, and where they should go in your PBI directory
structure.

Example:

/usr/local/lib/firefox/firefox-bin bin/
^^^^^^^^^^^^^^^^^^^^^^^^ Copy this file to bin/ in your PBI directory

/usr/local/lib/nss/* autolibs/
^^^^^ Wildcards are also allowed, in this case to the autolibs/ directory


-------------------------------------------------------------------------------
The preportmake.sh script
-------------------------------------------------------------------------------
This script, if it present is run right before starting the "make install"
of your port. This allows you to make modifications to the pbisandbox
environment or to the port building source itself. Normally this won't be
necessary, unless working with a very tricky program to get compiled.

Example:

#!/bin/sh

# Remove any /Programs/BMPx link, and recreate it, so we can use
#PREFIX=/Programs/BMPx in the make.conf properly

rm -rf /Programs/BMPx
mkdir /Programs
ln -s /usr/local /Programs/BMPx


-------------------------------------------------------------------------------
The build.sh script
-------------------------------------------------------------------------------
Below is the example of the build.sh script, which runs after all the files
have been copied to your PBI directory. This allows you to make mods to
specific things for your PBI to work properly. In this example we
modify the uninstall script to use the right version.

#!/bin/sh
# PBI building script
# This will run after your port build is complete
# Build your PBI here, and exit 0 on success, or exit 1 on failure.
##############################################################################
# Available Variables
#    PBIDIR = The location of where you can populate your PBI directory
# MODULEDIR = The location of the module directory for this PBI
#   PORTVER = Version number of the port we used to build
##############################################################################

# Save the right version number in the removepbi.sh script
sed -e "s,CHANGEME,Firefox${PORTVER},g" ${PBIDIR}/scripts/removepbi.sh > /tmp/removepbi.sh
mv /tmp/removepbi.sh ${PBIDIR}/scripts/removepbi.sh
chmod 755 ${PBIDIR}/scripts/removepbi.sh



-------------------------------------------------------------------------------
The kmenu-dir file structure
-------------------------------------------------------------------------------
In this directory you may make any number of files, which contain the
.pbc configuration for your kmenu icons. This defines where you would like
icons created for your users desktop

example of kmenu-dir/firefox file:
------------------
ExePath: bin/firefox
ExeIcon: share/pixmaps/FireFox-128.png
ExeDescr: FireFox
ExeNoDesktop: 0
ExeNoMenu: 0
ExeRunRoot: 0
ExeRunShell: 0
ExeNotify: 1
ExeLink: 0
ExeWebLink: 0
ExeTaskbar: 0
ExeOwndir: 1
ExeKdeCat: Internet

Line-By-Line description of each entry:
------------------

-> ExePath: bin/firefox
This line indicates the binary / script we want this icon to run when
the user clicks it. This is relative to the PBI directory, so we use bin/

-> ExeIcon: share/pixmaps/FireFox-128.png
This is the icon you want to show up for this program, again it is relative
to the PBI directory

-> ExeDescr: FireFox
This would be the name of the icon in the kmenu or on the users desktop.

-> ExeNoDesktop: 0
This allows you to disable creating a desktop icon for this entry. Set it to
'0' if you want a desktop icon, or '1' if you don't wish an icon.

-> ExeNoMenu: 0
This allows you to disable creating a kmenu icon for this entry. Set it to
'0' if you want a kmenu icon, or '1' if you don't wish an icon.

->ExeRunRoot: 0
This indicates if you want your program to be run as "root" when the user
clicks it. Set it to '0' to run as a regular user, or '1' to run kdesu and
switch to "root"
Set this to '0'

-> ExeRunShell: 0
This indicates if you want your program to be executed in a konsole session,
which may be useful for command-line applications. Set it to '0' if you dont
want it to run in konsole, or set it to '1' if you do.

-> ExeNotify: 1
This indicates if you want to enable launch feedback in KDE, which is the
bouncing icon, showing that the program is loading. Set it to '0' to disable
launch feedback, or set it to '1' if you want this enabled. Normally it is
best to leave this enabled.

-> ExeLink: 0
This is used to indicate if the ExePath variable was set to a local file /
document you want opened with konqueror insetead of just being "run". This
is useful for README type documents. Set this to '1' if you want your
document opened with konq, or '0' to just run it as normal.

-> ExeWebLink: 0
This is similar to above, and instead indicates that the ExePath being opened
is actuall a web URL. Set this to '1' to open it the ExePath with Konq, or '0'
to just run it as normal.

-> ExeTaskbar: 0
This indicates if you want this application icon added to the taskbar. Set it
to '1' to add it, or '0' to leave it disabled.
(THIS FEATURE IS CURRENTLY UNAVAILABLE, BUT WILL BE ADDED DOWN THE ROAD)


-> ExeOwndir: 1
This option is used to specify where you want your Kmenu icon to be placed, and
may be set to 0, 1, 2
 0 = Place kmenu icon directory in top level. I.E.  Kmenu -> Firefox -> Firefox
 1 = Place kmenu icon in its own directory in the sub category indicated by
     ExeKdeCat:  I.E.  Kmenu -> Internet -> Firefox -> Firefox
 2 = Place kmenu icon directly in the sub category indicated by ExeKdeCat:  
     I.E.  Kmenu -> Internet -> Firefox

-> ExeKdeCat: Internet
This allows you to choose a kmenu sub-directory to place your icons / directory
into, when ExeOwnDir is set to 1 or 2. Available options are:
    ExeOwndir: Development
    ExeOwndir: Editors
    ExeOwndir: Edutainment/Languages
    ExeOwndir: Edutainment/Math
    ExeOwndir: Edutainment/Misc
    ExeOwndir: Edutainment/Science
    ExeOwndir: Edutainment/Teaching
    ExeOwndir: Games/Arcade
    ExeOwndir: Games/Board
    ExeOwndir: Games/Card
    ExeOwndir: Games/Kidsgames
    ExeOwndir: Games/TacticStrategy
    ExeOwndir: Graphics
    ExeOwndir: Internet
    ExeOwndir: Multimedia
    ExeOwndir: Office
    ExeOwndir: System
    ExeOwndir: Toys
    ExeOwndir: Utilities



-------------------------------------------------------------------------------
The mime-dir file structure
-------------------------------------------------------------------------------
This directory allows to you specify mime types for your applications defined
in the kmenu-dir entries.

example of mime-dir/exe file:
--------------------
MimeExt: *.exe; *.EXE
MimeIcon: win_apps.png
MimeProg: 0

The only catch to this is to note that the "MimeProg: 0" is a pointer to a
file in the kmenu-dir structure. In this case you would have to ensure that
the application you want to open .exe files gets added first to the template
the server creates. Files in the kmenu-dir are added in the order of a "ls"
listing, so if you have a wine-exe entry, you may wish to rename it to
00wine-exe to ensure it is added first, which would make this MimeProg: 0
entry work with it.

If you have more than 1 mime-type, you would then increment the MimeProg: 0
number to MimeProg: 1, MimeProg: 2, and so forth. Then you would do the same
with your kmenu-dir entries, such as 00wine-exe, 01wine-bat, 02wine-msi


-------------------------------------------------------------------------------
The overlay-dir file structure
-------------------------------------------------------------------------------
This folder contains any of the files you wish placed into your PBI program
directory. Here is an example from firefox:

leftside.png
PBI.FirstRun.sh         autolibs                lib
PBI.RemoveScript.sh     bin                     scripts
PBI.SetupScript.sh      header.png              share

In this example you see we have added our PBI.* setup scripts, and the
custom graphics we want for the PBI installer. You may also create directories
that will be populated with the copy-files configuration, such as share/ or
others you may need.

For information on using the PBI*.sh files, please refer to the PBI Creator
documentation.

-------------------------------------------------------------------------------