Import new package specs for introduction into repository.

Fri, 07 Oct 2011 00:17:41 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 07 Oct 2011 00:17:41 +0200
changeset 389
3cce61ce5fdd
parent 388
d174a379fbfd
child 390
29651fde8b05

Import new package specs for introduction into repository.

kamailio/fsl.kamailio file | annotate | diff | comparison | revisions
kamailio/kamailio.spec file | annotate | diff | comparison | revisions
kamailio/rc.kamailio file | annotate | diff | comparison | revisions
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/kamailio/fsl.kamailio	Fri Oct 07 00:17:41 2011 +0200
     1.3 @@ -0,0 +1,16 @@
     1.4 +##
     1.5 +##  fsl.kamailio -- OSSP fsl configuration
     1.6 +##
     1.7 +
     1.8 +ident .*(kamailio)/.+ q{
     1.9 +    prefix(
    1.10 +        prefix="%b %d %H:%M:%S %N <%L> $1[%P]: "
    1.11 +    )
    1.12 +    -> {
    1.13 +        debug: file(
    1.14 +            path="@l_prefix@/var/kamailio/kamailio.log",
    1.15 +            perm=0664
    1.16 +        )
    1.17 +    }
    1.18 +};
    1.19 +
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/kamailio/kamailio.spec	Fri Oct 07 00:17:41 2011 +0200
     2.3 @@ -0,0 +1,440 @@
     2.4 +##
     2.5 +##  kamailio.spec -- OpenPKG RPM Package Specification
     2.6 +##  Copyright (c) 2011 Michael Schloh von Bennewitz <michael@schloh.com>
     2.7 +##
     2.8 +##  Permission to use, copy, modify, and distribute this software for
     2.9 +##  any purpose with or without fee is hereby granted, provided that
    2.10 +##  the above copyright notice and this permission notice appear in all
    2.11 +##  copies.
    2.12 +##
    2.13 +##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    2.14 +##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    2.15 +##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    2.16 +##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    2.17 +##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    2.18 +##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    2.19 +##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    2.20 +##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    2.21 +##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    2.22 +##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    2.23 +##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    2.24 +##  SUCH DAMAGE.
    2.25 +##
    2.26 +
    2.27 +#   package information
    2.28 +Name:         kamailio
    2.29 +Summary:      Open Source SIP Server
    2.30 +URL:          http://www.kamailio.org/
    2.31 +Vendor:       IPTelorg GmbH, Fraunhofer FOKUS, SIP Router Project
    2.32 +Packager:     Michael Schloh von Bennewitz
    2.33 +Distribution: Europalab Networks Production
    2.34 +Class:        PLUS
    2.35 +Group:        VoIP
    2.36 +License:      GPL
    2.37 +Version:      3.1.5
    2.38 +Release:      20111000
    2.39 +
    2.40 +#   package options
    2.41 +%option       with_cons    yes
    2.42 +%option       with_fsl     yes
    2.43 +%option       with_ssl     yes
    2.44 +%option       with_sctp    no
    2.45 +%option       with_croute  no
    2.46 +%option       with_ldap    no
    2.47 +%option       with_memcached no
    2.48 +%option       with_radius  no
    2.49 +%option       with_snmp    no
    2.50 +%option       with_bdb     no
    2.51 +%option       with_mysql   no
    2.52 +%option       with_osp     no
    2.53 +%option       with_pgsql   no
    2.54 +%option       with_odbc    no
    2.55 +%option       with_geoip   no
    2.56 +%option       with_lua     no
    2.57 +%option       with_python  no
    2.58 +
    2.59 +#   list of sources
    2.60 +Source0:      http://www.kamailio.org/pub/kamailio/%{version}/src/kamailio-%{version}_src.tar.gz
    2.61 +Source2:      rc.kamailio
    2.62 +Source3:      fsl.kamailio
    2.63 +
    2.64 +#   build information
    2.65 +Prefix:       %{l_prefix}
    2.66 +BuildRoot:    %{l_buildroot}
    2.67 +BuildPreReq:  OpenPKG, openpkg >= 20060823
    2.68 +PreReq:       OpenPKG, openpkg >= 20060823
    2.69 +BuildPreReq:  libxml, expat, curl, readline
    2.70 +PreReq:       libxml, expat, curl, readline
    2.71 +BuildPreReq:  make, gcc, flex, bison, sed, pkgconfig
    2.72 +PreReq:       bash
    2.73 +%if "%{with_cons}" == "yes"
    2.74 +PreReq:       perl-dbi, perl-term
    2.75 +%endif
    2.76 +%if "%{with_fsl}" == "yes"
    2.77 +BuildPreReq:  fsl
    2.78 +PreReq:       fsl
    2.79 +%endif
    2.80 +%if "%{with_ssl}" == "yes"
    2.81 +BuildPreReq:  openssl
    2.82 +PreReq:       openssl
    2.83 +%endif
    2.84 +%if "%{with_croute}" == "yes"
    2.85 +BuildPreReq:  confuse
    2.86 +PreReq:       confuse
    2.87 +%endif
    2.88 +%if "%{with_ldap}" == "yes"
    2.89 +BuildPreReq:  openldap
    2.90 +PreReq:       openldap
    2.91 +%endif
    2.92 +%if "%{with_memcached}" == "yes"
    2.93 +BuildPreReq:  memcached
    2.94 +PreReq:       memcached
    2.95 +%endif
    2.96 +%if "%{with_osp}" == "yes"
    2.97 +BuildPreReq:  osptoolkit
    2.98 +PreReq:       osptoolkit
    2.99 +%endif
   2.100 +%if "%{with_radius}" == "yes"
   2.101 +BuildPreReq:  radiusclient
   2.102 +PreReq:       radiusclient
   2.103 +%endif
   2.104 +%if "%{with_snmp}" == "yes"
   2.105 +BuildPreReq:  snmp
   2.106 +PreReq:       snmp
   2.107 +%endif
   2.108 +%if "%{with_bdb}" == "yes"
   2.109 +BuildPreReq:  db
   2.110 +PreReq:       db
   2.111 +%endif
   2.112 +%if "%{with_mysql}" == "yes"
   2.113 +BuildPreReq:  mysql
   2.114 +PreReq:       mysql
   2.115 +%endif
   2.116 +%if "%{with_pgsql}" == "yes"
   2.117 +BuildPreReq:  postgresql
   2.118 +PreReq:       postgresql
   2.119 +%endif
   2.120 +%if "%{with_odbc}" == "yes"
   2.121 +BuildPreReq:  unixodbc
   2.122 +PreReq:       unixodbc
   2.123 +%endif
   2.124 +%if "%{with_geoip}" == "yes"
   2.125 +BuildPreReq:  geoip
   2.126 +PreReq:       geoip
   2.127 +%endif
   2.128 +%if "%{with_lua}" == "yes"
   2.129 +BuildPreReq:  lua
   2.130 +PreReq:       lua
   2.131 +%endif
   2.132 +%if "%{with_python}" == "yes"
   2.133 +BuildPreReq:  python
   2.134 +PreReq:       python
   2.135 +%endif
   2.136 +AutoReq:      no
   2.137 +AutoReqProv:  no
   2.138 +
   2.139 +%description
   2.140 +    Kamailio is (beside Opensips) a successor to OpenSER, which in
   2.141 +    turn was spawned from FhG FOKUS's SIP Express Router (SER). It
   2.142 +    provides SIP (RFC3621) registrar, proxy and routing functionality.
   2.143 +    A C shell like scripting language provides for control over the
   2.144 +    server's behaviour. It's modular architecture allows for fine
   2.145 +    grained loading of required functionality.
   2.146 +
   2.147 +    Kamailio can be used as a:      Kamailio fits in scenarios:
   2.148 +
   2.149 +    Registrar server                SIP trunking
   2.150 +    Router, proxy                   SIP load balancing
   2.151 +    Redirect server                 SIP front end termination
   2.152 +    Presence agent                  Residential providers
   2.153 +    Back to back user agent         white label solutions
   2.154 +    Instant messaging server        Enterprise services
   2.155 +    SIP to SMS gateway              LCR for multi gateways
   2.156 +    SIP to XMPP gateway
   2.157 +    Load balancer or dispatcher
   2.158 +    Front end for asterisk
   2.159 +    NAT traversal unit
   2.160 +    Application server
   2.161 +
   2.162 +%track
   2.163 +    prog kamailio = {
   2.164 +        version   = %{version}
   2.165 +        url       = http://www.kamailio.org/pub/kamailio/
   2.166 +        regex     = (\d+\.\d+\.\d+)/
   2.167 +        url       = http://www.kamailio.org/pub/kamailio/__NEWVER__/src/
   2.168 +        regex     = kamailio-(__VER__)_src\.tar\.gz
   2.169 +    }
   2.170 +
   2.171 +%prep
   2.172 +    %setup -q
   2.173 +    %{l_shtool} subst \
   2.174 +        -e 's;\$(LOCALBASE)/[^/][^/]*/sctp.h;;g' \
   2.175 +        -e 's;\$(LOCALBASE)/ssl/include;`%{l_prefix}/bin/pkg-config --cflags-only-I openssl`;g' \
   2.176 +        -e 's;\$(LOCALBASE)/ssl/lib;`%{l_prefix}/bin/pkg-config --libs openssl`;g' \
   2.177 +        -e 's;\(data_dir\) *= *\(\$(MAIN_NAME)\);\1 = share/\2;g' \
   2.178 +        -e 's;LOCALBASE *[\?:]*=.*;LOCALBASE = %{l_prefix};g' \
   2.179 +        Makefile.defs
   2.180 +    %{l_shtool} subst \
   2.181 +        -e 's;CFLAGS *= *$;CFLAGS = %{l_cflags -O};g' \
   2.182 +        -e 's;LDFLAGS *= *$;LDFLAGS = %{l_ldflags};g' \
   2.183 +        -e 's;C_INCLUDES *= *$;C_INCLUDES = %{l_cppflags};g' \
   2.184 +        Makefile.defs
   2.185 +    %{l_shtool} subst \
   2.186 +        -e 's;/usr/include/readline/readline.h;;g' \
   2.187 +        utils/sercmd/Makefile
   2.188 +    %{l_shtool} subst \
   2.189 +        -e 's;-I$(LOCALBASE)/Berkeley[^ ]* *;;g' \
   2.190 +        -e 's;-I$(LOCALBASE)/include[^ ]* *;;g' \
   2.191 +        -e 's;-I$(SYSBASE)/include[^ ]* *;;g' \
   2.192 +        -e 's;LIBS=.*;LIBS=`%{l_prefix}/bin/pkg-config --libs db`;g' \
   2.193 +        utils/db_berkeley/Makefile
   2.194 +    %{l_shtool} subst \
   2.195 +        -e 's;\(mkdir.*\$(data_prefix)/\$(data_dir)/.*\)/kamailio;\1;g' \
   2.196 +        utils/kamctl/Makefile
   2.197 +    %{l_shtool} subst \
   2.198 +        -e 's;\(radiusclient\)-ng;\1;g' \
   2.199 +        -e 's;/usr/local\(/etc/radiusclient/radiusclient.conf\);%{l_prefix}\1;' \
   2.200 +        Makefile.radius \
   2.201 +        lib/kcore/radius.h \
   2.202 +        modules_s/avp_radius/avp_radius.c \
   2.203 +        modules_s/uri_radius/checks.c \
   2.204 +        modules_s/uri_radius/urirad_mod.c \
   2.205 +        modules_s/acc_radius/acc_radius.c \
   2.206 +        modules_s/auth_radius/authrad_mod.c \
   2.207 +        modules_s/auth_radius/sterman.h
   2.208 +    %{l_shtool} subst \
   2.209 +        -e 's;\(DEFS *[\?:+]*=[^\\]*\);\1 -D__EXTENSIONS__;g' \
   2.210 +        modules/db_mysql/Makefile \
   2.211 +        modules/xmlrpc/Makefile
   2.212 +    %{l_shtool} subst \
   2.213 +        -e 's;\(-keyout.*\);\1 || true;' \
   2.214 +        modules/tls/sip-router_cert.sh
   2.215 +
   2.216 +%build
   2.217 +    #   select modules
   2.218 +    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'
   2.219 +%if "%{with_ssl}" == "yes"
   2.220 +    modslist="$modslist tls"
   2.221 +%endif
   2.222 +%if "%{with_croute}" == "yes"
   2.223 +    modslist="$modslist carrierroute"
   2.224 +%endif
   2.225 +%if "%{with_ldap}" == "yes"
   2.226 +    modslist="$modslist ldap h350"
   2.227 +%endif
   2.228 +%if "%{with_memcached}" == "yes"
   2.229 +    modslist="$modslist memcached"
   2.230 +%endif
   2.231 +%if "%{with_osp}" == "yes"
   2.232 +    modslist="$modslist osp"
   2.233 +%endif
   2.234 +%if "%{with_radius}" == "yes"
   2.235 +    modslist="$modslist acc_radius auth_radius avp_radius group misc_radius uri_radius"
   2.236 +%endif
   2.237 +%if "%{with_snmp}" == "yes"
   2.238 +    modslist="$modslist snmpstats"
   2.239 +%endif
   2.240 +%if "%{with_bdb}" == "yes"
   2.241 +    modslist="$modslist db_berkeley"
   2.242 +%endif
   2.243 +%if "%{with_mysql}" == "yes"
   2.244 +    modslist="$modslist db_mysql"
   2.245 +%endif
   2.246 +%if "%{with_pgsql}" == "yes"
   2.247 +    modslist="$modslist db_postgres"
   2.248 +%endif
   2.249 +%if "%{with_odbc}" == "yes"
   2.250 +    modslist="$modslist db_unixodbc"
   2.251 +%endif
   2.252 +%if "%{with_lua}" == "yes"
   2.253 +    modslist="$modslist app_lua"
   2.254 +%endif
   2.255 +%if "%{with_python}" == "yes"
   2.256 +    modslist="$modslist app_python"
   2.257 +%endif
   2.258 +%if "%{with_geoip}" == "yes"
   2.259 +    modslist="$modslist geoip"
   2.260 +%endif
   2.261 +
   2.262 +    #   build configuration
   2.263 +    %{l_make} %{l_mflags} \
   2.264 +        CC="%{l_cc}" \
   2.265 +        FLAVOUR=kamailio \
   2.266 +%if "%{with_sctp}" == "yes"
   2.267 +        SCTP=1 \
   2.268 +%endif
   2.269 +%if "%{with_ssl}" == "yes"
   2.270 +        TLS_HOOKS=1 \
   2.271 +%endif
   2.272 +        prefix=%{l_prefix} \
   2.273 +        cfg
   2.274 +
   2.275 +    #   build program
   2.276 +    %{l_make} %{l_mflags -O} \
   2.277 +        CC="%{l_cc}" \
   2.278 +%if "%{with_sctp}" == "yes"
   2.279 +        SCTP=1 \
   2.280 +%endif
   2.281 +%if "%{with_ssl}" == "yes"
   2.282 +        TLS_HOOKS=1 \
   2.283 +%endif
   2.284 +        prefix=%{l_prefix} \
   2.285 +        kamailio
   2.286 +
   2.287 +    #   build utilities
   2.288 +    %{l_make} %{l_mflags -O} \
   2.289 +        CC="%{l_cc}" \
   2.290 +%if "%{with_sctp}" == "yes"
   2.291 +        SCTP=1 \
   2.292 +%endif
   2.293 +%if "%{with_ssl}" == "yes"
   2.294 +        TLS_HOOKS=1 \
   2.295 +%endif
   2.296 +        prefix=%{l_prefix} \
   2.297 +        modules="$modslist" \
   2.298 +        utils utils/kamctl
   2.299 +
   2.300 +    #   build modules
   2.301 +    %{l_make} %{l_mflags -O} \
   2.302 +        CC="%{l_cc}" \
   2.303 +        LD_RPATH=-Wl,-rpath, \
   2.304 +        SER_RPATH_LST=%{l_prefix}/lib/kamailio \
   2.305 +%if "%{with_sctp}" == "yes"
   2.306 +        SCTP=1 \
   2.307 +%endif
   2.308 +%if "%{with_ssl}" == "yes"
   2.309 +        TLS_HOOKS=1 \
   2.310 +%endif
   2.311 +        include_modules="$modslist" \
   2.312 +        skip_modules="" \
   2.313 +        prefix=%{l_prefix} \
   2.314 +        every-module
   2.315 +
   2.316 +%install
   2.317 +    rm -rf $RPM_BUILD_ROOT
   2.318 +
   2.319 +    #   select modules
   2.320 +    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'
   2.321 +%if "%{with_ssl}" == "yes"
   2.322 +    modslist="$modslist tls"
   2.323 +%endif
   2.324 +%if "%{with_croute}" == "yes"
   2.325 +    modslist="$modslist carrierroute"
   2.326 +%endif
   2.327 +%if "%{with_ldap}" == "yes"
   2.328 +    modslist="$modslist ldap h350"
   2.329 +%endif
   2.330 +%if "%{with_memcached}" == "yes"
   2.331 +    modslist="$modslist memcached"
   2.332 +%endif
   2.333 +%if "%{with_osp}" == "yes"
   2.334 +    modslist="$modslist osp"
   2.335 +%endif
   2.336 +%if "%{with_radius}" == "yes"
   2.337 +    modslist="$modslist acc_radius auth_radius avp_radius group misc_radius uri_radius"
   2.338 +%endif
   2.339 +%if "%{with_snmp}" == "yes"
   2.340 +    modslist="$modslist snmpstats"
   2.341 +%endif
   2.342 +%if "%{with_bdb}" == "yes"
   2.343 +    modslist="$modslist db_berkeley"
   2.344 +%endif
   2.345 +%if "%{with_mysql}" == "yes"
   2.346 +    modslist="$modslist db_mysql"
   2.347 +%endif
   2.348 +%if "%{with_pgsql}" == "yes"
   2.349 +    modslist="$modslist db_postgres"
   2.350 +%endif
   2.351 +%if "%{with_odbc}" == "yes"
   2.352 +    modslist="$modslist db_unixodbc"
   2.353 +%endif
   2.354 +%if "%{with_lua}" == "yes"
   2.355 +    modslist="$modslist app_lua"
   2.356 +%endif
   2.357 +%if "%{with_python}" == "yes"
   2.358 +    modslist="$modslist app_python"
   2.359 +%endif
   2.360 +%if "%{with_geoip}" == "yes"
   2.361 +    modslist="$modslist geoip"
   2.362 +%endif
   2.363 +
   2.364 +    #   install program, utils, and modules
   2.365 +    %{l_make} %{l_mflags} \
   2.366 +        INSTALL="%{l_shtool} install -c" \
   2.367 +        INSTALL_CFG="%{l_shtool} install -c" \
   2.368 +        INSTALL_BIN="%{l_shtool} install -c" \
   2.369 +        INSTALL_SCRIPT="%{l_shtool} install -c" \
   2.370 +        INSTALL_MODULES="%{l_shtool} install -c" \
   2.371 +        INSTALL_LIB="%{l_shtool} install -c" \
   2.372 +        INSTALL_DOC="%{l_shtool} install -c" \
   2.373 +        INSTALL_MAN="%{l_shtool} install -c" \
   2.374 +        INSTALL_SHARE="%{l_shtool} install -c" \
   2.375 +        basedir=$RPM_BUILD_ROOT \
   2.376 +        prefix=%{l_prefix} \
   2.377 +        doc-dir=share/kamailio/doc \
   2.378 +        man-dir=man \
   2.379 +        data-dir=share/kamailio \
   2.380 +        include_modules="$modslist" \
   2.381 +        skip_modules="" \
   2.382 +        install
   2.383 +
   2.384 +    #   strip down installation
   2.385 +    strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
   2.386 +
   2.387 +    #   create installation hierarchy
   2.388 +    %{l_shtool} mkdir -f -p -m 700 \
   2.389 +        $RPM_BUILD_ROOT%{l_prefix}/var/kamailio
   2.390 +
   2.391 +    #   install OSSP fsl configuration
   2.392 +    %{l_shtool} mkdir -f -p -m 755 \
   2.393 +        $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
   2.394 +    %{l_shtool} install -c -m 644 %{l_value -s -a} \
   2.395 +        %{SOURCE fsl.kamailio} \
   2.396 +        $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
   2.397 +
   2.398 +    #   install runcommand script
   2.399 +    %{l_shtool} mkdir -f -p -m 755 \
   2.400 +        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
   2.401 +    %{l_shtool} install -c -m 755 %{l_value -s -a} \
   2.402 +        %{SOURCE rc.kamailio} \
   2.403 +        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
   2.404 +
   2.405 +    #   determine installation files
   2.406 +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   2.407 +        %{l_files_std} \
   2.408 +        '%not %dir %{l_prefix}/etc/fsl' \
   2.409 +        '%config %{l_prefix}/etc/fsl/*' \
   2.410 +        '%config %{l_prefix}/etc/kamailio/*' \
   2.411 +        '%doc %{l_prefix}/share/kamailio/doc/*' \
   2.412 +        '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/kamailio'
   2.413 +
   2.414 +%files -f files
   2.415 +
   2.416 +%clean
   2.417 +    rm -rf $RPM_BUILD_ROOT
   2.418 +
   2.419 +%post
   2.420 +    #   on install, setup database (kamctl db create /pfx/var/kamailio/db)
   2.421 +    if [ ! -d $RPM_INSTALL_PREFIX/var/kamailio/db ]; then
   2.422 +        %{l_shtool} mkdir -f -p -m 700 -o %{l_rusr} -g %{l_rgrp} \
   2.423 +            $RPM_INSTALL_PREFIX/var/kamailio/db
   2.424 +        rm -f $RPM_INSTALL_PREFIX/share/kamailio/dbtext/*.orig
   2.425 +        %{l_shtool} install -c -m 600 -o %{l_rusr} -g %{l_rgrp} \
   2.426 +            $RPM_INSTALL_PREFIX/share/kamailio/dbtext/* \
   2.427 +            $RPM_INSTALL_PREFIX/var/kamailio/db/
   2.428 +    fi
   2.429 +
   2.430 +    #   after upgrade, restart service
   2.431 +    [ $1 -eq 2 ] || exit 0
   2.432 +    eval `%{l_rc} kamailio status 2>/dev/null`
   2.433 +    [ ".$kamailio_active" = .yes ] && %{l_rc} kamailio restart
   2.434 +    exit 0
   2.435 +
   2.436 +%preun
   2.437 +    #   before erase, stop service and remove log files
   2.438 +    [ $1 -eq 0 ] || exit 0
   2.439 +    %{l_rc} kamailio stop 2>/dev/null
   2.440 +    rm -rf $RPM_INSTALL_PREFIX/var/kamailio/db 2>/dev/null || true
   2.441 +    rm -f  $RPM_INSTALL_PREFIX/var/kamailio/*  2>/dev/null || true
   2.442 +    exit 0
   2.443 +
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/kamailio/rc.kamailio	Fri Oct 07 00:17:41 2011 +0200
     3.3 @@ -0,0 +1,59 @@
     3.4 +#!@l_prefix@/bin/openpkg rc
     3.5 +##
     3.6 +##  rc.kamailio -- Run-Commands
     3.7 +##
     3.8 +
     3.9 +%config
    3.10 +    kamailio_enable="$openpkg_rc_def"
    3.11 +    kamailio_log_prolog="true"
    3.12 +    kamailio_log_epilog="true"
    3.13 +    kamailio_log_numfiles="10"
    3.14 +    kamailio_log_minsize="1M"
    3.15 +    kamailio_log_complevel="9"
    3.16 +
    3.17 +%common
    3.18 +    kamailio_cfgfile="@l_prefix@/etc/kamailio/kamailio.cfg"
    3.19 +    kamailio_pidfile="@l_prefix@/var/kamailio/kamailio.pid"
    3.20 +    kamailio_signal () {
    3.21 +        [ -f $kamailio_pidfile ] && kill -$1 `cat $kamailio_pidfile`
    3.22 +    }
    3.23 +
    3.24 +%status -u @l_susr@ -o
    3.25 +    kamailio_usable="no"
    3.26 +    kamailio_active="no"
    3.27 +    if @l_prefix@/sbin/kamailio -c >/dev/null 2>&1; then
    3.28 +        kamailio_usable="yes"
    3.29 +    fi
    3.30 +    if rcService kamailio enable yes && kamailio_signal 0; then
    3.31 +        kamailio_active="yes"
    3.32 +    fi
    3.33 +    echo "kamailio_enable=\"$kamailio_enable\""
    3.34 +    echo "kamailio_usable=\"$kamailio_usable\""
    3.35 +    echo "kamailio_active=\"$kamailio_active\""
    3.36 +
    3.37 +%start -u @l_susr@
    3.38 +    rcService kamailio enable yes || exit 0
    3.39 +    rcService kamailio active yes && exit 0
    3.40 +    @l_prefix@/sbin/kamailioctl start
    3.41 +
    3.42 +%stop -u @l_susr@
    3.43 +    rcService kamailio enable yes || exit 0
    3.44 +    rcService kamailio active no  && exit 0
    3.45 +    @l_prefix@/sbin/kamailioctl stop
    3.46 +    rm -f $kamailio_pidfile 2>/dev/null || true
    3.47 +    sleep 2
    3.48 +
    3.49 +%restart -u @l_susr@
    3.50 +    rcService kamailio enable yes || exit 0
    3.51 +    rcService kamailio active no  && exit 0
    3.52 +    rc kamailio stop start
    3.53 +
    3.54 +%daily -u @l_susr@
    3.55 +    rcService kamailio enable yes || exit 0
    3.56 +    shtool rotate -f \
    3.57 +        -n ${kamailio_log_numfiles} -s ${kamailio_log_minsize} -d \
    3.58 +        -z ${kamailio_log_complevel} -m 644 -o @l_rusr@ -g @l_rgrp@ \
    3.59 +        -P "${kamailio_log_prolog}" \
    3.60 +        -E "${kamailio_log_epilog}; rc kamailio reload" \
    3.61 +        @l_prefix@/var/kamailio/kamailio.log
    3.62 +

mercurial