pkg: remove obselete gentoo ebuild, add new generic ebuild from Claudio Furrer (FS...
authorHenning Westerholt <henning.westerholt@1und1.de>
Mon, 5 Sep 2011 16:17:40 +0000 (18:17 +0200)
committerHenning Westerholt <henning.westerholt@1und1.de>
Mon, 5 Sep 2011 16:17:40 +0000 (18:17 +0200)
12 files changed:
pkg/kamailio/gentoo/kamailio-1.2.0.ebuild [deleted file]
pkg/kamailio/gentoo/kamailio.init [deleted file]
pkg/sip-router/gentoo/ChangeLog [new file with mode: 0644]
pkg/sip-router/gentoo/Manifest [new file with mode: 0644]
pkg/sip-router/gentoo/files/Makefile.defs.diff [new file with mode: 0644]
pkg/sip-router/gentoo/files/siprouter.confd [new file with mode: 0644]
pkg/sip-router/gentoo/files/siprouter.init [new file with mode: 0755]
pkg/sip-router/gentoo/metadata.xml [new file with mode: 0644]
pkg/sip-router/gentoo/sip-router-3.1.2.ebuild [new file with mode: 0644]
pkg/sip-router/gentoo/sip-router-3.1.3.ebuild [new file with mode: 0644]
pkg/sip-router/gentoo/sip-router-3.1.4-r1.ebuild [new file with mode: 0644]
pkg/sip-router/gentoo/sip-router-3.1.4.ebuild [new file with mode: 0644]

diff --git a/pkg/kamailio/gentoo/kamailio-1.2.0.ebuild b/pkg/kamailio/gentoo/kamailio-1.2.0.ebuild
deleted file mode 100644 (file)
index a9877d6..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-# 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
-}
diff --git a/pkg/kamailio/gentoo/kamailio.init b/pkg/kamailio/gentoo/kamailio.init
deleted file mode 100644 (file)
index b417580..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/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 $?
-}
-
diff --git a/pkg/sip-router/gentoo/ChangeLog b/pkg/sip-router/gentoo/ChangeLog
new file mode 100644 (file)
index 0000000..b69a047
--- /dev/null
@@ -0,0 +1,29 @@
+# ChangeLog for net-misc/sip-router
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: $
+
+*sip-router-3.1.4-r1 (24 Aug 2011)
+  
+  24 Aug 2011; Claudio G. Furrer <elcaio@gmail.com> sip-router-3.1.4-r1.ebuild:
+  Added kamailio-specific groups (group_k*) in USE flags.
+
+*sip-router-3.1.4 (31 May 2011)
+  
+  31 May 2011; Claudio G. Furrer <elcaio@gmail.com> sip-router-3.1.4.ebuild:
+  Version bump.
+
+*sip-router-3.1.3 (03 May 2011)
+  
+  03 May 2011; Claudio G. Furrer <elcaio@gmail.com> sip-router-3.1.3.ebuild:
+  Version bump.
+
+*sip-router-3.1.2 (21 Mar 2011)
+  
+  23 Mar 2011; Claudio G. Furrer <elcaio@gmail.com> sip-router-3.1.2.ebuild,
+  +metadata.xml:
+  Added flavours USE setup for kamailio/ser/sip-router options.
+  Also was added metadata file.
+
+  22 Mar 2011; Claudio G. Furrer <elcaio@gmail.com> sip-router-3.1.2.ebuild:
+  Added initial ChangeLog which should be updated whenever the package is
+  updated in any way.
diff --git a/pkg/sip-router/gentoo/Manifest b/pkg/sip-router/gentoo/Manifest
new file mode 100644 (file)
index 0000000..033e40e
--- /dev/null
@@ -0,0 +1,12 @@
+AUX Makefile.defs.diff 280 RMD160 b45541a28f0d7abf816785503733a5856ec99f9d SHA1 c7f5a827705a798dace6b0f2a1d76c6b6b7bb72e SHA256 b8e90c4f7515eff038d08019cd949090f6e960aca32ec35505f44f155bfbedf1
+AUX siprouter.confd 496 RMD160 1bbdc51c80a1622b0d2cf17540c572590d35a0ad SHA1 deadd28c437edd3cd5a2f7c2ad7add39275d5845 SHA256 f01307979d2ef07b53889a6d17a2b65313ff109ac15bcb16446fb08cf390ee4a
+AUX siprouter.init 793 RMD160 6bc17c6d454c0c57a0c8720ac0ec34c3548a2431 SHA1 794dc51028151d2b312c1c9d1c085d68dcbc1b45 SHA256 e4755430ca44e1d7dff7049b130a4a08d99e3149e3842dc4a822795367c5ae88
+DIST kamailio-3.1.2_src.tar.gz 6936249 RMD160 8811bc7b1310e4ca550b40d108002f6a36cd6ab8 SHA1 76b417f9b54575d8ec179558c16953a8e6510809 SHA256 03396f7a202507075d8c81fd1bbc689cedc8bf96941faaa570e007164f2f9550
+DIST kamailio-3.1.3_src.tar.gz 6994333 RMD160 4aac64a217d2344236d5749d103579b0fff1504f SHA1 6675786e3b717f62e4eaa9ff33b4c78ae3a19fdb SHA256 f7e108ac6ee8d8a79cb0b6b37c660597807db2a933991bd982d26405a3ed4f7c
+DIST kamailio-3.1.4_src.tar.gz 6959507 RMD160 d0f8746be3bda86c650486ac3a31186778e79dc4 SHA1 d663936e542969b63671dd514e7b368448fbe404 SHA256 669564fe3be9c8439749f6d435d39b5851c7fff61392924e2e6aeb60a8793956
+EBUILD sip-router-3.1.2.ebuild 6665 RMD160 01c9fcdbb400b606ccc74a179ded35aa6fd0bb39 SHA1 bd1f526fd6bdadce4e2894a7ee24f8e9f16679c6 SHA256 7d69ce200547be20b0ca1a5010352995036c2461d921a94aa44964a37a3921e0
+EBUILD sip-router-3.1.3.ebuild 6665 RMD160 01c9fcdbb400b606ccc74a179ded35aa6fd0bb39 SHA1 bd1f526fd6bdadce4e2894a7ee24f8e9f16679c6 SHA256 7d69ce200547be20b0ca1a5010352995036c2461d921a94aa44964a37a3921e0
+EBUILD sip-router-3.1.4-r1.ebuild 8118 RMD160 2f4c70fbfb12d19364d5abf66704f3425ee204a8 SHA1 e7b5b02f840fc1b06b49bf6b3e59a0531344d6be SHA256 ca8e4128372eccc7f1dd92a969bb02aab840864bb48c81d40e34879eb4a4fc9b
+EBUILD sip-router-3.1.4.ebuild 7154 RMD160 eb3c99cab58cc54205d93cb094e33898c91aad0d SHA1 3be71ff8e560dfe7f70e938450435afec22c9fe2 SHA256 3449403c22c5b07ddd59e789601ddad57e8252c0e28d14e23c36c6e5b6780ad6
+MISC ChangeLog 954 RMD160 65b97f4702b4445d911a397a202baa0854dafb01 SHA1 7cc7a5d25b403e395162ddc76ec65354c23eee04 SHA256 dc2da375970f6312f490d3b9c4701508fb599c562f11baa7a7ecac3797df3c35
+MISC metadata.xml 234 RMD160 7e65eb5a9a08368288fc1e3608ddb9a4677defdd SHA1 93c38407f533f522647683eb7b7c2121bc6f3707 SHA256 4009ad9d312db0ece6fd53e9dfabda98e2c1037ec540eb64d6ab43fe318c1a25
diff --git a/pkg/sip-router/gentoo/files/Makefile.defs.diff b/pkg/sip-router/gentoo/files/Makefile.defs.diff
new file mode 100644 (file)
index 0000000..3c2d430
--- /dev/null
@@ -0,0 +1,11 @@
+--- Makefile.defs~     2011-03-22 14:57:24.759454311 -0300
++++ Makefile.defs      2011-03-23 10:06:57.997000132 -0300
+@@ -133,7 +133,7 @@
+ ifeq ($(FLAVOUR),sip-router)
+ # main binary name
+-MAIN_NAME=ser
++MAIN_NAME=siprouter
+ else ifeq ($(FLAVOUR),ser)
+ # main binary name
+ MAIN_NAME=ser
diff --git a/pkg/sip-router/gentoo/files/siprouter.confd b/pkg/sip-router/gentoo/files/siprouter.confd
new file mode 100644 (file)
index 0000000..38eaa19
--- /dev/null
@@ -0,0 +1,15 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+# Additional options to start Sip-Router with.
+#
+# see "siprouter -h" for a list of options
+#
+# default: run SER as user:group = siprouter:siprouter
+#
+SR_USER="siprouter"
+SR_GROUP="siprouter"
+CONFIGFILE="${CONFIGFILE:-/etc/siprouter/siprouter.cfg}"
+CONFIGDEFS="" # eg: "-A WITH_DEBUG -A WITH_NAT -A WITH_TLS"
+SR_OPTS="-u $SR_USER -g $SR_GROUP -f ${CONFIGFILE} ${CONFIGDEFS}"
diff --git a/pkg/sip-router/gentoo/files/siprouter.init b/pkg/sip-router/gentoo/files/siprouter.init
new file mode 100755 (executable)
index 0000000..66e8315
--- /dev/null
@@ -0,0 +1,34 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+depend() {
+       need net
+}
+
+check_config() {
+       out=`(/usr/sbin/siprouter -f ${CONFIGFILE} -c > /dev/null || true) 2>&1`
+       echo "$out" | grep -q 'config file ok, exiting...'
+       if [ "$?" == 1 ]; then
+               echo -e "There are errors in the configuration. Please fix them first"
+               echo -e "\n$out\n"
+               return 1
+       fi
+}
+
+start() {
+       check_config || return 1
+       ebegin "Starting siprouter"
+       start-stop-daemon --start --quiet --pidfile /var/run/siprouter.pid \
+               --exec /usr/sbin/siprouter -- -P /var/run/siprouter.pid \
+                ${SR_OPTS}
+       eend $?
+}
+
+stop() {
+       ebegin "Stopping siprouter"
+       start-stop-daemon --stop --quiet --pidfile /var/run/siprouter.pid
+       eend $?
+}
+
diff --git a/pkg/sip-router/gentoo/metadata.xml b/pkg/sip-router/gentoo/metadata.xml
new file mode 100644 (file)
index 0000000..d48077a
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+       <herd>voip</herd>
+       <maintainer>
+               <email>maintainer-needed@gentoo.org</email>
+       </maintainer>
+</pkgmetadata>
+
diff --git a/pkg/sip-router/gentoo/sip-router-3.1.2.ebuild b/pkg/sip-router/gentoo/sip-router-3.1.2.ebuild
new file mode 100644 (file)
index 0000000..fd1fcc6
--- /dev/null
@@ -0,0 +1,227 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit eutils flag-o-matic toolchain-funcs multilib
+
+DESCRIPTION="Sip-Router (Kamailio/SER) is an Open Source SIP Server"
+HOMEPAGE="http://sip-router.org/"
+MY_P="${P/sip-router/kamailio}"
+MY_PN="${PN/-/}"
+SRC_URI="http://www.kamailio.org/pub/kamailio/${PV}/src/${MY_P}_src.tar.gz"
+S=${WORKDIR}/${MY_P}
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+
+#Documentation can be found here: http://www.kamailio.org/docs/modules/3.1.x/
+IUSE="flavour_kamailio flavour_ser debug ipv6 sctp
+group_standard group_standard_dep group_mysql group_radius group_postgres group_presence group_stable group_experimental
+acc acc_radius alias_db app_lua app_python auth auth_identity auth_db auth_diameter auth_radius avpops
+benchmark blst
+call_control carrierroute cfg_db cfg_rpc cfgutils counters cpl-c ctl
+db_berkeley db_flatstore db_mysql db_oracle db_postgres db_text db_unixodbc
+debugger dialog dialplan dispatcher diversion domain domainpolicy drouting
+enum exec
+geoip group
+h350 htable imc iptrtpproxy jabber kex
+lcr ldap
+matrix maxfwd mediaproxy memcached misc_radius mi_datagram mi_fifo mi_rpc mi_xmlrpc mqueue msilo mtree
+nathelper nat_traversal
+osp
+path pdb pdt peering perl perlvdb permissions pike pipelimit prefix_route
+presence presence_conference presence_dialoginfo presence_mwi presence_xml
+pua pua_bla pua_dialoginfo pua_mi pua_usrloc pua_xmpp purple pv
+qos
+ratelimit regex registrar rls rtimer rr rtpproxy
+sanity seas siptrace siputils sl sms snmpstats speeddial sqlops statistics sst
+textops textopsx tls tm tmx topoh
+uac uac_redirect uri_db userblacklist usrloc utils
+xcap_client xcap_server xhttp xlog xmlops xmlrpc xmpp"
+
+#osp? ( net-libs/osptoolkit )
+#pdb? ( pdb-server )
+#seas? ( www.wesip.eu )
+
+RDEPEND="
+       >=sys-libs/ncurses-5.7
+       >=sys-libs/readline-6.1_p2
+       group_mysql? ( >=dev-db/mysql-5.1.50 sys-libs/zlib )
+       group_radius? ( >=net-dialup/radiusclient-ng-0.5.0 )
+       group_presence? ( dev-libs/libxml2 net-misc/curl )
+       group_postgres? ( dev-db/postgresql-base )
+       group_standard? ( dev-libs/libxml2 dev-libs/openssl net-misc/curl )
+       acc_radius? ( net-dialup/radiusclient-ng )
+       app_lua? ( dev-lang/lua )
+       app_python? ( dev-lang/python )
+       auth_identity? ( dev-libs/openssl net-misc/curl )
+       carrierroute? ( dev-libs/confuse )
+       cpl-c? ( dev-libs/libxml2 )
+       db_berkeley? ( >=sys-libs/db-4.6 )
+       db_mysql? ( >=dev-db/mysql-5.1.50 )
+       db_oracle? ( dev-db/oracle-instantclient-basic )
+       db_postgres? ( dev-db/postgresql-base )
+        db_unixodbc? ( dev-db/unixODBC )
+       dialplan? ( dev-libs/libpcre )
+       geoip? ( dev-libs/geoip )
+       h350? ( net-nds/openldap )
+       jabber? ( dev-libs/expat )
+       lcr? ( dev-libs/libpcre )
+       ldap? ( net-nds/openldap )
+       memcached? ( dev-libs/libmemcache net-misc/memcached )
+       mi_xmlrpc? ( dev-libs/libxml2 dev-libs/xmlrpc-c )
+       peering? ( net-dialup/radiusclient-ng )
+       perl? ( dev-lang/perl dev-perl/perl-ldap )
+       presence? ( dev-libs/libxml2 )
+       presence_conference? ( dev-libs/libxml2 )
+       presence_xml? ( dev-libs/libxml2 )
+       pua? ( dev-libs/libxml2 )
+       pua_bla? ( dev-libs/libxml2 )
+       pua_dialoginfo? ( dev-libs/libxml2 )
+       pua_usrloc? ( dev-libs/libxml2 )
+       pua_xmpp? ( dev-libs/libxml2 )
+       purple? ( net-im/pidgin )
+       regex? ( dev-libs/libpcre )
+       rls? ( dev-libs/libxml2 )
+       snmpstats? ( net-analyzer/net-snmp sys-apps/lm_sensors )
+       tls? (
+               sys-libs/zlib
+               >=dev-libs/openssl-1.0.0a-r1
+       )
+       utils? ( net-misc/curl )
+       xcap_client? ( dev-libs/libxml2 net-misc/curl )
+       xcap_server? ( dev-libs/libxml2 )
+       xmlops? ( dev-libs/libxml2 )
+       xmpp? ( dev-libs/expat )
+"
+DEPEND="${RDEPEND}
+       >=sys-devel/bison-1.35
+       >=sys-devel/flex-2.5.4a
+       app-text/docbook2X"
+
+src_unpack() {
+       unpack ${A}
+       cd "${S}"
+
+       use ipv6 || \
+               sed -i -e "s/-DUSE_IPV6//g" Makefile.defs || die
+
+       # Patch for sip-router flavour binaries names
+       epatch "${FILESDIR}/Makefile.defs.diff"
+}
+
+src_compile() {
+       #iptrtpproxy broken as the needed netfilter module is not supported
+       #local mod_exc="iptrtpproxy"
+       local mod_exc=""
+       local group_inc=""
+       use group_standard && group_inc="${group_inc} standard"
+       use group_standard_dep && group_inc="${group_inc} standard_dep"
+       use group_mysql && group_inc="${group_inc} mysql"
+       use group_radius && group_inc="${group_inc} radius"
+       use group_postgres && group_inc="${group_inc} postgres"
+       use group_presence && group_inc="${group_inc} presence"
+       use group_stable && group_inc="${group_inc} stable"
+       use group_experimental && group_inc="${group_inc} experimental"
+       # TODO: skip_modules?
+
+       local mod_inc=""
+       for i in ${IUSE[@]}; do
+               for j in ${i[@]}; do
+                       use "${i}" && mod_inc="${mod_inc} ${i}"
+               done
+       done
+
+       if use tls; then
+               tls_hooks=1
+       else
+               tls_hooks=0
+       fi
+
+       if use debug; then
+               mode=debug
+       else
+               mode=release
+       fi
+
+       if use flavour_kamailio; then
+               flavour=kamailio
+       elif use flavour_ser; then
+               flavour=ser # SER compatibility names
+       else
+               flavour=sip-router # defaults: Siprouter compatibility names
+       fi
+
+       if use sctp; then
+               sctp=1
+       else
+               sctp=0
+       fi
+
+       emake \
+               CC="$(tc-getCC)" \
+               CPU_TYPE="$(get-flag march)" \
+               SCTP="${sctp}" \
+               CC_EXTRA_OPTS=-I/usr/gnu/include \
+               mode="${mode}" \
+               TLS_HOOKS="${tls_hooks}" \
+               FLAVOUR="${flavour}" \
+               group_include="${group_inc}" \
+               include_modules="${mod_inc}" \
+               exclude_modules="${mod_exc}" \
+               prefix="/" \
+               all || die "emake all failed"
+}
+
+src_install() {
+       emake -j1 \
+               BASEDIR="${D}" \
+               FLAVOUR="${flavour}" \
+               prefix="/" \
+               bin_dir=/usr/sbin/ \
+               cfg_dir=/etc/${MY_PN}/ \
+               lib_dir=/usr/$(get_libdir)/${MY_PN}/ \
+               modules_dir="/usr/$(get_libdir)/${MY_PN}/" \
+               man_dir="/usr/share/man/" \
+               doc_dir="/usr/share/doc/${P}/" \
+               install || die "emake install failed"
+
+       newinitd "${FILESDIR}/${MY_PN}".init "${MY_PN}"
+       newconfd "${FILESDIR}/${MY_PN}".confd "${MY_PN}"
+}
+
+pkg_preinst() {
+       if [[ -z "$(egetent passwd ${MY_PN})" ]]; then
+               einfo "Adding ${MY_PN} user and group"
+               enewgroup "${MY_PN}"
+               enewuser  "${MY_PN}" -1 -1 /dev/null "${MY_PN}"
+       fi
+
+       chown -R root:"${MY_PN}"  "${D}/etc/${MY_PN}"
+       chmod -R u=rwX,g=rX,o= "${D}/etc/${MY_PN}"
+
+       has_version "${CATEGORY}/ser"
+       previous_installed_version=$?
+}
+
+pkg_postinst() {
+       if [[ $previous_installed_version = 1 ]] ; then
+               einfo "You have a previous version of SER on ${ROOT}etc/ser"
+               einfo "Consider or verify to remove it"
+               einfo
+               einfo "Now you've installed Sip-Router ON ${ROOT}etc/${MY_PN}"
+       fi
+       if [ use mediaproxy ]; then
+               echo "You have enabled mediaproxy support. In order to use it, you have
+               to run it somewhere."
+       fi
+       if [ use rtpproxy ]; then
+               "You have enabled rtpproxy support. In order to use it, you have to run
+               it somewhere."
+       fi
+}
+
+pkg_prerm () {
+       /etc/init.d/"${MY_PN}" stop >/dev/null
+}
diff --git a/pkg/sip-router/gentoo/sip-router-3.1.3.ebuild b/pkg/sip-router/gentoo/sip-router-3.1.3.ebuild
new file mode 100644 (file)
index 0000000..fd1fcc6
--- /dev/null
@@ -0,0 +1,227 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit eutils flag-o-matic toolchain-funcs multilib
+
+DESCRIPTION="Sip-Router (Kamailio/SER) is an Open Source SIP Server"
+HOMEPAGE="http://sip-router.org/"
+MY_P="${P/sip-router/kamailio}"
+MY_PN="${PN/-/}"
+SRC_URI="http://www.kamailio.org/pub/kamailio/${PV}/src/${MY_P}_src.tar.gz"
+S=${WORKDIR}/${MY_P}
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+
+#Documentation can be found here: http://www.kamailio.org/docs/modules/3.1.x/
+IUSE="flavour_kamailio flavour_ser debug ipv6 sctp
+group_standard group_standard_dep group_mysql group_radius group_postgres group_presence group_stable group_experimental
+acc acc_radius alias_db app_lua app_python auth auth_identity auth_db auth_diameter auth_radius avpops
+benchmark blst
+call_control carrierroute cfg_db cfg_rpc cfgutils counters cpl-c ctl
+db_berkeley db_flatstore db_mysql db_oracle db_postgres db_text db_unixodbc
+debugger dialog dialplan dispatcher diversion domain domainpolicy drouting
+enum exec
+geoip group
+h350 htable imc iptrtpproxy jabber kex
+lcr ldap
+matrix maxfwd mediaproxy memcached misc_radius mi_datagram mi_fifo mi_rpc mi_xmlrpc mqueue msilo mtree
+nathelper nat_traversal
+osp
+path pdb pdt peering perl perlvdb permissions pike pipelimit prefix_route
+presence presence_conference presence_dialoginfo presence_mwi presence_xml
+pua pua_bla pua_dialoginfo pua_mi pua_usrloc pua_xmpp purple pv
+qos
+ratelimit regex registrar rls rtimer rr rtpproxy
+sanity seas siptrace siputils sl sms snmpstats speeddial sqlops statistics sst
+textops textopsx tls tm tmx topoh
+uac uac_redirect uri_db userblacklist usrloc utils
+xcap_client xcap_server xhttp xlog xmlops xmlrpc xmpp"
+
+#osp? ( net-libs/osptoolkit )
+#pdb? ( pdb-server )
+#seas? ( www.wesip.eu )
+
+RDEPEND="
+       >=sys-libs/ncurses-5.7
+       >=sys-libs/readline-6.1_p2
+       group_mysql? ( >=dev-db/mysql-5.1.50 sys-libs/zlib )
+       group_radius? ( >=net-dialup/radiusclient-ng-0.5.0 )
+       group_presence? ( dev-libs/libxml2 net-misc/curl )
+       group_postgres? ( dev-db/postgresql-base )
+       group_standard? ( dev-libs/libxml2 dev-libs/openssl net-misc/curl )
+       acc_radius? ( net-dialup/radiusclient-ng )
+       app_lua? ( dev-lang/lua )
+       app_python? ( dev-lang/python )
+       auth_identity? ( dev-libs/openssl net-misc/curl )
+       carrierroute? ( dev-libs/confuse )
+       cpl-c? ( dev-libs/libxml2 )
+       db_berkeley? ( >=sys-libs/db-4.6 )
+       db_mysql? ( >=dev-db/mysql-5.1.50 )
+       db_oracle? ( dev-db/oracle-instantclient-basic )
+       db_postgres? ( dev-db/postgresql-base )
+        db_unixodbc? ( dev-db/unixODBC )
+       dialplan? ( dev-libs/libpcre )
+       geoip? ( dev-libs/geoip )
+       h350? ( net-nds/openldap )
+       jabber? ( dev-libs/expat )
+       lcr? ( dev-libs/libpcre )
+       ldap? ( net-nds/openldap )
+       memcached? ( dev-libs/libmemcache net-misc/memcached )
+       mi_xmlrpc? ( dev-libs/libxml2 dev-libs/xmlrpc-c )
+       peering? ( net-dialup/radiusclient-ng )
+       perl? ( dev-lang/perl dev-perl/perl-ldap )
+       presence? ( dev-libs/libxml2 )
+       presence_conference? ( dev-libs/libxml2 )
+       presence_xml? ( dev-libs/libxml2 )
+       pua? ( dev-libs/libxml2 )
+       pua_bla? ( dev-libs/libxml2 )
+       pua_dialoginfo? ( dev-libs/libxml2 )
+       pua_usrloc? ( dev-libs/libxml2 )
+       pua_xmpp? ( dev-libs/libxml2 )
+       purple? ( net-im/pidgin )
+       regex? ( dev-libs/libpcre )
+       rls? ( dev-libs/libxml2 )
+       snmpstats? ( net-analyzer/net-snmp sys-apps/lm_sensors )
+       tls? (
+               sys-libs/zlib
+               >=dev-libs/openssl-1.0.0a-r1
+       )
+       utils? ( net-misc/curl )
+       xcap_client? ( dev-libs/libxml2 net-misc/curl )
+       xcap_server? ( dev-libs/libxml2 )
+       xmlops? ( dev-libs/libxml2 )
+       xmpp? ( dev-libs/expat )
+"
+DEPEND="${RDEPEND}
+       >=sys-devel/bison-1.35
+       >=sys-devel/flex-2.5.4a
+       app-text/docbook2X"
+
+src_unpack() {
+       unpack ${A}
+       cd "${S}"
+
+       use ipv6 || \
+               sed -i -e "s/-DUSE_IPV6//g" Makefile.defs || die
+
+       # Patch for sip-router flavour binaries names
+       epatch "${FILESDIR}/Makefile.defs.diff"
+}
+
+src_compile() {
+       #iptrtpproxy broken as the needed netfilter module is not supported
+       #local mod_exc="iptrtpproxy"
+       local mod_exc=""
+       local group_inc=""
+       use group_standard && group_inc="${group_inc} standard"
+       use group_standard_dep && group_inc="${group_inc} standard_dep"
+       use group_mysql && group_inc="${group_inc} mysql"
+       use group_radius && group_inc="${group_inc} radius"
+       use group_postgres && group_inc="${group_inc} postgres"
+       use group_presence && group_inc="${group_inc} presence"
+       use group_stable && group_inc="${group_inc} stable"
+       use group_experimental && group_inc="${group_inc} experimental"
+       # TODO: skip_modules?
+
+       local mod_inc=""
+       for i in ${IUSE[@]}; do
+               for j in ${i[@]}; do
+                       use "${i}" && mod_inc="${mod_inc} ${i}"
+               done
+       done
+
+       if use tls; then
+               tls_hooks=1
+       else
+               tls_hooks=0
+       fi
+
+       if use debug; then
+               mode=debug
+       else
+               mode=release
+       fi
+
+       if use flavour_kamailio; then
+               flavour=kamailio
+       elif use flavour_ser; then
+               flavour=ser # SER compatibility names
+       else
+               flavour=sip-router # defaults: Siprouter compatibility names
+       fi
+
+       if use sctp; then
+               sctp=1
+       else
+               sctp=0
+       fi
+
+       emake \
+               CC="$(tc-getCC)" \
+               CPU_TYPE="$(get-flag march)" \
+               SCTP="${sctp}" \
+               CC_EXTRA_OPTS=-I/usr/gnu/include \
+               mode="${mode}" \
+               TLS_HOOKS="${tls_hooks}" \
+               FLAVOUR="${flavour}" \
+               group_include="${group_inc}" \
+               include_modules="${mod_inc}" \
+               exclude_modules="${mod_exc}" \
+               prefix="/" \
+               all || die "emake all failed"
+}
+
+src_install() {
+       emake -j1 \
+               BASEDIR="${D}" \
+               FLAVOUR="${flavour}" \
+               prefix="/" \
+               bin_dir=/usr/sbin/ \
+               cfg_dir=/etc/${MY_PN}/ \
+               lib_dir=/usr/$(get_libdir)/${MY_PN}/ \
+               modules_dir="/usr/$(get_libdir)/${MY_PN}/" \
+               man_dir="/usr/share/man/" \
+               doc_dir="/usr/share/doc/${P}/" \
+               install || die "emake install failed"
+
+       newinitd "${FILESDIR}/${MY_PN}".init "${MY_PN}"
+       newconfd "${FILESDIR}/${MY_PN}".confd "${MY_PN}"
+}
+
+pkg_preinst() {
+       if [[ -z "$(egetent passwd ${MY_PN})" ]]; then
+               einfo "Adding ${MY_PN} user and group"
+               enewgroup "${MY_PN}"
+               enewuser  "${MY_PN}" -1 -1 /dev/null "${MY_PN}"
+       fi
+
+       chown -R root:"${MY_PN}"  "${D}/etc/${MY_PN}"
+       chmod -R u=rwX,g=rX,o= "${D}/etc/${MY_PN}"
+
+       has_version "${CATEGORY}/ser"
+       previous_installed_version=$?
+}
+
+pkg_postinst() {
+       if [[ $previous_installed_version = 1 ]] ; then
+               einfo "You have a previous version of SER on ${ROOT}etc/ser"
+               einfo "Consider or verify to remove it"
+               einfo
+               einfo "Now you've installed Sip-Router ON ${ROOT}etc/${MY_PN}"
+       fi
+       if [ use mediaproxy ]; then
+               echo "You have enabled mediaproxy support. In order to use it, you have
+               to run it somewhere."
+       fi
+       if [ use rtpproxy ]; then
+               "You have enabled rtpproxy support. In order to use it, you have to run
+               it somewhere."
+       fi
+}
+
+pkg_prerm () {
+       /etc/init.d/"${MY_PN}" stop >/dev/null
+}
diff --git a/pkg/sip-router/gentoo/sip-router-3.1.4-r1.ebuild b/pkg/sip-router/gentoo/sip-router-3.1.4-r1.ebuild
new file mode 100644 (file)
index 0000000..1d8fb85
--- /dev/null
@@ -0,0 +1,257 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit eutils flag-o-matic toolchain-funcs multilib
+
+DESCRIPTION="Sip-Router (Kamailio/SER) is an Open Source SIP Server"
+HOMEPAGE="http://sip-router.org/"
+MY_P="${P/sip-router/kamailio}"
+MY_PN="${PN/-/}"
+SRC_URI="http://www.kamailio.org/pub/kamailio/${PV}/src/${MY_P}_src.tar.gz"
+S=${WORKDIR}/${MY_P}
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+
+#Documentation can be found here: http://www.kamailio.org/docs/modules/3.1.x/
+IUSE="flavour_kamailio flavour_ser debug ipv6 sctp
+group_standard group_standard_dep group_mysql group_radius group_postgres group_presence group_stable group_experimental
+group_kstandard group_kmysql group_kradius group_kpostgres group_kpresence group_kxml group_kperl group_kldap
+acc acc_radius alias_db app_lua app_python auth auth_identity auth_db auth_diameter auth_radius avpops
+benchmark blst
+call_control carrierroute cfg_db cfg_rpc cfgutils counters cpl-c ctl
+db_berkeley db_flatstore db_mysql db_oracle db_postgres db_text db_unixodbc
+debugger dialog dialplan dispatcher diversion domain domainpolicy drouting
+enum exec
+geoip group
+h350 htable imc iptrtpproxy jabber kex
+lcr ldap
+matrix maxfwd mediaproxy memcached misc_radius mi_datagram mi_fifo mi_rpc mi_xmlrpc mqueue msilo mtree
+nathelper nat_traversal
+osp
+path pdb pdt peering perl perlvdb permissions pike pipelimit prefix_route
+presence presence_conference presence_dialoginfo presence_mwi presence_xml
+pua pua_bla pua_dialoginfo pua_mi pua_usrloc pua_xmpp purple pv
+qos
+ratelimit regex registrar rls rtimer rr rtpproxy
+sanity seas siptrace siputils sl sms snmpstats speeddial sqlops statistics sst
+textops textopsx tls tm tmx topoh
+uac uac_redirect uri_db userblacklist usrloc utils
+xcap_client xcap_server xhttp xlog xmlops xmlrpc xmpp"
+
+#osp? ( net-libs/osptoolkit )
+#pdb? ( pdb-server )
+#seas? ( www.wesip.eu )
+
+RDEPEND="
+       >=sys-libs/ncurses-5.7
+       >=sys-libs/readline-6.1_p2
+       group_mysql? ( >=dev-db/mysql-5.1.50 sys-libs/zlib )
+       group_radius? ( >=net-dialup/radiusclient-ng-0.5.0 )
+       group_presence? ( dev-libs/libxml2 net-misc/curl )
+       group_postgres? ( dev-db/postgresql-base )
+       group_standard? ( dev-libs/libxml2 dev-libs/openssl net-misc/curl )
+       group_kmysql? ( >=dev-db/mysql-5.1.50 sys-libs/zlib )
+       group_kradius? ( >=net-dialup/radiusclient-ng-0.5.0 )
+       group_kpresence? ( dev-libs/libxml2 net-misc/curl )
+       group_kpostgres? ( dev-db/postgresql-base )
+       group_kstandard? ( dev-libs/libxml2 dev-libs/openssl net-misc/curl )
+       group_kxml? ( dev-libs/libxml2 dev-libs/xmlrpc-c )
+       group_kperl? ( dev-lang/perl dev-perl/perl-ldap )
+       group_kldap? ( net-nds/openldap )
+       acc_radius? ( net-dialup/radiusclient-ng )
+       app_lua? ( dev-lang/lua )
+       app_python? ( dev-lang/python )
+       auth_identity? ( dev-libs/openssl net-misc/curl )
+       carrierroute? ( dev-libs/confuse )
+       cpl-c? ( dev-libs/libxml2 )
+       db_berkeley? ( >=sys-libs/db-4.6 )
+       db_mysql? ( >=dev-db/mysql-5.1.50 )
+       db_oracle? ( dev-db/oracle-instantclient-basic )
+       db_postgres? ( dev-db/postgresql-base )
+        db_unixodbc? ( dev-db/unixODBC )
+       dialplan? ( dev-libs/libpcre )
+       geoip? ( dev-libs/geoip )
+       h350? ( net-nds/openldap )
+       jabber? ( dev-libs/expat )
+       lcr? ( dev-libs/libpcre )
+       ldap? ( net-nds/openldap )
+       memcached? ( dev-libs/libmemcache net-misc/memcached )
+       mi_xmlrpc? ( dev-libs/libxml2 dev-libs/xmlrpc-c )
+       peering? ( net-dialup/radiusclient-ng )
+       perl? ( dev-lang/perl dev-perl/perl-ldap )
+       presence? ( dev-libs/libxml2 )
+       presence_conference? ( dev-libs/libxml2 )
+       presence_xml? ( dev-libs/libxml2 )
+       pua? ( dev-libs/libxml2 )
+       pua_bla? ( dev-libs/libxml2 )
+       pua_dialoginfo? ( dev-libs/libxml2 )
+       pua_usrloc? ( dev-libs/libxml2 )
+       pua_xmpp? ( dev-libs/libxml2 )
+       purple? ( net-im/pidgin )
+       regex? ( dev-libs/libpcre )
+       rls? ( dev-libs/libxml2 )
+       snmpstats? ( net-analyzer/net-snmp sys-apps/lm_sensors )
+       tls? (
+               sys-libs/zlib
+               >=dev-libs/openssl-1.0.0a-r1
+       )
+       utils? ( net-misc/curl )
+       xcap_client? ( dev-libs/libxml2 net-misc/curl )
+       xcap_server? ( dev-libs/libxml2 )
+       xmlops? ( dev-libs/libxml2 )
+       xmpp? ( dev-libs/expat )
+"
+DEPEND="${RDEPEND}
+       >=sys-devel/bison-1.35
+       >=sys-devel/flex-2.5.4a
+       app-text/docbook2X"
+
+src_unpack() {
+       unpack ${A}
+       cd "${S}"
+
+       use ipv6 || \
+               sed -i -e "s/-DUSE_IPV6//g" Makefile.defs || die
+
+       # Patch for sip-router flavour binaries names
+       epatch "${FILESDIR}/Makefile.defs.diff"
+}
+
+src_compile() {
+       # iptrtpproxy broken as the needed netfilter module is not supported
+       local mod_exc="iptrtpproxy"
+       local group_inc=""
+       local k=""
+       if use flavour_kamailio; then
+               k="k"
+               use group_kxml && group_inc="${group_inc} kxml"
+               use group_kperl && group_inc="${group_inc} kperl"
+               use group_kldap && group_inc="${group_inc} kldap"
+       fi
+       # you can USE flavour=kamailio but also group_standard. It will be converted to group_kstandard
+       # same as mysql/kmysql, postgres/kpostgres, radius/kradius, presence/kpresence
+       (use group_standard || use group_kstandard) && group_inc="${group_inc} ${k}standard"
+       use group_standard_dep && group_inc="${group_inc} standard_dep"
+       (use group_mysql || use group_kmysql) && group_inc="${group_inc} ${k}mysql"
+       (use group_radius || use group_kradius) && group_inc="${group_inc} ${k}radius"
+       (use group_postgres || use group_kpostgres) && group_inc="${group_inc} ${k}postgres"
+       (use group_presence || use group_kpresence) && group_inc="${group_inc} ${k}presence"
+       use group_stable && group_inc="${group_inc} stable"
+       use group_experimental && group_inc="${group_inc} experimental"
+       # TODO: skip_modules?
+
+       local mod_inc=""
+       # FIXME: some IUSE flags must not be included here in mod_inc
+       # e.g.: flavour_kamailio, flavour_ser, debug, sctp, ipv6
+       for i in ${IUSE[@]}; do
+               for j in ${i[@]}; do
+                       [[ ! "${i}" =~ "flavour_" ]] && \
+                               [ ! "${i}" == "debug" ] && \
+                               [ ! "${i}" == "ipv6" ] && \
+                               [ ! "${i}" == "sctp" ] && \
+                               [[ ! "${i}" =~ "group_" ]] && \
+                       use "${i}" && mod_inc="${mod_inc} ${i}"
+               done
+       done
+
+       if use tls; then
+               tls_hooks=1
+       else
+               tls_hooks=0
+       fi
+
+       if use debug; then
+               mode=debug
+       else
+               mode=release
+       fi
+
+       if use flavour_kamailio; then
+               flavour=kamailio
+       elif use flavour_ser; then
+               flavour=ser # SER compatibility names
+       else
+               flavour=sip-router # defaults: Siprouter compatibility names
+       fi
+
+       if use sctp; then
+               sctp=1
+       else
+               sctp=0
+       fi
+
+       emake \
+               CC="$(tc-getCC)" \
+               CPU_TYPE="$(get-flag march)" \
+               SCTP="${sctp}" \
+               CC_EXTRA_OPTS=-I/usr/gnu/include \
+               mode="${mode}" \
+               TLS_HOOKS="${tls_hooks}" \
+               FLAVOUR="${flavour}" \
+               group_include="${group_inc}" \
+               include_modules="${mod_inc}" \
+               exclude_modules="${mod_exc}" \
+               prefix="/" \
+               all || die "emake all failed"
+}
+
+src_install() {
+       emake -j1 \
+               BASEDIR="${D}" \
+               FLAVOUR="${flavour}" \
+               prefix="/" \
+               bin_dir=/usr/sbin/ \
+               cfg_dir=/etc/${MY_PN}/ \
+               lib_dir=/usr/$(get_libdir)/${MY_PN}/ \
+               modules_dir="/usr/$(get_libdir)/${MY_PN}/" \
+               man_dir="/usr/share/man/" \
+               doc_dir="/usr/share/doc/${P}/" \
+               install || die "emake install failed"
+
+       [ "${flavour}" == "sip-router" ] || \
+               sed -e "s/siprouter/${flavour}/g" \
+                       ${FILESDIR}/${MY_PN}.init > ${flavour}.init || die
+
+       newinitd "${flavour}".init "${flavour}"
+       newconfd "${FILESDIR}/${MY_PN}".confd "${flavour}"
+
+
+}
+
+pkg_preinst() {
+       if [[ -z "$(egetent passwd ${MY_PN})" ]]; then
+               einfo "Adding ${MY_PN} user and group"
+               enewgroup "${MY_PN}"
+               enewuser  "${MY_PN}" -1 -1 /dev/null "${MY_PN}"
+       fi
+
+       chown -R root:"${MY_PN}"  "${D}/etc/${MY_PN}"
+       chmod -R u=rwX,g=rX,o= "${D}/etc/${MY_PN}"
+
+       has_version "${CATEGORY}/ser"
+       previous_installed_version=$?
+}
+
+pkg_postinst() {
+       if [[ $previous_installed_version = 1 ]] ; then
+               einfo "You have a previous version of SER on ${ROOT}etc/ser"
+               einfo "Consider or verify to remove it"
+               einfo
+               einfo "Now you've installed Sip-Router ON ${ROOT}etc/${MY_PN}"
+       fi
+       if [ use mediaproxy ]; then
+               echo "You have enabled mediaproxy support. In order to use it, you have
+               to run it somewhere."
+       fi
+       if [ use rtpproxy ]; then
+               "You have enabled rtpproxy support. In order to use it, you have to run
+               it somewhere."
+       fi
+}
+
+pkg_prerm () {
+       /etc/init.d/"${MY_PN}" stop >/dev/null
+}
diff --git a/pkg/sip-router/gentoo/sip-router-3.1.4.ebuild b/pkg/sip-router/gentoo/sip-router-3.1.4.ebuild
new file mode 100644 (file)
index 0000000..2d5d670
--- /dev/null
@@ -0,0 +1,241 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit eutils flag-o-matic toolchain-funcs multilib
+
+DESCRIPTION="Sip-Router (Kamailio/SER) is an Open Source SIP Server"
+HOMEPAGE="http://sip-router.org/"
+MY_P="${P/sip-router/kamailio}"
+MY_PN="${PN/-/}"
+SRC_URI="http://www.kamailio.org/pub/kamailio/${PV}/src/${MY_P}_src.tar.gz"
+S=${WORKDIR}/${MY_P}
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+
+#Documentation can be found here: http://www.kamailio.org/docs/modules/3.1.x/
+IUSE="flavour_kamailio flavour_ser debug ipv6 sctp
+group_standard group_standard_dep group_mysql group_radius group_postgres group_presence group_stable group_experimental
+acc acc_radius alias_db app_lua app_python auth auth_identity auth_db auth_diameter auth_radius avpops
+benchmark blst
+call_control carrierroute cfg_db cfg_rpc cfgutils counters cpl-c ctl
+db_berkeley db_flatstore db_mysql db_oracle db_postgres db_text db_unixodbc
+debugger dialog dialplan dispatcher diversion domain domainpolicy drouting
+enum exec
+geoip group
+h350 htable imc iptrtpproxy jabber kex
+lcr ldap
+matrix maxfwd mediaproxy memcached misc_radius mi_datagram mi_fifo mi_rpc mi_xmlrpc mqueue msilo mtree
+nathelper nat_traversal
+osp
+path pdb pdt peering perl perlvdb permissions pike pipelimit prefix_route
+presence presence_conference presence_dialoginfo presence_mwi presence_xml
+pua pua_bla pua_dialoginfo pua_mi pua_usrloc pua_xmpp purple pv
+qos
+ratelimit regex registrar rls rtimer rr rtpproxy
+sanity seas siptrace siputils sl sms snmpstats speeddial sqlops statistics sst
+textops textopsx tls tm tmx topoh
+uac uac_redirect uri_db userblacklist usrloc utils
+xcap_client xcap_server xhttp xlog xmlops xmlrpc xmpp"
+
+#osp? ( net-libs/osptoolkit )
+#pdb? ( pdb-server )
+#seas? ( www.wesip.eu )
+
+RDEPEND="
+       >=sys-libs/ncurses-5.7
+       >=sys-libs/readline-6.1_p2
+       group_mysql? ( >=dev-db/mysql-5.1.50 sys-libs/zlib )
+       group_radius? ( >=net-dialup/radiusclient-ng-0.5.0 )
+       group_presence? ( dev-libs/libxml2 net-misc/curl )
+       group_postgres? ( dev-db/postgresql-base )
+       group_standard? ( dev-libs/libxml2 dev-libs/openssl net-misc/curl )
+       acc_radius? ( net-dialup/radiusclient-ng )
+       app_lua? ( dev-lang/lua )
+       app_python? ( dev-lang/python )
+       auth_identity? ( dev-libs/openssl net-misc/curl )
+       carrierroute? ( dev-libs/confuse )
+       cpl-c? ( dev-libs/libxml2 )
+       db_berkeley? ( >=sys-libs/db-4.6 )
+       db_mysql? ( >=dev-db/mysql-5.1.50 )
+       db_oracle? ( dev-db/oracle-instantclient-basic )
+       db_postgres? ( dev-db/postgresql-base )
+        db_unixodbc? ( dev-db/unixODBC )
+       dialplan? ( dev-libs/libpcre )
+       geoip? ( dev-libs/geoip )
+       h350? ( net-nds/openldap )
+       jabber? ( dev-libs/expat )
+       lcr? ( dev-libs/libpcre )
+       ldap? ( net-nds/openldap )
+       memcached? ( dev-libs/libmemcache net-misc/memcached )
+       mi_xmlrpc? ( dev-libs/libxml2 dev-libs/xmlrpc-c )
+       peering? ( net-dialup/radiusclient-ng )
+       perl? ( dev-lang/perl dev-perl/perl-ldap )
+       presence? ( dev-libs/libxml2 )
+       presence_conference? ( dev-libs/libxml2 )
+       presence_xml? ( dev-libs/libxml2 )
+       pua? ( dev-libs/libxml2 )
+       pua_bla? ( dev-libs/libxml2 )
+       pua_dialoginfo? ( dev-libs/libxml2 )
+       pua_usrloc? ( dev-libs/libxml2 )
+       pua_xmpp? ( dev-libs/libxml2 )
+       purple? ( net-im/pidgin )
+       regex? ( dev-libs/libpcre )
+       rls? ( dev-libs/libxml2 )
+       snmpstats? ( net-analyzer/net-snmp sys-apps/lm_sensors )
+       tls? (
+               sys-libs/zlib
+               >=dev-libs/openssl-1.0.0a-r1
+       )
+       utils? ( net-misc/curl )
+       xcap_client? ( dev-libs/libxml2 net-misc/curl )
+       xcap_server? ( dev-libs/libxml2 )
+       xmlops? ( dev-libs/libxml2 )
+       xmpp? ( dev-libs/expat )
+"
+DEPEND="${RDEPEND}
+       >=sys-devel/bison-1.35
+       >=sys-devel/flex-2.5.4a
+       app-text/docbook2X"
+
+src_unpack() {
+       unpack ${A}
+       cd "${S}"
+
+       use ipv6 || \
+               sed -i -e "s/-DUSE_IPV6//g" Makefile.defs || die
+
+       # Patch for sip-router flavour binaries names
+       epatch "${FILESDIR}/Makefile.defs.diff"
+}
+
+src_compile() {
+       #iptrtpproxy broken as the needed netfilter module is not supported
+       #local mod_exc="iptrtpproxy"
+       local mod_exc=""
+       local group_inc=""
+       use group_standard && group_inc="${group_inc} standard"
+       use group_standard_dep && group_inc="${group_inc} standard_dep"
+       use group_mysql && group_inc="${group_inc} mysql"
+       use group_radius && group_inc="${group_inc} radius"
+       use group_postgres && group_inc="${group_inc} postgres"
+       use group_presence && group_inc="${group_inc} presence"
+       use group_stable && group_inc="${group_inc} stable"
+       use group_experimental && group_inc="${group_inc} experimental"
+       # TODO: add kamailio specific groups (kstandard, kradius, kxml, etc)
+       # TODO: skip_modules?
+
+       local mod_inc=""
+       # FIXME: some IUSE flags must not be included here in mod_inc
+       # e.g.: flavour_kamailio, flavour_ser, debug, sctp, ipv6
+       for i in ${IUSE[@]}; do
+               for j in ${i[@]}; do
+                       [[ ! "${i}" =~ "flavour_" ]] && \
+                               [ ! "${i}" == "debug" ] && \
+                               [ ! "${i}" == "ipv6" ] && \
+                               [ ! "${i}" == "sctp" ] && \
+                               [[ ! "${i}" =~ "group_" ]] && \
+                       use "${i}" && mod_inc="${mod_inc} ${i}"
+               done
+       done
+
+       if use tls; then
+               tls_hooks=1
+       else
+               tls_hooks=0
+       fi
+
+       if use debug; then
+               mode=debug
+       else
+               mode=release
+       fi
+
+       if use flavour_kamailio; then
+               flavour=kamailio
+       elif use flavour_ser; then
+               flavour=ser # SER compatibility names
+       else
+               flavour=sip-router # defaults: Siprouter compatibility names
+       fi
+
+       if use sctp; then
+               sctp=1
+       else
+               sctp=0
+       fi
+
+       emake \
+               CC="$(tc-getCC)" \
+               CPU_TYPE="$(get-flag march)" \
+               SCTP="${sctp}" \
+               CC_EXTRA_OPTS=-I/usr/gnu/include \
+               mode="${mode}" \
+               TLS_HOOKS="${tls_hooks}" \
+               FLAVOUR="${flavour}" \
+               group_include="${group_inc}" \
+               include_modules="${mod_inc}" \
+               exclude_modules="${mod_exc}" \
+               prefix="/" \
+               all || die "emake all failed"
+}
+
+src_install() {
+       emake -j1 \
+               BASEDIR="${D}" \
+               FLAVOUR="${flavour}" \
+               prefix="/" \
+               bin_dir=/usr/sbin/ \
+               cfg_dir=/etc/${MY_PN}/ \
+               lib_dir=/usr/$(get_libdir)/${MY_PN}/ \
+               modules_dir="/usr/$(get_libdir)/${MY_PN}/" \
+               man_dir="/usr/share/man/" \
+               doc_dir="/usr/share/doc/${P}/" \
+               install || die "emake install failed"
+
+       [ "${flavour}" == "sip-router" ] || \
+               sed -e "s/siprouter/${flavour}/g" \
+                       ${FILESDIR}/${MY_PN}.init > ${flavour}.init || die
+
+       newinitd "${flavour}".init "${flavour}"
+       newconfd "${FILESDIR}/${MY_PN}".confd "${flavour}"
+
+
+}
+
+pkg_preinst() {
+       if [[ -z "$(egetent passwd ${MY_PN})" ]]; then
+               einfo "Adding ${MY_PN} user and group"
+               enewgroup "${MY_PN}"
+               enewuser  "${MY_PN}" -1 -1 /dev/null "${MY_PN}"
+       fi
+
+       chown -R root:"${MY_PN}"  "${D}/etc/${MY_PN}"
+       chmod -R u=rwX,g=rX,o= "${D}/etc/${MY_PN}"
+
+       has_version "${CATEGORY}/ser"
+       previous_installed_version=$?
+}
+
+pkg_postinst() {
+       if [[ $previous_installed_version = 1 ]] ; then
+               einfo "You have a previous version of SER on ${ROOT}etc/ser"
+               einfo "Consider or verify to remove it"
+               einfo
+               einfo "Now you've installed Sip-Router ON ${ROOT}etc/${MY_PN}"
+       fi
+       if [ use mediaproxy ]; then
+               echo "You have enabled mediaproxy support. In order to use it, you have
+               to run it somewhere."
+       fi
+       if [ use rtpproxy ]; then
+               "You have enabled rtpproxy support. In order to use it, you have to run
+               it somewhere."
+       fi
+}
+
+pkg_prerm () {
+       /etc/init.d/"${MY_PN}" stop >/dev/null
+}