kamailio/kamailio.spec

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
child 391
9ea3ce683273
permissions
-rw-r--r--

Import new package specs for introduction into repository.

michael@389 1 ##
michael@389 2 ## kamailio.spec -- OpenPKG RPM Package Specification
michael@389 3 ## Copyright (c) 2011 Michael Schloh von Bennewitz <michael@schloh.com>
michael@389 4 ##
michael@389 5 ## Permission to use, copy, modify, and distribute this software for
michael@389 6 ## any purpose with or without fee is hereby granted, provided that
michael@389 7 ## the above copyright notice and this permission notice appear in all
michael@389 8 ## copies.
michael@389 9 ##
michael@389 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@389 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@389 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@389 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@389 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@389 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@389 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@389 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@389 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@389 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@389 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@389 21 ## SUCH DAMAGE.
michael@389 22 ##
michael@389 23
michael@389 24 # package information
michael@389 25 Name: kamailio
michael@389 26 Summary: Open Source SIP Server
michael@389 27 URL: http://www.kamailio.org/
michael@389 28 Vendor: IPTelorg GmbH, Fraunhofer FOKUS, SIP Router Project
michael@389 29 Packager: Michael Schloh von Bennewitz
michael@389 30 Distribution: Europalab Networks Production
michael@389 31 Class: PLUS
michael@389 32 Group: VoIP
michael@389 33 License: GPL
michael@389 34 Version: 3.1.5
michael@389 35 Release: 20111000
michael@389 36
michael@389 37 # package options
michael@389 38 %option with_cons yes
michael@389 39 %option with_fsl yes
michael@389 40 %option with_ssl yes
michael@389 41 %option with_sctp no
michael@389 42 %option with_croute no
michael@389 43 %option with_ldap no
michael@389 44 %option with_memcached no
michael@389 45 %option with_radius no
michael@389 46 %option with_snmp no
michael@389 47 %option with_bdb no
michael@389 48 %option with_mysql no
michael@389 49 %option with_osp no
michael@389 50 %option with_pgsql no
michael@389 51 %option with_odbc no
michael@389 52 %option with_geoip no
michael@389 53 %option with_lua no
michael@389 54 %option with_python no
michael@389 55
michael@389 56 # list of sources
michael@389 57 Source0: http://www.kamailio.org/pub/kamailio/%{version}/src/kamailio-%{version}_src.tar.gz
michael@389 58 Source2: rc.kamailio
michael@389 59 Source3: fsl.kamailio
michael@389 60
michael@389 61 # build information
michael@389 62 Prefix: %{l_prefix}
michael@389 63 BuildRoot: %{l_buildroot}
michael@389 64 BuildPreReq: OpenPKG, openpkg >= 20060823
michael@389 65 PreReq: OpenPKG, openpkg >= 20060823
michael@389 66 BuildPreReq: libxml, expat, curl, readline
michael@389 67 PreReq: libxml, expat, curl, readline
michael@389 68 BuildPreReq: make, gcc, flex, bison, sed, pkgconfig
michael@389 69 PreReq: bash
michael@389 70 %if "%{with_cons}" == "yes"
michael@389 71 PreReq: perl-dbi, perl-term
michael@389 72 %endif
michael@389 73 %if "%{with_fsl}" == "yes"
michael@389 74 BuildPreReq: fsl
michael@389 75 PreReq: fsl
michael@389 76 %endif
michael@389 77 %if "%{with_ssl}" == "yes"
michael@389 78 BuildPreReq: openssl
michael@389 79 PreReq: openssl
michael@389 80 %endif
michael@389 81 %if "%{with_croute}" == "yes"
michael@389 82 BuildPreReq: confuse
michael@389 83 PreReq: confuse
michael@389 84 %endif
michael@389 85 %if "%{with_ldap}" == "yes"
michael@389 86 BuildPreReq: openldap
michael@389 87 PreReq: openldap
michael@389 88 %endif
michael@389 89 %if "%{with_memcached}" == "yes"
michael@389 90 BuildPreReq: memcached
michael@389 91 PreReq: memcached
michael@389 92 %endif
michael@389 93 %if "%{with_osp}" == "yes"
michael@389 94 BuildPreReq: osptoolkit
michael@389 95 PreReq: osptoolkit
michael@389 96 %endif
michael@389 97 %if "%{with_radius}" == "yes"
michael@389 98 BuildPreReq: radiusclient
michael@389 99 PreReq: radiusclient
michael@389 100 %endif
michael@389 101 %if "%{with_snmp}" == "yes"
michael@389 102 BuildPreReq: snmp
michael@389 103 PreReq: snmp
michael@389 104 %endif
michael@389 105 %if "%{with_bdb}" == "yes"
michael@389 106 BuildPreReq: db
michael@389 107 PreReq: db
michael@389 108 %endif
michael@389 109 %if "%{with_mysql}" == "yes"
michael@389 110 BuildPreReq: mysql
michael@389 111 PreReq: mysql
michael@389 112 %endif
michael@389 113 %if "%{with_pgsql}" == "yes"
michael@389 114 BuildPreReq: postgresql
michael@389 115 PreReq: postgresql
michael@389 116 %endif
michael@389 117 %if "%{with_odbc}" == "yes"
michael@389 118 BuildPreReq: unixodbc
michael@389 119 PreReq: unixodbc
michael@389 120 %endif
michael@389 121 %if "%{with_geoip}" == "yes"
michael@389 122 BuildPreReq: geoip
michael@389 123 PreReq: geoip
michael@389 124 %endif
michael@389 125 %if "%{with_lua}" == "yes"
michael@389 126 BuildPreReq: lua
michael@389 127 PreReq: lua
michael@389 128 %endif
michael@389 129 %if "%{with_python}" == "yes"
michael@389 130 BuildPreReq: python
michael@389 131 PreReq: python
michael@389 132 %endif
michael@389 133 AutoReq: no
michael@389 134 AutoReqProv: no
michael@389 135
michael@389 136 %description
michael@389 137 Kamailio is (beside Opensips) a successor to OpenSER, which in
michael@389 138 turn was spawned from FhG FOKUS's SIP Express Router (SER). It
michael@389 139 provides SIP (RFC3621) registrar, proxy and routing functionality.
michael@389 140 A C shell like scripting language provides for control over the
michael@389 141 server's behaviour. It's modular architecture allows for fine
michael@389 142 grained loading of required functionality.
michael@389 143
michael@389 144 Kamailio can be used as a: Kamailio fits in scenarios:
michael@389 145
michael@389 146 Registrar server SIP trunking
michael@389 147 Router, proxy SIP load balancing
michael@389 148 Redirect server SIP front end termination
michael@389 149 Presence agent Residential providers
michael@389 150 Back to back user agent white label solutions
michael@389 151 Instant messaging server Enterprise services
michael@389 152 SIP to SMS gateway LCR for multi gateways
michael@389 153 SIP to XMPP gateway
michael@389 154 Load balancer or dispatcher
michael@389 155 Front end for asterisk
michael@389 156 NAT traversal unit
michael@389 157 Application server
michael@389 158
michael@389 159 %track
michael@389 160 prog kamailio = {
michael@389 161 version = %{version}
michael@389 162 url = http://www.kamailio.org/pub/kamailio/
michael@389 163 regex = (\d+\.\d+\.\d+)/
michael@389 164 url = http://www.kamailio.org/pub/kamailio/__NEWVER__/src/
michael@389 165 regex = kamailio-(__VER__)_src\.tar\.gz
michael@389 166 }
michael@389 167
michael@389 168 %prep
michael@389 169 %setup -q
michael@389 170 %{l_shtool} subst \
michael@389 171 -e 's;\$(LOCALBASE)/[^/][^/]*/sctp.h;;g' \
michael@389 172 -e 's;\$(LOCALBASE)/ssl/include;`%{l_prefix}/bin/pkg-config --cflags-only-I openssl`;g' \
michael@389 173 -e 's;\$(LOCALBASE)/ssl/lib;`%{l_prefix}/bin/pkg-config --libs openssl`;g' \
michael@389 174 -e 's;\(data_dir\) *= *\(\$(MAIN_NAME)\);\1 = share/\2;g' \
michael@389 175 -e 's;LOCALBASE *[\?:]*=.*;LOCALBASE = %{l_prefix};g' \
michael@389 176 Makefile.defs
michael@389 177 %{l_shtool} subst \
michael@389 178 -e 's;CFLAGS *= *$;CFLAGS = %{l_cflags -O};g' \
michael@389 179 -e 's;LDFLAGS *= *$;LDFLAGS = %{l_ldflags};g' \
michael@389 180 -e 's;C_INCLUDES *= *$;C_INCLUDES = %{l_cppflags};g' \
michael@389 181 Makefile.defs
michael@389 182 %{l_shtool} subst \
michael@389 183 -e 's;/usr/include/readline/readline.h;;g' \
michael@389 184 utils/sercmd/Makefile
michael@389 185 %{l_shtool} subst \
michael@389 186 -e 's;-I$(LOCALBASE)/Berkeley[^ ]* *;;g' \
michael@389 187 -e 's;-I$(LOCALBASE)/include[^ ]* *;;g' \
michael@389 188 -e 's;-I$(SYSBASE)/include[^ ]* *;;g' \
michael@389 189 -e 's;LIBS=.*;LIBS=`%{l_prefix}/bin/pkg-config --libs db`;g' \
michael@389 190 utils/db_berkeley/Makefile
michael@389 191 %{l_shtool} subst \
michael@389 192 -e 's;\(mkdir.*\$(data_prefix)/\$(data_dir)/.*\)/kamailio;\1;g' \
michael@389 193 utils/kamctl/Makefile
michael@389 194 %{l_shtool} subst \
michael@389 195 -e 's;\(radiusclient\)-ng;\1;g' \
michael@389 196 -e 's;/usr/local\(/etc/radiusclient/radiusclient.conf\);%{l_prefix}\1;' \
michael@389 197 Makefile.radius \
michael@389 198 lib/kcore/radius.h \
michael@389 199 modules_s/avp_radius/avp_radius.c \
michael@389 200 modules_s/uri_radius/checks.c \
michael@389 201 modules_s/uri_radius/urirad_mod.c \
michael@389 202 modules_s/acc_radius/acc_radius.c \
michael@389 203 modules_s/auth_radius/authrad_mod.c \
michael@389 204 modules_s/auth_radius/sterman.h
michael@389 205 %{l_shtool} subst \
michael@389 206 -e 's;\(DEFS *[\?:+]*=[^\\]*\);\1 -D__EXTENSIONS__;g' \
michael@389 207 modules/db_mysql/Makefile \
michael@389 208 modules/xmlrpc/Makefile
michael@389 209 %{l_shtool} subst \
michael@389 210 -e 's;\(-keyout.*\);\1 || true;' \
michael@389 211 modules/tls/sip-router_cert.sh
michael@389 212
michael@389 213 %build
michael@389 214 # select modules
michael@389 215 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'
michael@389 216 %if "%{with_ssl}" == "yes"
michael@389 217 modslist="$modslist tls"
michael@389 218 %endif
michael@389 219 %if "%{with_croute}" == "yes"
michael@389 220 modslist="$modslist carrierroute"
michael@389 221 %endif
michael@389 222 %if "%{with_ldap}" == "yes"
michael@389 223 modslist="$modslist ldap h350"
michael@389 224 %endif
michael@389 225 %if "%{with_memcached}" == "yes"
michael@389 226 modslist="$modslist memcached"
michael@389 227 %endif
michael@389 228 %if "%{with_osp}" == "yes"
michael@389 229 modslist="$modslist osp"
michael@389 230 %endif
michael@389 231 %if "%{with_radius}" == "yes"
michael@389 232 modslist="$modslist acc_radius auth_radius avp_radius group misc_radius uri_radius"
michael@389 233 %endif
michael@389 234 %if "%{with_snmp}" == "yes"
michael@389 235 modslist="$modslist snmpstats"
michael@389 236 %endif
michael@389 237 %if "%{with_bdb}" == "yes"
michael@389 238 modslist="$modslist db_berkeley"
michael@389 239 %endif
michael@389 240 %if "%{with_mysql}" == "yes"
michael@389 241 modslist="$modslist db_mysql"
michael@389 242 %endif
michael@389 243 %if "%{with_pgsql}" == "yes"
michael@389 244 modslist="$modslist db_postgres"
michael@389 245 %endif
michael@389 246 %if "%{with_odbc}" == "yes"
michael@389 247 modslist="$modslist db_unixodbc"
michael@389 248 %endif
michael@389 249 %if "%{with_lua}" == "yes"
michael@389 250 modslist="$modslist app_lua"
michael@389 251 %endif
michael@389 252 %if "%{with_python}" == "yes"
michael@389 253 modslist="$modslist app_python"
michael@389 254 %endif
michael@389 255 %if "%{with_geoip}" == "yes"
michael@389 256 modslist="$modslist geoip"
michael@389 257 %endif
michael@389 258
michael@389 259 # build configuration
michael@389 260 %{l_make} %{l_mflags} \
michael@389 261 CC="%{l_cc}" \
michael@389 262 FLAVOUR=kamailio \
michael@389 263 %if "%{with_sctp}" == "yes"
michael@389 264 SCTP=1 \
michael@389 265 %endif
michael@389 266 %if "%{with_ssl}" == "yes"
michael@389 267 TLS_HOOKS=1 \
michael@389 268 %endif
michael@389 269 prefix=%{l_prefix} \
michael@389 270 cfg
michael@389 271
michael@389 272 # build program
michael@389 273 %{l_make} %{l_mflags -O} \
michael@389 274 CC="%{l_cc}" \
michael@389 275 %if "%{with_sctp}" == "yes"
michael@389 276 SCTP=1 \
michael@389 277 %endif
michael@389 278 %if "%{with_ssl}" == "yes"
michael@389 279 TLS_HOOKS=1 \
michael@389 280 %endif
michael@389 281 prefix=%{l_prefix} \
michael@389 282 kamailio
michael@389 283
michael@389 284 # build utilities
michael@389 285 %{l_make} %{l_mflags -O} \
michael@389 286 CC="%{l_cc}" \
michael@389 287 %if "%{with_sctp}" == "yes"
michael@389 288 SCTP=1 \
michael@389 289 %endif
michael@389 290 %if "%{with_ssl}" == "yes"
michael@389 291 TLS_HOOKS=1 \
michael@389 292 %endif
michael@389 293 prefix=%{l_prefix} \
michael@389 294 modules="$modslist" \
michael@389 295 utils utils/kamctl
michael@389 296
michael@389 297 # build modules
michael@389 298 %{l_make} %{l_mflags -O} \
michael@389 299 CC="%{l_cc}" \
michael@389 300 LD_RPATH=-Wl,-rpath, \
michael@389 301 SER_RPATH_LST=%{l_prefix}/lib/kamailio \
michael@389 302 %if "%{with_sctp}" == "yes"
michael@389 303 SCTP=1 \
michael@389 304 %endif
michael@389 305 %if "%{with_ssl}" == "yes"
michael@389 306 TLS_HOOKS=1 \
michael@389 307 %endif
michael@389 308 include_modules="$modslist" \
michael@389 309 skip_modules="" \
michael@389 310 prefix=%{l_prefix} \
michael@389 311 every-module
michael@389 312
michael@389 313 %install
michael@389 314 rm -rf $RPM_BUILD_ROOT
michael@389 315
michael@389 316 # select modules
michael@389 317 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'
michael@389 318 %if "%{with_ssl}" == "yes"
michael@389 319 modslist="$modslist tls"
michael@389 320 %endif
michael@389 321 %if "%{with_croute}" == "yes"
michael@389 322 modslist="$modslist carrierroute"
michael@389 323 %endif
michael@389 324 %if "%{with_ldap}" == "yes"
michael@389 325 modslist="$modslist ldap h350"
michael@389 326 %endif
michael@389 327 %if "%{with_memcached}" == "yes"
michael@389 328 modslist="$modslist memcached"
michael@389 329 %endif
michael@389 330 %if "%{with_osp}" == "yes"
michael@389 331 modslist="$modslist osp"
michael@389 332 %endif
michael@389 333 %if "%{with_radius}" == "yes"
michael@389 334 modslist="$modslist acc_radius auth_radius avp_radius group misc_radius uri_radius"
michael@389 335 %endif
michael@389 336 %if "%{with_snmp}" == "yes"
michael@389 337 modslist="$modslist snmpstats"
michael@389 338 %endif
michael@389 339 %if "%{with_bdb}" == "yes"
michael@389 340 modslist="$modslist db_berkeley"
michael@389 341 %endif
michael@389 342 %if "%{with_mysql}" == "yes"
michael@389 343 modslist="$modslist db_mysql"
michael@389 344 %endif
michael@389 345 %if "%{with_pgsql}" == "yes"
michael@389 346 modslist="$modslist db_postgres"
michael@389 347 %endif
michael@389 348 %if "%{with_odbc}" == "yes"
michael@389 349 modslist="$modslist db_unixodbc"
michael@389 350 %endif
michael@389 351 %if "%{with_lua}" == "yes"
michael@389 352 modslist="$modslist app_lua"
michael@389 353 %endif
michael@389 354 %if "%{with_python}" == "yes"
michael@389 355 modslist="$modslist app_python"
michael@389 356 %endif
michael@389 357 %if "%{with_geoip}" == "yes"
michael@389 358 modslist="$modslist geoip"
michael@389 359 %endif
michael@389 360
michael@389 361 # install program, utils, and modules
michael@389 362 %{l_make} %{l_mflags} \
michael@389 363 INSTALL="%{l_shtool} install -c" \
michael@389 364 INSTALL_CFG="%{l_shtool} install -c" \
michael@389 365 INSTALL_BIN="%{l_shtool} install -c" \
michael@389 366 INSTALL_SCRIPT="%{l_shtool} install -c" \
michael@389 367 INSTALL_MODULES="%{l_shtool} install -c" \
michael@389 368 INSTALL_LIB="%{l_shtool} install -c" \
michael@389 369 INSTALL_DOC="%{l_shtool} install -c" \
michael@389 370 INSTALL_MAN="%{l_shtool} install -c" \
michael@389 371 INSTALL_SHARE="%{l_shtool} install -c" \
michael@389 372 basedir=$RPM_BUILD_ROOT \
michael@389 373 prefix=%{l_prefix} \
michael@389 374 doc-dir=share/kamailio/doc \
michael@389 375 man-dir=man \
michael@389 376 data-dir=share/kamailio \
michael@389 377 include_modules="$modslist" \
michael@389 378 skip_modules="" \
michael@389 379 install
michael@389 380
michael@389 381 # strip down installation
michael@389 382 strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
michael@389 383
michael@389 384 # create installation hierarchy
michael@389 385 %{l_shtool} mkdir -f -p -m 700 \
michael@389 386 $RPM_BUILD_ROOT%{l_prefix}/var/kamailio
michael@389 387
michael@389 388 # install OSSP fsl configuration
michael@389 389 %{l_shtool} mkdir -f -p -m 755 \
michael@389 390 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
michael@389 391 %{l_shtool} install -c -m 644 %{l_value -s -a} \
michael@389 392 %{SOURCE fsl.kamailio} \
michael@389 393 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
michael@389 394
michael@389 395 # install runcommand script
michael@389 396 %{l_shtool} mkdir -f -p -m 755 \
michael@389 397 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
michael@389 398 %{l_shtool} install -c -m 755 %{l_value -s -a} \
michael@389 399 %{SOURCE rc.kamailio} \
michael@389 400 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
michael@389 401
michael@389 402 # determine installation files
michael@389 403 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
michael@389 404 %{l_files_std} \
michael@389 405 '%not %dir %{l_prefix}/etc/fsl' \
michael@389 406 '%config %{l_prefix}/etc/fsl/*' \
michael@389 407 '%config %{l_prefix}/etc/kamailio/*' \
michael@389 408 '%doc %{l_prefix}/share/kamailio/doc/*' \
michael@389 409 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/kamailio'
michael@389 410
michael@389 411 %files -f files
michael@389 412
michael@389 413 %clean
michael@389 414 rm -rf $RPM_BUILD_ROOT
michael@389 415
michael@389 416 %post
michael@389 417 # on install, setup database (kamctl db create /pfx/var/kamailio/db)
michael@389 418 if [ ! -d $RPM_INSTALL_PREFIX/var/kamailio/db ]; then
michael@389 419 %{l_shtool} mkdir -f -p -m 700 -o %{l_rusr} -g %{l_rgrp} \
michael@389 420 $RPM_INSTALL_PREFIX/var/kamailio/db
michael@389 421 rm -f $RPM_INSTALL_PREFIX/share/kamailio/dbtext/*.orig
michael@389 422 %{l_shtool} install -c -m 600 -o %{l_rusr} -g %{l_rgrp} \
michael@389 423 $RPM_INSTALL_PREFIX/share/kamailio/dbtext/* \
michael@389 424 $RPM_INSTALL_PREFIX/var/kamailio/db/
michael@389 425 fi
michael@389 426
michael@389 427 # after upgrade, restart service
michael@389 428 [ $1 -eq 2 ] || exit 0
michael@389 429 eval `%{l_rc} kamailio status 2>/dev/null`
michael@389 430 [ ".$kamailio_active" = .yes ] && %{l_rc} kamailio restart
michael@389 431 exit 0
michael@389 432
michael@389 433 %preun
michael@389 434 # before erase, stop service and remove log files
michael@389 435 [ $1 -eq 0 ] || exit 0
michael@389 436 %{l_rc} kamailio stop 2>/dev/null
michael@389 437 rm -rf $RPM_INSTALL_PREFIX/var/kamailio/db 2>/dev/null || true
michael@389 438 rm -f $RPM_INSTALL_PREFIX/var/kamailio/* 2>/dev/null || true
michael@389 439 exit 0
michael@389 440

mercurial