# HG changeset patch # User Pascal Bellard # Date 1479833257 -3600 # Node ID 6d1193fe62330ee9d4f2d6f69941a973f99a940c # Parent beee0d431f3b1e1e5e08931386b5787444a5b1e2 Add kamailio diff -r beee0d431f3b -r 6d1193fe6233 kamailio/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kamailio/receipt Tue Nov 22 17:47:37 2016 +0100 @@ -0,0 +1,60 @@ +# SliTaz package receipt. + +PACKAGE="kamailio" +VERSION="4.4.4" +CATEGORY="network" +SHORT_DESC="Open Source SIP Server." +MAINTAINER="pascal.bellard@slitaz.org" +LICENSE="GPL2" +TARBALL="$PACKAGE-${VERSION}_src.tar.gz" +WEB_SITE="https://www.kamailio.org/" +WGET_URL="${WEB_SITE}pub/kamailio/$VERSION/src/$TARBALL" +CONFIG_FILES="/etc/kamailio" + +DEPENDS="libssl curl libxml2 pcre \ +radiusclient-ng libpostgresqlclient libldap net-snmp-dev expat" +BUILD_DEPENDS="flex bison openssl-dev curl-dev libxml2-dev pcre-dev \ +radiusclient-ng-dev postgresql-dev openldap-dev net-snmp-dev expat-dev" + +# Rules to configure and make the package. +compile_rules() +{ + make PREFIX="/usr" include_modules="acc_radius app_python auth_radius \ +db_postgres ldap presence_conference presence_dialoginfo presence_mwi \ +presence_profile presence_reginfo presence_xml snmpstats xmpp dialplan" cfg + make all + make DESTDIR=$DESTDIR install +} + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/var/run/kamailio + cp -a $install/* $fs + mv $fs/usr/etc $fs ; ln -s /etc $fs/usr/etc +} + +# Pre and post install commands for Tazpkg. +post_install() +{ + + local user + local group + + user=kamailio + group=kamailio + + if ! grep -q $user $1/etc/passwd; then + echo -n "Adding user/group $user..." + chroot $1/ addgroup -S $group + chroot $1/ adduser -s /bin/false -S -D -H -G $group $user + status + fi + chroot "$1/" chown $user:$group /var/run/kamailio +} + +post_remove() +{ + echo "Removing user/group kamailio" + chroot "$1/" deluser kamailio +}