瀏覽代碼

Merge 'pkg' of kamailio svn into sip-router/pkg/kamailio

* 'pkg' of kamailio svn: (166 commits)
  - updated email address
  - build memcached module as own debian package
  - Added libmemcache-dev to "control" files for deb packages (patch by Andreas Heise)
  - Improved Debian init script:
  - remove debian-sarge, etch is now oldstable
  - increment debian packaging version for trunk
  - add missing libpcre3-dev depencency
  - remove purple module from sarge packaging
  - fix description, debian radius packages also contains the peering module
  - add purple module to debian packaging
  - fix packaging for utils module, wrong directory name
  - add utils module to packaging
  - activate module man page building for debian packages
  Add RLS to the debian-presence-package.
  - update port for OpenBSD (created for 1.4.2)
  * LCR module is now using Perl compatible PCRE regular expression
  - add modules for dialog-info support to pua and presence module
  - add manifest file to start/ stop/ restart kamailio/ openser with Solaris 10
  * Packaging changes related to new misc_radius module
  - fix e-mail address
  ...
Jan Janak 16 年之前
父節點
當前提交
5c4cc0750b
共有 100 個文件被更改,包括 4637 次插入0 次删除
  1. 14 0
      pkg/kamailio/debian-etch/changelog
  2. 1 0
      pkg/kamailio/debian-etch/compat
  3. 239 0
      pkg/kamailio/debian-etch/control
  4. 27 0
      pkg/kamailio/debian-etch/copyright
  5. 38 0
      pkg/kamailio/debian-etch/kamailio.README.Debian
  6. 24 0
      pkg/kamailio/debian-etch/kamailio.default
  7. 2 0
      pkg/kamailio/debian-etch/kamailio.dirs
  8. 2 0
      pkg/kamailio/debian-etch/kamailio.examples
  9. 170 0
      pkg/kamailio/debian-etch/kamailio.init
  10. 48 0
      pkg/kamailio/debian-etch/kamailio.postinst
  11. 3 0
      pkg/kamailio/debian-etch/patches/00list
  12. 27 0
      pkg/kamailio/debian-etch/patches/10_no_lib64_on_64_bits.dpatch
  13. 24 0
      pkg/kamailio/debian-etch/patches/11_always_smp.dpatch
  14. 374 0
      pkg/kamailio/debian-etch/rules
  15. 14 0
      pkg/kamailio/debian-lenny/changelog
  16. 1 0
      pkg/kamailio/debian-lenny/compat
  17. 242 0
      pkg/kamailio/debian-lenny/control
  18. 27 0
      pkg/kamailio/debian-lenny/copyright
  19. 38 0
      pkg/kamailio/debian-lenny/kamailio.README.Debian
  20. 24 0
      pkg/kamailio/debian-lenny/kamailio.default
  21. 2 0
      pkg/kamailio/debian-lenny/kamailio.dirs
  22. 2 0
      pkg/kamailio/debian-lenny/kamailio.examples
  23. 170 0
      pkg/kamailio/debian-lenny/kamailio.init
  24. 48 0
      pkg/kamailio/debian-lenny/kamailio.postinst
  25. 3 0
      pkg/kamailio/debian-lenny/patches/00list
  26. 27 0
      pkg/kamailio/debian-lenny/patches/10_no_lib64_on_64_bits.dpatch
  27. 24 0
      pkg/kamailio/debian-lenny/patches/11_always_smp.dpatch
  28. 374 0
      pkg/kamailio/debian-lenny/rules
  29. 14 0
      pkg/kamailio/debian/changelog
  30. 1 0
      pkg/kamailio/debian/compat
  31. 242 0
      pkg/kamailio/debian/control
  32. 27 0
      pkg/kamailio/debian/copyright
  33. 38 0
      pkg/kamailio/debian/kamailio.README.Debian
  34. 24 0
      pkg/kamailio/debian/kamailio.default
  35. 2 0
      pkg/kamailio/debian/kamailio.dirs
  36. 2 0
      pkg/kamailio/debian/kamailio.examples
  37. 170 0
      pkg/kamailio/debian/kamailio.init
  38. 48 0
      pkg/kamailio/debian/kamailio.postinst
  39. 3 0
      pkg/kamailio/debian/patches/00list
  40. 27 0
      pkg/kamailio/debian/patches/10_no_lib64_on_64_bits.dpatch
  41. 24 0
      pkg/kamailio/debian/patches/11_always_smp.dpatch
  42. 375 0
      pkg/kamailio/debian/rules
  43. 75 0
      pkg/kamailio/fedora/kamailio.init
  44. 201 0
      pkg/kamailio/freebsd/Makefile
  45. 3 0
      pkg/kamailio/freebsd/distinfo
  46. 78 0
      pkg/kamailio/freebsd/files/patch-Makefile
  47. 11 0
      pkg/kamailio/freebsd/files/patch-Makefile-mysql
  48. 42 0
      pkg/kamailio/freebsd/files/patch-Makefile.defs
  49. 24 0
      pkg/kamailio/freebsd/files/pkg-deinstall.in
  50. 12 0
      pkg/kamailio/freebsd/files/pkg-install.in
  51. 13 0
      pkg/kamailio/freebsd/pkg-descr
  52. 118 0
      pkg/kamailio/gentoo/kamailio-1.2.0.ebuild
  53. 22 0
      pkg/kamailio/gentoo/kamailio.init
  54. 1 0
      pkg/kamailio/netbsd/COMMENT
  55. 18 0
      pkg/kamailio/netbsd/DESCR
  56. 42 0
      pkg/kamailio/netbsd/Makefile
  57. 120 0
      pkg/kamailio/netbsd/PLIST
  58. 1 0
      pkg/kamailio/netbsd/distinfo
  59. 154 0
      pkg/kamailio/openbsd/Makefile
  60. 5 0
      pkg/kamailio/openbsd/distinfo
  61. 13 0
      pkg/kamailio/openbsd/patches/patch-etc_kamailio_cfg
  62. 15 0
      pkg/kamailio/openbsd/patches/patch-modules_perl_Makefile
  63. 12 0
      pkg/kamailio/openbsd/patches/patch-scripts_kamctlrc
  64. 1 0
      pkg/kamailio/openbsd/pkg/COMMENT
  65. 18 0
      pkg/kamailio/openbsd/pkg/DESCR
  66. 1 0
      pkg/kamailio/openbsd/pkg/DESCR-berkeleydb
  67. 1 0
      pkg/kamailio/openbsd/pkg/DESCR-carrierroute
  68. 1 0
      pkg/kamailio/openbsd/pkg/DESCR-ldap
  69. 7 0
      pkg/kamailio/openbsd/pkg/DESCR-main
  70. 1 0
      pkg/kamailio/openbsd/pkg/DESCR-mysql
  71. 1 0
      pkg/kamailio/openbsd/pkg/DESCR-perl
  72. 1 0
      pkg/kamailio/openbsd/pkg/DESCR-postgresql
  73. 1 0
      pkg/kamailio/openbsd/pkg/DESCR-radius
  74. 1 0
      pkg/kamailio/openbsd/pkg/DESCR-snmpstats
  75. 1 0
      pkg/kamailio/openbsd/pkg/DESCR-xcap_client
  76. 1 0
      pkg/kamailio/openbsd/pkg/DESCR-xmlrpc
  77. 2 0
      pkg/kamailio/openbsd/pkg/PFRAG.shared-berkeleydb
  78. 2 0
      pkg/kamailio/openbsd/pkg/PFRAG.shared-carrierroute
  79. 3 0
      pkg/kamailio/openbsd/pkg/PFRAG.shared-ldap
  80. 68 0
      pkg/kamailio/openbsd/pkg/PFRAG.shared-main
  81. 2 0
      pkg/kamailio/openbsd/pkg/PFRAG.shared-mysql
  82. 3 0
      pkg/kamailio/openbsd/pkg/PFRAG.shared-perl
  83. 2 0
      pkg/kamailio/openbsd/pkg/PFRAG.shared-postgresql
  84. 6 0
      pkg/kamailio/openbsd/pkg/PFRAG.shared-radius
  85. 2 0
      pkg/kamailio/openbsd/pkg/PFRAG.shared-snmpstats
  86. 2 0
      pkg/kamailio/openbsd/pkg/PFRAG.shared-xcap_client
  87. 2 0
      pkg/kamailio/openbsd/pkg/PFRAG.shared-xmlrpc
  88. 120 0
      pkg/kamailio/openbsd/pkg/PLIST
  89. 47 0
      pkg/kamailio/openbsd/pkg/PLIST-berkeleydb
  90. 3 0
      pkg/kamailio/openbsd/pkg/PLIST-carrierroute
  91. 4 0
      pkg/kamailio/openbsd/pkg/PLIST-ldap
  92. 186 0
      pkg/kamailio/openbsd/pkg/PLIST-main
  93. 32 0
      pkg/kamailio/openbsd/pkg/PLIST-mysql
  94. 30 0
      pkg/kamailio/openbsd/pkg/PLIST-perl
  95. 32 0
      pkg/kamailio/openbsd/pkg/PLIST-postgresql
  96. 8 0
      pkg/kamailio/openbsd/pkg/PLIST-radius
  97. 10 0
      pkg/kamailio/openbsd/pkg/PLIST-snmpstats
  98. 3 0
      pkg/kamailio/openbsd/pkg/PLIST-xcap_client
  99. 3 0
      pkg/kamailio/openbsd/pkg/PLIST-xmlrpc
  100. 63 0
      pkg/kamailio/rpm/kamailio.init

+ 14 - 0
pkg/kamailio/debian-etch/changelog

@@ -0,0 +1,14 @@
+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-etch/compat

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

+ 239 - 0
pkg/kamailio/debian-etch/control

@@ -0,0 +1,239 @@
+Source: kamailio
+Section: net
+Priority: optional
+Maintainer: Debian VoIP Team <[email protected]>
+Uploaders: Kilian Krause <[email protected]>
+Build-Depends: debhelper (>= 5), dpatch, libmysqlclient15-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), libdb4.4-dev , xsltproc, libconfuse-dev, libldap2-dev, libcurl3-gnutls-dev, python, libpcre3-dev, docbook-xml, libpurple-dev, libmemcache-dev
+Standards-Version: 3.7.2
+
+Package: kamailio
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, adduser
+Suggests: kamailio-mysql-module, kamailio-postgres-module, kamailio-unixodbc-module, kamailio-jabber-module, kamailio-cpl-module, kamailio-radius-modules, kamailio-presence-modules, kamailio-xmlrpc-module, kamailio-perl-modules, kamailio-snmpstats-module, kamailio-xmpp-module, kamailio-carrierroute-module, kamailio-berkeley-module, 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-dbg
+Priority: extra
+Architecture: any
+Depends: kamailio (= ${binary:Version})
+Conflicts: kamailio (<< ${binary:Version})
+Description: very fast and configurable SIP proxy [debug symbols]
+ 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 contains the debugging symbols for the Kamailio binaries and
+ modules. You only need to install it if you need to debug Kamailio.
+
+Package: kamailio-mysql-module
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version}), mysql-client
+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-module
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version}), postgresql-client
+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-jabber-module
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+Description: Jabber 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 Jabber translator module for Kamailio.
+
+Package: kamailio-cpl-module
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+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-module 
+Architecture: any 
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+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-module
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+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 implementation for Kamailio's
+ Management 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-module
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version}), snmpd
+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-module
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+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-module
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+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-module
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version}), db4.4-util
+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-module
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+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-regex-modules
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+Description: Provides the lcr, diaplan and regex modules
+ 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.
+ .
+ Contains the lcr, diaplan and regex modules that depends on the pcre library.
+
+Package: kamailio-purple-module
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+Description: Provides the purple module, a multi-protocol IM gateway
+ 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 purple module, a multi-protocol instant
+ messaging gateway module.
+
+Package: kamailio-memcached-module
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+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.

+ 27 - 0
pkg/kamailio/debian-etch/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-etch/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-etch/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-etch/kamailio.dirs

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

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

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

+ 170 - 0
pkg/kamailio/debian-etch/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-etch/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#
+

+ 3 - 0
pkg/kamailio/debian-etch/patches/00list

@@ -0,0 +1,3 @@
+10_no_lib64_on_64_bits
+11_always_smp
+

+ 27 - 0
pkg/kamailio/debian-etch/patches/10_no_lib64_on_64_bits.dpatch

@@ -0,0 +1,27 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 10_no_lib64_on_64_bits.dpatch by  <[email protected]>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Debian uses /usr/lib even for 64bit architectures.
+
+@DPATCH@
+diff -urNad kamailio-1.2.0~/Makefile.defs kamailio-1.2.0/Makefile.defs
+--- kamailio-1.2.0~/Makefile.defs	2007-02-24 12:35:45.000000000 +0100
++++ kamailio-1.2.0/Makefile.defs	2007-02-24 16:26:45.886854110 +0100
+@@ -123,14 +123,12 @@
+ bin-dir = sbin/
+ 
+ ARCH_B= $(shell echo $(ARCH) | sed -e 's/.*64.*/64b/')
+-ifeq ($(ARCH_B),64b)
+-	LIBDIR ?= lib64
+-else
+-	LIBDIR ?= lib
++ifneq ($(ARCH_B),64b)
+ 	# assume 32b - it is not really used further
+ 	ARCH_B=32b
+ endif
+ 
++LIBDIR ?= lib
+ lib-dir = $(LIBDIR)/$(MAIN_NAME)
+ modules-dir = $(LIBDIR)/$(MAIN_NAME)/modules/
+ 

+ 24 - 0
pkg/kamailio/debian-etch/patches/11_always_smp.dpatch

@@ -0,0 +1,24 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 11_always_smp.dpatch by  <[email protected]>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Always build for SMP.
+
+@DPATCH@
+diff -urNad kamailio-1.2.0~/Makefile.defs kamailio-1.2.0/Makefile.defs
+--- kamailio-1.2.0~/Makefile.defs	2007-02-24 16:28:43.152825070 +0100
++++ kamailio-1.2.0/Makefile.defs	2007-02-24 16:28:46.123102964 +0100
+@@ -82,12 +82,7 @@
+ 	endif
+ endif
+ 
+-SMP_STR = $(shell uname -v | grep -i "SMP")
+-ifeq (,$(SMP_STR))
+-	ISSMP=no
+-else
+-	ISSMP=yes
+-endif
++ISSMP=yes
+ 
+ OSREL = $(shell uname -r)
+ # numerical version (good for comparisons: A.B.C => A*1000000+B*1000+C)

+ 374 - 0
pkg/kamailio/debian-etch/rules

