Package Port Directory Structure¶
The directory structure of a pfSense® package is similar to that of a traditional FreeBSD port.
For more information on working with FreeBSD Ports, see and bsd.port.mk.
This page uses the simple Cron package as an example, many other packages are similar. See Package Port List for links to existing packages to copy/clone from.
First is the category, which roughly lines up with the category for the package with the caveat that if a pfSense package is based on a FreeBSD port, it should be in the same location (e.g. squid is under www/squid) – In the case of Cron this is sysutils:
Next is the main package directory inside of the category, it is always prefixed with pfSense-pkg-:
From here down the “FreeBSD-ports” prefix will be omitted for brevity.
The main Makefile, which includes version information, information about binaries, dependencies, install procedures, where to copy files, and so on – copy an existing one for a similar package and adjust as needed (but do so carefully):
pfSense standard pkg install/deinstall scripts (same for all packages, copy contents from another existing pkg):
A brief text description of the package:
A list of files installed by the package, for specifics on the format, see the links above:
The directory under which custom files are placed which will be copied to the firewall:
An optional file containing privilege information:
The package’s include files and XML files:
The packages XML metadata (which formerly would have been found in, for example, pkg_config.10.xml:
Files that go into the main directory of the web server:
Note that the Cron package uses a directory under /usr/local/www for its files – this is optional.
sysutils/pfSense-pkg-Cron/files/usr/local/www/packages/cron/cron.php sysutils/pfSense-pkg-Cron/files/usr/local/www/packages/cron/cron_edit.php sysutils/pfSense-pkg-Cron/files/usr/local/www/packages/cron/index.php
The structure under the files/ directory should follow , so any scripts to be run (for example) would be under files/usr/local/bin/