pkg: name fixes and cleanups, Patch from Claudio Furrer, elcaio at gmail dot com
authorHenning Westerholt <henning.westerholt@1und1.de>
Mon, 19 Sep 2011 11:47:22 +0000 (13:47 +0200)
committerHenning Westerholt <henning.westerholt@1und1.de>
Mon, 19 Sep 2011 11:47:22 +0000 (13:47 +0200)
pkg/ser/gentoo/ChangeLog
pkg/ser/gentoo/Manifest
pkg/ser/gentoo/files/ser.confd [moved from pkg/ser/gentoo/files/siprouter.confd with 58% similarity]
pkg/ser/gentoo/files/ser.initd [moved from pkg/ser/gentoo/files/siprouter.init with 58% similarity, mode: 0644]
pkg/ser/gentoo/sip-router-3.1.2.ebuild
pkg/ser/gentoo/sip-router-3.1.3.ebuild
pkg/ser/gentoo/sip-router-3.1.4-r1.ebuild [deleted file]
pkg/ser/gentoo/sip-router-3.1.4.ebuild

index b69a047..cfc9f7e 100644 (file)
@@ -2,13 +2,15 @@
 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
 # $Header: $
 
-*sip-router-3.1.4-r1 (24 Aug 2011)
+*sip-router-3.1.4 (13 Sep 2011)
   
+  13 Sep 2011; Claudio G. Furrer <elcaio@gmail.com> sip-router-3.1.4-r2.ebuild:
+  Fix installation paths and names based on flavour specified in the USE flag
+  (ser or kamailio). Backported also to 3.1.3 and 3.1.2.
+
   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.
 
index 15ed9dd..8763c30 100644 (file)
@@ -1,11 +1,10 @@
-AUX siprouter.confd 496 RMD160 1bbdc51c80a1622b0d2cf17540c572590d35a0ad SHA1 deadd28c437edd3cd5a2f7c2ad7add39275d5845 SHA256 f01307979d2ef07b53889a6d17a2b65313ff109ac15bcb16446fb08cf390ee4a
-AUX siprouter.init 793 RMD160 6bc17c6d454c0c57a0c8720ac0ec34c3548a2431 SHA1 794dc51028151d2b312c1c9d1c085d68dcbc1b45 SHA256 e4755430ca44e1d7dff7049b130a4a08d99e3149e3842dc4a822795367c5ae88
+AUX ser.confd 514 RMD160 3bed2bc682d4c4ac05d52f1d0bc9c76c09983ec8 SHA1 c7d1b38d778d1913f3099511db72479a6cc346f6 SHA256 5f06b166e3ed5a0627e5f5919511ec610b4ac1fa6906b49c52fcabef6a0cfb66
+AUX ser.initd 800 RMD160 7ccea24a25ff0bbbf799f18febe8ec3470850091 SHA1 b79975c2bf5ef43b52195b0a0f967eb968b05148 SHA256 46d9c47ac66d73fddf1cce743a2155b1b332af5b1a5a423fe5b7e86781aa9df0
 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
+EBUILD sip-router-3.1.2.ebuild 8024 RMD160 604e7f73449afcd0659ad0b7628a41f95aca16bf SHA1 012566e917c412e90e2addec3d5f83f895e337c1 SHA256 1adb67682eaa5a9dfee306473023bf7403068199a0e8916db521e230452b1e78
+EBUILD sip-router-3.1.3.ebuild 8024 RMD160 604e7f73449afcd0659ad0b7628a41f95aca16bf SHA1 012566e917c412e90e2addec3d5f83f895e337c1 SHA256 1adb67682eaa5a9dfee306473023bf7403068199a0e8916db521e230452b1e78
+EBUILD sip-router-3.1.4.ebuild 8024 RMD160 604e7f73449afcd0659ad0b7628a41f95aca16bf SHA1 012566e917c412e90e2addec3d5f83f895e337c1 SHA256 1adb67682eaa5a9dfee306473023bf7403068199a0e8916db521e230452b1e78
+MISC ChangeLog 1132 RMD160 0995d9d41b18403b6f8f619c36590b63dc946735 SHA1 b7caa0573ef696d1d821856e0eb28c2c1851ae77 SHA256 d6cf8d917e3e1de5a8edf2f8dbad13f443f86232cd354357b8df389bdd75b128
 MISC metadata.xml 234 RMD160 7e65eb5a9a08368288fc1e3608ddb9a4677defdd SHA1 93c38407f533f522647683eb7b7c2121bc6f3707 SHA256 4009ad9d312db0ece6fd53e9dfabda98e2c1037ec540eb64d6ab43fe318c1a25
