– Kamailio SIP Server –

Howto make Debian packages for Kamailio 3.1.x

This Howto was tested with Kamailio 3.1.0. Nevertheless it should work also with Kamailio 3.0 release and newer versions.

The build process for Debian packages generates all Kamailio packages (also mysql, postgres, radius …). Thus, on the PC used for compiling the Debian packages, all required libraries must be installed, even if you do not install all packages afterwards.

Thus, you need the client and development libraries for the database backends (mysql and postgres), openssl, xmpp and the radiusclient-ng libraries. The database libraries are included in Debian and can be easily installed using apt-get.

1. Get the Kamailio source code. Either download a tar-ball or checkout the respective Kamilio branch from git.

Debian packages are built with the command “make deb”. But this command is also used to build “ser” style Debian packages. Therefore, you have to advise the buld process to build the “Kamailio” release when executing “make deb”. This is done by setting the FLAVOR:

2. Execute:

make FLAVOUR=kamailio cfg

Note: Do not specify other build options here, but do specify them in the Debian rules file.

This instructs the build process to use pkg/kamailio/deb/debian/rules for creating the Debian packages. If you want to add custom build parameters you have to add them to the rules file:

3. (optional) Add build options to the rules file, e.g: edit pkg/kamailio/deb/debian/rules:

configure-stamp:
        dh_testdir
        # Add here commands to configure the package.
        $(MAKE) STUN=1 FLAVOUR=kamailio cfg prefix=/usr cfg_prefix=$(CURDIR)/debian/kamailio

For example in above example the custom build parameter “STUN=1” was added.

4. Build the packages

make deb

If the build process fails due to missing dependencies install them via “apt-get install …..” and try “make deb” again.

5. Done. The packages are located in ../