Sfoglia il codice sorgente

PKG Debian: More version support

- debian-squeeze added.
      Purple excluded from the compile list. Seems that purple module does not work with libpurple 2.7+
- ubuntu-lucid added
      Universe has to be enabled in sources.list for radius and memcached module dependency matching
Jon Bonilla 15 anni fa
parent
commit
64db1af36c

+ 52 - 0
pkg/kamailio/debian-squeeze/changelog

@@ -0,0 +1,52 @@
+kamailio (3.0.2.99) unstable; urgency=low
+
+  * update to 3.0.2.99 for development version builds
+
+ -- Jon Bonilla <[email protected]>  Fri, 28 May 2010 22:26:00 +0100
+
+kamailio (3.0.2) unstable; urgency=low
+
+  * update to 3.0.2 from upstream
+
+ -- Daniel-Constantin Mierla <[email protected]>  Thu, 27 May 2010 10:27:36 +0100
+
+kamailio (3.0.1) unstable; urgency=low
+
+  * update to 3.0.1 from upstream
+
+ -- Daniel-Constantin Mierla <[email protected]>  Mon, 08 Mar 2010 20:30:48 +0100
+
+kamailio (3.0.0) unstable; urgency=low
+
+  * update to 3.0.0 from upstream
+
+ -- Daniel-Constantin Mierla <[email protected]>  Mon, 11 Jan 2010 18:30:42 +0100
+
+kamailio (3.0.0-rc3) unstable; urgency=low
+
+  * update to 3.0.0-rc3 from upstream
+  * updated debian/rules to work with the SIP Router style module packaging
+
+ -- Daniel-Constantin Mierla <[email protected]>  Fri, 10 Dec 2009 12:10:02 +0100
+
+kamailio (3.0.0-rc2) unstable; urgency=low
+
+  * update to 3.0.0-rc2 from upstream
+  * updated debian/rules to work with the new style module packaging
+
+ -- Jonas Bergler <[email protected]>  Wed, 18 Nov 2009 12:30:02 +1300
+
+kamailio (1.5.0-svn1) unstable; urgency=low
+
+  * increment debian packaging for trunk
+
+ -- Henning Westerholt <[email protected]>  Mon, 02 Mar 2009 17:40:02 +0100
+
+kamailio (1.4.0-svn1) unstable; urgency=low
+
+  [ Klaus Darilion ]
+  * first release of Kamailio (after renaming from Openser)
+
+ -- Julien BLACHE <[email protected]>  Wed, 12 Dec 2007 17:25:31 +0100
+
+

+ 1 - 0
pkg/kamailio/debian-squeeze/compat

@@ -0,0 +1 @@
+5

+ 225 - 0
pkg/kamailio/debian-squeeze/control

