pfSense English Support > Packages

Documenting Package System

(1/4) > >>


I am trying to write a package for clamav and havp. I have setup a test repository locally and trying to understand the manifest and package xml formats. Rather than just ask the questions, I will document what I understand and ask what I do not know, In the process making a crude documentation of package system. I will wikify it  once I get enough information.  Pl correct any errors

pfSense Packaging System

The basic idea behind pfSense packaging system is to install the normal FreeBSD packages, but keep the configuration inside the pfSense xml. This is achieved by creating the config file of application from scratch from xml duing installation and when it is changed in web interface. pfSense provides infrastructure to create the web interface and to store it in it's xml config. The package writer is expected to convert the data from xml to the native format of the application.

Creating a Local Repository.

To test local packages you need to create a local repository of packages. The local repository can be any web server accessible from wan interface with 2 main subdirectories. They are packages and pfSense. packages contain the main package manifest file pkg_config.xml. This also has config subdirectory for package specefic configuration files. The pfSense directory has xmlrpc code. Get the xmlrpc code from and untar it in the directory. To change the default repository directory from to your webserver, edit the /etc/inc/ and change xmlrpcbaseurl to your repository. Now click the System -> Packages from the pfsense web interface and you should see packages from your local repository. You are set to go now.

Package System

pfSense package are composed of
* Manifest File
* Package Configuration files
* Actual Binaries from FreeBSD
Manifest File

Manifest file is the packages/pkg_config.xml It contains list of packages available for installation and some basic information about packages. The format of manifest xml is as follows:


Package configuration files
Package manifest file for each package specifies a configuration file for each package via config_file tag. The convention is  to keep this file inside the packages/config/ directory. The format is:

<?xml version="1.0" encoding="utf-8" ?>
   <!-- For what is this used? -->
   <!-- the package configs are stored in this subtree of main config file -->

   <!-- pfSense menu hookup. Section should be an existing pfSense section -->
      <!-- the act=edit will let you directly edit the page -->

   <!-- Start the service, rc file comes from FreeBSD package or generated using write_rcfile -->
   <!--is rcfile and executable mutually exclusive? -->

   <!-- For creation of Tabs inside the package page -->
   <!-- The page opened after clicking the menu item will have these tabs. -->
   <!-- url can be of the form  /pkg.php?xml=spamd.xml for getting data from a form -->
   <!-- Additional xml files should be included via additional_files_needed -->

   <!-- Used to include additional xml files for tabbed menu and (what all?)-->

   <!-- What is this used for? -->

   <!-- data fields are defined here, these data is accepted from user-->

   <!-- these gets executed during various times of package installation.-->
   <!-- Is the full list available here? -->

   <!-- This is used to define inline php functions that are called by other hooks -->
   <!-- You can also use include_file to include php code -->
   <custom_php_global_functions>      </custom_php_global_functions>

   <!-- The install and deinstall commands, create your directories etc here and call sync function -->
   <!-- Sync function should convert the xml to config file, write out the config fle and restart the daemon -->
   <custom_php_install_command>       </custom_php_install_command>
   <custom_php_deinstall_command>      </custom_php_deinstall_command>

   <!-- No idea where this is used -->
   <custom_add_php_command>      </custom_add_php_command>
   <custom_add_php_command_late>      </custom_add_php_command_late>
   <custom_delete_php_command>      </custom_delete_php_command>
   <custom_php_resync_config_command> </custom_php_resync_config_command>

   <!-- Is this similar to Service tab? -->
   <start_command> </start_command>

   <!-- When is this used ? -->
   <process_kill_command> </process_kill_command>

Binaries from FreeBSD
The actual bineries are the normal FreeBSD packages for that particular program. That can be downloaded directly from FreeBSD FTP Server.


I will expand this as I proceed with my package and understand more about package system, In the mean time pl feel free to add more info as comments.

With Regards,


Adding my questions here, if some one know the answers to them pl reply.

* what is  the meaning of logging along with facilityname and logfilename in manifest xml
* What is the difference between config_file and configurationfile in manifest xml
* has package tag inside packages tab and ouside it. for example spamd comes inside packages tag,
while pure-ftpd comes directly under pfsensepkgs. What's the difference?
* Which of the tags are mandatory for manifest xml
* Is the version tag in package xml the same as the one in manifest xml?
* What types of file can be included via include_file ? (Only php or another xml file also?)
* How is include_file different from additional_files_needed
* When tabs are used what should be the format of externel xml files that are included?
* How can I display the output of commands executed during installation to the output window?
* How can I make one pfSense package dependent on another pfSense package? For example havp package depends on clamav package, and that package needs to be installed and configured
--- Code: ---Apparently this is not possible
--- End code ---

Feel free to start a new section "Package Developement" at  ;)


--- Quote from: hoba on April 06, 2006, 08:36:46 am ---Feel free to start a new section "Package Developement" at  ;)

--- End quote ---

This will go there, if you notice I am updating the first post with new material as soon as I get them. But these needs to be peer reviewd to be posted as "Documentation" :) So post the answers ;)


You might find this interesting if you didn't already see it.


[0] Message Index

[#] Next page

Go to full version