@@ -0,0 +1,374 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+
+DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
+
+ALL_PACKAGES = kamailio kamailio-mysql-module kamailio-postgres-module \
+	kamailio-jabber-module kamailio-cpl-module kamailio-radius-modules \
+	kamailio-unixodbc-module kamailio-presence-modules kamailio-xmlrpc-module \
+	kamailio-perl-modules kamailio-snmpstats-module kamailio-xmpp-module \
+	kamailio-carrierroute-module kamailio-berkeley-module kamailio-ldap-modules \
+	kamailio-utils-module kamailio-regex-modules kamailio-purple-module \
+	kamailio-memcached-module
+
+DEBVERSION:=$(shell head -n 1 debian/changelog \
+                    | sed -e 's/^[^(]*(\([^)]*\)).*/\1/')
+UPVERSION:=$(shell echo $(DEBVERSION) | sed -e 's/^.*://' -e 's/-[0-9.]*$$//' -e 's/.dfsg$$//')
+
+FILENAME := kamailio_$(UPVERSION).orig.tar.gz
+UPFILENAME := kamailio-$(UPVERSION)-tls_src.tar.gz
+URL := http://kamailio.org/pub/kamailio/$(UPVERSION)/src/kamailio-$(UPVERSION)-tls_src.tar.gz
+
+# Uncomment this to turn on verbose mode.
+# export DH_VERBOSE=1
+
+# Include dpatch rules
+include /usr/share/dpatch/dpatch.make
+
+
+# Do we want the TLS version ?
+# Disabled by default due to license issues, set to non-void to enable
+TLS=
+
+# modules depending on mysql
+MYSQL_MODULES = db_mysql
+# modules depending on postgres
+POSTGRES_MODULES = db_postgres
+# modules depending on unixODBC
+UNIXODBC_MODULES=db_unixodbc
+# jabber module
+JABBER_MODULES = jabber
+# cpl related modules
+CPL_MODULES = cpl-c
+# module depending on radiusclient
+RADIUS_MODULES = auth_radius misc_radius peering
+# presence related modules
+PRESENCE_MODULES = presence presence_xml presence_mwi presence_dialoginfo pua pua_bla pua_mi pua_usrloc pua_xmpp pua_dialoginfo xcap_client rls
+# XMLRPC module
+XMLRPC_MODULES = mi_xmlrpc
+# Perl module
+PERL_MODULES = perl perlvdb
+# SNMPstats module
+SNMPSTATS_MODULES = snmpstats
+# XMPP module
+XMPP_MODULES = xmpp
+# Carrierroute module
+CROUTE_MODULES = carrierroute
+# Berkeley DB module
+BERKELEY_MODULES = db_berkeley
+# LDAP modules
+LDAP_MODULES = ldap h350
+# utils module
+UTILS_MODULES = utils
+# modules depending on libpcre
+REGEX_MODULES = dialplan regex lcr
+# purple module
+PURPLE_MODULES = purple
+# memcached module
+MEMCACHED_MODULES = memcached
+
+ALL_MODULES = $(MYSQL_MODULES) $(POSTGRES_MODULES) $(UNIXODBC_MODULES) $(JABBER_MODULES) $(CPL_MODULES) $(RADIUS_MODULES) $(PRESENCE_MODULES) $(XMLRPC_MODULES) $(PERL_MODULES) $(SNMPSTATS_MODULES) $(XMPP_MODULES) $(CROUTE_MODULES) $(BERKELEY_MODULES) $(LDAP_MODULES) $(UTILS_MODULES) $(REGEX_MODULES) $(PURPLE_MODULES) $(MEMCACHED_MODULES)
+
+# modules not in the "main" package or unstable modules
+EXCLUDED_MODULES = $(ALL_MODULES) pa osp
+
+# the same but with path prepended (needed for modules="...")
+MYSQL_MOD_PATH=$(addprefix modules/, $(MYSQL_MODULES))
+POSTGRES_MOD_PATH=$(addprefix modules/, $(POSTGRES_MODULES))
+UNIXODBC_MOD_PATH=$(addprefix modules/, $(UNIXODBC_MODULES))
+JABBER_MOD_PATH=$(addprefix modules/, $(JABBER_MODULES))
+CPL_MOD_PATH=$(addprefix modules/, $(CPL_MODULES))
+RADIUS_MOD_PATH=$(addprefix modules/, $(RADIUS_MODULES))
+PRESENCE_MOD_PATH=$(addprefix modules/, $(PRESENCE_MODULES))
+XMLRPC_MOD_PATH=$(addprefix modules/, $(XMLRPC_MODULES))
+PERL_MOD_PATH=$(addprefix modules/, $(PERL_MODULES))
+SNMPSTATS_MOD_PATH=$(addprefix modules/, $(SNMPSTATS_MODULES))
+XMPP_MOD_PATH=$(addprefix modules/, $(XMPP_MODULES))
+CROUTE_MOD_PATH=$(addprefix modules/, $(CROUTE_MODULES))
+BERKELEY_MOD_PATH=$(addprefix modules/, $(BERKELEY_MODULES))
+LDAP_MOD_PATH=$(addprefix modules/, $(LDAP_MODULES))
+UTILS_MOD_PATH=$(addprefix modules/, $(UTILS_MODULES))
+REGEX_MOD_PATH=$(addprefix modules/, $(REGEX_MODULES))
+PURPLE_MOD_PATH=$(addprefix modules/, $(PURPLE_MODULES))
+MEMCACHED_MOD_PATH=$(addprefix modules/, $(MEMCACHED_MODULES))
+
+ifeq (cc, $(CC))
+	CC = gcc
+endif
+
+CFLAGS = -Wall -g
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+        CFLAGS += -O0
+else
+	CFLAGS += -O2
+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.
+
+	touch configure-stamp
+
+
+build: build-stamp
+build-stamp: patch-stamp configure-stamp 
+	dh_testdir
+
+	# Add here commands to compile the package.
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) all skip_modules="$(EXCLUDED_MODULES)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(MYSQL_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(POSTGRES_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(UNIXODBC_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(JABBER_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(CPL_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(RADIUS_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(PRESENCE_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(XMLRPC_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(PERL_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(SNMPSTATS_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(XMPP_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(CROUTE_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(BERKELEY_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(LDAP_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(UTILS_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(REGEX_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(PURPLE_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(MEMCACHED_MOD_PATH)" cfg-target=/etc/kamailio/
+
+	# generate the man pages for modules
+	$(MAKE) modules-docbook-man include_modules="$(ALL_MODULES)"
+
+	# generate the utils db_berkeley
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) utils include_modules="db_berkeley"
+
+	touch build-stamp
+
+clean: real-clean unpatch
+real-clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp configure-stamp
+
+	# Add here commands to clean up after the build process.
+	$(MAKE) TLS=$(TLS) include_modules="$(ALL_MODULES)" proper
+	rm -f cfg.tab.h
+	rm -f utils/kamunix/kamunix.o utils/kamunix/kamunix
+	rm -f utils/db_berkeley/kambdb_recover.o utils/db_berkeley/kambdb_recover
+
+	dh_clean
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
+
+	# Add here commands to install the package into debian/kamailio
+	# kamailio base package
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install skip_modules="$(EXCLUDED_MODULES)" \
+		basedir=$(CURDIR)/debian/kamailio \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio
+
+	find $(CURDIR)/debian/kamailio/etc/kamailio -type f -exec chmod -x {} \;
+	sed -i -e "s/^PATH.*//" $(CURDIR)/debian/kamailio/usr/sbin/kamctl
+
+	# install only the mysql module
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(MYSQL_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-mysql-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-mysql-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-mysql-module
+
+	# install only the postgres module
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(POSTGRES_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-postgres-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-postgres-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-postgres-module
+
+	# install only the unixodbc module
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(UNIXODBC_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-unixodbc-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-unixodbc-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-unixodbc-module
+
+	# install only the jabber module
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(JABBER_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-jabber-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-jabber-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-jabber-module
+
+	# install only the cpl module
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(CPL_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-cpl-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-cpl-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-cpl-module
+
+	# install only the radius modules
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(RADIUS_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-radius-modules \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-radius-modules \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-radius-modules
+
+	# install only the presence modules
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(PRESENCE_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-presence-modules \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-presence-modules \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-presence-modules
+
+	# install only the xmlrpc module
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(XMLRPC_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-xmlrpc-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-xmlrpc-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-xmlrpc-module
+
+	# install only the perl modules
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(PERL_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-perl-modules \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-perl-modules \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-perl-modules
+
+	# install only the snmpstats module
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(SNMPSTATS_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-snmpstats-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-snmpstats-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-snmpstats-module
+
+	# install only the xmpp module
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(XMPP_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-xmpp-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-xmpp-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-xmpp-module
+
+	# install only the carrierroute module
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(CROUTE_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-carrierroute-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-carrierroute-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-carrierroute-module
+
+	# install only the db_berkeley module
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(BERKELEY_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-berkeley-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-berkeley-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-berkeley-module
+
+	# install only the ldap modules
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(LDAP_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-ldap-modules \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-ldap-modules \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-ldap-modules
+
+	# install only the utils modules
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(UTILS_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-utils-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-utils-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-utils-module
+
+	# install only the regex modules
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(REGEX_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-regex-modules \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-regex-modules \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-regex-modules
+
+	# install only the purple modules
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(PURPLE_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-purple-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-purple-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-purple-module
+
+	# install only the memcached modules
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(MEMCACHED_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-memcached-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-memcached-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-memcached-module
+
+	# the modules packages all ship an empty /usr/sbin directory, let's clean that up
+	for p in $(ALL_PACKAGES); \
+		do rmdir --ignore-fail-on-non-empty $(CURDIR)/debian/$$p/usr/sbin; done
+
+# 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-arch: build install
+	dh_testdir
+	dh_testroot
+	dh_installdocs
+	dh_installexamples --exclude=".svn"
+#	dh_installlogrotate
+	dh_installinit -pkamailio -- defaults 23
+	dh_installcron
+	dh_installman
+	dh_installinfo
+	dh_installchangelogs
+	dh_link
+	dh_strip --dbg-package=kamailio-dbg
+	dh_compress 
+	dh_fixperms
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+# Build architecture-independent packages using the common target
+binary-indep: build install
+# We have nothing to do by default.
+
+binary: binary-indep binary-arch
+
+print-version:
+	@@echo "Debian version:          $(DEBVERSION)"
+	@@echo "Upstream version:        $(UPVERSION)"
+
+get-orig-source:
+	@@dh_testdir
+	@@[ -d ../tarballs/. ]||mkdir -p ../tarballs
+	@@echo Downloading $(FILENAME) from $(URL) ...
+	@@wget -N -nv -T10 -t3 -O ../tarballs/$(FILENAME) $(URL)
+
+.PHONY: build clean binary-indep binary-arch binary install configure patch unpatch real-clean

+ 14 - 0
pkg/kamailio/debian-lenny/changelog

@@ -0,0 +1,14 @@
+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-lenny/compat

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

+ 242 - 0
pkg/kamailio/debian-lenny/control

@@ -0,0 +1,242 @@
+Source: kamailio
+Section: net
+Priority: optional
+Maintainer: Debian VoIP Team <[email protected]>
+Uploaders: Kilian Krause <[email protected]>
+Build-Depends: debhelper (>= 5), dpatch, libmysqlclient15-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, libcurl4-gnutls-dev, python, libpcre3-dev, docbook-xml, libpurple-dev, libmemcache-dev
+Standards-Version: 3.8.0
+Homepage: http://www.kamailio.org/
+Vcs-Svn: svn://svn.debian.org/pkg-voip/kamailio/trunk/
+Vcs-Browser: http://svn.debian.org/wsvn/pkg-voip/kamailio/?op=log
+
+Package: kamailio
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, adduser
+Suggests: kamailio-mysql-module, kamailio-postgres-module, kamailio-unixodbc-module, kamailio-jabber-module, kamailio-cpl-module, kamailio-radius-modules, kamailio-presence-modules, kamailio-xmlrpc-module, kamailio-perl-modules, kamailio-snmpstats-module, kamailio-xmpp-module, kamailio-carrierroute-module, kamailio-berkeley-module, 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-dbg
+Priority: extra
+Architecture: any
+Depends: kamailio (= ${binary:Version})
+Conflicts: kamailio (<< ${binary:Version})
+Description: very fast and configurable SIP proxy [debug symbols]
+ 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 contains the debugging symbols for the Kamailio binaries and
+ modules. You only need to install it if you need to debug Kamailio.
+
+Package: kamailio-mysql-module
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version}), mysql-client
+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-module
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version}), postgresql-client
+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-jabber-module
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+Description: Jabber 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 Jabber translator module for Kamailio.
+
+Package: kamailio-cpl-module
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+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-module 
+Architecture: any 
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+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-module
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+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 implementation for Kamailio's
+ Management 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-module
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version}), snmpd
+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-module
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+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-module
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+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-module
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version}), db4.6-util
+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-module
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+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-regex-modules
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+Description: Provides the lcr, diaplan and regex modules
+ 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.
+ .
+ Contains the lcr, diaplan and regex modules that depends on the pcre library.
+
+Package: kamailio-purple-module
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+Description: Provides the purple module, a multi-protocol IM gateway
+ 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 purple module, a multi-protocol instant
+ messaging gateway module.
+
+Package: kamailio-memcached-module
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+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.

+ 27 - 0
pkg/kamailio/debian-lenny/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-lenny/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-lenny/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-lenny/kamailio.dirs

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

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

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

+ 170 - 0
pkg/kamailio/debian-lenny/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-lenny/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#
+

+ 3 - 0
pkg/kamailio/debian-lenny/patches/00list

@@ -0,0 +1,3 @@
+10_no_lib64_on_64_bits
+11_always_smp
+

+ 27 - 0
pkg/kamailio/debian-lenny/patches/10_no_lib64_on_64_bits.dpatch

@@ -0,0 +1,27 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 10_no_lib64_on_64_bits.dpatch by  <[email protected]>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Debian uses /usr/lib even for 64bit architectures.
+
+@DPATCH@
+diff -urNad kamailio-1.2.0~/Makefile.defs kamailio-1.2.0/Makefile.defs
+--- kamailio-1.2.0~/Makefile.defs	2007-02-24 12:35:45.000000000 +0100
++++ kamailio-1.2.0/Makefile.defs	2007-02-24 16:26:45.886854110 +0100
+@@ -123,14 +123,12 @@
+ bin-dir = sbin/
+ 
+ ARCH_B= $(shell echo $(ARCH) | sed -e 's/.*64.*/64b/')
+-ifeq ($(ARCH_B),64b)
+-	LIBDIR ?= lib64
+-else
+-	LIBDIR ?= lib
++ifneq ($(ARCH_B),64b)
+ 	# assume 32b - it is not really used further
+ 	ARCH_B=32b
+ endif
+ 
++LIBDIR ?= lib
+ lib-dir = $(LIBDIR)/$(MAIN_NAME)
+ modules-dir = $(LIBDIR)/$(MAIN_NAME)/modules/
+ 

+ 24 - 0
pkg/kamailio/debian-lenny/patches/11_always_smp.dpatch

@@ -0,0 +1,24 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 11_always_smp.dpatch by  <[email protected]>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Always build for SMP.
+
+@DPATCH@
+diff -urNad kamailio-1.2.0~/Makefile.defs kamailio-1.2.0/Makefile.defs
+--- kamailio-1.2.0~/Makefile.defs	2007-02-24 16:28:43.152825070 +0100
++++ kamailio-1.2.0/Makefile.defs	2007-02-24 16:28:46.123102964 +0100
+@@ -82,12 +82,7 @@
+ 	endif
+ endif
+ 
+-SMP_STR = $(shell uname -v | grep -i "SMP")
+-ifeq (,$(SMP_STR))
+-	ISSMP=no
+-else
+-	ISSMP=yes
+-endif
++ISSMP=yes
+ 
+ OSREL = $(shell uname -r)
+ # numerical version (good for comparisons: A.B.C => A*1000000+B*1000+C)

+ 374 - 0
pkg/kamailio/debian-lenny/rules

@@ -0,0 +1,374 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+
+DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
+
+ALL_PACKAGES = kamailio kamailio-mysql-module kamailio-postgres-module \
+	kamailio-jabber-module kamailio-cpl-module kamailio-radius-modules \
+	kamailio-unixodbc-module kamailio-presence-modules kamailio-xmlrpc-module \
+	kamailio-perl-modules kamailio-snmpstats-module kamailio-xmpp-module \
+	kamailio-carrierroute-module kamailio-berkeley-module kamailio-ldap-modules \
+	kamailio-utils-module kamailio-regex-modules kamailio-purple-module \
+	kamailio-memcached-module
+
+DEBVERSION:=$(shell head -n 1 debian/changelog \
+                    | sed -e 's/^[^(]*(\([^)]*\)).*/\1/')
+UPVERSION:=$(shell echo $(DEBVERSION) | sed -e 's/^.*://' -e 's/-[0-9.]*$$//' -e 's/.dfsg$$//')
+
+FILENAME := kamailio_$(UPVERSION).orig.tar.gz
+UPFILENAME := kamailio-$(UPVERSION)-tls_src.tar.gz
+URL := http://kamailio.org/pub/kamailio/$(UPVERSION)/src/kamailio-$(UPVERSION)-tls_src.tar.gz
+
+# Uncomment this to turn on verbose mode.
+# export DH_VERBOSE=1
+
+# Include dpatch rules
+include /usr/share/dpatch/dpatch.make
+
+
+# Do we want the TLS version ?
+# Disabled by default due to license issues, set to non-void to enable
+TLS=
+
+# modules depending on mysql
+MYSQL_MODULES = db_mysql
+# modules depending on postgres
+POSTGRES_MODULES = db_postgres
+# modules depending on unixODBC
+UNIXODBC_MODULES=db_unixodbc
+# jabber module
+JABBER_MODULES = jabber
+# cpl related modules
+CPL_MODULES = cpl-c
+# module depending on radiusclient
+RADIUS_MODULES = auth_radius misc_radius peering
+# presence related modules
+PRESENCE_MODULES = presence presence_xml presence_mwi presence_dialoginfo pua pua_bla pua_mi pua_usrloc pua_xmpp pua_dialoginfo xcap_client rls
+# XMLRPC module
+XMLRPC_MODULES = mi_xmlrpc
+# Perl module
+PERL_MODULES = perl perlvdb
+# SNMPstats module
+SNMPSTATS_MODULES = snmpstats
+# XMPP module
+XMPP_MODULES = xmpp
+# Carrierroute module
+CROUTE_MODULES = carrierroute
+# Berkeley DB module
+BERKELEY_MODULES = db_berkeley
+# LDAP modules
+LDAP_MODULES = ldap h350
+# utils module
+UTILS_MODULES = utils
+# modules depending on libpcre
+REGEX_MODULES = dialplan regex lcr
+# purple module
+PURPLE_MODULES = purple
+# memcached module
+MEMCACHED_MODULES = memcached
+
+ALL_MODULES = $(MYSQL_MODULES) $(POSTGRES_MODULES) $(UNIXODBC_MODULES) $(JABBER_MODULES) $(CPL_MODULES) $(RADIUS_MODULES) $(PRESENCE_MODULES) $(XMLRPC_MODULES) $(PERL_MODULES) $(SNMPSTATS_MODULES) $(XMPP_MODULES) $(CROUTE_MODULES) $(BERKELEY_MODULES) $(LDAP_MODULES) $(UTILS_MODULES) $(REGEX_MODULES) $(PURPLE_MODULES) $(MEMCACHED_MODULES)
+
+# modules not in the "main" package or unstable modules
+EXCLUDED_MODULES = $(ALL_MODULES) pa osp
+
+# the same but with path prepended (needed for modules="...")
+MYSQL_MOD_PATH=$(addprefix modules/, $(MYSQL_MODULES))
+POSTGRES_MOD_PATH=$(addprefix modules/, $(POSTGRES_MODULES))
+UNIXODBC_MOD_PATH=$(addprefix modules/, $(UNIXODBC_MODULES))
+JABBER_MOD_PATH=$(addprefix modules/, $(JABBER_MODULES))
+CPL_MOD_PATH=$(addprefix modules/, $(CPL_MODULES))
+RADIUS_MOD_PATH=$(addprefix modules/, $(RADIUS_MODULES))
+PRESENCE_MOD_PATH=$(addprefix modules/, $(PRESENCE_MODULES))
+XMLRPC_MOD_PATH=$(addprefix modules/, $(XMLRPC_MODULES))
+PERL_MOD_PATH=$(addprefix modules/, $(PERL_MODULES))
+SNMPSTATS_MOD_PATH=$(addprefix modules/, $(SNMPSTATS_MODULES))
+XMPP_MOD_PATH=$(addprefix modules/, $(XMPP_MODULES))
+CROUTE_MOD_PATH=$(addprefix modules/, $(CROUTE_MODULES))
+BERKELEY_MOD_PATH=$(addprefix modules/, $(BERKELEY_MODULES))
+LDAP_MOD_PATH=$(addprefix modules/, $(LDAP_MODULES))
+UTILS_MOD_PATH=$(addprefix modules/, $(UTILS_MODULES))
+REGEX_MOD_PATH=$(addprefix modules/, $(REGEX_MODULES))
+PURPLE_MOD_PATH=$(addprefix modules/, $(PURPLE_MODULES))
+MEMCACHED_MOD_PATH=$(addprefix modules/, $(MEMCACHED_MODULES))
+
+ifeq (cc, $(CC))
+	CC = gcc
+endif
+
+CFLAGS = -Wall -g
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+        CFLAGS += -O0
+else
+	CFLAGS += -O2
+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.
+
+	touch configure-stamp
+
+
+build: build-stamp
+build-stamp: patch-stamp configure-stamp 
+	dh_testdir
+
+	# Add here commands to compile the package.
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) all skip_modules="$(EXCLUDED_MODULES)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(MYSQL_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(POSTGRES_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(UNIXODBC_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(JABBER_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(CPL_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(RADIUS_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(PRESENCE_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(XMLRPC_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(PERL_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(SNMPSTATS_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(XMPP_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(CROUTE_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(BERKELEY_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(LDAP_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(UTILS_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(REGEX_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(PURPLE_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(MEMCACHED_MOD_PATH)" cfg-target=/etc/kamailio/
+
+	# generate the utils db_berkeley
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) utils include_modules="db_berkeley"
+
+	# generate the man pages for modules
+	$(MAKE) modules-docbook-man include_modules="$(ALL_MODULES)"
+
+	touch build-stamp
+
+clean: real-clean unpatch
+real-clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp configure-stamp
+
+	# Add here commands to clean up after the build process.
+	$(MAKE) TLS=$(TLS) include_modules="$(ALL_MODULES)" proper
+	rm -f cfg.tab.h
+	rm -f utils/kamunix/kamunix.o utils/kamunix/kamunix
+	rm -f utils/db_berkeley/kambdb_recover.o utils/db_berkeley/kambdb_recover
+
+	dh_clean
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
+
+	# Add here commands to install the package into debian/kamailio
+	# kamailio base package
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install skip_modules="$(EXCLUDED_MODULES)" \
+		basedir=$(CURDIR)/debian/kamailio \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio
+
+	find $(CURDIR)/debian/kamailio/etc/kamailio -type f -exec chmod -x {} \;
+	sed -i -e "s/^PATH.*//" $(CURDIR)/debian/kamailio/usr/sbin/kamctl
+
+	# install only the mysql module
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(MYSQL_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-mysql-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-mysql-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-mysql-module
+
+	# install only the postgres module
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(POSTGRES_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-postgres-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-postgres-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-postgres-module
+
+	# install only the unixodbc module
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(UNIXODBC_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-unixodbc-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-unixodbc-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-unixodbc-module
+
+	# install only the jabber module
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(JABBER_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-jabber-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-jabber-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-jabber-module
+
+	# install only the cpl module
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(CPL_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-cpl-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-cpl-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-cpl-module
+
+	# install only the radius modules
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(RADIUS_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-radius-modules \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-radius-modules \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-radius-modules
+
+	# install only the presence modules
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(PRESENCE_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-presence-modules \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-presence-modules \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-presence-modules
+
+	# install only the xmlrpc module
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(XMLRPC_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-xmlrpc-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-xmlrpc-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-xmlrpc-module
+
+	# install only the perl modules
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(PERL_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-perl-modules \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-perl-modules \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-perl-modules
+
+	# install only the snmpstats module
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(SNMPSTATS_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-snmpstats-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-snmpstats-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-snmpstats-module
+
+	# install only the xmpp module
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(XMPP_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-xmpp-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-xmpp-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-xmpp-module
+
+	# install only the carrierroute module
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(CROUTE_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-carrierroute-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-carrierroute-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-carrierroute-module
+
+	# install only the db_berkeley module
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(BERKELEY_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-berkeley-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-berkeley-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-berkeley-module
+
+	# install only the ldap modules
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(LDAP_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-ldap-modules \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-ldap-modules \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-ldap-modules
+
+	# install only the utils modules
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(UTILS_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-utils-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-utils-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-utils-module
+
+	# install only the regex modules
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(REGEX_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-regex-modules \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-regex-modules \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-regex-modules
+
+	# install only the purple modules
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(PURPLE_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-purple-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-purple-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-purple-module
+
+	# install only the memcached modules
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(MEMCACHED_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-memcached-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-memcached-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-memcached-module
+
+	# the modules packages all ship an empty /usr/sbin directory, let's clean that up
+	for p in $(ALL_PACKAGES); \
+		do rmdir --ignore-fail-on-non-empty $(CURDIR)/debian/$$p/usr/sbin; done
+
+# 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-arch: build install
+	dh_testdir
+	dh_testroot
+	dh_installdocs
+	dh_installexamples --exclude=".svn"
+#	dh_installlogrotate
+	dh_installinit -pkamailio -- defaults 23
+	dh_installcron
+	dh_installman
+	dh_installinfo
+	dh_installchangelogs
+	dh_link
+	dh_strip --dbg-package=kamailio-dbg
+	dh_compress 
+	dh_fixperms
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+# Build architecture-independent packages using the common target
+binary-indep: build install
+# We have nothing to do by default.
+
+binary: binary-indep binary-arch
+
+print-version:
+	@@echo "Debian version:          $(DEBVERSION)"
+	@@echo "Upstream version:        $(UPVERSION)"
+
+get-orig-source:
+	@@dh_testdir
+	@@[ -d ../tarballs/. ]||mkdir -p ../tarballs
+	@@echo Downloading $(FILENAME) from $(URL) ...
+	@@wget -N -nv -T10 -t3 -O ../tarballs/$(FILENAME) $(URL)
+
+.PHONY: build clean binary-indep binary-arch binary install configure patch unpatch real-clean

+ 14 - 0
pkg/kamailio/debian/changelog

@@ -0,0 +1,14 @@
+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/compat

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

+ 242 - 0
pkg/kamailio/debian/control

@@ -0,0 +1,242 @@
+Source: kamailio
+Section: net
+Priority: optional
+Maintainer: Debian VoIP Team <[email protected]>
+Uploaders: Kilian Krause <[email protected]>
+Build-Depends: debhelper (>= 5), dpatch, libmysqlclient15-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, libcurl4-gnutls-dev, python, libpcre3-dev, docbook-xml, libpurple-dev, libmemcache-dev
+Standards-Version: 3.8.0
+Homepage: http://www.kamailio.org/
+Vcs-Svn: svn://svn.debian.org/pkg-voip/kamailio/trunk/
+Vcs-Browser: http://svn.debian.org/wsvn/pkg-voip/kamailio/?op=log
+
+Package: kamailio
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, adduser
+Suggests: kamailio-mysql-module, kamailio-postgres-module, kamailio-unixodbc-module, kamailio-jabber-module, kamailio-cpl-module, kamailio-radius-modules, kamailio-presence-modules, kamailio-xmlrpc-module, kamailio-perl-modules, kamailio-snmpstats-module, kamailio-xmpp-module, kamailio-carrierroute-module, kamailio-berkeley-module, 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-dbg
+Priority: extra
+Architecture: any
+Depends: kamailio (= ${binary:Version})
+Conflicts: kamailio (<< ${binary:Version})
+Description: very fast and configurable SIP proxy [debug symbols]
+ 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 contains the debugging symbols for the Kamailio binaries and
+ modules. You only need to install it if you need to debug Kamailio.
+
+Package: kamailio-mysql-module
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version}), mysql-client
+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-module
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version}), postgresql-client
+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-jabber-module
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+Description: Jabber 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 Jabber translator module for Kamailio.
+
+Package: kamailio-cpl-module
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+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-module 
+Architecture: any 
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+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-module
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+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 implementation for Kamailio's
+ Management 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-module
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version}), snmpd
+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-module
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+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-module
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+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-module
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version}), db4.6-util
+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-module
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+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-regex-modules
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+Description: Provides the lcr, diaplan and regex modules
+ 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.
+ .
+ Contains the lcr, diaplan and regex modules that depends on the pcre library.
+
+Package: kamailio-purple-module
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+Description: Provides the purple module, a multi-protocol IM gateway
+ 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 purple module, a multi-protocol instant
+ messaging gateway module.
+
+Package: kamailio-memcached-module
+Architecture: any
+Depends: ${shlibs:Depends}, kamailio (= ${binary:Version})
+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.

+ 27 - 0
pkg/kamailio/debian/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/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/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/kamailio.dirs

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

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

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

+ 170 - 0
pkg/kamailio/debian/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/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#
+

+ 3 - 0
pkg/kamailio/debian/patches/00list

@@ -0,0 +1,3 @@
+10_no_lib64_on_64_bits
+11_always_smp
+

+ 27 - 0
pkg/kamailio/debian/patches/10_no_lib64_on_64_bits.dpatch

@@ -0,0 +1,27 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 10_no_lib64_on_64_bits.dpatch by  <[email protected]>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Debian uses /usr/lib even for 64bit architectures.
+
+@DPATCH@
+diff -urNad kamailio-1.2.0~/Makefile.defs kamailio-1.2.0/Makefile.defs
+--- kamailio-1.2.0~/Makefile.defs	2007-02-24 12:35:45.000000000 +0100
++++ kamailio-1.2.0/Makefile.defs	2007-02-24 16:26:45.886854110 +0100
+@@ -123,14 +123,12 @@
+ bin-dir = sbin/
+ 
+ ARCH_B= $(shell echo $(ARCH) | sed -e 's/.*64.*/64b/')
+-ifeq ($(ARCH_B),64b)
+-	LIBDIR ?= lib64
+-else
+-	LIBDIR ?= lib
++ifneq ($(ARCH_B),64b)
+ 	# assume 32b - it is not really used further
+ 	ARCH_B=32b
+ endif
+ 
++LIBDIR ?= lib
+ lib-dir = $(LIBDIR)/$(MAIN_NAME)
+ modules-dir = $(LIBDIR)/$(MAIN_NAME)/modules/
+ 

+ 24 - 0
pkg/kamailio/debian/patches/11_always_smp.dpatch

@@ -0,0 +1,24 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 11_always_smp.dpatch by  <[email protected]>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Always build for SMP.
+
+@DPATCH@
+diff -urNad kamailio-1.2.0~/Makefile.defs kamailio-1.2.0/Makefile.defs
+--- kamailio-1.2.0~/Makefile.defs	2007-02-24 16:28:43.152825070 +0100
++++ kamailio-1.2.0/Makefile.defs	2007-02-24 16:28:46.123102964 +0100
+@@ -82,12 +82,7 @@
+ 	endif
+ endif
+ 
+-SMP_STR = $(shell uname -v | grep -i "SMP")
+-ifeq (,$(SMP_STR))
+-	ISSMP=no
+-else
+-	ISSMP=yes
+-endif
++ISSMP=yes
+ 
+ OSREL = $(shell uname -r)
+ # numerical version (good for comparisons: A.B.C => A*1000000+B*1000+C)

+ 375 - 0
pkg/kamailio/debian/rules

@@ -0,0 +1,375 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+
+DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
+
+ALL_PACKAGES = kamailio kamailio-mysql-module kamailio-postgres-module \
+	kamailio-jabber-module kamailio-cpl-module kamailio-radius-modules \
+	kamailio-unixodbc-module kamailio-presence-modules kamailio-xmlrpc-module \
+	kamailio-perl-modules kamailio-snmpstats-module kamailio-xmpp-module \
+	kamailio-carrierroute-module kamailio-berkeley-module kamailio-ldap-modules \
+	kamailio-utils-module kamailio-regex-modules kamailio-purple-module \
+	kamailio-memcached-module
+
+DEBVERSION:=$(shell head -n 1 debian/changelog \
+                    | sed -e 's/^[^(]*(\([^)]*\)).*/\1/')
+UPVERSION:=$(shell echo $(DEBVERSION) | sed -e 's/^.*://' -e 's/-[0-9.]*$$//' -e 's/.dfsg$$//')
+
+FILENAME := kamailio_$(UPVERSION).orig.tar.gz
+UPFILENAME := kamailio-$(UPVERSION)-tls_src.tar.gz
+URL := http://kamailio.org/pub/kamailio/$(UPVERSION)/src/kamailio-$(UPVERSION)-tls_src.tar.gz
+
+# Uncomment this to turn on verbose mode.
+# export DH_VERBOSE=1
+
+# Include dpatch rules
+include /usr/share/dpatch/dpatch.make
+
+
+# Do we want the TLS version ?
+# Disabled by default due to license issues, set to non-void to enable
+TLS=
+
+# modules depending on mysql
+MYSQL_MODULES = db_mysql
+# modules depending on postgres
+POSTGRES_MODULES = db_postgres
+# modules depending on unixODBC
+UNIXODBC_MODULES=db_unixodbc
+# jabber module
+JABBER_MODULES = jabber
+# cpl related modules
+CPL_MODULES = cpl-c
+# module depending on radiusclient
+RADIUS_MODULES = auth_radius misc_radius peering
+# presence related modules
+PRESENCE_MODULES = presence presence_xml presence_mwi presence_dialoginfo pua pua_bla pua_mi pua_usrloc pua_xmpp pua_dialoginfo xcap_client rls
+# XMLRPC module
+XMLRPC_MODULES = mi_xmlrpc
+# Perl module
+PERL_MODULES = perl perlvdb
+# SNMPstats module
+SNMPSTATS_MODULES = snmpstats
+# XMPP module
+XMPP_MODULES = xmpp
+# Carrierroute module
+CROUTE_MODULES = carrierroute
+# Berkeley DB module
+BERKELEY_MODULES = db_berkeley
+# LDAP modules
+LDAP_MODULES = ldap h350
+# utils module
+UTILS_MODULES = utils
+# modules depending on libpcre
+REGEX_MODULES = dialplan regex lcr
+# purple module
+PURPLE_MODULES = purple
+# memcached module
+MEMCACHED_MODULES = memcached
+
+ALL_MODULES = $(MYSQL_MODULES) $(POSTGRES_MODULES) $(UNIXODBC_MODULES) $(JABBER_MODULES) $(CPL_MODULES) $(RADIUS_MODULES) $(PRESENCE_MODULES) $(XMLRPC_MODULES) $(PERL_MODULES) $(SNMPSTATS_MODULES) $(XMPP_MODULES) $(CROUTE_MODULES) $(BERKELEY_MODULES) $(LDAP_MODULES) $(UTILS_MODULES) $(REGEX_MODULES) $(PURPLE_MODULES) $(MEMCACHED_MODULES)
+
+# modules not in the "main" package or unstable modules
+EXCLUDED_MODULES = $(ALL_MODULES) pa osp
+
+# the same but with path prepended (needed for modules="...")
+MYSQL_MOD_PATH=$(addprefix modules/, $(MYSQL_MODULES))
+POSTGRES_MOD_PATH=$(addprefix modules/, $(POSTGRES_MODULES))
+UNIXODBC_MOD_PATH=$(addprefix modules/, $(UNIXODBC_MODULES))
+JABBER_MOD_PATH=$(addprefix modules/, $(JABBER_MODULES))
+CPL_MOD_PATH=$(addprefix modules/, $(CPL_MODULES))
+RADIUS_MOD_PATH=$(addprefix modules/, $(RADIUS_MODULES))
+PRESENCE_MOD_PATH=$(addprefix modules/, $(PRESENCE_MODULES))
+XMLRPC_MOD_PATH=$(addprefix modules/, $(XMLRPC_MODULES))
+PERL_MOD_PATH=$(addprefix modules/, $(PERL_MODULES))
+SNMPSTATS_MOD_PATH=$(addprefix modules/, $(SNMPSTATS_MODULES))
+XMPP_MOD_PATH=$(addprefix modules/, $(XMPP_MODULES))
+CROUTE_MOD_PATH=$(addprefix modules/, $(CROUTE_MODULES))
+BERKELEY_MOD_PATH=$(addprefix modules/, $(BERKELEY_MODULES))
+LDAP_MOD_PATH=$(addprefix modules/, $(LDAP_MODULES))
+UTILS_MOD_PATH=$(addprefix modules/, $(UTILS_MODULES))
+REGEX_MOD_PATH=$(addprefix modules/, $(REGEX_MODULES))
+PURPLE_MOD_PATH=$(addprefix modules/, $(PURPLE_MODULES))
+MEMCACHED_MOD_PATH=$(addprefix modules/, $(MEMCACHED_MODULES))
+
+ifeq (cc, $(CC))
+	CC = gcc
+endif
+
+CFLAGS = -Wall -g
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+        CFLAGS += -O0
+else
+	CFLAGS += -O2
+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.
+
+	touch configure-stamp
+
+
+build: build-stamp
+build-stamp: patch-stamp configure-stamp 
+	dh_testdir
+
+	# Add here commands to compile the package.
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) all skip_modules="$(EXCLUDED_MODULES)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(MYSQL_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(POSTGRES_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(UNIXODBC_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(JABBER_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(CPL_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(RADIUS_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(PRESENCE_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(XMLRPC_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(PERL_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(SNMPSTATS_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(XMPP_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(CROUTE_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(BERKELEY_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(LDAP_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(UTILS_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(REGEX_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(PURPLE_MOD_PATH)" cfg-target=/etc/kamailio/
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) modules modules="$(MEMCACHED_MOD_PATH)" cfg-target=/etc/kamailio/
+
+	# generate the utils db_berkeley
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) utils include_modules="db_berkeley"
+
+	# generate the man pages for modules
+	$(MAKE) modules-docbook-man include_modules="$(ALL_MODULES)"
+
+	touch build-stamp
+
+clean: real-clean unpatch
+real-clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp configure-stamp
+
+	# Add here commands to clean up after the build process.
+	$(MAKE) TLS=$(TLS) include_modules="$(ALL_MODULES)" proper
+	rm -f cfg.tab.h
+	rm -f utils/kamunix/kamunix.o utils/kamunix/kamunix
+	rm -f utils/db_berkeley/kambdb_recover.o utils/db_berkeley/kambdb_recover
+
+	dh_clean
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
+
+	# Add here commands to install the package into debian/kamailio
+	# kamailio base package
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install skip_modules="$(EXCLUDED_MODULES)" \
+		basedir=$(CURDIR)/debian/kamailio \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio
+
+	find $(CURDIR)/debian/kamailio/etc/kamailio -type f -exec chmod -x {} \;
+	sed -i -e "s/^PATH.*//" $(CURDIR)/debian/kamailio/usr/sbin/kamctl
+
+	# install only the mysql module
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(MYSQL_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-mysql-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-mysql-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-mysql-module
+
+	# install only the postgres module
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(POSTGRES_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-postgres-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-postgres-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-postgres-module
+
+	# install only the unixodbc module
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(UNIXODBC_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-unixodbc-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-unixodbc-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-unixodbc-module
+
+	# install only the jabber module
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(JABBER_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-jabber-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-jabber-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-jabber-module
+
+	# install only the cpl module
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(CPL_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-cpl-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-cpl-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-cpl-module
+
+	# install only the radius modules
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(RADIUS_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-radius-modules \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-radius-modules \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-radius-modules
+
+	# install only the presence modules
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(PRESENCE_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-presence-modules \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-presence-modules \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-presence-modules
+
+	# install only the xmlrpc module
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(XMLRPC_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-xmlrpc-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-xmlrpc-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-xmlrpc-module
+
+	# install only the perl modules
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(PERL_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-perl-modules \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-perl-modules \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-perl-modules
+
+	# install only the snmpstats module
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(SNMPSTATS_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-snmpstats-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-snmpstats-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-snmpstats-module
+
+	# install only the xmpp module
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(XMPP_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-xmpp-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-xmpp-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-xmpp-module
+
+	# install only the carrierroute module
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(CROUTE_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-carrierroute-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-carrierroute-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-carrierroute-module
+
+	# install only the db_berkeley module
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(BERKELEY_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-berkeley-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-berkeley-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-berkeley-module
+
+	# install only the ldap modules
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(LDAP_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-ldap-modules \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-ldap-modules \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-ldap-modules
+
+	# install only the utils modules
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(UTILS_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-utils-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-utils-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-utils-module
+
+	# install only the regex modules
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(REGEX_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-regex-modules \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-regex-modules \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-regex-modules
+
+	# install only the purple modules
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(PURPLE_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-purple-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-purple-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-purple-module
+
+	# install only the memcached modules
+	CC="$(CC)" CFLAGS="$(CFLAGS)" TLS=$(TLS) $(MAKE) install-modules-all modules="$(MEMCACHED_MOD_PATH)"  \
+		basedir=$(CURDIR)/debian/kamailio-memcached-module \
+		prefix=/usr \
+		cfg-prefix=$(CURDIR)/debian/kamailio-memcached-module \
+		cfg-target=/etc/kamailio/ \
+		doc-dir=share/doc/kamailio-memcached-module
+
+
+	# the modules packages all ship an empty /usr/sbin directory, let's clean that up
+	for p in $(ALL_PACKAGES); \
+		do rmdir --ignore-fail-on-non-empty $(CURDIR)/debian/$$p/usr/sbin; done
+
+# 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-arch: build install
+	dh_testdir
+	dh_testroot
+	dh_installdocs
+	dh_installexamples --exclude=".svn"
+#	dh_installlogrotate
+	dh_installinit -pkamailio -- defaults 23
+	dh_installcron
+	dh_installman
+	dh_installinfo
+	dh_installchangelogs
+	dh_link
+	dh_strip --dbg-package=kamailio-dbg
+	dh_compress 
+	dh_fixperms
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+# Build architecture-independent packages using the common target
+binary-indep: build install
+# We have nothing to do by default.
+
+binary: binary-indep binary-arch
+
+print-version:
+	@@echo "Debian version:          $(DEBVERSION)"
+	@@echo "Upstream version:        $(UPVERSION)"
+
+get-orig-source:
+	@@dh_testdir
+	@@[ -d ../tarballs/. ]||mkdir -p ../tarballs
+	@@echo Downloading $(FILENAME) from $(URL) ...
+	@@wget -N -nv -T10 -t3 -O ../tarballs/$(FILENAME) $(URL)
+
+.PHONY: build clean binary-indep binary-arch binary install configure patch unpatch real-clean

+ 75 - 0
pkg/kamailio/fedora/kamailio.init

@@ -0,0 +1,75 @@
+#!/bin/bash
+#
+# Startup script for Kamailio
+#
+# chkconfig: - 85 15
+# description: Kamailio is a fast SIP Proxy.
+#
+# processname: kamailio
+# pidfile: /var/run/kamailio.pid
+# config: /etc/kamailio/kamailio.cfg
+#
+### BEGIN INIT INFO
+# Provides: kamailio
+# Required-Start: $local_fs $network $named
+# Should-Start: mysqld postgresql
+# Short-Description: start, stop Open SIP express router
+# Description: Kamailio or OPEN SIP Express Router is a very fast and flexible
+# 	SIP (RFC3261) proxy server.
+### END INIT INFO
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+oser=/usr/sbin/kamailio
+prog=kamailio
+RETVAL=0
+
+[ -f /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+start() {
+	echo -n $"Starting $prog: "
+	# there is something at end of this output which is needed to
+	# report proper [ OK ] status in Fedora scripts
+	daemon $oser $OPTIONS 2>/dev/null | tail -1
+	RETVAL=$?
+	echo
+	[ $RETVAL = 0 ] && touch /var/lock/subsys/$prog
+}
+
+stop() {
+	echo -n $"Stopping $prog: "
+	killproc $oser
+	RETVAL=$?
+	echo
+	[ $RETVAL = 0 ] && rm -f /var/lock/subsys/$prog /var/run/$prog.pid
+}
+
+# See how we were called.
+case "$1" in
+	start)
+		start
+		;;
+	stop)
+		stop
+		;;
+	status)
+		status $oser
+		RETVAL=$?
+		;;
+	restart|reload)
+		stop
+		start
+		;;
+	condrestart)
+		if [ -f /var/run/kamailio.pid ] ; then
+			stop
+			start
+		fi
+		;;
+	*)
+		echo $"Usage: $prog {start|stop|reload|restart|condrestart|status|help}"
+		exit 1
+esac
+
+exit $RETVAL

+ 201 - 0
pkg/kamailio/freebsd/Makefile

@@ -0,0 +1,201 @@
+# New ports collection makefile for:	kamailio
+# Date created:				20 October 2005
+# Whom:					jesusr
+#
+# $FreeBSD: ports/net/kamailio/Makefile,v 1.9 2007/08/20 09:12:42 miwi Exp $
+#
+
+PORTNAME=	kamailio
+PORTVERSION=	1.3.0
+CATEGORIES=	net
+MASTER_SITES=	http://kamailio.org/pub/kamailio/${PORTVERSION}/src/
+DISTNAME=	${PORTNAME}-${PORTVERSION}-tls_src
+
+MAINTAINER=	[email protected]
+COMMENT=	A very fast and configurable SIP proxy with TLS support
+
+LIB_DEPENDS=	radiusclient-ng.2:${PORTSDIR}/net/radiusclient
+
+WRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION}-tls
+
+USE_GMAKE=	yes
+MAKE_ENV=	CC="${CC}" \
+		CC_EXTRA_OPTS="${CFLAGS}" \
+		PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
+		PTHREAD_LIBS="${PTHREAD_LIBS}"
+
+PLIST_FILES=	sbin/kamailio sbin/kamctl sbin/kamdbctl sbin/kamunix \
+		lib/kamailio/kamctl/kamctl.base lib/kamailio/kamctl/kamctl.ctlbase \
+		lib/kamailio/kamctl/kamctl.dbtext lib/kamailio/kamctl/kamctl.fifo \
+		lib/kamailio/kamctl/kamctl.sqlbase lib/kamailio/kamctl/kamctl.unixsock \
+		lib/kamailio/kamctl/kamdbctl.base lib/kamailio/kamctl/kamdbctl.dbtext \
+		etc/kamailio/kamctlrc
+
+PLIST_DIRS=	lib/kamailio/modules lib/kamailio/kamctl lib/kamailio
+
+MODULES=	acc alias_db auth auth_db auth_diameter avpops benchmark \
+		cfgutils dbtext dialog dispatcher diversion domain \
+		domainpolicy enum exec flatstore gflags group imc lcr \
+		mangler maxfwd mediaproxy mi_datagram mi_fifo msilo nathelper \
+		options path pdt permissions pike registrar rr seas \
+		siptrace sl sms speeddial sst statistics textops tm uac \
+		uac_redirect uri uri_db usrloc xlog
+
+RC_FILES=	acc/radiusclient.conf \
+		acc/servers \
+		dictionary.radius \
+		kamailio.cfg
+RC_DIRS=	acc
+
+ONLY_FOR_ARCHS=	i386
+
+MAN5=		kamailio.cfg.5
+MAN8=		kamailio.8 \
+		kamctl.8 \
+		kamunix.8
+
+PORTDOCS=	*
+
+SUB_FILES=	pkg-install pkg-deinstall
+SUB_LIST=	RC_DIRS="${RC_DIRS}" RC_FILES="${RC_FILES}"
+
+OPTIONS=	MYSQL "MySQL support" on \
+		POSTGRESQL "PostgreSQL support" off \
+		UNIXODBC "UnixODBC support" off \
+		CPL "CPL-C support" off \
+		TLS "TLS support" off \
+		SNMPSTATS "SNMPStats support" off
+
+.include <bsd.port.pre.mk>
+
+.if defined(WITH_MYSQL)
+USE_MYSQL=	yes
+MODULES+=	mysql
+PLIST_FILES+=	lib/kamailio/kamctl/kamdbctl.mysql lib/kamailio/kamctl/kamctl.mysql
+.else
+MAKE_ENV+=	MYSQL=mysql
+.endif
+
+.if defined(WITH_POSTGRESQL)
+USE_PGSQL=	yes
+MODULES+=	postgres
+PLIST_FILES+=	lib/kamailio/kamctl/kamdbctl.pgsql lib/kamailio/kamctl/kamctl.pgsql
+.else
+MAKE_ENV+=	POSTGRESQL=postgres
+.endif
+
+.if defined(WITH_UNIXODBC)
+LIB_DEPENDS+=	odbc.1:${PORTSDIR}/databases/unixODBC
+MODULES+=	unixodbc
+.else
+MAKE_ENV+=	UNIXODBC=unixodbc
+.endif
+
+.if defined(WITH_CPL)
+USE_GNOME=	libxml2
+MODULES+=	cpl-c
+PLIST_FILES+=	etc/kamailio/cpl-06.dtd
+.else
+MAKE_ENV+=	CPL=cpl-c
+.endif
+
+.if defined(WITH_TLS)
+MODULES+=	tlsops
+.include "${PORTSDIR}/Mk/bsd.openssl.mk"
+TLS_RC_FILES=	tls/rootCA/cacert.pem \
+		tls/rootCA/certs/01.pem \
+		tls/rootCA/index.txt \
+		tls/rootCA/private/cakey.pem \
+		tls/rootCA/serial \
+		tls/user/user-calist.pem \
+		tls/user/user-cert.pem \
+		tls/user/user-cert_req.pem \
+		tls/user/user-privkey.pem \
+		tls/README \
+		tls/ca.conf \
+		tls/request.conf \
+		tls/user.conf
+RC_FILES+=	${TLS_RC_FILES}
+TLS_RC_DIRS=	tls/user \
+		tls/rootCA/certs \
+		tls/rootCA/private \
+		tls/rootCA \
+		tls
+RC_DIRS+=	${TLS_RC_DIRS}
+.else
+MAKE_ENV+=	TLSOPS=tlsops
+MAKE_ARGS+=	TLS=""
+.endif
+
+.if defined(WITH_SNMPSTATS)
+RUN_DEPENDS+=	snmpcheck:${PORTSDIR}/net-mgmt/net-snmp
+MODULES+=	snmpstats
+.else
+MAKE_ENV+=	SNMPSTATS=snmpstats
+.endif
+
+PLIST_FILES+=	${MODULES:S|^|lib/kamailio/modules/|:S|$|.so|} \
+		${RC_FILES:S|^|etc/kamailio/|:S|$|.default|}
+
+post-patch:
+.if defined(NOPORTDOCS)
+	@${REINPLACE_CMD} -e 's|install-doc install-man|install-man|' \
+		${WRKSRC}/Makefile
+.endif
+	@${REINPLACE_CMD} -e 's|-g -O9 ||' -e 's|-O9 ||' ${WRKSRC}/Makefile.defs
+	@${REINPLACE_CMD} -e 's|/usr/local/etc/kamailio|${PREFIX}/etc/kamailio|' \
+		${WRKSRC}/scripts/kamdbctl.dbtext
+	@${REINPLACE_CMD} -e 's|/usr/local/share/kamailio|${PREFIX}/share/kamailio|' \
+		${WRKSRC}/scripts/kamdbctl.dbtext
+	@${REINPLACE_CMD} -e 's|/etc/kamailio|${PREFIX}/etc/kamailio|' \
+		${WRKSRC}/modules/mediaproxy/README \
+		${WRKSRC}/modules/cpl-c/README \
+		${WRKSRC}/INSTALL
+	@${REINPLACE_CMD} -e 's|/usr/local/sbin/kamailio|${PREFIX}/sbin/kamailio|' \
+		${WRKSRC}/INSTALL
+	@${REINPLACE_CMD} -e 's|/usr/local|${PREFIX}|' \
+		${WRKSRC}/etc/kamailio.cfg \
+		${WRKSRC}/scripts/kamctl \
+		${WRKSRC}/scripts/kamctl.8 \
+		${WRKSRC}/scripts/kamctl.base \
+		${WRKSRC}/scripts/kamctl.db_berkeley \
+		${WRKSRC}/scripts/kamctl.dbtext \
+		${WRKSRC}/scripts/kamctlrc \
+		${WRKSRC}/scripts/kamdbctl \
+		${WRKSRC}/scripts/kamdbctl.base \
+		${WRKSRC}/scripts/kamdbctl.db_berkeley \
+		${WRKSRC}/scripts/kamdbctl.dbtext \
+		${WRKSRC}/scripts/kamdbctl.mysql \
+		${WRKSRC}/scripts/kamdbctl.pgsql \
+		${WRKSRC}/modules/acc/README \
+		${WRKSRC}/modules/avp_radius/README \
+		${WRKSRC}/modules/db_berkeley/README \
+		${WRKSRC}/modules/ldap/README \
+		${WRKSRC}/modules/osp/README \
+		${WRKSRC}/modules/perl/README \
+		${WRKSRC}/modules/seas/README \
+		${WRKSRC}/modules/snmpstats/README \
+		${WRKSRC}/modules/speeddial/README \
+		${WRKSRC}/modules/unixodbc/README
+	@${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|' \
+		${WRKSRC}/modules/acc/etc/radiusclient.conf
+	@${REINPLACE_CMD} -e 's|/usr/local/etc/radiusclient|${PREFIX}/etc/kamailio/acc|' \
+		${WRKSRC}/modules/acc/acc_mod.c ${WRKSRC}/modules/acc/README
+
+post-install:
+	${INSTALL_DATA} ${WRKSRC}/etc/kamailio.cfg \
+		${PREFIX}/etc/kamailio/kamailio.cfg.default
+	${MKDIR} ${PREFIX}/etc/kamailio/acc
+	${INSTALL_DATA} ${WRKSRC}/modules/acc/etc/radiusclient.conf \
+		${PREFIX}/etc/kamailio/acc/radiusclient.conf.default
+	${INSTALL_DATA} ${WRKSRC}/modules/acc/etc/servers \
+		${PREFIX}/etc/kamailio/acc/servers.default
+.for d in ${TLS_RC_DIRS}
+	${MKDIR} ${PREFIX}/etc/kamailio/${d}
+.endfor
+.for f in ${TLS_RC_FILES}
+	${INSTALL_DATA} ${WRKSRC}/etc/${f} ${PREFIX}/etc/kamailio/${f}.default
+.endfor
+	@PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
+
+.include <bsd.port.post.mk>

+ 3 - 0
pkg/kamailio/freebsd/distinfo

@@ -0,0 +1,3 @@
+MD5 (kamailio-1.3.0-tls_src.tar.gz) = e380fa73095274162fac129e16d7c7d8
+SHA256 (kamailio-1.3.0-tls_src.tar.gz) = afd43b70e5887c5f91769bbc22506e8a6e0da90a91bf699da17f73988fc61fcf
+SIZE (kamailio-1.3.0-tls_src.tar.gz) = 3405325

+ 78 - 0
pkg/kamailio/freebsd/files/patch-Makefile

@@ -0,0 +1,78 @@
+--- Makefile.orig	Thu Dec 13 18:49:12 2007
++++ Makefile	Thu Dec 13 21:49:54 2007
+@@ -48,11 +48,11 @@
+ skip_modules?=
+ 
+ # if not set on the cmd. line or the env, exclude this modules:
+-exclude_modules?= jabber cpl-c mysql postgres osp unixodbc \
+-	avp_radius auth_radius group_radius uri_radius xmpp \
++exclude_modules?= 	$(MYSQL) $(POSTGRESQL) $(CPL) $(SNMPSTATS) $(TLSOPS) $(UNIXODBC) \
++	jabber osp avp_radius auth_radius group_radius uri_radius xmpp \
+ 	presence presence_xml presence_mwi pua pua_bla pua_mi \
+ 	pua_usrloc pua_xmpp rls mi_xmlrpc perl snmpstats perlvdb \
+-	ldap carrierroute h350 xcap_client db_berkeley seas
++	ldap carrierroute h350 xcap_client db_berkeley
+ ifeq ($(TLS),)
+ 	exclude_modules+= tlsops
+ endif
+@@ -392,24 +392,11 @@
+ 		
+ # note: on solaris 8 sed: ? or \(...\)* (a.s.o) do not work
+ install-cfg: $(cfg-prefix)/$(cfg-dir)
+-		sed -e "s#/usr/.*lib/$(NAME)/modules/#$(modules-target)#g" \
+-			< etc/$(NAME).cfg > $(cfg-prefix)/$(cfg-dir)$(NAME).cfg.sample0
+-		sed -e "s#/usr/.*etc/$(NAME)/tls/#$(cfg-target)tls/#g" \
+-			< $(cfg-prefix)/$(cfg-dir)$(NAME).cfg.sample0 \
+-			> $(cfg-prefix)/$(cfg-dir)$(NAME).cfg.sample
+-		rm -fr $(cfg-prefix)/$(cfg-dir)$(NAME).cfg.sample0
+-		chmod 644 $(cfg-prefix)/$(cfg-dir)$(NAME).cfg.sample
+-		if [ -z "${skip_cfg_install}" -a \
+-				! -f $(cfg-prefix)/$(cfg-dir)$(NAME).cfg ]; then \
+-			mv -f $(cfg-prefix)/$(cfg-dir)$(NAME).cfg.sample \
+-				$(cfg-prefix)/$(cfg-dir)$(NAME).cfg; \
+-		fi
+ 		# radius dictionary
+-		$(INSTALL_TOUCH) $(cfg-prefix)/$(cfg-dir)/dictionary.radius.sample
+-		$(INSTALL_CFG) etc/dictionary.radius \
+-			$(cfg-prefix)/$(cfg-dir)/dictionary.radius.sample
++		$(INSTALL_TOUCH) $(cfg-prefix)/$(cfg-dir)/dictionary.radius.default
++		$(INSTALL_CFG) etc/dictionary.radius $(cfg-prefix)/$(cfg-dir)/dictionary.radius.default
+ 		if [ ! -f $(cfg-prefix)/$(cfg-dir)/dictionary.radius ]; then \
+-			mv -f $(cfg-prefix)/$(cfg-dir)/dictionary.radius.sample \
++			cp -f $(cfg-prefix)/$(cfg-dir)/dictionary.radius.default \
+ 				$(cfg-prefix)/$(cfg-dir)/dictionary.radius; \
+ 		fi
+ 		# kamctl config
+@@ -445,7 +432,7 @@
+ 		sed -e "s#/usr/local/lib/kamailio/#$(lib-target)#g" | \
+ 		sed -e "s#/usr/local/etc/kamailio/#$(cfg-target)#g"  >/tmp/kamctl
+ 		$(INSTALL_TOUCH) $(bin-prefix)/$(bin-dir)/kamctl
+-		$(INSTALL_BIN) /tmp/kamctl $(bin-prefix)/$(bin-dir)
++		$(BSD_INSTALL_SCRIPT) /tmp/kamctl $(bin-prefix)/$(bin-dir)
+ 		rm -fr /tmp/kamctl
+ 		sed -e "s#/usr/local/sbin#$(bin-target)#g" \
+ 			< scripts/kamctl.base > /tmp/kamctl.base
+@@ -492,10 +479,10 @@
+ 		sed -e "s#/usr/local/lib/kamailio/#$(lib-target)#g" | \
+ 		sed -e "s#/usr/local/etc/kamailio/#$(cfg-target)#g"  >/tmp/kamdbctl
+ 		$(INSTALL_TOUCH) $(bin-prefix)/$(bin-dir)/kamdbctl
+-		$(INSTALL_BIN) /tmp/kamdbctl $(bin-prefix)/$(bin-dir)
++		$(BSD_INSTALL_SCRIPT) /tmp/kamdbctl $(bin-prefix)/$(bin-dir)
+ 		rm -fr /tmp/kamdbctl
+ 		$(INSTALL_TOUCH)   $(bin-prefix)/$(bin-dir)/$(NAME)unix
+-		$(INSTALL_BIN) utils/$(NAME)unix/$(NAME)unix $(bin-prefix)/$(bin-dir)
++		$(BSD_INSTALL_SCRIPT) utils/$(NAME)unix/$(NAME)unix $(bin-prefix)/$(bin-dir)
+ 		# install dbtext stuff
+ 		mkdir -p $(modules-prefix)/$(lib-dir)/kamctl ; \
+ 		sed -e "s#/usr/local/share/kamailio/#$(data-target)#g" \
+@@ -624,9 +611,7 @@
+ 			if [ -f modules/"$$r"/README ]; then \
+ 				$(INSTALL_TOUCH)  $(doc-prefix)/$(doc-dir)/README ; \
+ 				$(INSTALL_DOC)  modules/"$$r"/README  \
+-									$(doc-prefix)/$(doc-dir)/README ; \
+-				mv -f $(doc-prefix)/$(doc-dir)/README \
+-						$(doc-prefix)/$(doc-dir)/README."$$r" ; \
++					$(doc-prefix)/$(doc-dir)/README."$$r" ; \
+ 			fi ; \
+ 		fi ; \
+ 	done 

+ 11 - 0
pkg/kamailio/freebsd/files/patch-Makefile-mysql

@@ -0,0 +1,11 @@
+--- modules/mysql/Makefile.orig	Thu Dec 13 20:15:16 2007
++++ modules/mysql/Makefile	Thu Dec 13 20:15:20 2007
+@@ -8,7 +8,7 @@
+ 
+ # set CROSS_COMPILE to true if you want to skip
+ # the autodetection
+-# CROSS_COMPILE=true
++CROSS_COMPILE=true
+ 
+ ifeq ($(CROSS_COMPILE),)
+ MYSQLCFG=$(shell which mysql_config)

+ 42 - 0
pkg/kamailio/freebsd/files/patch-Makefile.defs

@@ -0,0 +1,42 @@
+--- Makefile.defs.orig	Thu Dec 13 18:56:53 2007
++++ Makefile.defs	Thu Dec 13 20:31:40 2007
+@@ -135,7 +135,7 @@
+ ifeq ($(ARCH_B),64b)
+ 	LIBDIR ?= lib64
+ else
+-	LIBDIR ?= lib
++	LIBDIR = lib
+ 	# assume 32b - it is not really used further
+ 	ARCH_B=32b
+ endif
+@@ -228,13 +228,13 @@
+ TAR ?= tar
+ endif
+ 
+-INSTALL_TOUCH = touch          # used to create the file first (good to 
++INSTALL_TOUCH = :          # used to create the file first (good to 
+                                #  make solaris install work)
+-INSTALL_CFG = $(INSTALL) -m 644
+-INSTALL_BIN = $(INSTALL) -m 755
+-INSTALL_MODULES = $(INSTALL) -m 755
+-INSTALL_DOC = $(INSTALL) -m 644
+-INSTALL_MAN = $(INSTALL) -m 644
++INSTALL_CFG = $(BSD_INSTALL_DATA) -m 644
++INSTALL_BIN = $(BSD_INSTALL_PROGRAM) -m 755
++INSTALL_MODULES = $(BSD_INSTALL_PROGRAM) -m 755
++INSTALL_DOC = $(BSD_INSTALL_DATA) -m 644
++INSTALL_MAN = $(BSD_INSTALL_MAN) -m 644
+ 
+ #set some vars from the environment (and not make builtins)
+ CC   := $(shell echo "$${CC}")
+@@ -1254,8 +1254,8 @@
+ 
+ #add libssl if needed
+ ifneq ($(TLS),)
+-DEFS+= -I$(LOCALBASE)/ssl/include -I$(LOCALBASE)/include
+-LIBS+= -L$(LOCALBASE)/lib -L$(LOCALBASE)/ssl/lib -lssl  -lcrypto
++DEFS+= -I$(OPENSSLINC)
++LIBS+= -L$(OPENSSLLIB) -lssl  -lcrypto
+ endif
+ 
+ #add libsctp if needed

+ 24 - 0
pkg/kamailio/freebsd/files/pkg-deinstall.in

@@ -0,0 +1,24 @@
+#!/bin/sh
+
+rc_dir=$PKG_PREFIX/etc/kamailio/
+
+if [ "$2" = DEINSTALL ]; then
+	for f in %%RC_FILES%%; do
+		if /usr/bin/cmp -s $rc_dir/$f.default $rc_dir/$f; then
+			/bin/rm -f $rc_dir/$f
+		fi
+	done
+elif [ "$2" = POST-DEINSTALL ]; then
+	rc_dirs=`for d in %%RC_DIRS%%; do echo $d; done | /usr/bin/sort -r`
+
+	for d in $rc_dirs ""; do
+		/bin/rmdir $rc_dir/$d 2>/dev/null || /usr/bin/true
+	done
+
+	if [ -e $rc_dir ]; then
+		echo "==============================================================================="
+		echo "If you are permanently removing this port, you should manually remove the"
+		echo "$rc_dir directory."
+		echo "==============================================================================="
+	fi
+fi

+ 12 - 0
pkg/kamailio/freebsd/files/pkg-install.in

@@ -0,0 +1,12 @@
+#!/bin/sh
+
+[ "$2" != POST-INSTALL ] && exit
+
+rc_dir=$PKG_PREFIX/etc/kamailio/
+
+for f in %%RC_FILES%%; do
+	if ! [ -e $rc_dir/$f ]; then
+		/usr/bin/install -o root -g wheel -m 644 \
+			$rc_dir/$f.default $rc_dir/$f
+	fi
+done

+ 13 - 0
pkg/kamailio/freebsd/pkg-descr

@@ -0,0 +1,13 @@
+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. A C Shell like scripting language
+provides full control over the server's behaviour. It's modular
+architecture allows only required functionality to be loaded.
+Currently the following modules are available: digest authentication,
+CPL scripts, instant messaging, MySQL and UNIXODBC support, a presence agent,
+radius authentication, record routing, an SMS gateway, a jabber gateway, a 
+transaction and dialog module, OSP module, statistics support, 
+registrar and user location, SIMPLE Presence, Perl programming interface,
+SNMP and Java SIP Servlet.
+
+WWW: http://www.kamailio.org/

+ 118 - 0
pkg/kamailio/gentoo/kamailio-1.2.0.ebuild

@@ -0,0 +1,118 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header$
+
+inherit eutils
+
+DESCRIPTION="Kamailio - flexible and robust SIP (RFC3261) server"
+HOMEPAGE="http://www.kamailio.org/"
+MY_P="${P}_src"
+SRC_URI="http://kamailio.org/pub/kamailio/${PV}/src/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86"
+IUSE="debug ipv6 mysql postgres radius jabber ssl cpl unixodbc"
+
+RDEPEND="
+	mysql? ( >=dev-db/mysql-4.1.20 )
+	radius? ( >=net-dialup/radiusclient-ng-0.5.0 )
+	postgres? ( >=dev-db/postgresql-8.0.8 )
+	jabber? ( dev-libs/expat )
+	ssl? ( dev-libs/openssl )
+	cpl? ( dev-libs/libxml2 )
+	unixodbc? ( dev-libs/unixodbc-2.2.6 )"
+
+inc_mod=""
+make_options=""
+
+pkg_setup() {
+	use mysql && \
+		inc_mod="${inc_mod} mysql"
+
+	use postgres && \
+		inc_mod="${inc_mod} postgres"
+
+	use radius && \
+		inc_mod="${inc_mod} auth_radius misc_radius peering
+
+	use jabber && \
+		inc_mod="${inc_mod} jabber"
+
+	use cpl && \
+		inc_mod="${inc_mod} cpl-c"
+
+	use unixodbc && \
+		inc_mod="${inc_mod} unixodbc"
+
+	export inc_mod
+}
+
+src_unpack() {
+	unpack ${MY_P}.tar.gz
+
+	cd ${S}
+	use ipv6 || \
+		sed -i -e "s/-DUSE_IPV6//g" Makefile.defs
+}
+
+src_compile() {
+	local compile_options
+
+	pkg_setup
+
+	# optimization can result in strange debuging symbols so omit it in case
+	if use debug; then
+		compile_options="${compile_options} mode=debug"
+	else
+		compile_options="${compile_options} CFLAGS=${CFLAGS}"
+	fi
+	
+	if use ssl; then
+		compile_options="TLS=1 ${compile_options}"
+	fi
+
+	emake all "${compile_options}" \
+		prefix=${ROOT}/ \
+		include_modules="${inc_mod}" \
+		cfg-prefix=${ROOT}/ \
+		cfg-target=${ROOT}/etc/kamailio/ || die
+}
+
+src_install () {
+	local install_options
+
+	emake install \
+		prefix=${D}/ \
+		include_modules="${inc_mod}" \
+		bin-prefix=${D}/usr/sbin \
+		bin-dir="" \
+		cfg-prefix=${D}/etc \
+		cfg-dir=kamailio/ \
+		cfg-target=${D}/etc/kamailio \
+		modules-prefix=${D}/usr/lib/kamailio \
+		modules-dir=modules \
+		modules-target=${D}/usr/lib/kamailio/modules/ \
+		man-prefix=${D}/usr/share/man \
+		man-dir="" \
+		doc-prefix=${D}/usr/share/doc \
+		doc-dir=${PF} || die
+	exeinto /etc/init.d
+	newexe ${FILESDIR}/kamailio.init kamailio
+
+	# fix what the Makefile don't do
+	use mysql || \
+		rm ${D}/usr/sbin/kamailio_mysql.sh
+}
+
+pkg_postinst() {
+	einfo "WARNING: If you upgraded from a previous Kamailio version"
+	einfo "please read the README, NEWS and INSTALL files in the"
+	einfo "documentation directory because the database and the"
+	einfo "configuration file of old Kamailio versions are incompatible"
+	einfo "with the current version."
+}
+
+pkg_prerm () {
+	${D}/etc/init.d/kamailio stop >/dev/null
+}

+ 22 - 0
pkg/kamailio/gentoo/kamailio.init

@@ -0,0 +1,22 @@
+#!/sbin/runscript
+# Copyright 2002 Frauenhofer Gesellschaft FOKUS, Germany.
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Header$
+
+depend() {
+	need net
+}
+
+start() {
+	ebegin "Starting Kamailio"
+	start-stop-daemon --start --quiet --pidfile /var/run/kamailio.pid \
+		--exec /usr/sbin/kamailio -- -P /var/run/kamailio.pid
+	eend $?
+}
+
+stop() {
+	ebegin "Stopping Kamailio"
+	start-stop-daemon --stop --quiet --pidfile /var/run/kamailio.pid
+	eend $?
+}
+

+ 1 - 0
pkg/kamailio/netbsd/COMMENT

@@ -0,0 +1 @@
+Kamailio, very fast and configurable SIP proxy

+ 18 - 0
pkg/kamailio/netbsd/DESCR

@@ -0,0 +1,18 @@
+Kamailio is a very fast and flexible SIP (RFC3261)
+proxy server. Written entirely in C, ser can handle thousands calls
+per second even on low-budget hardware. C Shell like scripting language
+provides full control over the server's behaviour. It's modular
+architecture allows only required functionality to be loaded.
+Currently the following modules are available: Digest Authentication,
+CPL scripts, Instant Messaging, MySQL support, UNIXODBC support,
+OSP support, Radius Authentication, Record Routing, SMS Gateway,
+Jabber Gateway, Transaction Module, Dialog Module, Registrar and
+User Location, Perl programming interface, SIMPLE Presence and SNMP.
+
+
+WWW: http://www.kamailio.org/
+
+- Bogdan-Andrei Iancu
[email protected]
+- Daniel-Constantin Mierla
[email protected]

+ 42 - 0
pkg/kamailio/netbsd/Makefile

@@ -0,0 +1,42 @@
+# New ports collection makefile for:    kamailio
+#
+# $NetBSD$
+#
+# $Id$
+#
+
+COMMENT= "Kamailio"
+
+PORTNAME= kamailio
+PORTVERSION= 1.2.0-notls
+CATEGORIES= net
+MASTER_SITES= http://kamailio.org/pub/kamailio/1.2.0/src/
+
+MAINTAINER= [email protected]
+
+MAN8=kamailio.8
+MAN5=kamailio.cfg.5
+# MANCOMPRESSED must not be specified (if defined is assumed to be yes)
+
+
+USE_GMAKE= yes
+USE_TOOLS+= gmake
+# we override the DISTFILE NAME
+DISTNAME= ${PORTNAME}-${PORTVERSION}
+DISTFILES= ${DISTNAME}_src.tar.gz
+WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
+
+# build by default mysql and jabber
+MAKE_ENV= include_modules="mysql jabber"
+
+# depends on expat and mysqlclient because of the above modules
+DEPENDS= expat-[0-9]*:../../textproc/expat \
+         mysql-client>=3.23.35:../../databases/mysql-client
+
+#.include "/usr/pkgsrc/mk/bsd.prefs.mk"
+
+pre-fetch:
+
+.include "../../mk/bsd.pkg.mk"
+
+

+ 120 - 0
pkg/kamailio/netbsd/PLIST

@@ -0,0 +1,120 @@
+etc/kamailio/kamailio.cfg
+etc/kamailio/kamctlrc
+sbin/kamailio
+sbin/kamctl
+sbin/kamailio_mysql.sh
+lib/kamailio/modules/acc.so
+lib/kamailio/modules/alias_db.so
+lib/kamailio/modules/auth.so
+lib/kamailio/modules/auth_db.so
+lib/kamailio/modules/auth_diameter.so
+lib/kamailio/modules/avpops.so
+lib/kamailio/modules/dbtext.so
+lib/kamailio/modules/dialog.so
+lib/kamailio/modules/dispatcher.so
+lib/kamailio/modules/diversion.so
+lib/kamailio/modules/domain.so
+lib/kamailio/modules/domainpolicy.so
+lib/kamailio/modules/enum.so
+lib/kamailio/modules/exec.so
+lib/kamailio/modules/flatstore.so
+lib/kamailio/modules/gflags.so
+lib/kamailio/modules/group.so
+lib/kamailio/modules/jabber.so
+lib/kamailio/modules/lcr.so
+lib/kamailio/modules/mangler.so
+lib/kamailio/modules/maxfwd.so
+lib/kamailio/modules/mediaproxy.so
+lib/kamailio/modules/mi_fifo.so
+lib/kamailio/modules/msilo.so
+lib/kamailio/modules/mysql.so
+lib/kamailio/modules/nathelper.so
+lib/kamailio/modules/options.so
+lib/kamailio/modules/pa.so
+lib/kamailio/modules/path.so
+lib/kamailio/modules/pdt.so
+lib/kamailio/modules/permissions.so
+lib/kamailio/modules/pike.so
+lib/kamailio/modules/registrar.so
+lib/kamailio/modules/rr.so
+lib/kamailio/modules/seas.so
+lib/kamailio/modules/siptrace.so
+lib/kamailio/modules/sl.so
+lib/kamailio/modules/sms.so
+lib/kamailio/modules/speeddial.so
+lib/kamailio/modules/sst.so
+lib/kamailio/modules/statistics.so
+lib/kamailio/modules/textops.so
+lib/kamailio/modules/tm.so
+lib/kamailio/modules/uac.so
+lib/kamailio/modules/uac_redirect.so
+lib/kamailio/modules/uri.so
+lib/kamailio/modules/uri_db.so
+lib/kamailio/modules/usrloc.so
+lib/kamailio/modules/xlog.so
+lib/kamailio/modules/xmpp.so
+lib/kamctl/kamctl.base
+lib/kamctl/kamctl.sqlbase
+lib/kamctl/kamctl.ctlbase
+lib/kamctl/kamctl.fifo
+lib/kamctl/kamctl.unixsock
+lib/kamctl/kamctl.mysql
+share/doc/kamailio/README
+share/doc/kamailio/INSTALL
+share/doc/kamailio/README-MODULES
+share/doc/kamailio/AUTHORS
+share/doc/kamailio/NEWS
+share/doc/kamailio/README.acc
+share/doc/kamailio/README.alias_db
+share/doc/kamailio/README.auth
+share/doc/kamailio/README.auth_db
+share/doc/kamailio/README.auth_diameter
+share/doc/kamailio/README.avpops
+share/doc/kamailio/README.dbtext
+share/doc/kamailio/README.dialog
+share/doc/kamailio/README.dispatcher
+share/doc/kamailio/README.diversion
+share/doc/kamailio/README.domain
+share/doc/kamailio/README.domainpolicy
+share/doc/kamailio/README.enum
+share/doc/kamailio/README.exec
+share/doc/kamailio/README.flatstore
+share/doc/kamailio/README.gflags
+share/doc/kamailio/README.group
+share/doc/kamailio/README.jabber
+share/doc/kamailio/README.lcr
+share/doc/kamailio/README.mangler
+share/doc/kamailio/README.maxfwd
+share/doc/kamailio/README.mediaproxy
+share/doc/kamailio/README.mi_fifo
+share/doc/kamailio/README.msilo
+share/doc/kamailio/README.mysql
+share/doc/kamailio/README.nathelper
+share/doc/kamailio/README.options
+share/doc/kamailio/README.pa
+share/doc/kamailio/README.path
+share/doc/kamailio/README.pdt
+share/doc/kamailio/README.permissions
+share/doc/kamailio/README.pike
+share/doc/kamailio/README.registrar
+share/doc/kamailio/README.rr
+share/doc/kamailio/README.seas
+share/doc/kamailio/README.siptrace
+share/doc/kamailio/README.sl
+share/doc/kamailio/README.sms
+share/doc/kamailio/README.speeddial
+share/doc/kamailio/README.sst
+share/doc/kamailio/README.statistics
+share/doc/kamailio/README.textops
+share/doc/kamailio/README.tm
+share/doc/kamailio/README.uac
+share/doc/kamailio/README.uac_redirect
+share/doc/kamailio/README.uri
+share/doc/kamailio/README.uri_db
+share/doc/kamailio/README.usrloc
+share/doc/kamailio/README.xlog
+share/doc/kamailio/README.xmpp
+@dirrm share/doc/kamailio
+@dirrm etc/kamailio
+@dirrm lib/kamailio/modules
+@dirrm lib/kamailio

+ 1 - 0
pkg/kamailio/netbsd/distinfo

@@ -0,0 +1 @@
+MD5 (kamailio-1.2.0-notls_src.tar.gz) = 9ca396cb5d95623206b109bdfb4c6374

+ 154 - 0
pkg/kamailio/openbsd/Makefile

@@ -0,0 +1,154 @@
+# $OpenBSD$
+
+COMMENT-main =		mature and flexible open source SIP server
+COMMENT-postgresql =	kamailio postgresql module
+COMMENT-mysql =		kamailio mysql module
+COMMENT-radius =	kamailio RADIUS modules
+COMMENT-berkeleydb =	kamailio berkeley DB module
+COMMENT-ldap =		kamailio LDAP modules
+COMMENT-xmlrpc =	kamailio XML-RPC module
+COMMENT-xcap_client =	kamailio XCAP client module
+COMMENT-carrierroute =	kamailio carrierroute module
+COMMENT-snmpstats =	kamailio snmpstats module
+COMMENT-perl =		kamailio perl modules
+
+VERSION =		1.5.0
+DISTNAME =		kamailio-${VERSION}
+PKGNAME-main =		kamailio-${VERSION}
+PKGNAME-mysql =		kamailio-mysql-${VERSION}
+PKGNAME-postgresql =	kamailio-postgresql-${VERSION}
+PKGNAME-radius =	kamailio-radius-${VERSION}
+PKGNAME-berkeleydb =	kamailio-berkeleydb-${VERSION}
+PKGNAME-ldap =		kamailio-ldap-${VERSION}
+PKGNAME-xmlrpc =	kamailio-xmlrpc-${VERSION}
+PKGNAME-xcap_client =	kamailio-xcap_client-${VERSION}
+PKGNAME-carrierroute =	kamailio-carrierroute-${VERSION}
+PKGNAME-snmpstats =	kamailio-snmpstats-${VERSION}
+PKGNAME-perl =		kamailio-perl-${VERSION}
+
+CATEGORIES =		telephony
+MAINTAINER =		[email protected]
+
+HOMEPAGE =		http://www.kamailio.org/
+
+# GPL
+PERMIT_PACKAGE_CDROM =	Yes
+PERMIT_PACKAGE_FTP =	Yes
+PERMIT_DISTFILES_CDROM =Yes
+PERMIT_DISTFILES_FTP =	Yes
+
+MASTER_SITES =		http://www.kamailio.org/pub/kamailio/${VERSION}/src/
+DISTFILES =		${DISTNAME}-tls_src.tar.gz
+WRKDIST =		${WRKDIR}/${DISTNAME}-tls
+
+BUILD_DEPENDS =		::devel/gmake
+
+WANTLIB-main =		c expat crypto ssl
+LIB_DEPENDS-main =	xml2::textproc/libxml,-main,no_python
+# kamctl and kamdbctl use bash
+RUN_DEPENDS-main =	::shells/bash
+
+WANTLIB-berkeleydb =	c
+LIB_DEPENDS-berkeleydb =db::databases/db/v4,-main
+RUN_DEPENDS-berkeleydb =::telephony/kamailio
+
+LIB_DEPENDS-postgresql =pq:postgresql-client-*:databases/postgresql,-main
+RUN_DEPENDS-postgresql =::telephony/kamailio
+
+WANTLIB-mysql =		crypto m ssl z
+LIB_DEPENDS-mysql =	mysqlclient:mysql-client-*:databases/mysql,-main
+RUN_DEPENDS-mysql =	::telephony/kamailio
+
+LIB_DEPENDS-radius =	radiusclient-ng:radiusclient-ng-*:net/radiusclient-ng
+RUN_DEPENDS-radius =	::telephony/kamailio
+
+LIB_DEPENDS-ldap =	ldap:openldap-client-*:databases/openldap,-main
+RUN_DEPENDS-ldap =	::telephony/kamailio
+
+LIB_DEPENDS-xmlrpc =	xmlrpc::net/xmlrpc-c \
+			xmlrpc_server::net/xmlrpc-c \
+			xmlrpc_util::net/xmlrpc-c \
+			xmlrpc_xmlparse::net/xmlrpc-c \
+			xmlrpc_xmltok::net/xmlrpc-c
+RUN_DEPENDS-xmlrpc =	::telephony/kamailio
+
+LIB_DEPENDS-xcap_client =	curl::net/curl \
+				xml2::textproc/libxml,-main
+RUN_DEPENDS-xcap_client =	::telephony/kamailio
+
+LIB_DEPENDS-carrierroute =	confuse::devel/libconfuse
+RUN_DEPENDS-carrierroute =	::telephony/kamailio
+
+WANTLIB-snmpstats =	c m perl util
+LIB_DEPENDS-snmpstats =	netsnmp:net-snmp-*:net/net-snmp \
+			netsnmpagent:net-snmp-*:net/net-snmp \
+			netsnmphelpers:net-snmp-*:net/net-snmp
+RUN_DEPENDS-snmpstats =	::telephony/kamailio
+
+RUN_DEPENDS-perl =	::telephony/kamailio \
+			::databases/p5-ldap
+WANTLIB-perl =		c m perl util
+
+PSEUDO_FLAVORS =	no_berkeleydb no_postgresql no_mysql no_radius no_ldap no_xmlrpc no_xcap_client no_carrierroute no_snmpstats no_perl
+
+KAMAILIO_MODULES =	cpl-c jabber presence presence_mwi presence_xml pua pua_bla pua_mi pua_usrloc pua_xmpp rls seas xmpp
+FLAVOR ?=
+MULTI_PACKAGES =	-main
+
+.if !${FLAVOR:L:Mno_berkeleydb}
+MULTI_PACKAGES +=	-berkeleydb
+KAMAILIO_MODULES +=	db_berkeley
+.endif
+.if !${FLAVOR:L:Mno_postgresql}
+MULTI_PACKAGES +=	-postgresql
+KAMAILIO_MODULES +=	db_postgres
+.endif
+.if !${FLAVOR:L:Mno_mysql}
+MULTI_PACKAGES +=	-mysql
+KAMAILIO_MODULES +=	db_mysql
+.endif
+.if !${FLAVOR:L:Mno_radius}
+MULTI_PACKAGES +=	-radius
+KAMAILIO_MODULES +=	avp_radius auth_radius group_radius uri_radius peering
+.endif
+.if !${FLAVOR:L:Mno_ldap}
+MULTI_PACKAGES +=	-ldap
+KAMAILIO_MODULES +=	ldap h350
+.endif
+.if !${FLAVOR:L:Mno_xmlrpc}
+MULTI_PACKAGES +=	-xmlrpc
+KAMAILIO_MODULES +=	mi_xmlrpc
+.endif
+.if !${FLAVOR:L:Mno_xcap_client}
+MULTI_PACKAGES +=	-xcap_client
+KAMAILIO_MODULES +=	xcap_client
+.endif
+.if !${FLAVOR:L:Mno_snmpstats}
+MULTI_PACKAGES +=	-snmpstats
+KAMAILIO_MODULES +=	snmpstats
+.endif
+.if !${FLAVOR:L:Mno_carrierroute}
+MULTI_PACKAGES +=	-carrierroute
+KAMAILIO_MODULES +=	carrierroute
+.endif
+.if !${FLAVOR:L:Mno_perl}
+MULTI_PACKAGES +=	-perl
+KAMAILIO_MODULES +=	perl perlvdb
+.endif
+
+MAKE_FLAGS =		TLS=1 LIBDIR="lib" cfg-prefix="${WRKINST}" cfg-target="/etc/kamailio/" include_modules="${KAMAILIO_MODULES}"
+FAKE_FLAGS =		PREFIX=${PREFIX}
+USE_GMAKE =		Yes
+CONFIGURE_STYLE =	none
+DESTDIRNAME=BASEDIR
+NO_REGRESS =		Yes
+
+post-patch:
+.for f in kamctl kamdbctl
+	@cp ${WRKDIST}/scripts/${f} ${WRKDIST}/scripts/${f}.bak
+	@sed -e '1s,^#!/bin/bash,#!/usr/local/bin/bash,' ${WRKDIST}/scripts/${f}.bak > ${WRKDIST}/scripts/${f}
+.endfor
+
+post-install:
+	mv ${WRKINST}${SYSCONFDIR}/kamailio ${WRKINST}${LOCALBASE}/share/examples
+.include <bsd.port.mk>

+ 5 - 0
pkg/kamailio/openbsd/distinfo

@@ -0,0 +1,5 @@
+MD5 (kamailio-1.5.0-tls_src.tar.gz) = 
+RMD160 (kamailio-1.5.0-tls_src.tar.gz) = 
+SHA1 (kamailio-1.5.0-tls_src.tar.gz) = 
+SHA256 (kamailio-1.5.0-tls_src.tar.gz) = 
+SIZE (kamailio-1.5.0-tls_src.tar.gz) = 

+ 13 - 0
pkg/kamailio/openbsd/patches/patch-etc_kamailio_cfg

@@ -0,0 +1,13 @@
+$OpenBSD$
+--- etc/kamailio.cfg.orig	Thu Oct 23 19:32:11 2008
++++ etc/kamailio.cfg	Thu Oct 23 19:33:14 2008
+@@ -18,6 +18,9 @@ log_facility=LOG_LOCAL0
+ fork=yes
+ children=4
+ 
++user="_kamailio"
++group="_kamailio"
++
+ /* uncomment the following lines to enable debugging */
+ #debug=6
+ #fork=no

+ 15 - 0
pkg/kamailio/openbsd/patches/patch-modules_perl_Makefile

@@ -0,0 +1,15 @@
+$OpenBSD$
+--- modules/perl/Makefile.orig	Thu Oct 23 12:04:58 2008
++++ modules/perl/Makefile	Mon Nov  3 21:33:22 2008
+@@ -5,6 +5,11 @@
+ # 
+ # WARNING: do not run this directly, it should be run by the master Makefile
+ 
++# Force inclusion due to bug in gmake 3.81 on OpenBSD which causes the 
++# "export" command to fail when the variable name contains hyphens. (!)
++ifeq ($(OS),openbsd)
++	makefile_defs=0
++endif
+ include ../../Makefile.defs
+ auto_gen=
+ NAME=perl.so

+ 12 - 0
pkg/kamailio/openbsd/patches/patch-scripts_kamctlrc

@@ -0,0 +1,12 @@
+$OpenBSD$
+--- scripts/kamctlrc.orig	Thu Oct 23 12:04:49 2008
++++ scripts/kamctlrc	Mon Nov  3 20:15:24 2008
+@@ -135,7 +135,7 @@
+ 
+ ## OPENSER START Options
+ ## PID file path - default is: /var/run/kamailio.pid
+-# PID_FILE=/var/run/kamailio.pid
++PID_FILE=/var/kamailio/kamailio.pid
+ 
+ ## Extra start options - default is: not set
+ # example: start Kamailio with 64MB share memory: STARTOPTIONS="-m 64"

+ 1 - 0
pkg/kamailio/openbsd/pkg/COMMENT

@@ -0,0 +1 @@
+Kamailio, very fast and configurable SIP proxy

+ 18 - 0
pkg/kamailio/openbsd/pkg/DESCR

@@ -0,0 +1,18 @@
+Kamailio is a very fast and flexible SIP (RFC3261)
+proxy server. Written entirely in C, ser can handle thousands calls
+per second even on low-budget hardware. C Shell like scripting language
+provides full control over the server's behaviour. It's modular
+architecture allows only required functionality to be loaded.
+Currently the following modules are available: Digest Authentication,
+CPL scripts, Instant Messaging, MySQL support, UNIXODBC support,
+OSP support, Radius Authentication, Record Routing, SMS Gateway,
+Jabber Gateway, Transaction Module, Dialog Module, Registrar and
+User Location, SIMPLE Presence, Perl programming interface, SNMP.
+
+
+WWW: http://www.kamailio.org/
+
+- Bogdan-Andrei Iancu
[email protected]
+- Daniel-Constantin Mierla
[email protected]

+ 1 - 0
pkg/kamailio/openbsd/pkg/DESCR-berkeleydb

@@ -0,0 +1 @@
+kamailio berkeley DB module

+ 1 - 0
pkg/kamailio/openbsd/pkg/DESCR-carrierroute

@@ -0,0 +1 @@
+kamailio carrierroute module

+ 1 - 0
pkg/kamailio/openbsd/pkg/DESCR-ldap

@@ -0,0 +1 @@
+kamailio LDAP modules

+ 7 - 0
pkg/kamailio/openbsd/pkg/DESCR-main

@@ -0,0 +1,7 @@
+KAMAILIO (OpenSER) is a mature and flexible open source SIP server (RFC3261).
+It can be used on systems with limitted resources as well as on carrier grade
+servers, scaling to up to thousands call setups per second. It is written in
+pure C for Unix/Linux-like systems with architecture specific optimizations to
+offer high performances. It is customizable, being able to feature as fast load
+balancer; SIP server flavours: registrar, location server, proxy server,
+redirect server; gateway to SMS/XMPP; or advanced VoIP application server.

+ 1 - 0
pkg/kamailio/openbsd/pkg/DESCR-mysql

@@ -0,0 +1 @@
+kamailio mysql module

+ 1 - 0
pkg/kamailio/openbsd/pkg/DESCR-perl

@@ -0,0 +1 @@
+kamailio perl modules

+ 1 - 0
pkg/kamailio/openbsd/pkg/DESCR-postgresql

@@ -0,0 +1 @@
+kamailio postgresql module

+ 1 - 0
pkg/kamailio/openbsd/pkg/DESCR-radius

@@ -0,0 +1 @@
+kamailio RADIUS modules

+ 1 - 0
pkg/kamailio/openbsd/pkg/DESCR-snmpstats

@@ -0,0 +1 @@
+kamailio snmpstats module

+ 1 - 0
pkg/kamailio/openbsd/pkg/DESCR-xcap_client

@@ -0,0 +1 @@
+kamailio XCAP client module

+ 1 - 0
pkg/kamailio/openbsd/pkg/DESCR-xmlrpc

@@ -0,0 +1 @@
+kamailio XML-RPC module

+ 2 - 0
pkg/kamailio/openbsd/pkg/PFRAG.shared-berkeleydb

@@ -0,0 +1,2 @@
+@comment $OpenBSD$
+lib/kamailio/modules/db_berkeley.so

+ 2 - 0
pkg/kamailio/openbsd/pkg/PFRAG.shared-carrierroute

@@ -0,0 +1,2 @@
+@comment $OpenBSD$
+lib/kamailio/modules/carrierroute.so

+ 3 - 0
pkg/kamailio/openbsd/pkg/PFRAG.shared-ldap

@@ -0,0 +1,3 @@
+@comment $OpenBSD$
+lib/kamailio/modules/h350.so
+lib/kamailio/modules/ldap.so

+ 68 - 0
pkg/kamailio/openbsd/pkg/PFRAG.shared-main

@@ -0,0 +1,68 @@
+@comment $OpenBSD$
+lib/kamailio/modules/acc.so
+lib/kamailio/modules/alias_db.so
+lib/kamailio/modules/auth.so
+lib/kamailio/modules/auth_db.so
+lib/kamailio/modules/auth_diameter.so
+lib/kamailio/modules/avpops.so
+lib/kamailio/modules/benchmark.so
+lib/kamailio/modules/cfgutils.so
+lib/kamailio/modules/cpl-c.so
+lib/kamailio/modules/db_flatstore.so
+lib/kamailio/modules/db_text.so
+lib/kamailio/modules/dialog.so
+lib/kamailio/modules/dialplan.so
+lib/kamailio/modules/dispatcher.so
+lib/kamailio/modules/diversion.so
+lib/kamailio/modules/domain.so
+lib/kamailio/modules/domainpolicy.so
+lib/kamailio/modules/enum.so
+lib/kamailio/modules/exec.so
+lib/kamailio/modules/gflags.so
+lib/kamailio/modules/group.so
+lib/kamailio/modules/imc.so
+lib/kamailio/modules/jabber.so
+lib/kamailio/modules/lcr.so
+lib/kamailio/modules/mangler.so
+lib/kamailio/modules/maxfwd.so
+lib/kamailio/modules/mediaproxy.so
+lib/kamailio/modules/mi_datagram.so
+lib/kamailio/modules/mi_fifo.so
+lib/kamailio/modules/msilo.so
+lib/kamailio/modules/nat_traversal.so
+lib/kamailio/modules/nathelper.so
+lib/kamailio/modules/options.so
+lib/kamailio/modules/path.so
+lib/kamailio/modules/pdt.so
+lib/kamailio/modules/permissions.so
+lib/kamailio/modules/pike.so
+lib/kamailio/modules/presence.so
+lib/kamailio/modules/presence_mwi.so
+lib/kamailio/modules/presence_xml.so
+lib/kamailio/modules/pua.so
+lib/kamailio/modules/pua_bla.so
+lib/kamailio/modules/pua_mi.so
+lib/kamailio/modules/pua_usrloc.so
+lib/kamailio/modules/pua_xmpp.so
+lib/kamailio/modules/ratelimit.so
+lib/kamailio/modules/registrar.so
+lib/kamailio/modules/rls.so
+lib/kamailio/modules/rr.so
+lib/kamailio/modules/seas.so
+lib/kamailio/modules/siptrace.so
+lib/kamailio/modules/sl.so
+lib/kamailio/modules/sms.so
+lib/kamailio/modules/speeddial.so
+lib/kamailio/modules/sst.so
+lib/kamailio/modules/statistics.so
+lib/kamailio/modules/textops.so
+lib/kamailio/modules/tlsops.so
+lib/kamailio/modules/tm.so
+lib/kamailio/modules/uac.so
+lib/kamailio/modules/uac_redirect.so
+lib/kamailio/modules/uri.so
+lib/kamailio/modules/uri_db.so
+lib/kamailio/modules/userblacklist.so
+lib/kamailio/modules/usrloc.so
+lib/kamailio/modules/xlog.so
+lib/kamailio/modules/xmpp.so

+ 2 - 0
pkg/kamailio/openbsd/pkg/PFRAG.shared-mysql

@@ -0,0 +1,2 @@
+@comment $OpenBSD$
+lib/kamailio/modules/db_mysql.so

+ 3 - 0
pkg/kamailio/openbsd/pkg/PFRAG.shared-perl

@@ -0,0 +1,3 @@
+@comment $OpenBSD$
+lib/kamailio/modules/perl.so
+lib/kamailio/modules/perlvdb.so

+ 2 - 0
pkg/kamailio/openbsd/pkg/PFRAG.shared-postgresql

@@ -0,0 +1,2 @@
+@comment $OpenBSD$
+lib/kamailio/modules/db_postgres.so

+ 6 - 0
pkg/kamailio/openbsd/pkg/PFRAG.shared-radius

@@ -0,0 +1,6 @@
+@comment $OpenBSD$
+lib/kamailio/modules/auth_radius.so
+lib/kamailio/modules/avp_radius.so
+lib/kamailio/modules/group_radius.so
+lib/kamailio/modules/peering.so
+lib/kamailio/modules/uri_radius.so

+ 2 - 0
pkg/kamailio/openbsd/pkg/PFRAG.shared-snmpstats

@@ -0,0 +1,2 @@
+@comment $OpenBSD$
+lib/kamailio/modules/snmpstats.so

+ 2 - 0
pkg/kamailio/openbsd/pkg/PFRAG.shared-xcap_client

@@ -0,0 +1,2 @@
+@comment $OpenBSD$
+lib/kamailio/modules/xcap_client.so

+ 2 - 0
pkg/kamailio/openbsd/pkg/PFRAG.shared-xmlrpc

@@ -0,0 +1,2 @@
+@comment $OpenBSD$
+lib/kamailio/modules/mi_xmlrpc.so

+ 120 - 0
pkg/kamailio/openbsd/pkg/PLIST

@@ -0,0 +1,120 @@
+etc/kamailio/kamailio.cfg
+etc/kamailio/kamctl
+sbin/kamailio
+sbin/kamctl
+sbin/kamailio_mysql.sh
+lib/kamailio/modules/acc.so
+lib/kamailio/modules/alias_db.so
+lib/kamailio/modules/auth.so
+lib/kamailio/modules/auth_db.so
+lib/kamailio/modules/auth_diameter.so
+lib/kamailio/modules/avpops.so
+lib/kamailio/modules/dbtext.so
+lib/kamailio/modules/dialog.so
+lib/kamailio/modules/dispatcher.so
+lib/kamailio/modules/diversion.so
+lib/kamailio/modules/domain.so
+lib/kamailio/modules/domainpolicy.so
+lib/kamailio/modules/enum.so
+lib/kamailio/modules/exec.so
+lib/kamailio/modules/flatstore.so
+lib/kamailio/modules/gflags.so
+lib/kamailio/modules/group.so
+lib/kamailio/modules/jabber.so
+lib/kamailio/modules/lcr.so
+lib/kamailio/modules/mangler.so
+lib/kamailio/modules/maxfwd.so
+lib/kamailio/modules/mediaproxy.so
+lib/kamailio/modules/mi_fifo.so
+lib/kamailio/modules/msilo.so
+lib/kamailio/modules/mysql.so
+lib/kamailio/modules/nathelper.so
+lib/kamailio/modules/options.so
+lib/kamailio/modules/pa.so
+lib/kamailio/modules/path.so
+lib/kamailio/modules/pdt.so
+lib/kamailio/modules/permissions.so
+lib/kamailio/modules/pike.so
+lib/kamailio/modules/registrar.so
+lib/kamailio/modules/rr.so
+lib/kamailio/modules/seas.so
+lib/kamailio/modules/siptrace.so
+lib/kamailio/modules/sl.so
+lib/kamailio/modules/sms.so
+lib/kamailio/modules/speeddial.so
+lib/kamailio/modules/sst.so
+lib/kamailio/modules/statistics.so
+lib/kamailio/modules/textops.so
+lib/kamailio/modules/tm.so
+lib/kamailio/modules/uac.so
+lib/kamailio/modules/uac_redirect.so
+lib/kamailio/modules/uri.so
+lib/kamailio/modules/uri_db.so
+lib/kamailio/modules/usrloc.so
+lib/kamailio/modules/xlog.so
+lib/kamailio/modules/xmpp.so
+lib/kamctl/kamctl.base
+lib/kamctl/kamctl.sqlbase
+lib/kamctl/kamctl.ctlbase
+lib/kamctl/kamctl.fifo
+lib/kamctl/kamctl.unixsock
+lib/kamctl/kamctl.mysql
+share/doc/kamailio/README
+share/doc/kamailio/INSTALL
+share/doc/kamailio/README-MODULES
+share/doc/kamailio/AUTHORS
+share/doc/kamailio/NEWS
+share/doc/kamailio/README.acc
+share/doc/kamailio/README.alias_db
+share/doc/kamailio/README.auth
+share/doc/kamailio/README.auth_db
+share/doc/kamailio/README.auth_diameter
+share/doc/kamailio/README.avpops
+share/doc/kamailio/README.dbtext
+share/doc/kamailio/README.dialog
+share/doc/kamailio/README.dispatcher
+share/doc/kamailio/README.diversion
+share/doc/kamailio/README.domain
+share/doc/kamailio/README.domainpolicy
+share/doc/kamailio/README.enum
+share/doc/kamailio/README.exec
+share/doc/kamailio/README.flatstore
+share/doc/kamailio/README.gflags
+share/doc/kamailio/README.group
+share/doc/kamailio/README.jabber
+share/doc/kamailio/README.lcr
+share/doc/kamailio/README.mangler
+share/doc/kamailio/README.maxfwd
+share/doc/kamailio/README.mediaproxy
+share/doc/kamailio/README.mi_fifo
+share/doc/kamailio/README.msilo
+share/doc/kamailio/README.mysql
+share/doc/kamailio/README.nathelper
+share/doc/kamailio/README.options
+share/doc/kamailio/README.pa
+share/doc/kamailio/README.path
+share/doc/kamailio/README.pdt
+share/doc/kamailio/README.permissions
+share/doc/kamailio/README.pike
+share/doc/kamailio/README.registrar
+share/doc/kamailio/README.rr
+share/doc/kamailio/README.seas
+share/doc/kamailio/README.siptrace
+share/doc/kamailio/README.sl
+share/doc/kamailio/README.sms
+share/doc/kamailio/README.speeddial
+share/doc/kamailio/README.statistics
+share/doc/kamailio/README.sst
+share/doc/kamailio/README.textops
+share/doc/kamailio/README.tm
+share/doc/kamailio/README.uac
+share/doc/kamailio/README.uac_redirect
+share/doc/kamailio/README.uri
+share/doc/kamailio/README.uri_db
+share/doc/kamailio/README.usrloc
+share/doc/kamailio/README.xlog
+share/doc/kamailio/README.xmpp
+@dirrm share/doc/kamailio
+@dirrm etc/kamailio
+@dirrm lib/kamailio/modules
+@dirrm lib/kamailio

+ 47 - 0
pkg/kamailio/openbsd/pkg/PLIST-berkeleydb

@@ -0,0 +1,47 @@
+@comment $OpenBSD$
+%%SHARED%%
+lib/kamailio/kamctl/kamctl.db_berkeley
+lib/kamailio/kamctl/kamdbctl.db_berkeley
+@bin sbin/kambdb_recover
+share/doc/kamailio/README.db_berkeley
+share/kamailio/db_berkeley/
+share/kamailio/db_berkeley/kamailio/
+share/kamailio/db_berkeley/kamailio/acc
+share/kamailio/db_berkeley/kamailio/active_watchers
+share/kamailio/db_berkeley/kamailio/address
+share/kamailio/db_berkeley/kamailio/aliases
+share/kamailio/db_berkeley/kamailio/carrierfailureroute
+share/kamailio/db_berkeley/kamailio/carrierroute
+share/kamailio/db_berkeley/kamailio/cpl
+share/kamailio/db_berkeley/kamailio/dbaliases
+share/kamailio/db_berkeley/kamailio/dialog
+share/kamailio/db_berkeley/kamailio/dialplan
+share/kamailio/db_berkeley/kamailio/dispatcher
+share/kamailio/db_berkeley/kamailio/domain
+share/kamailio/db_berkeley/kamailio/domainpolicy
+share/kamailio/db_berkeley/kamailio/globalblacklist
+share/kamailio/db_berkeley/kamailio/grp
+share/kamailio/db_berkeley/kamailio/gw
+share/kamailio/db_berkeley/kamailio/imc_members
+share/kamailio/db_berkeley/kamailio/imc_rooms
+share/kamailio/db_berkeley/kamailio/lcr
+share/kamailio/db_berkeley/kamailio/location
+share/kamailio/db_berkeley/kamailio/missed_calls
+share/kamailio/db_berkeley/kamailio/pdt
+share/kamailio/db_berkeley/kamailio/presentity
+share/kamailio/db_berkeley/kamailio/pua
+share/kamailio/db_berkeley/kamailio/re_grp
+share/kamailio/db_berkeley/kamailio/rls_presentity
+share/kamailio/db_berkeley/kamailio/rls_watchers
+share/kamailio/db_berkeley/kamailio/route_tree
+share/kamailio/db_berkeley/kamailio/silo
+share/kamailio/db_berkeley/kamailio/sip_trace
+share/kamailio/db_berkeley/kamailio/speed_dial
+share/kamailio/db_berkeley/kamailio/subscriber
+share/kamailio/db_berkeley/kamailio/trusted
+share/kamailio/db_berkeley/kamailio/uri
+share/kamailio/db_berkeley/kamailio/userblacklist
+share/kamailio/db_berkeley/kamailio/usr_preferences
+share/kamailio/db_berkeley/kamailio/version
+share/kamailio/db_berkeley/kamailio/watchers
+share/kamailio/db_berkeley/kamailio/xcap

+ 3 - 0
pkg/kamailio/openbsd/pkg/PLIST-carrierroute

@@ -0,0 +1,3 @@
+@comment $OpenBSD$
+%%SHARED%%
+share/doc/kamailio/README.carrierroute

+ 4 - 0
pkg/kamailio/openbsd/pkg/PLIST-ldap

@@ -0,0 +1,4 @@
+@comment $OpenBSD$
+%%SHARED%%
+share/doc/kamailio/README.h350
+share/doc/kamailio/README.ldap

+ 186 - 0
pkg/kamailio/openbsd/pkg/PLIST-main

@@ -0,0 +1,186 @@
+@comment $OpenBSD$
+@newgroup _kamailio:610
+@newuser _kamailio:610:610:daemon:Kamailio:/nonexistent:/sbin/nologin
+%%SHARED%%
+lib/kamailio/
+lib/kamailio/kamctl/
+lib/kamailio/kamctl/dbtextdb/
+lib/kamailio/kamctl/dbtextdb/dbtextdb.py
+lib/kamailio/kamctl/kamctl.base
+lib/kamailio/kamctl/kamctl.ctlbase
+lib/kamailio/kamctl/kamctl.dbtext
+lib/kamailio/kamctl/kamctl.fifo
+lib/kamailio/kamctl/kamctl.sqlbase
+lib/kamailio/kamctl/kamctl.unixsock
+lib/kamailio/kamctl/kamdbctl.base
+lib/kamailio/kamctl/kamdbctl.dbtext
+lib/kamailio/modules/
+@man man/man5/kamailio.cfg.5
+@man man/man8/kamailio.8
+@man man/man8/kamctl.8
+@man man/man8/kamunix.8
+@bin sbin/kamailio
+sbin/kamctl
+sbin/kamdbctl
+@bin sbin/kamunix
+share/doc/kamailio/
+share/doc/kamailio/AUTHORS
+share/doc/kamailio/INSTALL
+share/doc/kamailio/NEWS
+share/doc/kamailio/README
+share/doc/kamailio/README-MODULES
+share/doc/kamailio/README.acc
+share/doc/kamailio/README.alias_db
+share/doc/kamailio/README.auth
+share/doc/kamailio/README.auth_db
+share/doc/kamailio/README.auth_diameter
+share/doc/kamailio/README.avpops
+share/doc/kamailio/README.benchmark
+share/doc/kamailio/README.cfgutils
+share/doc/kamailio/README.cpl-c
+share/doc/kamailio/README.db_flatstore
+share/doc/kamailio/README.db_text
+share/doc/kamailio/README.dialog
+share/doc/kamailio/README.dialplan
+share/doc/kamailio/README.dispatcher
+share/doc/kamailio/README.diversion
+share/doc/kamailio/README.domain
+share/doc/kamailio/README.domainpolicy
+share/doc/kamailio/README.enum
+share/doc/kamailio/README.exec
+share/doc/kamailio/README.gflags
+share/doc/kamailio/README.group
+share/doc/kamailio/README.imc
+share/doc/kamailio/README.jabber
+share/doc/kamailio/README.lcr
+share/doc/kamailio/README.mangler
+share/doc/kamailio/README.maxfwd
+share/doc/kamailio/README.mediaproxy
+share/doc/kamailio/README.mi_datagram
+share/doc/kamailio/README.mi_fifo
+share/doc/kamailio/README.msilo
+share/doc/kamailio/README.nat_traversal
+share/doc/kamailio/README.nathelper
+share/doc/kamailio/README.options
+share/doc/kamailio/README.path
+share/doc/kamailio/README.pdt
+share/doc/kamailio/README.permissions
+share/doc/kamailio/README.pike
+share/doc/kamailio/README.presence
+share/doc/kamailio/README.presence_mwi
+share/doc/kamailio/README.presence_xml
+share/doc/kamailio/README.pua
+share/doc/kamailio/README.pua_bla
+share/doc/kamailio/README.pua_mi
+share/doc/kamailio/README.pua_usrloc
+share/doc/kamailio/README.pua_xmpp
+share/doc/kamailio/README.ratelimit
+share/doc/kamailio/README.registrar
+share/doc/kamailio/README.rls
+share/doc/kamailio/README.rr
+share/doc/kamailio/README.seas
+share/doc/kamailio/README.siptrace
+share/doc/kamailio/README.sl
+share/doc/kamailio/README.sms
+share/doc/kamailio/README.speeddial
+share/doc/kamailio/README.sst
+share/doc/kamailio/README.statistics
+share/doc/kamailio/README.textops
+share/doc/kamailio/README.tlsops
+share/doc/kamailio/README.tm
+share/doc/kamailio/README.uac
+share/doc/kamailio/README.uac_redirect
+share/doc/kamailio/README.uri
+share/doc/kamailio/README.uri_db
+share/doc/kamailio/README.userblacklist
+share/doc/kamailio/README.usrloc
+share/doc/kamailio/README.xlog
+share/doc/kamailio/README.xmpp
+share/examples/kamailio/
+@sample ${SYSCONFDIR}/kamailio/
+share/examples/kamailio/kamailio.cfg
+@sample ${SYSCONFDIR}/kamailio/kamailio.cfg
+share/examples/kamailio/kamctlrc
+@sample ${SYSCONFDIR}/kamailio/kamctlrc
+share/examples/kamailio/tls/
+@sample ${SYSCONFDIR}/kamailio/tls/
+share/examples/kamailio/tls/README
+@sample ${SYSCONFDIR}/kamailio/tls/README
+share/examples/kamailio/tls/ca.conf
+@sample ${SYSCONFDIR}/kamailio/tls/ca.conf
+share/examples/kamailio/tls/request.conf
+@sample ${SYSCONFDIR}/kamailio/tls/request.conf
+share/examples/kamailio/tls/rootCA/
+@sample ${SYSCONFDIR}/kamailio/tls/rootCA/
+share/examples/kamailio/tls/rootCA/cacert.pem
+@sample ${SYSCONFDIR}/kamailio/tls/rootCA/cacert.pem
+share/examples/kamailio/tls/rootCA/certs/
+@sample ${SYSCONFDIR}/kamailio/tls/rootCA/certs/
+share/examples/kamailio/tls/rootCA/certs/01.pem
+@sample ${SYSCONFDIR}/kamailio/tls/rootCA/certs/01.pem
+share/examples/kamailio/tls/rootCA/index.txt
+@sample ${SYSCONFDIR}/kamailio/tls/rootCA/index.txt
+share/examples/kamailio/tls/rootCA/private/
+@sample ${SYSCONFDIR}/kamailio/tls/rootCA/private/
+share/examples/kamailio/tls/rootCA/private/cakey.pem
+@sample ${SYSCONFDIR}/kamailio/tls/rootCA/private/cakey.pem
+share/examples/kamailio/tls/rootCA/serial
+@sample ${SYSCONFDIR}/kamailio/tls/rootCA/serial
+share/examples/kamailio/tls/user/
+@sample ${SYSCONFDIR}/kamailio/tls/user/
+share/examples/kamailio/tls/user.conf
+@sample ${SYSCONFDIR}/kamailio/tls/user.conf
+share/examples/kamailio/tls/user/user-calist.pem
+@sample ${SYSCONFDIR}/kamailio/tls/user/user-calist.pem
+share/examples/kamailio/tls/user/user-cert.pem
+@sample ${SYSCONFDIR}/kamailio/tls/user/user-cert.pem
+share/examples/kamailio/tls/user/user-cert_req.pem
+@sample ${SYSCONFDIR}/kamailio/tls/user/user-cert_req.pem
+share/examples/kamailio/tls/user/user-privkey.pem
+@sample ${SYSCONFDIR}/kamailio/tls/user/user-privkey.pem
+share/kamailio/
+share/kamailio/dbtext/
+share/kamailio/dbtext/kamailio/
+share/kamailio/dbtext/kamailio/acc
+share/kamailio/dbtext/kamailio/active_watchers
+share/kamailio/dbtext/kamailio/address
+share/kamailio/dbtext/kamailio/aliases
+share/kamailio/dbtext/kamailio/carrierfailureroute
+share/kamailio/dbtext/kamailio/carrierroute
+share/kamailio/dbtext/kamailio/cpl
+share/kamailio/dbtext/kamailio/dbaliases
+share/kamailio/dbtext/kamailio/dialog
+share/kamailio/dbtext/kamailio/dialplan
+share/kamailio/dbtext/kamailio/dispatcher
+share/kamailio/dbtext/kamailio/domain
+share/kamailio/dbtext/kamailio/domainpolicy
+share/kamailio/dbtext/kamailio/globalblacklist
+share/kamailio/dbtext/kamailio/grp
+share/kamailio/dbtext/kamailio/gw
+share/kamailio/dbtext/kamailio/imc_members
+share/kamailio/dbtext/kamailio/imc_rooms
+share/kamailio/dbtext/kamailio/lcr
+share/kamailio/dbtext/kamailio/location
+share/kamailio/dbtext/kamailio/missed_calls
+share/kamailio/dbtext/kamailio/pdt
+share/kamailio/dbtext/kamailio/presentity
+share/kamailio/dbtext/kamailio/pua
+share/kamailio/dbtext/kamailio/re_grp
+share/kamailio/dbtext/kamailio/rls_presentity
+share/kamailio/dbtext/kamailio/rls_watchers
+share/kamailio/dbtext/kamailio/route_tree
+share/kamailio/dbtext/kamailio/silo
+share/kamailio/dbtext/kamailio/sip_trace
+share/kamailio/dbtext/kamailio/speed_dial
+share/kamailio/dbtext/kamailio/subscriber
+share/kamailio/dbtext/kamailio/trusted
+share/kamailio/dbtext/kamailio/uri
+share/kamailio/dbtext/kamailio/userblacklist
+share/kamailio/dbtext/kamailio/usr_preferences
+share/kamailio/dbtext/kamailio/version
+share/kamailio/dbtext/kamailio/watchers
+share/kamailio/dbtext/kamailio/xcap
+@mode 700
+@owner _kamailio
+@sample /var/kamailio/
+@extraunexec rm -rf /var/kamailio/

+ 32 - 0
pkg/kamailio/openbsd/pkg/PLIST-mysql

@@ -0,0 +1,32 @@
+@comment $OpenBSD$
+%%SHARED%%
+lib/kamailio/kamctl/kamctl.mysql
+lib/kamailio/kamctl/kamdbctl.mysql
+share/doc/kamailio/README.db_mysql
+share/kamailio/mysql/
+share/kamailio/mysql/acc-create.sql
+share/kamailio/mysql/alias_db-create.sql
+share/kamailio/mysql/auth_db-create.sql
+share/kamailio/mysql/avpops-create.sql
+share/kamailio/mysql/carrierroute-create.sql
+share/kamailio/mysql/cpl-create.sql
+share/kamailio/mysql/dialog-create.sql
+share/kamailio/mysql/dialplan-create.sql
+share/kamailio/mysql/dispatcher-create.sql
+share/kamailio/mysql/domain-create.sql
+share/kamailio/mysql/domainpolicy-create.sql
+share/kamailio/mysql/group-create.sql
+share/kamailio/mysql/imc-create.sql
+share/kamailio/mysql/lcr-create.sql
+share/kamailio/mysql/msilo-create.sql
+share/kamailio/mysql/pdt-create.sql
+share/kamailio/mysql/permissions-create.sql
+share/kamailio/mysql/presence-create.sql
+share/kamailio/mysql/registrar-create.sql
+share/kamailio/mysql/rls-create.sql
+share/kamailio/mysql/siptrace-create.sql
+share/kamailio/mysql/speeddial-create.sql
+share/kamailio/mysql/standard-create.sql
+share/kamailio/mysql/uri_db-create.sql
+share/kamailio/mysql/userblacklist-create.sql
+share/kamailio/mysql/usrloc-create.sql

+ 30 - 0
pkg/kamailio/openbsd/pkg/PLIST-perl

@@ -0,0 +1,30 @@
+@comment $OpenBSD$
+%%SHARED%%
+lib/kamailio/perl/
+lib/kamailio/perl/OpenSER/
+lib/kamailio/perl/OpenSER.pm
+lib/kamailio/perl/OpenSER/Constants.pm
+lib/kamailio/perl/OpenSER/LDAPUtils/
+lib/kamailio/perl/OpenSER/LDAPUtils/LDAPConf.pm
+lib/kamailio/perl/OpenSER/LDAPUtils/LDAPConnection.pm
+lib/kamailio/perl/OpenSER/Message.pm
+lib/kamailio/perl/OpenSER/Utils/
+lib/kamailio/perl/OpenSER/Utils/Debug.pm
+lib/kamailio/perl/OpenSER/Utils/PhoneNumbers.pm
+lib/kamailio/perl/OpenSER/VDB/
+lib/kamailio/perl/OpenSER/VDB.pm
+lib/kamailio/perl/OpenSER/VDB/Adapter/
+lib/kamailio/perl/OpenSER/VDB/Adapter/AccountingSIPtrace.pm
+lib/kamailio/perl/OpenSER/VDB/Adapter/Alias.pm
+lib/kamailio/perl/OpenSER/VDB/Adapter/Auth.pm
+lib/kamailio/perl/OpenSER/VDB/Adapter/Describe.pm
+lib/kamailio/perl/OpenSER/VDB/Adapter/Speeddial.pm
+lib/kamailio/perl/OpenSER/VDB/Adapter/TableVersions.pm
+lib/kamailio/perl/OpenSER/VDB/Column.pm
+lib/kamailio/perl/OpenSER/VDB/Pair.pm
+lib/kamailio/perl/OpenSER/VDB/ReqCond.pm
+lib/kamailio/perl/OpenSER/VDB/Result.pm
+lib/kamailio/perl/OpenSER/VDB/VTab.pm
+lib/kamailio/perl/OpenSER/VDB/Value.pm
+share/doc/kamailio/README.perl
+share/doc/kamailio/README.perlvdb

+ 32 - 0
pkg/kamailio/openbsd/pkg/PLIST-postgresql

@@ -0,0 +1,32 @@
+@comment $OpenBSD$
+%%SHARED%%
+lib/kamailio/kamctl/kamctl.pgsql
+lib/kamailio/kamctl/kamdbctl.pgsql
+share/doc/kamailio/README.db_postgres
+share/kamailio/postgres/
+share/kamailio/postgres/acc-create.sql
+share/kamailio/postgres/alias_db-create.sql
+share/kamailio/postgres/auth_db-create.sql
+share/kamailio/postgres/avpops-create.sql
+share/kamailio/postgres/carrierroute-create.sql
+share/kamailio/postgres/cpl-create.sql
+share/kamailio/postgres/dialog-create.sql
+share/kamailio/postgres/dialplan-create.sql
+share/kamailio/postgres/dispatcher-create.sql
+share/kamailio/postgres/domain-create.sql
+share/kamailio/postgres/domainpolicy-create.sql
+share/kamailio/postgres/group-create.sql
+share/kamailio/postgres/imc-create.sql
+share/kamailio/postgres/lcr-create.sql
+share/kamailio/postgres/msilo-create.sql
+share/kamailio/postgres/pdt-create.sql
+share/kamailio/postgres/permissions-create.sql
+share/kamailio/postgres/presence-create.sql
+share/kamailio/postgres/registrar-create.sql
+share/kamailio/postgres/rls-create.sql
+share/kamailio/postgres/siptrace-create.sql
+share/kamailio/postgres/speeddial-create.sql
+share/kamailio/postgres/standard-create.sql
+share/kamailio/postgres/uri_db-create.sql
+share/kamailio/postgres/userblacklist-create.sql
+share/kamailio/postgres/usrloc-create.sql

+ 8 - 0
pkg/kamailio/openbsd/pkg/PLIST-radius

@@ -0,0 +1,8 @@
+@comment $OpenBSD$
+%%SHARED%%
+share/doc/kamailio/README.auth_radius
+share/doc/kamailio/README.avp_radius
+share/doc/kamailio/README.group_radius
+share/doc/kamailio/README.peering
+share/doc/kamailio/README.uri_radius
+share/examples/kamailio/dictionary.radius

+ 10 - 0
pkg/kamailio/openbsd/pkg/PLIST-snmpstats

@@ -0,0 +1,10 @@
+@comment $OpenBSD$
+%%SHARED%%
+share/doc/kamailio/README.snmpstats
+share/snmp/
+share/snmp/mibs/
+share/snmp/mibs/OPENSER-MIB
+share/snmp/mibs/OPENSER-REG-MIB
+share/snmp/mibs/OPENSER-SIP-COMMON-MIB
+share/snmp/mibs/OPENSER-SIP-SERVER-MIB
+share/snmp/mibs/OPENSER-TC

+ 3 - 0
pkg/kamailio/openbsd/pkg/PLIST-xcap_client

@@ -0,0 +1,3 @@
+@comment $OpenBSD$
+%%SHARED%%
+share/doc/kamailio/README.xcap_client

+ 3 - 0
pkg/kamailio/openbsd/pkg/PLIST-xmlrpc

@@ -0,0 +1,3 @@
+@comment $OpenBSD$
+%%SHARED%%
+share/doc/kamailio/README.mi_xmlrpc

+ 63 - 0
pkg/kamailio/rpm/kamailio.init

@@ -0,0 +1,63 @@
+#!/bin/bash
+#
+# Startup script for Kamailio
+#
+# chkconfig: 345 85 15
+# description: Kamailio is a fast SIP Proxy.
+#
+# processname: kamailio
+# pidfile: /var/run/kamailio.pid
+# config: /etc/kamailio/kamailio.cfg
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+oser=/usr/sbin/kamailio
+prog=kamailio
+RETVAL=0
+
+start() {
+	echo -n $"Starting $prog: "
+	daemon $oser $OPTIONS >/dev/null 2>/dev/null
+	RETVAL=$?
+	echo
+	[ $RETVAL = 0 ] && touch /var/lock/subsys/kamailio
+	return $RETVAL
+}
+
+stop() {
+	echo -n $"Stopping $prog: "
+	killproc $oser
+	RETVAL=$?
+	echo
+	[ $RETVAL = 0 ] && rm -f /var/lock/subsys/kamailio /var/run/kamailio.pid
+}
+
+# See how we were called.
+case "$1" in
+	start)
+		start
+		;;
+	stop)
+		stop
+		;;
+	status)
+		status $oser
+		RETVAL=$?
+		;;
+	restart)
+		stop
+		start
+		;;
+	condrestart)
+		if [ -f /var/run/kamailio.pid ] ; then
+			stop
+			start
+		fi
+		;;
+	*)
+		echo $"Usage: $prog {start|stop|restart|condrestart|status|help}"
+		exit 1
+esac
+
+exit $RETVAL

Some files were not shown because too many files changed in this diff