@@ -0,0 +1,225 @@
+Source: kamailio
+Section: net
+Priority: optional
+Maintainer: Debian VoIP Team <[email protected]>
+Uploaders: Kilian Krause <[email protected]>
+Build-Depends: debhelper (>= 5), dpatch, libmysqlclient-dev, libexpat1-dev, libxml2-dev, libpq-dev, libradiusclient-ng-dev, flex, bison, zlib1g-dev, unixodbc-dev, libxmlrpc-c3-dev, libperl-dev, libsnmp-dev, dpkg-dev (>= 1.13.19), libdb-dev (>= 4.6.19), xsltproc, libconfuse-dev, libldap2-dev, libssl-dev, libcurl3-openssl-dev, python, libpcre3-dev, docbook-xml, libmemcache-dev, libreadline5-dev
+Standards-Version: 3.8.0
+Homepage: http://www.kamailio.org/
+
+Package: kamailio
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, adduser
+Conflicts: kamailio-regex-modules, kamailio-dbg, kamailio-purple-modules (< ${binary:Version}), kamailio-purple-module
+Suggests: kamailio-mysql-modules, kamailio-postgres-modules, kamailio-unixodbc-modules, kamailio-tls-modules, kamailio-cpl-modules, kamailio-radius-modules, kamailio-presence-modules, kamailio-xmlrpc-modules, kamailio-perl-modules, kamailio-snmpstats-modules, kamailio-xmpp-modules, kamailio-carrierroute-modules, kamailio-berkeley-modules, kamailio-ldap-modules
+Description: very fast and configurable SIP proxy
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ C Shell-like scripting language provides full control over the server's
+ behaviour. Its modular architecture allows only required functionality to be
+ loaded.
+ .
+ Among others, the following modules are available: Digest Authentication, CPL
+ scripts, Instant Messaging, MySQL support, Presence Agent, Radius
+ Authentication, Record Routing, SMS Gateway, Jabber/XMPP Gateway, Transaction
+ Module, Registrar and User Location, XMLRPC Interface.
+ .
+ This package contains the main Kamailio binary along with the principal modules
+ and support binaries.
+
+
+Package: kamailio-mysql-modules
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version}), mysql-client
+Replaces: kamailio-mysql-module
+Description: MySQL database connectivity module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the MySQL database driver for Kamailio.
+
+Package: kamailio-postgres-modules
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version}), postgresql-client
+Replaces: kamailio-postgres-module
+Description: PostgreSQL database connectivity module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the PostgreSQL database driver for Kamailio.
+
+Package: kamailio-cpl-modules
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+Replaces: kamailio-cpl-module
+Description: CPL module (CPL interpreter engine) for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides a CPL (Call Processing Language) interpreter for
+ Kamailio, turning Kamailio into a CPL server (storage and interpreter).
+
+Package: kamailio-radius-modules
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+Description: radius modules for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides a set of Radius modules for Kamailio, for
+ authentication, peering, group membership and messages URIs checking
+ against a Radius Server.
+
+Package: kamailio-unixodbc-modules
+Architecture: any 
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+Replaces: kamailio-unixodbc-module
+Description: unixODBC database connectivity module for Kamailio 
+ Kamailio is a very fast and flexible SIP (RFC3261) 
+ proxy server. Written entirely in C, Kamailio can handle thousands calls 
+ per second even on low-budget hardware. 
+ . 
+ This package provides the unixODBC database driver for Kamailio. 
+
+Package: kamailio-presence-modules
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+Description: SIMPLE presence modules for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides several Kamailio modules for implementing presence
+ server and presence user agent for RICH presence, registrar-based presence,
+ external triggered presence and XCAP support.
+
+Package: kamailio-xmlrpc-modules
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+Replaces: kamailio-xmlrpc-module
+Description: XMLRPC support for Kamailio's Management Interface
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the XMLRPC transport implementations for Kamailio's
+ Management and Control Interface.
+
+Package: kamailio-perl-modules
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+Replaces: kamailio-perl-module
+Conflicts: kamailio-perl-module
+Description: Perl extensions and database driver for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides an interface for Kamailio to write Perl extensions and
+ the perlvdb database driver for Kamailio.
+
+Package: kamailio-snmpstats-modules
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version}), snmpd
+Replaces: kamailio-snmpstats-module
+Description: SNMP AgentX subagent module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the snmpstats module for Kamailio. This module acts
+ as an AgentX subagent which connects to a master agent.
+
+Package: kamailio-xmpp-modules
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+Replaces: kamailio-xmpp-module
+Description: XMPP gateway module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the SIP to XMPP IM translator module for Kamailio.
+
+Package: kamailio-carrierroute-modules
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+Replaces: kamailio-carrierroute-module
+Description: Carrierroute module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the carrierroute module for Kamailio, an integrated
+ solution for routing, balancing and blacklisting.
+
+Package: kamailio-berkeley-modules
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version}), db4.6-util
+Replaces: kamailio-berkeley-module
+Description: Berkeley Database module for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the berkeley database module for Kamailio, a
+ high-performance embedded DB kernel. All database tables are stored
+ in files, no additional server is necessary.
+
+Package: kamailio-ldap-modules
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+Description: LDAP modules for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the ldap and h350 modules for Kamailio, enabling LDAP
+ queries from the Kamailio config and storage of SIP account data in an LDAP
+ directory.
+
+Package: kamailio-utils-modules
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+Replaces: kamailio-utils-module
+Description: Provides a set utility functions for Kamailio
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ Provides a set of utility functions for Kamailio, which are not related
+ to the server configuration.
+
+Package: kamailio-memcached-modules
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+Replaces: kamailio-memcached-module
+Description: Provides the memcached module, an interface to the memcached server
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the memcached module, an interface to the memcached
+ server, a high-performance, distributed memory object caching system.
+
+Package: kamailio-tls-modules
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${Source-Version})
+Description: contains the TLS kamailio transport module
+ This has been split out of the main kamailio package, so that kamailio will not
+ depend on openssl. This module will enable you to use the TLS transport.
+
+Package: kamailio-nth
+Architecture: any
+Depends: screen, gdb, binutils, gcc, bison, flex, ngrep, tcpdump, iftop, lsof, psmisc, vim, bvi, most, mc, sipsak
+Description: Kamailio - package for "nice to have" installation
+ This is a meta-package for easy installation various useful tools that may be
+ handy on server with Kamailio installed.
+
+

