Package Port Directory Structure¶
The directory structure of a package for pfSense® software is similar to that of a traditional FreeBSD port.
or more information on working with FreeBSD Ports, see bsd.port.mk.
This page uses the simple Cron package as an example, many other packages are similar. See FreeBSD Ports Used for Packages for links to existing packages to copy/clone from.
- Category
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.
haproxy
is undernet/haproxy
)In the case of Cron this is
sysutils
:FreeBSD-ports/sysutils/
- Main package directory
Inside of the category directory, it is always prefixed with
pfSense-pkg-
:FreeBSD-ports/sysutils/pfSense-pkg-Cron/
Note
From here on, the
FreeBSD-ports
prefix will be omitted for brevity.Makefile
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):
sysutils/pfSense-pkg-Cron/Makefile
- pfSense software standard package
install
/deinstall
scripts Note
These files are identical for all packages. Copy the contents from another existing package.
sysutils/pfSense-pkg-Cron/files/pkg-deinstall.in sysutils/pfSense-pkg-Cron/files/pkg-install.in
- Description
A brief text description of the package:
sysutils/pfSense-pkg-Cron/pkg-descr
- Packing List
A list of files installed by the package, for specifics on the format, see the links above:
sysutils/pfSense-pkg-Cron/pkg-plist
- Files Directory
The directory where custom files are placed which will be copied to the firewall:
sysutils/pfSense-pkg-Cron/files/
The structure under the
files/
directory should follow the same conventions as files on the pfSense installation, which typically follows hier(7) from FreeBSD. For example, executable scripts would go underfiles/usr/local/bin/
- Privileges
An optional file containing privilege information:
sysutils/pfSense-pkg-Cron/files/etc/inc/priv/cron.priv.inc
- Package Code and Configuration
The include files and XML files for the package:
sysutils/pfSense-pkg-Cron/files/usr/local/pkg/cron.inc sysutils/pfSense-pkg-Cron/files/usr/local/pkg/cron.xml
XML Metadata
sysutils/pfSense-pkg-Cron/files/usr/local/share/pfSense-pkg-Cron/info.xml
- GUI-Accessible Files
Files that go into the main directory of the web server:
sysutils/pfSense-pkg-Cron/files/usr/local/www/
Note
The Cron package uses a subdirectory 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