# HG changeset patch # User Michael Schloh von Bennewitz # Date 1317939461 -7200 # Node ID 3cce61ce5fdd8aa37d26f87ff3b5080a55688325 # Parent d174a379fbfd04cbc2c648d744bd8a34bd6dbc34 Import new package specs for introduction into repository. diff -r d174a379fbfd -r 3cce61ce5fdd kamailio/fsl.kamailio --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kamailio/fsl.kamailio Fri Oct 07 00:17:41 2011 +0200 @@ -0,0 +1,16 @@ +## +## fsl.kamailio -- OSSP fsl configuration +## + +ident .*(kamailio)/.+ q{ + prefix( + prefix="%b %d %H:%M:%S %N <%L> $1[%P]: " + ) + -> { + debug: file( + path="@l_prefix@/var/kamailio/kamailio.log", + perm=0664 + ) + } +}; + diff -r d174a379fbfd -r 3cce61ce5fdd kamailio/kamailio.spec --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kamailio/kamailio.spec Fri Oct 07 00:17:41 2011 +0200 @@ -0,0 +1,440 @@ +## +## kamailio.spec -- OpenPKG RPM Package Specification +## Copyright (c) 2011 Michael Schloh von Bennewitz +## +## Permission to use, copy, modify, and distribute this software for +## any purpose with or without fee is hereby granted, provided that +## the above copyright notice and this permission notice appear in all +## copies. +## +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## + +# package information +Name: kamailio +Summary: Open Source SIP Server +URL: http://www.kamailio.org/ +Vendor: IPTelorg GmbH, Fraunhofer FOKUS, SIP Router Project +Packager: Michael Schloh von Bennewitz +Distribution: Europalab Networks Production +Class: PLUS +Group: VoIP +License: GPL +Version: 3.1.5 +Release: 20111000 + +# package options +%option with_cons yes +%option with_fsl yes +%option with_ssl yes +%option with_sctp no +%option with_croute no +%option with_ldap no +%option with_memcached no +%option with_radius no +%option with_snmp no +%option with_bdb no +%option with_mysql no +%option with_osp no +%option with_pgsql no +%option with_odbc no +%option with_geoip no +%option with_lua no +%option with_python no + +# list of sources +Source0: http://www.kamailio.org/pub/kamailio/%{version}/src/kamailio-%{version}_src.tar.gz +Source2: rc.kamailio +Source3: fsl.kamailio + +# build information +Prefix: %{l_prefix} +BuildRoot: %{l_buildroot} +BuildPreReq: OpenPKG, openpkg >= 20060823 +PreReq: OpenPKG, openpkg >= 20060823 +BuildPreReq: libxml, expat, curl, readline +PreReq: libxml, expat, curl, readline +BuildPreReq: make, gcc, flex, bison, sed, pkgconfig +PreReq: bash +%if "%{with_cons}" == "yes" +PreReq: perl-dbi, perl-term +%endif +%if "%{with_fsl}" == "yes" +BuildPreReq: fsl +PreReq: fsl +%endif +%if "%{with_ssl}" == "yes" +BuildPreReq: openssl +PreReq: openssl +%endif +%if "%{with_croute}" == "yes" +BuildPreReq: confuse +PreReq: confuse +%endif +%if "%{with_ldap}" == "yes" +BuildPreReq: openldap +PreReq: openldap +%endif +%if "%{with_memcached}" == "yes" +BuildPreReq: memcached +PreReq: memcached +%endif +%if "%{with_osp}" == "yes" +BuildPreReq: osptoolkit +PreReq: osptoolkit +%endif +%if "%{with_radius}" == "yes" +BuildPreReq: radiusclient +PreReq: radiusclient +%endif +%if "%{with_snmp}" == "yes" +BuildPreReq: snmp +PreReq: snmp +%endif +%if "%{with_bdb}" == "yes" +BuildPreReq: db +PreReq: db +%endif +%if "%{with_mysql}" == "yes" +BuildPreReq: mysql +PreReq: mysql +%endif +%if "%{with_pgsql}" == "yes" +BuildPreReq: postgresql +PreReq: postgresql +%endif +%if "%{with_odbc}" == "yes" +BuildPreReq: unixodbc +PreReq: unixodbc +%endif +%if "%{with_geoip}" == "yes" +BuildPreReq: geoip +PreReq: geoip +%endif +%if "%{with_lua}" == "yes" +BuildPreReq: lua +PreReq: lua +%endif +%if "%{with_python}" == "yes" +BuildPreReq: python +PreReq: python +%endif +AutoReq: no +AutoReqProv: no + +%description + Kamailio is (beside Opensips) a successor to OpenSER, which in + turn was spawned from FhG FOKUS's SIP Express Router (SER). It + provides SIP (RFC3621) registrar, proxy and routing functionality. + A C shell like scripting language provides for control over the + server's behaviour. It's modular architecture allows for fine + grained loading of required functionality. + + Kamailio can be used as a: Kamailio fits in scenarios: + + Registrar server SIP trunking + Router, proxy SIP load balancing + Redirect server SIP front end termination + Presence agent Residential providers + Back to back user agent white label solutions + Instant messaging server Enterprise services + SIP to SMS gateway LCR for multi gateways + SIP to XMPP gateway + Load balancer or dispatcher + Front end for asterisk + NAT traversal unit + Application server + +%track + prog kamailio = { + version = %{version} + url = http://www.kamailio.org/pub/kamailio/ + regex = (\d+\.\d+\.\d+)/ + url = http://www.kamailio.org/pub/kamailio/__NEWVER__/src/ + regex = kamailio-(__VER__)_src\.tar\.gz + } + +%prep + %setup -q + %{l_shtool} subst \ + -e 's;\$(LOCALBASE)/[^/][^/]*/sctp.h;;g' \ + -e 's;\$(LOCALBASE)/ssl/include;`%{l_prefix}/bin/pkg-config --cflags-only-I openssl`;g' \ + -e 's;\$(LOCALBASE)/ssl/lib;`%{l_prefix}/bin/pkg-config --libs openssl`;g' \ + -e 's;\(data_dir\) *= *\(\$(MAIN_NAME)\);\1 = share/\2;g' \ + -e 's;LOCALBASE *[\?:]*=.*;LOCALBASE = %{l_prefix};g' \ + Makefile.defs + %{l_shtool} subst \ + -e 's;CFLAGS *= *$;CFLAGS = %{l_cflags -O};g' \ + -e 's;LDFLAGS *= *$;LDFLAGS = %{l_ldflags};g' \ + -e 's;C_INCLUDES *= *$;C_INCLUDES = %{l_cppflags};g' \ + Makefile.defs + %{l_shtool} subst \ + -e 's;/usr/include/readline/readline.h;;g' \ + utils/sercmd/Makefile + %{l_shtool} subst \ + -e 's;-I$(LOCALBASE)/Berkeley[^ ]* *;;g' \ + -e 's;-I$(LOCALBASE)/include[^ ]* *;;g' \ + -e 's;-I$(SYSBASE)/include[^ ]* *;;g' \ + -e 's;LIBS=.*;LIBS=`%{l_prefix}/bin/pkg-config --libs db`;g' \ + utils/db_berkeley/Makefile + %{l_shtool} subst \ + -e 's;\(mkdir.*\$(data_prefix)/\$(data_dir)/.*\)/kamailio;\1;g' \ + utils/kamctl/Makefile + %{l_shtool} subst \ + -e 's;\(radiusclient\)-ng;\1;g' \ + -e 's;/usr/local\(/etc/radiusclient/radiusclient.conf\);%{l_prefix}\1;' \ + Makefile.radius \ + lib/kcore/radius.h \ + modules_s/avp_radius/avp_radius.c \ + modules_s/uri_radius/checks.c \ + modules_s/uri_radius/urirad_mod.c \ + modules_s/acc_radius/acc_radius.c \ + modules_s/auth_radius/authrad_mod.c \ + modules_s/auth_radius/sterman.h + %{l_shtool} subst \ + -e 's;\(DEFS *[\?:+]*=[^\\]*\);\1 -D__EXTENSIONS__;g' \ + modules/db_mysql/Makefile \ + modules/xmlrpc/Makefile + %{l_shtool} subst \ + -e 's;\(-keyout.*\);\1 || true;' \ + modules/tls/sip-router_cert.sh + +%build + # select modules + modslist='acc alias_db auth auth_identity avp avpops avp_db benchmark blst call_control cfgutils cfg_db cfg_rpc counters cpl-c ctl db_text db_flatstore db_ops debugger dialog dialplan dispatcher diversion domain domainpolicy drouting eval exec enum fifo gflags group htable identity imc kex lcr malloc_test mangler matrix maxfwd mi_datagram mi_fifo mi_rpc mediaproxy mqueue msilo mtree nathelper nat_traversal options path pdb pdt peering perl perlvdb permissions pike pipelimit prefix_route presence presence_conference presence_dialoginfo presence_mwi presence_xml privacy pua pua_bla pua_dialoginfo pua_mi pua_usrloc pua_xmpp pv qos ratelimit regex registrar rr rls rtimer rtpproxy sanity seas siptrace siputils sl sms speeddial sqlops sst statistics textops textopsx timer tm tmx topoh uac uac_redirect uri uri_db userblacklist usrloc utils xcap xcap_client xcap_server xhttp xlog xmlops xmlrpc xmpp' +%if "%{with_ssl}" == "yes" + modslist="$modslist tls" +%endif +%if "%{with_croute}" == "yes" + modslist="$modslist carrierroute" +%endif +%if "%{with_ldap}" == "yes" + modslist="$modslist ldap h350" +%endif +%if "%{with_memcached}" == "yes" + modslist="$modslist memcached" +%endif +%if "%{with_osp}" == "yes" + modslist="$modslist osp" +%endif +%if "%{with_radius}" == "yes" + modslist="$modslist acc_radius auth_radius avp_radius group misc_radius uri_radius" +%endif +%if "%{with_snmp}" == "yes" + modslist="$modslist snmpstats" +%endif +%if "%{with_bdb}" == "yes" + modslist="$modslist db_berkeley" +%endif +%if "%{with_mysql}" == "yes" + modslist="$modslist db_mysql" +%endif +%if "%{with_pgsql}" == "yes" + modslist="$modslist db_postgres" +%endif +%if "%{with_odbc}" == "yes" + modslist="$modslist db_unixodbc" +%endif +%if "%{with_lua}" == "yes" + modslist="$modslist app_lua" +%endif +%if "%{with_python}" == "yes" + modslist="$modslist app_python" +%endif +%if "%{with_geoip}" == "yes" + modslist="$modslist geoip" +%endif + + # build configuration + %{l_make} %{l_mflags} \ + CC="%{l_cc}" \ + FLAVOUR=kamailio \ +%if "%{with_sctp}" == "yes" + SCTP=1 \ +%endif +%if "%{with_ssl}" == "yes" + TLS_HOOKS=1 \ +%endif + prefix=%{l_prefix} \ + cfg + + # build program + %{l_make} %{l_mflags -O} \ + CC="%{l_cc}" \ +%if "%{with_sctp}" == "yes" + SCTP=1 \ +%endif +%if "%{with_ssl}" == "yes" + TLS_HOOKS=1 \ +%endif + prefix=%{l_prefix} \ + kamailio + + # build utilities + %{l_make} %{l_mflags -O} \ + CC="%{l_cc}" \ +%if "%{with_sctp}" == "yes" + SCTP=1 \ +%endif +%if "%{with_ssl}" == "yes" + TLS_HOOKS=1 \ +%endif + prefix=%{l_prefix} \ + modules="$modslist" \ + utils utils/kamctl + + # build modules + %{l_make} %{l_mflags -O} \ + CC="%{l_cc}" \ + LD_RPATH=-Wl,-rpath, \ + SER_RPATH_LST=%{l_prefix}/lib/kamailio \ +%if "%{with_sctp}" == "yes" + SCTP=1 \ +%endif +%if "%{with_ssl}" == "yes" + TLS_HOOKS=1 \ +%endif + include_modules="$modslist" \ + skip_modules="" \ + prefix=%{l_prefix} \ + every-module + +%install + rm -rf $RPM_BUILD_ROOT + + # select modules + modslist='acc alias_db auth auth_identity avp avpops avp_db benchmark blst call_control cfgutils cfg_db cfg_rpc counters cpl-c ctl db_text db_flatstore db_ops debugger dialog dialplan dispatcher diversion domain domainpolicy drouting eval exec enum fifo gflags group htable identity imc kex lcr malloc_test mangler matrix maxfwd mi_datagram mi_fifo mi_rpc mediaproxy mqueue msilo mtree nathelper nat_traversal options path pdb pdt peering perl perlvdb permissions pike pipelimit prefix_route presence presence_conference presence_dialoginfo presence_mwi presence_xml privacy pua pua_bla pua_dialoginfo pua_mi pua_usrloc pua_xmpp pv qos ratelimit regex registrar rr rls rtimer rtpproxy sanity seas siptrace siputils sl sms speeddial sqlops sst statistics textops textopsx timer tm tmx topoh uac uac_redirect uri uri_db userblacklist usrloc utils xcap xcap_client xcap_server xhttp xlog xmlops xmlrpc xmpp' +%if "%{with_ssl}" == "yes" + modslist="$modslist tls" +%endif +%if "%{with_croute}" == "yes" + modslist="$modslist carrierroute" +%endif +%if "%{with_ldap}" == "yes" + modslist="$modslist ldap h350" +%endif +%if "%{with_memcached}" == "yes" + modslist="$modslist memcached" +%endif +%if "%{with_osp}" == "yes" + modslist="$modslist osp" +%endif +%if "%{with_radius}" == "yes" + modslist="$modslist acc_radius auth_radius avp_radius group misc_radius uri_radius" +%endif +%if "%{with_snmp}" == "yes" + modslist="$modslist snmpstats" +%endif +%if "%{with_bdb}" == "yes" + modslist="$modslist db_berkeley" +%endif +%if "%{with_mysql}" == "yes" + modslist="$modslist db_mysql" +%endif +%if "%{with_pgsql}" == "yes" + modslist="$modslist db_postgres" +%endif +%if "%{with_odbc}" == "yes" + modslist="$modslist db_unixodbc" +%endif +%if "%{with_lua}" == "yes" + modslist="$modslist app_lua" +%endif +%if "%{with_python}" == "yes" + modslist="$modslist app_python" +%endif +%if "%{with_geoip}" == "yes" + modslist="$modslist geoip" +%endif + + # install program, utils, and modules + %{l_make} %{l_mflags} \ + INSTALL="%{l_shtool} install -c" \ + INSTALL_CFG="%{l_shtool} install -c" \ + INSTALL_BIN="%{l_shtool} install -c" \ + INSTALL_SCRIPT="%{l_shtool} install -c" \ + INSTALL_MODULES="%{l_shtool} install -c" \ + INSTALL_LIB="%{l_shtool} install -c" \ + INSTALL_DOC="%{l_shtool} install -c" \ + INSTALL_MAN="%{l_shtool} install -c" \ + INSTALL_SHARE="%{l_shtool} install -c" \ + basedir=$RPM_BUILD_ROOT \ + prefix=%{l_prefix} \ + doc-dir=share/kamailio/doc \ + man-dir=man \ + data-dir=share/kamailio \ + include_modules="$modslist" \ + skip_modules="" \ + install + + # strip down installation + strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true + + # create installation hierarchy + %{l_shtool} mkdir -f -p -m 700 \ + $RPM_BUILD_ROOT%{l_prefix}/var/kamailio + + # install OSSP fsl configuration + %{l_shtool} mkdir -f -p -m 755 \ + $RPM_BUILD_ROOT%{l_prefix}/etc/fsl + %{l_shtool} install -c -m 644 %{l_value -s -a} \ + %{SOURCE fsl.kamailio} \ + $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/ + + # install runcommand script + %{l_shtool} mkdir -f -p -m 755 \ + $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d + %{l_shtool} install -c -m 755 %{l_value -s -a} \ + %{SOURCE rc.kamailio} \ + $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ + + # determine installation files + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ + %{l_files_std} \ + '%not %dir %{l_prefix}/etc/fsl' \ + '%config %{l_prefix}/etc/fsl/*' \ + '%config %{l_prefix}/etc/kamailio/*' \ + '%doc %{l_prefix}/share/kamailio/doc/*' \ + '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/kamailio' + +%files -f files + +%clean + rm -rf $RPM_BUILD_ROOT + +%post + # on install, setup database (kamctl db create /pfx/var/kamailio/db) + if [ ! -d $RPM_INSTALL_PREFIX/var/kamailio/db ]; then + %{l_shtool} mkdir -f -p -m 700 -o %{l_rusr} -g %{l_rgrp} \ + $RPM_INSTALL_PREFIX/var/kamailio/db + rm -f $RPM_INSTALL_PREFIX/share/kamailio/dbtext/*.orig + %{l_shtool} install -c -m 600 -o %{l_rusr} -g %{l_rgrp} \ + $RPM_INSTALL_PREFIX/share/kamailio/dbtext/* \ + $RPM_INSTALL_PREFIX/var/kamailio/db/ + fi + + # after upgrade, restart service + [ $1 -eq 2 ] || exit 0 + eval `%{l_rc} kamailio status 2>/dev/null` + [ ".$kamailio_active" = .yes ] && %{l_rc} kamailio restart + exit 0 + +%preun + # before erase, stop service and remove log files + [ $1 -eq 0 ] || exit 0 + %{l_rc} kamailio stop 2>/dev/null + rm -rf $RPM_INSTALL_PREFIX/var/kamailio/db 2>/dev/null || true + rm -f $RPM_INSTALL_PREFIX/var/kamailio/* 2>/dev/null || true + exit 0 + diff -r d174a379fbfd -r 3cce61ce5fdd kamailio/rc.kamailio --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kamailio/rc.kamailio Fri Oct 07 00:17:41 2011 +0200 @@ -0,0 +1,59 @@ +#!@l_prefix@/bin/openpkg rc +## +## rc.kamailio -- Run-Commands +## + +%config + kamailio_enable="$openpkg_rc_def" + kamailio_log_prolog="true" + kamailio_log_epilog="true" + kamailio_log_numfiles="10" + kamailio_log_minsize="1M" + kamailio_log_complevel="9" + +%common + kamailio_cfgfile="@l_prefix@/etc/kamailio/kamailio.cfg" + kamailio_pidfile="@l_prefix@/var/kamailio/kamailio.pid" + kamailio_signal () { + [ -f $kamailio_pidfile ] && kill -$1 `cat $kamailio_pidfile` + } + +%status -u @l_susr@ -o + kamailio_usable="no" + kamailio_active="no" + if @l_prefix@/sbin/kamailio -c >/dev/null 2>&1; then + kamailio_usable="yes" + fi + if rcService kamailio enable yes && kamailio_signal 0; then + kamailio_active="yes" + fi + echo "kamailio_enable=\"$kamailio_enable\"" + echo "kamailio_usable=\"$kamailio_usable\"" + echo "kamailio_active=\"$kamailio_active\"" + +%start -u @l_susr@ + rcService kamailio enable yes || exit 0 + rcService kamailio active yes && exit 0 + @l_prefix@/sbin/kamailioctl start + +%stop -u @l_susr@ + rcService kamailio enable yes || exit 0 + rcService kamailio active no && exit 0 + @l_prefix@/sbin/kamailioctl stop + rm -f $kamailio_pidfile 2>/dev/null || true + sleep 2 + +%restart -u @l_susr@ + rcService kamailio enable yes || exit 0 + rcService kamailio active no && exit 0 + rc kamailio stop start + +%daily -u @l_susr@ + rcService kamailio enable yes || exit 0 + shtool rotate -f \ + -n ${kamailio_log_numfiles} -s ${kamailio_log_minsize} -d \ + -z ${kamailio_log_complevel} -m 644 -o @l_rusr@ -g @l_rgrp@ \ + -P "${kamailio_log_prolog}" \ + -E "${kamailio_log_epilog}; rc kamailio reload" \ + @l_prefix@/var/kamailio/kamailio.log +