+ 27 - 0
pkg/kamailio/debian-squeeze/copyright

@@ -0,0 +1,27 @@
+This package was debianized by Andrei Pelinescu-Onciul
+<[email protected]> on Tue, 16 Jul 2002 15:41:31 +0200.
+This package was debianized by Julien BLACHE <[email protected]>
+on Thu, 29 Jun 2006 09:55:24 +0200, based on Andrei's work.
+
+It was downloaded from: http://kamailio.org
+
+Upstream Authors:
+       Andrei Pelinescu-Onciul <[email protected]>
+       Bogdan-Andrei Iancu <[email protected]>
+       Daniel-Constantin Mierla <[email protected]>
+       Jan Janak <[email protected]>
+       Jiri Kuthan <[email protected]>
+       Juha Heinanen
+       Ramona-Elena Modroiu
+       Maxim Sobolev
+       Miklos Tirpak
+       Nils Ohlmeier
+       and others ; see the AUTHORS file in the source code tree for details
+
+This software is copyright (c) 2002-2003 by FhG Fokus
+
+You are free to distribute this software under the terms of
+the GNU General Public License.
+
+On Debian systems, the complete text of the GNU General Public
+License can be found in the file `/usr/share/common-licenses/GPL.

+ 38 - 0
pkg/kamailio/debian-squeeze/kamailio.README.Debian

@@ -0,0 +1,38 @@
+Kamailio for Debian
+------------------
+
+* init script check for fork=no
+-------------------------------
+
+The Kamailio init script will not start Kamailio on boot if fork=no is
+specified in the config file. The check in the initscript will match
+any occurrence of fork=no in the file, even inside C-style comments.
+
+You can disable this check in the init script if you wish; just comment
+out the calls to the check_fork function in the script. Your changes to
+the init script will be preserved upon upgrade, as the file is tagged
+as a conffile.
+
+
+* Kamailio setup
+---------------
+
+To setup Kamailio, you need to:
+ - configure Kamailio properly to suit your needs
+ - edit /etc/default/kamailio, adjust the MEMORY parameter and set
+   RUN_KAMAILIO to "yes"
+
+If you are building an HA cluster using heartbeat or similar, you'll want
+to disable the init script by running:
+
+  update-rc.d kamailio remove
+
+so that Kamailio will not be launched at system startup. You still need
+to set RUN_KAMAILIO to "yes" if you want to use the /etc/init.d/kamailio init
+script.
+
+Set the DUMP_CORE parameter in /etc/default/kamailio to "yes" if you want to
+get a core dump in case Kamailio crashes. The debug symbols for Kamailio are
+provided by the kamailio-dbg package.
+
+-- Julien BLACHE <[email protected]>, Fri, 08 Sep 2006 14:43:21 +0200

+ 24 - 0
pkg/kamailio/debian-squeeze/kamailio.default

@@ -0,0 +1,24 @@
+#
+# Kamailio startup options
+#
+
+# Set to yes to enable kamailio, once configured properly.
+RUN_KAMAILIO=no
+
+# User to run as
+USER=kamailio
+
+# Group to run as
+GROUP=kamailio
+
+# Amount of memory to allocate for the running Kamailio server (in Mb)
+MEMORY=64
+
+# Enable the server to leave a core file when it crashes.
+# Set this to 'yes' to enable Kamailio to leave a core file when it crashes
+# or 'no' to disable this feature. This option is case sensitive and only
+# accepts 'yes' and 'no' and only in lowercase letters.
+# On some systems (e.g. Ubuntu 6.10, Debian 4.0) it is necessary to specify
+# a directory for the core files to get a dump. Look into the kamailio
+# init file for an example configuration.
+DUMP_CORE=no

+ 2 - 0
pkg/kamailio/debian-squeeze/kamailio.dirs

@@ -0,0 +1,2 @@
+var/run/kamailio
+

+ 2 - 0
pkg/kamailio/debian-squeeze/kamailio.examples

@@ -0,0 +1,2 @@
+examples/*
+

+ 170 - 0
pkg/kamailio/debian-squeeze/kamailio.init

@@ -0,0 +1,170 @@
+#! /bin/sh
+#
+### BEGIN INIT INFO
+# Provides:          kamailio
+# Required-Start:    $syslog $network $local_fs $time
+# Required-Stop:     $syslog $network $local_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Start the Kamailio SIP proxy server
+# Description:       Start the Kamailio SIP proxy server
+### END INIT INFO
+#
+# TODO:
+# The following fields should be added (and completed):
+# Should-Start:      postgresql mysql radius
+# Should-Stop:       postgresql mysql radius
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/kamailio
+NAME=kamailio
+DESC=kamailio
+HOMEDIR=/var/run/kamailio
+PIDFILE=$HOMEDIR/$NAME.pid
+DEFAULTS=/etc/default/kamailio
+RUN_KAMAILIO=no
+
+# Do not start kamailio if fork=no is set in the config file
+# otherwise the boot process will just stop
+check_fork ()
+{
+    if grep -q "^[[:space:]]*fork[[:space:]]*=[[:space:]]*no.*" /etc/kamailio/kamailio.cfg; then
+	echo "Not starting $DESC: fork=no specified in config file; run /etc/init.d/kamailio debug instead"
+	exit 1
+    fi
+}
+
+check_kamailio_config ()
+{
+	# Check if kamailio configuration is valid before starting the server
+	set +e
+	out=$($DAEMON -c 2>&1 > /dev/null)
+	retcode=$?
+	set -e
+	if [ "$retcode" != '0' ]; then
+	    echo "Not starting $DESC: invalid configuration file!"
+	    echo -e "\n$out\n"
+	    exit 1
+	fi
+}
+
+check_homedir ()
+{
+    # Create HOMEDIR directory in case it doesn't exist
+    if [ ! -d $HOMEDIR ]; then
+        mkdir $HOMEDIR
+    fi
+
+    # Set the appropiate owner and group
+    chown ${USER}:${GROUP} $HOMEDIR
+}
+
+
+create_radius_seqfile ()
+{
+    # Create a radius sequence file to be used by the radius client if
+    # radius accounting is enabled. This is needed to avoid any issue
+    # with the file not being writable if kamailio first starts as user
+    # root because DUMP_CORE is enabled and creates this file as user
+    # root and then later it switches back to user kamailio and cannot
+    # write to the file. If the file exists before kamailio starts, it
+    # won't change it's ownership and will be writable for both root
+    # and kamailio, no matter what options are chosen at install time
+    RADIUS_SEQ_FILE=$HOMEDIR/kamailio_radius.seq
+
+    if [ ! -f $RADIUS_SEQ_FILE ]; then
+        touch $RADIUS_SEQ_FILE
+    fi
+
+    chown ${USER}:${GROUP} $RADIUS_SEQ_FILE
+    chmod 660 $RADIUS_SEQ_FILE
+}
+
+test -f $DAEMON || exit 0
+
+# Load startup options if available
+if [ -f $DEFAULTS ]; then
+   . $DEFAULTS || true
+fi
+
+if [ "$RUN_KAMAILIO" != "yes" ]; then
+    echo "Kamailio not yet configured. Edit /etc/default/kamailio first."
+    exit 0
+fi
+
+set -e
+
+MEMORY=$((`echo $MEMORY | sed -e 's/[^0-9]//g'`))
+[ -z "$USER" ]  && USER=kamailio
+[ -z "$GROUP" ] && GROUP=kamailio
+[ $MEMORY -le 0 ] && MEMORY=32
+
+if test "$DUMP_CORE" = "yes" ; then
+    # set proper ulimit
+    ulimit -c unlimited
+    
+    # directory for the core dump files
+    # COREDIR=/home/corefiles
+    # [ -d $COREDIR ] || mkdir $COREDIR
+    # chmod 777 $COREDIR
+    # echo "$COREDIR/core.%e.sig%s.%p" > /proc/sys/kernel/core_pattern
+fi
+
+OPTIONS="-P $PIDFILE -m $MEMORY -u $USER -g $GROUP"
+
+case "$1" in
+  start|debug)
+	check_kamailio_config
+	check_homedir
+	create_radius_seqfile
+
+	if [ "$1" != "debug" ]; then
+	    check_fork
+	fi
+
+	echo -n "Starting $DESC: $NAME"
+	start-stop-daemon --start --quiet --pidfile $PIDFILE \
+		--exec $DAEMON -- $OPTIONS || echo -n " already running"
+	echo "."
+	;;
+  stop)
+	echo -n "Stopping $DESC: $NAME"
+	start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \
+		--exec $DAEMON
+	echo "."
+	;;
+  restart|force-reload)
+	check_kamailio_config
+	check_homedir
+	create_radius_seqfile
+
+	echo -n "Restarting $DESC: $NAME"
+	start-stop-daemon --oknodo --stop --quiet --pidfile \
+		$PIDFILE --exec $DAEMON
+	sleep 1
+	start-stop-daemon --start --quiet --pidfile \
+		$PIDFILE --exec $DAEMON  -- $OPTIONS
+	echo "."
+	;;
+  status)
+	echo -n "Status of $DESC: "
+	if [ ! -r "$PIDFILE" ]; then
+		echo "$NAME is not running."
+		exit 3
+	fi
+	if read pid < "$PIDFILE" && ps -p "$pid" > /dev/null 2>&1; then
+		echo "$NAME is running."
+		exit 0
+	else
+		echo "$NAME is not running but $PIDFILE exists."
+		exit 1
+	fi
+	;;
+  *)
+	N=/etc/init.d/$NAME
+	echo "Usage: $N {start|stop|restart|force-reload|debug|status}" >&2
+	exit 1
+	;;
+esac
+
+exit 0

+ 48 - 0
pkg/kamailio/debian-squeeze/kamailio.postinst

@@ -0,0 +1,48 @@
+#! /bin/sh
+#
+# $Id$
+
+PKG=kamailio
+DEFAULTS=/etc/default/kamailio
+HOMEDIR=/var/run/kamailio
+
+set -e
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+#
+# quoting from the policy:
+#     Any necessary prompting should almost always be confined to the
+#     post-installation script, and should be protected with a conditional
+#     so that unnecessary prompting doesn't happen if a package's
+#     installation fails and the `postinst' is called with `abort-upgrade',
+#     `abort-remove' or `abort-deconfigure'.
+
+case "$1" in
+    configure)
+        adduser --quiet --system --group --disabled-password \
+                --shell /bin/false --gecos "Kamailio" \
+                --home $HOMEDIR kamailio || true
+
+        ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+
+        ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+        ;;
+esac
+
+#DEBHELPER#
+