similarity index 58%
rename from pkg/ser/gentoo/files/siprouter.confd
rename to pkg/ser/gentoo/files/ser.confd
index 38eaa19..1d76370 100644 (file)
@@ -4,12 +4,13 @@
 
 # Additional options to start Sip-Router with.
 #
-# see "siprouter -h" for a list of options
+# see "sip-router -h" for a list of options
 #
-# default: run SER as user:group = siprouter:siprouter
+# default: run SER as user:group = ser:ser
 #
-SR_USER="siprouter"
-SR_GROUP="siprouter"
-CONFIGFILE="${CONFIGFILE:-/etc/siprouter/siprouter.cfg}"
+MAIN_NAME="sip-router"
+SR_USER="sip-router"
+SR_GROUP="sip-router"
+CONFIGFILE="${CONFIGFILE:-/etc/${MAIN_NAME}/sip-router.cfg}"
 CONFIGDEFS="" # eg: "-A WITH_DEBUG -A WITH_NAT -A WITH_TLS"
 SR_OPTS="-u $SR_USER -g $SR_GROUP -f ${CONFIGFILE} ${CONFIGDEFS}"
old mode 100755 (executable)
new mode 100644 (file)
similarity index 58%
rename from pkg/ser/gentoo/files/siprouter.init
rename to pkg/ser/gentoo/files/ser.initd
index 66e8315..f692395
@@ -8,7 +8,7 @@ depend() {
 }
 
 check_config() {
-       out=`(/usr/sbin/siprouter -f ${CONFIGFILE} -c > /dev/null || true) 2>&1`
+       out=`(/usr/sbin/sip-router -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"
@@ -19,16 +19,16 @@ check_config() {
 
 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 \
+       ebegin "Starting sip-router"
+       start-stop-daemon --start --quiet --pidfile /var/run/sip-router.pid \
+               --exec /usr/sbin/sip-router -- -P /var/run/sip-router.pid \
                 ${SR_OPTS}
        eend $?
 }
 
 stop() {
-       ebegin "Stopping siprouter"
-       start-stop-daemon --stop --quiet --pidfile /var/run/siprouter.pid
+       ebegin "Stopping sip-router"
+       start-stop-daemon --stop --quiet --pidfile /var/run/sip-router.pid
        eend $?
 }
 
index 13bca39..cd0f9a8 100644 (file)
@@ -7,7 +7,6 @@ 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}
 
@@ -18,6 +17,7 @@ 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
@@ -52,6 +52,14 @@ RDEPEND="
        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 )
@@ -109,23 +117,38 @@ src_unpack() {
 }
 
 src_compile() {
-       #iptrtpproxy broken as the needed netfilter module is not supported
-       #local mod_exc="iptrtpproxy"
-       local mod_exc=""
+       # iptrtpproxy broken as the needed netfilter module is not supported
+       local mod_exc="iptrtpproxy"
        local group_inc=""
-       use group_standard && group_inc="${group_inc} standard"
+       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 && 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_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=""
+       # 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
@@ -144,10 +167,8 @@ src_compile() {
 
        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
+               flavour=ser # defaults to SER compatibility names
        fi
 
        if use sctp; then
@@ -177,48 +198,53 @@ src_install() {
                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}/" \
+               cfg_dir=/etc/${flavour}/ \
+               lib_dir=/usr/$(get_libdir)/${flavour}/ \
+               modules_dir="/usr/$(get_libdir)/${flavour}/" \
                man_dir="/usr/share/man/" \
-               doc_dir="/usr/share/doc/${P}/" \
+               doc_dir="/usr/share/doc/${flavour}/" \
                install || die "emake install failed"
 
-       newinitd "${FILESDIR}/${MY_PN}".init "${MY_PN}"
-       newconfd "${FILESDIR}/${MY_PN}".confd "${MY_PN}"
+       sed -e "s/sip-router/${flavour}/g" \
+               ${FILESDIR}/ser.initd > ${flavour}.initd || die
+       sed -e "s/sip-router/${flavour}/g" \
+               ${FILESDIR}/ser.confd > ${flavour}.confd || die
+
+       newinitd "${flavour}".initd "${flavour}"
+       newconfd "${flavour}".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}"
+       if [[ -z "$(egetent passwd ${flavour})" ]]; then
+               einfo "Adding ${flavour} user and group"
+               enewgroup "${flavour}"
+               enewuser  "${flavour}" -1 -1 /dev/null "${flavour}"
        fi
 
-       chown -R root:"${MY_PN}"  "${D}/etc/${MY_PN}"
-       chmod -R u=rwX,g=rX,o= "${D}/etc/${MY_PN}"
+       chown -R root:"${flavour}"  "${D}/etc/${flavour}"
+       chmod -R u=rwX,g=rX,o= "${D}/etc/${flavour}"
 
-       has_version "${CATEGORY}/ser"
+       has_version <="${CATEGORY}/ser-0.9.8"
        previous_installed_version=$?
+       if [[ $previous_installed_version = 1 ]] ; then
+               elog "You have a previous version of SER on ${ROOT}etc/ser"
+               elog "Consider or verify to remove it (emerge -C ser)."
+               elog
+               elog "Sip-Router may not could be installed/merged. See your elog."
+       fi
 }
 
 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
+               einfo "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."
+               einfo "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
+       /etc/init.d/"${flavour}" stop >/dev/null
 }
index 13bca39..cd0f9a8 100644 (file)
@@ -7,7 +7,6 @@ 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}
 
@@ -18,6 +17,7 @@ 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
@@ -52,6 +52,14 @@ RDEPEND="
        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 )
@@ -109,23 +117,38 @@ src_unpack() {
 }
 
 src_compile() {
-       #iptrtpproxy broken as the needed netfilter module is not supported
-       #local mod_exc="iptrtpproxy"
-       local mod_exc=""
+       # iptrtpproxy broken as the needed netfilter module is not supported
+       local mod_exc="iptrtpproxy"
        local group_inc=""
-       use group_standard && group_inc="${group_inc} standard"
+       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 && 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_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=""
+       # 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
@@ -144,10 +167,8 @@ src_compile() {
 
        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
+               flavour=ser # defaults to SER compatibility names
        fi
 
        if use sctp; then
@@ -177,48 +198,53 @@ src_install() {
                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}/" \
+               cfg_dir=/etc/${flavour}/ \
+               lib_dir=/usr/$(get_libdir)/${flavour}/ \
+               modules_dir="/usr/$(get_libdir)/${flavour}/" \
                man_dir="/usr/share/man/" \
-               doc_dir="/usr/share/doc/${P}/" \
+               doc_dir="/usr/share/doc/${flavour}/" \
                install || die "emake install failed"
 
-       newinitd "${FILESDIR}/${MY_PN}".init "${MY_PN}"
-       newconfd "${FILESDIR}/${MY_PN}".confd "${MY_PN}"
+       sed -e "s/sip-router/${flavour}/g" \
+               ${FILESDIR}/ser.initd > ${flavour}.initd || die
+       sed -e "s/sip-router/${flavour}/g" \
+               ${FILESDIR}/ser.confd > ${flavour}.confd || die
+
+       newinitd "${flavour}".initd "${flavour}"
+       newconfd "${flavour}".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}"
+       if [[ -z "$(egetent passwd ${flavour})" ]]; then
+               einfo "Adding ${flavour} user and group"
+               enewgroup "${flavour}"
+               enewuser  "${flavour}" -1 -1 /dev/null "${flavour}"
        fi
 
-       chown -R root:"${MY_PN}"  "${D}/etc/${MY_PN}"
-       chmod -R u=rwX,g=rX,o= "${D}/etc/${MY_PN}"
+       chown -R root:"${flavour}"  "${D}/etc/${flavour}"
+       chmod -R u=rwX,g=rX,o= "${D}/etc/${flavour}"
 
-       has_version "${CATEGORY}/ser"
+       has_version <="${CATEGORY}/ser-0.9.8"
        previous_installed_version=$?
+       if [[ $previous_installed_version = 1 ]] ; then
+               elog "You have a previous version of SER on ${ROOT}etc/ser"
+               elog "Consider or verify to remove it (emerge -C ser)."
+               elog
+               elog "Sip-Router may not could be installed/merged. See your elog."
+       fi
 }
 
 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
+               einfo "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."
+               einfo "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
+       /etc/init.d/"${flavour}" stop >/dev/null
 }
diff --git a/pkg/ser/gentoo/sip-router-3.1.4-r1.ebuild b/pkg/ser/gentoo/sip-router-3.1.4-r1.ebuild
deleted file mode 100644 (file)
index ccf4083..0000000
+++ /dev/null
@@ -1,254 +0,0 @@
-# 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
-}
-
-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
-}
index 2ade9c4..cd0f9a8 100644 (file)
@@ -7,7 +7,6 @@ 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}
 
@@ -18,6 +17,7 @@ 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
@@ -52,6 +52,14 @@ RDEPEND="
        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 )
@@ -109,23 +117,30 @@ src_unpack() {
 }
 
 src_compile() {
-       #iptrtpproxy broken as the needed netfilter module is not supported
-       #local mod_exc="iptrtpproxy"
-       local mod_exc=""
+       # iptrtpproxy broken as the needed netfilter module is not supported
+       local mod_exc="iptrtpproxy"
        local group_inc=""
-       use group_standard && group_inc="${group_inc} standard"
+       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 && 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_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: 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
+       # 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
@@ -152,10 +167,8 @@ src_compile() {
 
        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
+               flavour=ser # defaults to SER compatibility names
        fi
 
        if use sctp; then
@@ -185,54 +198,53 @@ src_install() {
                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}/" \
+               cfg_dir=/etc/${flavour}/ \
+               lib_dir=/usr/$(get_libdir)/${flavour}/ \
+               modules_dir="/usr/$(get_libdir)/${flavour}/" \
                man_dir="/usr/share/man/" \
-               doc_dir="/usr/share/doc/${P}/" \
+               doc_dir="/usr/share/doc/${flavour}/" \
                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}"
-
+       sed -e "s/sip-router/${flavour}/g" \
+               ${FILESDIR}/ser.initd > ${flavour}.initd || die
+       sed -e "s/sip-router/${flavour}/g" \
+               ${FILESDIR}/ser.confd > ${flavour}.confd || die
 
+       newinitd "${flavour}".initd "${flavour}"
+       newconfd "${flavour}".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}"
+       if [[ -z "$(egetent passwd ${flavour})" ]]; then
+               einfo "Adding ${flavour} user and group"
+               enewgroup "${flavour}"
+               enewuser  "${flavour}" -1 -1 /dev/null "${flavour}"
        fi
 
-       chown -R root:"${MY_PN}"  "${D}/etc/${MY_PN}"
-       chmod -R u=rwX,g=rX,o= "${D}/etc/${MY_PN}"
+       chown -R root:"${flavour}"  "${D}/etc/${flavour}"
+       chmod -R u=rwX,g=rX,o= "${D}/etc/${flavour}"
 
-       has_version "${CATEGORY}/ser"
+       has_version <="${CATEGORY}/ser-0.9.8"
        previous_installed_version=$?
+       if [[ $previous_installed_version = 1 ]] ; then
+               elog "You have a previous version of SER on ${ROOT}etc/ser"
+               elog "Consider or verify to remove it (emerge -C ser)."
+               elog
+               elog "Sip-Router may not could be installed/merged. See your elog."
+       fi
 }
 
 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
+               einfo "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."
+               einfo "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
+       /etc/init.d/"${flavour}" stop >/dev/null
 }