We have created Debian packages of sipX, the Open Source SIP PBX for Linux from SIPfoundry.
The steps involved in creating these packages are documented on the following pages.
/debian tree of files for every particular packet are currently in Calivia's Subversion repository.apt-get install debootstrap dchroot sudo
mkdir /chroot/sarge
debootstrap --variant=buildd sarge /chroot/sarge http://mirrors.kernel.org/debian/
cp /etc/apt/sources.list /chroot/sarge/etc/apt/
vi /etc/fstab
proc-chroot /var/chroot/proc proc defaults 0 0
devpts-chroot /var/chroot/dev/pts devpts defaults 0 0
vi /etc/dchroot.conf
sarge /chroot/sarge
cp /etc/ passwd /chroot/sarge/etc
sed 's/\([^:]*\):[^:]*:/\1:*:/' /etc/shadow | tee /chroot/sarge/etc/shadow
cp /etc/group /chroot/sarge/etc/
cp /etc/hosts /chroot/sarge/etc/
cp /etc/sudoers /chroot/sarge/etc/
chroot /chroot/sarge/
apt-get update
apt-get install wget debconf devscripts gnupg nano subversion sudosudo apt-get install devscripts
DEBEMAIL to the e-mail address you want to show up in the changelog
Set DEBFULLNAME to the name you want to set in the changelog
sipX<em>package</em>lib to libsipx<em>package</em> to conform to the Debian Library Packaging Guide.
Furthermore, all source tarballs are renamed to (lib)sipx<em>package</em>_version.orig.tar.gz.
The script will then fetch the /debian tree from the Calivia sipX Debian subversion repository for every package.
After that, packages are ready to be built.
Alternatively, use wget to get all source tarballs with one command:
wget -r -l 1 -A .gz,.md5 -nd --cut-dirs=3 http://www.sipfoundry.org/pub/sipX/3.0/SRC/#!/bin/sh
W=`pwd`
wget -r -l 1 -A .gz,.md5 -nd --cut-dirs=3 http://www.sipfoundry.org/pub/sipX/3.0/SRC/
echo "** sipX*Lib"
for PACKAGE in {port,tack,media,mediaadapter,commserver,call}; do
echo "**sipx${PACKAGE}lib "
cd $W
mv sipx${PACKAGE}lib-3.0.1.tar.gz libsipx${PACKAGE}_3.0.1.orig.tar.gz
tar xzf libsipx${PACKAGE}_3.0.1.orig.tar.gz
cd sipx${PACKAGE}lib-3.0.1 && \
mkdir debian && \
cd debian && \
svn co http://scm.calivia.com/svn/sipx/debian/tags/3.0.1/sipx${PACKAGE}lib .
echo "** sipx${PACKAGE}lib done"
done;
echo "** sipX*"
for PACKAGE in {vxml,publisher,proxy,registry,config,pbx}; do
echo "**sipx${PACKAGE} "
cd $W
mv sipx${PACKAGE}-3.0.1.tar.gz sipx${PACKAGE}_3.0.1.orig.tar.gz
tar xzf sipx${PACKAGE}_3.0.1.orig.tar.gz
cd sipx${PACKAGE}-3.0.1 && \
mkdir debian && \
cd debian && \
svn co http://scm.calivia.com/svn/sipx/debian/tags/3.0.1/sipx${PACKAGE} .
echo "** sipx${PACKAGE} done"
done;#!/bin/sh
W=`pwd`
echo "** mod_cplusplus"
cd $W
wget -nv http://unc.dl.sourceforge.net/sourceforge/modcplusplus/mod_cplusplus-1.5.2.tar.gz
mv mod_cplusplus-1.5.2.tar.gz libapache-mod-cplusplus_1.5.2.orig.tar.gz
tar xzf libapache-mod-cplusplus_1.5.2.orig.tar.gz
cd mod_cplusplus-1.5.2 && \
mkdir debian && \
cd debian && \
svn co http://scm.calivia.com/svn/sipx/debian/mod_cplusplus .
echo "** mod_cplusplus done"
cd $Wautoreconf --install --force
./configure
make dist#!/bin/sh
P=`pwd`
case "$1" in
download)
echo "config"
svn co http://scm.sipfoundry.org/rep/sipX/branches/3.0/config config
for S in {sipXportLib,sipXtackLib,sipXmediaLib,sipXmediaadapterLib,sipXcallLib,sipXcommserverLib,sipXvxml,sipXpublisher,sipXregistry,sipXproxy,sipXconfig,sipXpbx}; do
echo "$S"
svn co http://scm.sipfoundry.org/rep/sipX/branches/3.0/$S/ $S
done
;;
update)
for S in {sipXportLib,sipXtackLib,sipXmediaLib,sipXmediaadapterLib,sipXcallLib,sipXcommserverLib,sipXvxml,sipXpublisher,sipXregistry,sipXproxy,sipXconfig,sipXpbx}; do
echo "$S"
cd $P/$S
svn update
autoreconf --install --force
./configure
make dist
done
;;
*)
echo "Usage: $0 {download|update}"
esacdpatch patch-template -p "httpd.conf.patch" "Patch LoadModule for Debian" > debian/patches/httpd.conf.dpatchdebian/patches/00list loks like this:
httpd.conf.in.diffdebian/patches/httpd.conf.in.diff).
Note that the patch is relative to the debian/ directory.
#! /bin/sh /usr/share/dpatch/dpatch-run
## httpd.conf.in.diff.dpatch by <msl@calivia.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Patch LoadModule for Debian
@DPATCH@
--- . . /etc/httpd.conf.in 2005-11-02 19:08:40.000000000 +0000
+++ . . /etc/httpd.conf.in.patched 2006-01-12 10:45:31.000000000 +0000
@@ -232,14 +232,10 @@
# LoadModule foo_module @APACHE2_MOD@/mod_foo.so
#
LoadModule ssl_module @APACHE2_MOD@/mod_ssl.so
-LoadModule access_module @APACHE2_MOD@/mod_access.so
-LoadModule auth_module @APACHE2_MOD@/mod_auth.so
LoadModule auth_anon_module @APACHE2_MOD@/mod_auth_anon.so
LoadModule auth_dbm_module @APACHE2_MOD@/mod_auth_dbm.so
LoadModule auth_digest_module @APACHE2_MOD@/mod_auth_digest.so
LoadModule include_module @APACHE2_MOD@/mod_include.so
-LoadModule log_config_module @APACHE2_MOD@/mod_log_config.so
-LoadModule env_module @APACHE2_MOD@/mod_env.so
LoadModule mime_magic_module @APACHE2_MOD@/mod_mime_magic.so
LoadModule cern_meta_module @APACHE2_MOD@/mod_cern_meta.so
LoadModule expires_module @APACHE2_MOD@/mod_expires.so
@@ -247,22 +243,15 @@
LoadModule headers_module @APACHE2_MOD@/mod_headers.so
LoadModule usertrack_module @APACHE2_MOD@/mod_usertrack.so
LoadModule unique_id_module @APACHE2_MOD@/mod_unique_id.so
-LoadModule setenvif_module @APACHE2_MOD@/mod_setenvif.so
-LoadModule mime_module @APACHE2_MOD@/mod_mime.so
LoadModule dav_module @APACHE2_MOD@/mod_dav.so
-LoadModule status_module @APACHE2_MOD@/mod_status.so
-LoadModule autoindex_module @APACHE2_MOD@/mod_autoindex.so
LoadModule asis_module @APACHE2_MOD@/mod_asis.so
LoadModule info_module @APACHE2_MOD@/mod_info.so
LoadModule dav_fs_module @APACHE2_MOD@/mod_dav_fs.so
LoadModule vhost_alias_module @APACHE2_MOD@/mod_vhost_alias.so
-LoadModule negotiation_module @APACHE2_MOD@/mod_negotiation.so
-LoadModule dir_module @APACHE2_MOD@/mod_dir.so
LoadModule imap_module @APACHE2_MOD@/mod_imap.so
LoadModule actions_module @APACHE2_MOD@/mod_actions.so
LoadModule speling_module @APACHE2_MOD@/mod_speling.so
LoadModule userdir_module @APACHE2_MOD@/mod_userdir.so
-LoadModule alias_module @APACHE2_MOD@/mod_alias.so
LoadModule rewrite_module @APACHE2_MOD@/mod_rewrite.so
LoadModule proxy_module @APACHE2_MOD@/mod_proxy.so
LoadModule proxy_ftp_module @APACHE2_MOD@/mod_proxy_ftp.so# choose a mirror close to you!
deb http://scm.calivia.com/pub/sipx/debian unstable mainapt-get update will fetch the information about what is available from all the repository URLs in /etc/apt/sources.list.
apt-get install sun-j2re1.5
ln -s /usr/lib/j2re1.5-sun/bin/keytool /etc/alternatives/keytool
ln -s /etc/alternatives/keytool /usr/bin/keytoollibapache-mod-cplusplus_1.5.2-0_i386.deb and libapache-mod-cplusplus-dev_1.5.2-0_i386.deb). It will be installed along with the other packages by apt.
sipXportLib will ask you for information using Debian debconf to create a key and self-signed certificate for both sipXpbx (Apache) and sipXconfig (Jetty). Check out the documentation if you plan to use a certificate from an external authority.
sudo apt-get install sipxpbx/etc/inetd.conf:
-tftp dgram udp wait root /usr/sbin/in.tftpd /usr/sbin/in.tftpd -s /var/lib/tftpboot
+tftp dgram udp wait root /usr/sbin/in.tftpd /usr/sbin/in.tftpd -s /var/sipxdata/configserver/phone/profile/tftproot//etc/init.d/inetd restart/var/log/sipxpbx/sipxconfig.log for errors. If anything with the certificates is wrong, it will not come up.
dpkg-buildpackage -rfakeroot
dpkg -c ../package.deb
dpkg -i ../package.deb dpkg -i ../package-dev.deb
source and binary subdirectories.
dpkg-scanpackages will generate the Packages file and dpkg-scansources the Sources file.
dpkg-scanpackages scans the .deb packages; dpkg-scansources scans the .dsc files. It is thus necessary to put the .orig.gz, .diff.gz and .dsc files together. The .changes files are not needed.
Note: for testing the binary packages you might want to create binary packages only.
Create the two index files as follows:
$ cd my-repository
$ dpkg-scanpackages binary /dev/null | gzip -9c > binary/Packages.gz
$ dpkg-scansources source /dev/null | gzip -9c > source/Sources.gz/pub/sipx/debian/dists/unstable/main/binary-i386/ looks like this:
Archive: unstable
Component: main
Origin: Calivia GmbH
Label: Calivia Debian repository
Architecture: i386 Archive: archive
Component: component
Origin: YourCompany
Label: YourCompany Debian repository
Architecture: architecture/etc/apt/sources.list.
sudo apt-get install -s packagenamesudo apt-get remove --purge packagenamesudo apt-get update/var/cache/apt/sudo apt-get clean