+ 220 - 0
pkg/kamailio/debian-squeeze/rules

@@ -0,0 +1,220 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+#
+# $Id$
+#
+# History:
+# --------
+#  2009-07-08  updated for sip-router (andrei)
+#  2009-12-10  updated for kamailio 3.0 (daniel)
+
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# This is the debhelper compatibility version to use.
+# export DH_COMPAT=4
+#  -- already set in compat
+#  force no striping (always include debug symbols for now)
+export DEB_BUILD_OPTIONS:="$(DEB_BUILD_OPTIONS) nostrip"
+
+# modules not in the "main" kamailio package
+EXCLUDED_MODULES=
+
+# extra modules to skip, because they are not compilable now
+# - regardless if they go to the main kamailio package or to some module package,
+# they will be excluded from compile and install of all
+EXTRA_EXCLUDED_MODULES=seas bdb dbtext oracle pa rls iptrtpproxy purple
+#EXTRA_EXCLUDED_MODULES=
+
+# possible module directories that can appear in MODULES_SP
+# (only used for deducing a module name)
+MDIRS=modules modules_s modules_k
+
+# modules packaged in separate packages (complete with full modules_* path)
+# with the package name: kamailio-$(module_name)-module
+MODULES_SP=
+
+# module groups that are packaged in seperate packages
+# (with the name kamailio-$(group_name)-modules)
+# Note: the order is important (should be in dependency order, the one
+# on which other depend first)
+PACKAGE_GROUPS=mysql postgres berkeley unixodbc radius presence \
+			   ldap xmlrpc perl utils memcached tls \
+			   snmpstats carrierroute xmpp cpl
+
+# directories with possible duplicate libraries (that should be deleted
+# from current module* packages)
+DUP_LIBS_DIRS=$(CURDIR)/debian/kamailio/usr/lib/kamailio \
+			$(CURDIR)/debian/kamailio-db-modules/usr/lib/kamailio
+
+# modules names out of modules sp
+MODULES_SP_NAMES=$(filter-out $(MDIRS),$(subst /, ,$(MODULES_SP)))
+
+# "function" to get package short name out of a dir/module_name
+# it also transforms db_foo into foo
+mod_name=$(subst db_,,$(lastword $(subst /, ,$(1))))
+
+define PACKAGE_GRP_BUILD_template
+	# package all the modules in PACKAGE_GROUPS in separate packages
+	$(foreach grp,$(PACKAGE_GROUPS),\
+		$(MAKE) every-module group_include="k$(grp)"
+	)
+endef
+
+
+define PACKAGE_MODULE_BUILD_template
+	# package all the modules MODULES_SP in separate packages
+	$(foreach mod,$(MODULES_SP),\
+		$(MAKE) modules modules="$(mod)"
+	)
+endef
+
+
+define PACKAGE_GRP_INSTALL_template
+	$(foreach grp,$(PACKAGE_GROUPS),\
+		$(MAKE) install-modules-all group_include="k$(grp)" \
+		basedir=$(CURDIR)/debian/kamailio-$(grp)-modules \
+		cfg_prefix=$(CURDIR)/debian/kamailio-$(grp)-modules \
+		doc-dir=share/doc/kamailio-$(grp)-modules
+		# eliminate duplicate libs
+		-for d in $(DUP_LIBS_DIRS); do \
+			test "$$d" != "$(CURDIR)/debian/kamailio-$(grp)-modules/usr/lib/kamailio" &&\
+			for r in $$d/lib*; do \
+				echo "removing $(grp) lib `basename $$r` present also in $$d";\
+				rm -f $(CURDIR)/debian/kamailio-$(grp)-modules/usr/lib/kamailio/`basename "$$r"` ; \
+			done ; \
+		done
+	)
+endef
+
+
+define PACKAGE_MODULE_INSTALL_template
+	$(foreach mod,$(MODULES_SP),
+		$(MAKE) install-modules-all modules="$(mod)" \
+				modules_s="" modules_k="" \
+				basedir=$(CURDIR)/debian/kamailio-$(call mod_name,$(mod))-module \
+				doc-dir=share/doc/kamailio-$(call mod_name,$(mod))-module
+		# eliminate duplicate libs
+		-for d in $(DUP_LIBS_DIRS); do \
+			test "$$d" != "$(CURDIR)/debian/kamailio-$(call mod_name,$(mod))-module/usr/lib/kamailio" &&\
+			for r in $$d/lib*; do \
+				echo "removing $(call mod_name, $(mod)) lib `basename $$r` present also in $$d";\
+				rm -f $(CURDIR)/debian/kamailio-$(call mod_name,$(mod))-module/usr/lib/kamailio/`basename "$$r"` ; \
+			done ; \
+		done
+	)
+endef
+
+ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
+	CFLAGS += -g
+endif
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+	INSTALL_PROGRAM += -s
+endif
+
+configure: configure-stamp
+configure-stamp:
+	dh_testdir
+	# Add here commands to configure the package.
+	$(MAKE) cfg prefix=/usr cfg_prefix=$(CURDIR)/debian/kamailio \
+			cfg_target=/etc/kamailio/ \
+			basedir=$(CURDIR)/debian/kamailio \
+			skip_modules="$(EXCLUDED_MODULES) $(EXTRA_EXCLUDED_MODULES)" \
+			group_include="kstandard"
+
+	touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp 
+	dh_testdir
+	# Add here commands to compile the package.
+	$(MAKE) all
+	# make groups
+	$(call PACKAGE_GRP_BUILD_template)
+	# make single-module packages
+	$(call PACKAGE_MODULE_BUILD_template)
+	touch build-stamp
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp configure-stamp
+	# Add here commands to clean up after the build process.
+	-$(MAKE) maintainer-clean
+	dh_clean
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
+	# Add here commands to install the package into debian/kamailio
+	$(MAKE) install group_include="kstandard"
+	# fix etc/kamailio dir location -- not needed -- andrei
+	# mv -f $(CURDIR)/debian/kamailio/usr/etc $(CURDIR)/debian/kamailio
+	# make group packages
+	$(call PACKAGE_GRP_INSTALL_template)
+	# make single module packages
+	$(call PACKAGE_MODULE_INSTALL_template)
+	# install /etc/default/kamailio file
+	mkdir -p $(CURDIR)/debian/kamailio/etc/default
+	cp -f debian/kamailio.default $(CURDIR)/debian/kamailio/etc/default/kamailio
+	#dh_movefiles
+
+
+
+# This single target is used to build all the packages, all at once, or
+# one at a time. So keep in mind: any options passed to commands here will
+# affect _all_ packages. Anything you want to only affect one package
+# should be put in another target, such as the install target.
+binary-common: 
+	dh_testdir
+	dh_testroot
+	dh_installdebconf	
+	dh_installdocs
+	dh_installexamples
+	dh_installmenu
+#	dh_installlogrotate
+#	dh_installemacsen
+#	dh_installpam
+#	dh_installmime
+	dh_installinit  -- defaults 23
+	dh_installcron
+	dh_installman
+	dh_installinfo
+#	dh_undocumented
+	dh_installchangelogs 
+	dh_link
+	dh_strip
+	dh_compress 
+	dh_fixperms
+	dh_makeshlibs
+	dh_installdeb
+#	dh_perl
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+# Build architecture-independent packages using the common target
+binary-indep: build install
+# (Uncomment this next line if you have such packages.)
+#        $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
+# We have nothing to do by default.
+
+
+# Build architecture-dependent packages using the common target
+binary-arch: build install
+	$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
+
+# Any other binary targets build just one binary package at a time.
+binary-%: build install
+	$(MAKE) -f debian/rules binary-common DH_OPTIONS=-p$*
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
+

+ 1 - 0
pkg/kamailio/ubuntu-lucid

@@ -0,0 +1 @@
+debian