Debian and Ubuntu packages
This is highly outdated and very incorrect now. It will basically try to put you on 2.4/2.5 when we are up to 2.11 now
Check out this for an alternative install: http://wiki.freepbx.org/pages/viewpage.action?pageId=1048598
This is a extention of ticket:1167.
An initial set of packages for Debian are hosted in the pkg-voip repository. They are currently developed and tested on Debian Stable (4.0 Etch), but should probably work on Lenny and Sid as well, and also on various Ubuntu distributions.
There is on-goin work for 2.4.0 packages. Feedback is needed.
Structure
The package is separated to the main freepbx source package and to a separate freepbx-modules package. The package freepbx includes the FreePBX framework and supporting scripts. It builds a number of binary packages, that provide support for the different databases. It is built from the freepbx tarball.
- freepbx-common : contains the core module, and many of the debian scripts. Depends on asterisk-config-freepbx and freepbx-sql. This package also install /usr/sbin/update-freepbx (upstream's update-conf.sh). It depends will run /usr/share/freepbx-common/install-db for configuration (that file in on freepbx-mysql or freepbx-sqlite3). To get a basic/minimalistic freePBX (but really usable) you can install only this package.
- asterisk-config-freepbx : contains /etc/asterisk/*
- freepbx-sqlite3, freepbx-mysql: the main module needs this package to install the newinstall.sql (maybe the full version, or the sqlite3 version) as well as the /usr/share/freepbx-common/install-db and /usr/share/freepbx-common/remove-db script which are used when configuring the package and on purging. In the future, it will be possible to create a freepbx-pgsql package, as the code in freePBX is already quite portable and it should support this.
- freepbx : virtual package which install op-panel, ari, freepbx-common and freepbx-modules.
The package freepbx-modules includes most of the modules. Currently it just installs all the modules together. better selection is needed as we cannot afford providing a package for each module.
We actively disable the ability to install modules from the web. This does not play nicely with package management system. And the security model for that is not well-defined.
Excluded modules:
- framework, to avoid duplication.
- zoip, due to the size.
- javassh - nonfree applet (I use ajaxterm if I must).
- IRC - should be packaged in a separate package when I get to it. In the mean time I use cgiirc.
Building the packages
Pre-requirements, as root:
aptitude install build-essentials svn-buildpackage fakeroot quilt debhelper
svn co svn://svn.debian.org/pkg-voip/freepbx/trunk freepbx svn co svn://svn.debian.org/pkg-voip/freepbx-modules/trunk freepbx-modules cd freepbx ./debian/rules get-orig-source svn-buildpackage -rfakeroot -uc -us cd ../freepbx-modules svn-buildpackage -rfakeroot -uc -us
The "get-orig-source" package will download from source forge the latest tarball, and repackage it. We need to repackage the tarball since the original tarball contains things which conflict the debian free software guidelines:
- The CDR code is not free. This is because it depends on jpgraph which is distributed under the QPL. This license does not permit the building packages for commercial usage for example.
- Flash operator panel has it's own package.
- ARI has it's own package.
Packages layout
- freepbx-common : contains the core module, and many of the debian scripts. Depends on asterisk-config-freepbx and freepbx-sql. This package also install /usr/sbin/update-freepbx (upstream's update-conf.sh). It depends will run /usr/share/freepbx-common/install-db for configuration (that file in on freepbx-mysql or freepbx-sqlite3). To get a basic/minimalistic freePBX (but really usable) you can install only this package.
- asterisk-config-freepbx : contains /etc/asterisk/*
- freepbx-sqlite3, freepbx-mysql: the main module needs this package to install the newinstall.sql (maybe the full version, or the sqlite3 version) as well as the /usr/share/freepbx-common/install-db and /usr/share/freepbx-common/remove-db script which are used when configuring the package and on purging. In the future, it will be possible to create a freepbx-pgsql package, as the code in freePBX is already quite portable and it should support this.
- freepbx : virtual package which install op-panel, ari, freepbx-common and freepbx-modules.
Installing the packages
The packages will be in the directory called "build-area" at the same level as the trunk.
You can install the new packages using
dpkg -i build-area/*.deb apt-get install -f
The last line is needed, because we are not using apt-get to install, and some dependencies might not be filled up. The proper way of installing, is by creating a repository, adding it to /etc/apt/sources.conf and then apt-get install freepbx
TODO explain how to make a minimal local apt repository
Modifying the Debian dir, to fix bugs or adding a new release
Please remember, that modifications to freePBX should not be done here, but on the freePBX svn. NEVER DEVELOP SOFTWARE AT THE STAGE OF PACKAGING, and if you do this, try to send the changes upstream to the freePBX developers.
Do the modifications you need, and build the packages using this command:
svn-buildpackage -rfakeroot -uc -us --svn-lintian --svn-linda --svn-ignore-new
Generally all of the patches are maintained with quilt. See the pkg-voip README for the exact details.
and then install the modified package using
dpkg -i freepbx-common_2.2.1-1_all.deb
(please note that you should note do the initial install using dpkg, but using apt-get).
When you are done with the modifications, generte a patch against the official svn, using this command:
svn diff > my-patch.diff
and send the patch to pkg-voip-maintainers _at_ lists.alioth.debian.org or to tzafrir.cohen _at_ xorcom.com. This way we can guarantee that the packages will get into the official distributions.
Reporting prooblems
For now, try to find tzafrir (IRC, mail).
(Yeah, this section will likely change in the future)
More reading
You are also strongly recommended to read the following links, as they will explain more about the subject of packaging in general.
Debian developers reference: http://www.us.debian.org/doc/manuals/developers-reference/index.en.html
Debian new maintainers guid: http://www.us.debian.org/doc/manuals/maint-guide/index.en.html
Creating a minimal apt source: http://www.calivia.com/book/sipx-on-debian/create-the-debian-package-repository
