1.1 --- a/opensips/opensips.spec Wed Sep 21 14:02:13 2011 +0200 1.2 +++ b/opensips/opensips.spec Wed Sep 21 14:04:16 2011 +0200 1.3 @@ -1,6 +1,6 @@ 1.4 ## 1.5 ## opensips.spec -- OpenPKG RPM Package Specification 1.6 -## Copyright (c) 2000-2010 OpenPKG Foundation e.V. <http://openpkg.net/> 1.7 +## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/> 1.8 ## 1.9 ## Permission to use, copy, modify, and distribute this software for 1.10 ## any purpose with or without fee is hereby granted, provided that 1.11 @@ -22,40 +22,62 @@ 1.12 ## 1.13 1.14 # package options 1.15 -%define V_opensips 1.6.4 1.16 %define V_rtpproxy 1.2.1 1.17 1.18 # package information 1.19 Name: opensips 1.20 -Summary: Open SIP Server 1.21 +Summary: Open SIP Router 1.22 URL: http://www.opensips.org/ 1.23 -Vendor: FhG FOKUS et al. 1.24 +Vendor: Voice System SRL 1.25 Packager: OpenPKG Foundation e.V. 1.26 Distribution: OpenPKG Community 1.27 Class: PLUS 1.28 Group: VoIP 1.29 License: GPL 1.30 -Version: %{V_opensips} 1.31 -Release: 20101221 1.32 +Version: 1.7.0 1.33 +Release: 20110912 1.34 1.35 # package options 1.36 -%option with_fsl yes 1.37 -%option with_ssl no 1.38 +%option with_cons yes 1.39 +%option with_fsl yes 1.40 +%option with_ssl yes 1.41 +%option with_sctp no 1.42 +%option with_json no 1.43 +%option with_croute no 1.44 +%option with_ldap no 1.45 +%option with_memcached no 1.46 +%option with_radius no 1.47 +%option with_snmp no 1.48 +%option with_bdb no 1.49 +%option with_mysql no 1.50 +%option with_osp no 1.51 +%option with_pgsql no 1.52 +%option with_odbc no 1.53 +%option with_geoip no 1.54 +%option with_dbgmem no 1.55 1.56 # list of sources 1.57 -Source0: http://www.opensips.org/pub/opensips/%{version}/src/opensips-%{V_opensips}-tls_src.tar.gz 1.58 -Source1: http://b2bua.org/chrome/site/rtpproxy-%{V_rtpproxy}.tar.gz 1.59 +Source0: http://www.opensips.org/pub/opensips/%{version}/src/opensips-%{version}_src.tar.gz 1.60 +Source1: http://www.b2bua.org/chrome/site/rtpproxy-%{V_rtpproxy}.tar.gz 1.61 Source2: rc.opensips 1.62 Source3: fsl.opensips 1.63 Source4: opensips.cfg 1.64 -Source5: opensips.schema-dbtext.txt 1.65 Patch0: opensips.patch 1.66 +Patch1: opensips.patch.dict 1.67 +Patch2: opensips.patch.uac 1.68 +Patch3: opensips.patch.reg 1.69 +Patch4: opensips.patch.rtpproxy 1.70 1.71 # build information 1.72 -BuildPreReq: OpenPKG, openpkg >= 20100101, make, gcc, flex, bison, sed 1.73 -PreReq: OpenPKG, openpkg >= 20100101 1.74 -BuildPreReq: pcre 1.75 -PreReq: pcre 1.76 +Prefix: %{l_prefix} 1.77 +BuildRoot: %{l_buildroot} 1.78 +BuildPreReq: OpenPKG, openpkg >= 20060823, make, gcc, flex, bison, sed 1.79 +PreReq: OpenPKG, openpkg >= 20060823, bash 1.80 +BuildPreReq: libxml, expat, curl, pkgconfig 1.81 +PreReq: libxml, expat, curl 1.82 +%if "%{with_cons}" == "yes" 1.83 +PreReq: perl-dbi, perl-term 1.84 +%endif 1.85 %if "%{with_fsl}" == "yes" 1.86 BuildPreReq: fsl 1.87 PreReq: fsl 1.88 @@ -64,22 +86,91 @@ 1.89 BuildPreReq: openssl 1.90 PreReq: openssl 1.91 %endif 1.92 +%if "%{with_croute}" == "yes" 1.93 +BuildPreReq: confuse 1.94 +PreReq: confuse 1.95 +%endif 1.96 +%if "%{with_json}" == "yes" 1.97 +BuildPreReq: json 1.98 +PreReq: json 1.99 +%endif 1.100 +%if "%{with_ldap}" == "yes" 1.101 +BuildPreReq: openldap 1.102 +PreReq: openldap 1.103 +%endif 1.104 +%if "%{with_memcached}" == "yes" 1.105 +BuildPreReq: memcached 1.106 +PreReq: memcached 1.107 +%endif 1.108 +%if "%{with_osp}" == "yes" 1.109 +BuildPreReq: osptoolkit 1.110 +PreReq: osptoolkit 1.111 +%endif 1.112 +%if "%{with_radius}" == "yes" 1.113 +BuildPreReq: radiusclient 1.114 +PreReq: radiusclient 1.115 +%endif 1.116 +%if "%{with_snmp}" == "yes" 1.117 +BuildPreReq: snmp 1.118 +PreReq: snmp 1.119 +%endif 1.120 +%if "%{with_bdb}" == "yes" 1.121 +BuildPreReq: db 1.122 +PreReq: db 1.123 +%endif 1.124 +%if "%{with_mysql}" == "yes" 1.125 +BuildPreReq: mysql 1.126 +PreReq: mysql 1.127 +%endif 1.128 +%if "%{with_pgsql}" == "yes" 1.129 +BuildPreReq: postgresql 1.130 +PreReq: postgresql 1.131 +%endif 1.132 +%if "%{with_odbc}" == "yes" 1.133 +BuildPreReq: unixodbc 1.134 +PreReq: unixodbc 1.135 +%endif 1.136 +%if "%{with_geoip}" == "yes" 1.137 +BuildPreReq: geoip 1.138 +PreReq: geoip 1.139 +%endif 1.140 +AutoReq: no 1.141 +AutoReqProv: no 1.142 1.143 %description 1.144 OpenSIPS is (beside Kamailio) a successor to OpenSER, which in 1.145 - turn was spawned from FhG FOKUS' SIP Express Router (SER). It 1.146 + turn was spawned from FhG FOKUS's SIP Express Router (SER). It 1.147 provides SIP (RFC3621) registrar, proxy and routing functionality. 1.148 - A C shell like scripting language provides full control over the 1.149 - server's behaviour. It's modular architecture allows only required 1.150 - functionality to be loaded. 1.151 + A C shell like scripting language provides for control over the 1.152 + server's behaviour. It's modular architecture allows for fine 1.153 + grained loading of required functionality. 1.154 + 1.155 + The third party Sippy RTPproxy from http://www.rtpproxy.org/ 1.156 + is included to make communication between SIP user agents 1.157 + behind NATs (Network Address Translators) possible. 1.158 + 1.159 + OpenSIPS can be used as a: OpenSIPS fits in scenarios: 1.160 + 1.161 + Registrar server SIP trunking 1.162 + Router, proxy SIP load balancing 1.163 + Redirect server SIP front end termination 1.164 + Presence agent Residential providers 1.165 + Back to back user agent white label solutions 1.166 + Instant messaging server Enterprise services 1.167 + SIP to SMS gateway LCR for multi gateways 1.168 + SIP to XMPP gateway 1.169 + Load balancer or dispatcher 1.170 + Front end for asterisk 1.171 + NAT traversal unit 1.172 + Application server 1.173 1.174 %track 1.175 prog opensips = { 1.176 - version = %{V_opensips} 1.177 + version = %{version} 1.178 url = http://www.opensips.org/pub/opensips/ 1.179 regex = (\d+\.\d+\.\d+)/ 1.180 url = http://www.opensips.org/pub/opensips/__NEWVER__/src/ 1.181 - regex = opensips-(__VER__)-tls_src\.tar\.gz 1.182 + regex = opensips-(__VER__)_src\.tar\.gz 1.183 } 1.184 prog opensips:rtpproxy = { 1.185 version = %{V_rtpproxy} 1.186 @@ -91,11 +182,267 @@ 1.187 %setup -q -n opensips-%{version}-tls 1.188 %setup -q -n opensips-%{version}-tls -T -D -a 1 1.189 %patch -p0 1.190 + %patch -p0 -P 1 1.191 + %patch -p0 -P 2 1.192 + %patch -p0 -P 3 1.193 + ( cd rtpproxy-%{V_rtpproxy} 1.194 + %patch -p0 -P 4 1.195 + ) || exit $? 1.196 + %{l_shtool} subst \ 1.197 + -e 's;^#! */bin/sh;#! %{l_prefix}/bin/bash;' \ 1.198 + scripts/opensipsctl 1.199 + %{l_shtool} subst \ 1.200 + -e 's;^#! */bin/bash;#! %{l_prefix}/bin/bash;' \ 1.201 + modules/seas/doc/xml2sgml.sh \ 1.202 + scripts/opensipsdbctl \ 1.203 + test/* 1.204 + %{l_shtool} subst \ 1.205 +%if "%{with_dbgmem}" == "yes" 1.206 + -e 's;\(-DF_MALLOC\);#\1;' \ 1.207 + -e 's;#\(-DDBG_QM_MALLOC\);\1;' \ 1.208 +%endif 1.209 + -e 's;\(#define PKG_MEM_POOL_SIZE\) \(1024\*1024\);\1 8*\2;' \ 1.210 + Makefile.defs \ 1.211 + config.h 1.212 + %{l_shtool} subst \ 1.213 +%if "%{with_fsl}" == "yes" 1.214 + -e 's;@fslldflags@;-L$(prefix)/lib;g' \ 1.215 + -e 's;@fsllibs@;-lfsl;g' \ 1.216 +%else 1.217 + -e 's;@fslldflags@;;g' \ 1.218 + -e 's;@fsllibs@;;g' \ 1.219 +%endif 1.220 + -e 's;^\(DEFS+= -I\)\$(LOCALBASE).*;\1$(prefix)/include;' \ 1.221 + -e 's;^\(DEFS+= -L\)\$(LOCALBASE).*;\1$(prefix)/lib -lssl -lcrypto;' \ 1.222 + -e 's;^SVNVERSION *=.*;;g' \ 1.223 + -e 's;^DBHTML2TXT *=.*;;g' \ 1.224 + -e 's;^DBXML2PDF *=.*;;g' \ 1.225 + -e 's;lib64;lib;' \ 1.226 + Makefile.defs 1.227 + %{l_shtool} subst \ 1.228 + -e 's;\(radiusclient\)-ng;\1;g' \ 1.229 + modules/aaa_radius/aaa_radius.c \ 1.230 + modules/aaa_radius/rad.c \ 1.231 + Makefile.defs 1.232 + %{l_shtool} subst \ 1.233 + -e 's;\(\$(data-dir)\)/\(dbtext\)/opensips;\1/\2;g' \ 1.234 + -e 's;\(\$(data-dir)\)/\(db_berkeley\)/opensips;\1/\2;g' \ 1.235 + -e 's;\(/usr/local/etc/opensips\);\1/*;g' \ 1.236 + -e 's;\(s#/usr/local/sbin\)#;\1/*#;g' \ 1.237 + -e 's;\(s#/usr/share/doc/$(NAME)/#$(doc-target)\)#;\1/#;g' \ 1.238 + -e 's;\(\$(MAKE).*\) \(install_module_custom\);\1 makefile_defs=0 \2;' \ 1.239 + Makefile 1.240 + %{l_shtool} subst \ 1.241 + -e 's;^\(LIBS=\).*;\1-L`%{l_prefix}/bin/pkg-config --libs db`;' \ 1.242 + utils/db_berkeley/Makefile 1.243 + %{l_shtool} subst \ 1.244 + -e 's;/usr/share/doc/opensips/AUTHORS;%{l_prefix}/share/opensips/doc/AUTHORS;' \ 1.245 + scripts/opensipsctl.8 1.246 + %{l_shtool} subst \ 1.247 + -e 's;\(ETCDIR=".*\)/"$;\1";' \ 1.248 + -e 's;\(ETCDIR="\)/usr/local/\(etc/opensips"\);\1%{l_prefix}/\2;' \ 1.249 + -e 's;\. /etc/opensips/opensipsctlrc;true;' \ 1.250 + -e 's;\. ~/.opensipsctlrc;true;' \ 1.251 + -e 's;/usr/local\(/lib/opensips/opensipsctl\);%{l_prefix}\1;' \ 1.252 + -e 's;/usr/local/\(etc/opensips/opensipsctlrc\);%{l_prefix}/\1;' \ 1.253 + -e 's;PATH=\$PATH:/usr/local/sbin;PATH=%{l_prefix}/sbin:$PATH;' \ 1.254 + scripts/opensipsdbctl \ 1.255 + scripts/opensipsctl 1.256 + %{l_shtool} subst \ 1.257 + -e 's;\(DB_PATH="\)[^"][^"]*;\1%{l_prefix}/var/opensips/db;' \ 1.258 + scripts/osipsconsolerc \ 1.259 + scripts/opensipsctlrc 1.260 + %{l_shtool} subst \ 1.261 + -e 's;=/var/run/\(opensips.pid\);=%{l_prefix}/var/opensips/\1;g' \ 1.262 + -e 's;/var/run/\(opensips.pid\);%{l_prefix}/var/opensips/\1;g' \ 1.263 + -e 's;\(my \$fifo_reply_path\) = "/tmp/";\1 = "%{l_prefix}/var/opensips/";' \ 1.264 + -e 's;\(my \$HISTORY_FILE\) = "/tmp/osipsconsole_history";\1 = "%{l_prefix}/var/opensips/osipsconsole_history";' \ 1.265 + scripts/opensipsctl \ 1.266 + scripts/opensipsctlrc \ 1.267 + scripts/osipsconsole \ 1.268 + scripts/osipsconsolerc 1.269 + %{l_shtool} subst \ 1.270 + -e 's;/usr/local;;g' \ 1.271 + -e 's;\(/etc/opensips/\)\.\(opensipsctlrc\);%{l_prefix}\1\2;g' \ 1.272 + scripts/opensipsctl.8 1.273 + %{l_shtool} subst \ 1.274 + -e 's;/var/run/\(opensips.pid\);%{l_prefix}/var/opensips/\1;' \ 1.275 + scripts/opensipsctl.base 1.276 + %{l_shtool} subst \ 1.277 + -e 's;\(path=\)\$CHROOT_DIR/tmp/\(\$name\);\1${OSER_FIRET}/\2;g' \ 1.278 + scripts/opensipsctl.fifo 1.279 + %{l_shtool} subst \ 1.280 + -e 's;/usr/local/share/opensips/dbtext/opensips;%{l_prefix}/var/opensips/db;' \ 1.281 + scripts/opensipsctl.dbtext 1.282 + %{l_shtool} subst \ 1.283 + -e 's;\(DB_PATH="\)[^"][^"]*;%{l_prefix}/var/opensips/db_berkeley;' \ 1.284 + scripts/opensipsctl.db_berkeley 1.285 + %{l_shtool} subst \ 1.286 + -e 's;PATH=\$PATH:/usr/local/sbin;PATH=%{l_prefix}/sbin:$PATH;' \ 1.287 + scripts/opensipsctl \ 1.288 + scripts/opensipsdbctl.base 1.289 + %{l_shtool} subst \ 1.290 + -e 's;/usr/local/etc/opensips/dbtext;%{l_prefix}/var/opensips/db;' \ 1.291 + -e 's;\(\$DATA_DIR/dbtext\)/opensips;\1;g' \ 1.292 + scripts/opensipsdbctl.dbtext 1.293 + %{l_shtool} subst \ 1.294 + -e 's;\(DATA_DIR="\)[^"][^"]*;\1%{l_prefix}/share/opensips;' \ 1.295 + scripts/opensipsdbctl.dbtext \ 1.296 + scripts/opensipsdbctl.oracle 1.297 + %{l_shtool} subst \ 1.298 + -e 's;/usr/local/etc/opensips/db_berkeley;%{l_prefix}/var/opensips/db_berkeley;' \ 1.299 + -e 's;/usr/local/BerkeleyDB.[^/][^/]*/bin;%{l_prefix}/bin;' \ 1.300 + scripts/opensipsdbctl.db_berkeley 1.301 + %{l_shtool} subst \ 1.302 + -e 's;/usr/local/\(share/opensips\);%{l_prefix}/\1;' \ 1.303 + scripts/opensipsdbctl.db_berkeley \ 1.304 + scripts/opensipsdbctl.mysql \ 1.305 + scripts/opensipsdbctl.pgsql 1.306 + %{l_shtool} subst \ 1.307 + -e 's;\(script_flags(int\));\1,null);' \ 1.308 + scripts/dbtext/opensips/dialog 1.309 + %{l_shtool} subst \ 1.310 + -e 's;body(string);body(blob);' \ 1.311 + -e 's;sender(string);sender(string,null);' \ 1.312 + scripts/dbtext/opensips/presentity 1.313 + %{l_shtool} subst \ 1.314 + -e 's;\(expires(int\));\1,null);' \ 1.315 + -e 's;\(desired_expires(int\));\1,null);' \ 1.316 + -e 's;\(contact(string\));\1,null);' \ 1.317 + -e 's;\(remote_contact(string\));\1,null);' \ 1.318 + -e 's;\(version(int\));\1,null);' \ 1.319 + -e 's;\(extra_headers(string\));\1,null);' \ 1.320 + scripts/dbtext/opensips/pua 1.321 + %{l_shtool} subst \ 1.322 + -e 's;\(reason(string\));\1,null);' \ 1.323 + scripts/dbtext/opensips/active_watchers \ 1.324 + scripts/dbtext/opensips/rls_watchers 1.325 + %{l_shtool} subst \ 1.326 + -e 's;#! */usr/bin/python;#! %{l_prefix}/bin/python;' \ 1.327 + scripts/dbtextdb/*.py 1.328 + %{l_shtool} subst \ 1.329 + -e 's;#! */usr/bin/perl;#! %{l_prefix}/bin/perl;' \ 1.330 + -e 's;^\(my \$PATH_BIN =\) "./";\1 "%{l_prefix}/bin/";' \ 1.331 + -e 's;^\(my \$PATH_CTLRC =\) "./scripts/";\1 "%{l_prefix}/etc/opensips/";' \ 1.332 + -e 's;^\(my \$PATH_ETC =\) "/usr/local/etc";\1 "%{l_prefix}/etc";' \ 1.333 + -e 's;^\(my \$PATH_LIBS =\) "/usr/local/lib";\1 "%{l_prefix}/lib";' \ 1.334 + -e 's;^\(my \$PATH_SHARE =\) "/usr/local/share";\1 "%{l_prefix}/share";' \ 1.335 + -e 's;^\(my $path = \)"/tmp/";\1"%{l_prefix}/var/opensips/";' \ 1.336 + scripts/osipsconsole 1.337 + %{l_shtool} subst \ 1.338 + -e 's;if ( -x "/usr/bin/";if ( -x "%{l_prefix}/bin";' \ 1.339 + -e 's;if \[ -x "/usr/bin/\$1" \];if [ -x "%{l_prefix}/bin/$1" ];' \ 1.340 + -e 's;\$TOOLPATH = "/usr/bin/";$TOOLPATH = "%{l_prefix}/bin/";' \ 1.341 + -e 's;TOOLPATH="/usr/bin/\$1";TOOLPATH="%{l_prefix}/bin/$1";' \ 1.342 + -e 's;if ( -x "/bin/";if ( -x "/usr/bin/";' \ 1.343 + -e 's;if \[ -x "/bin/\$1" \];if [ -x "/usr/bin/$1" ];' \ 1.344 + -e 's;\$TOOLPATH = "/bin/";$TOOLPATH = "/usr/bin/";' \ 1.345 + -e 's;TOOLPATH="/bin/\$1";TOOLPATH="/usr/bin/$1";' \ 1.346 + -e 's;if ( -x "/usr/local/bin/\$1";if ( -x "/bin/$1";' \ 1.347 + -e 's;if \[ -x "/usr/local/bin/\$1" \];if [ -x "/bin/$1" ];' \ 1.348 + -e 's;\$TOOLPATH = "/usr/local/bin/;$TOOLPATH = "/bin/;' \ 1.349 + -e 's;TOOLPATH="/usr/local/bin/\$1";TOOLPATH="/bin/$1";' \ 1.350 + scripts/osipsconsole \ 1.351 + scripts/opensipsctl.base 1.352 + %{l_shtool} subst \ 1.353 + -e 's;^\(DEFS+=\).*\\$;\1 \\;' \ 1.354 + -e "s;\-I[^ \t][^ \t]*;`%{l_prefix}/bin/pkg-config --cflags-only-I libcurl libxml-2.0`;g" \ 1.355 + -e "s;^\(LIBS=\).*;\1`%{l_prefix}/bin/pkg-config --libs libcurl libxml-2.0`;" \ 1.356 + modules/xcap_client/Makefile 1.357 + %{l_shtool} subst \ 1.358 + -e 's;^\(DEFS+=\).*\\$;\1 \\;' \ 1.359 + -e "s;\-I[^ \t][^ \t]*;`%{l_prefix}/bin/pkg-config --cflags-only-I libxml-2.0`;g" \ 1.360 + -e "s;^\(LIBS=\).*;\1`%{l_prefix}/bin/pkg-config --libs libxml-2.0`;" \ 1.361 + modules/cpl-c/Makefile \ 1.362 + modules/presence/Makefile \ 1.363 + modules/presence_dialoginfo/Makefile \ 1.364 + modules/presence_xml/Makefile \ 1.365 + modules/pua/Makefile \ 1.366 + modules/pua_bla/Makefile \ 1.367 + modules/pua_dialoginfo/Makefile \ 1.368 + modules/pua_mi/Makefile \ 1.369 + modules/pua_usrloc/Makefile \ 1.370 + modules/pua_xmpp/Makefile \ 1.371 + modules/b2b_logic/Makefile \ 1.372 + modules/rls/Makefile 1.373 + %{l_shtool} subst \ 1.374 + -e 's;^\(DEFS+=\).*;\1`%{l_prefix}/bin/pkg-config --cflags-only-I libconfuse`;' \ 1.375 + -e 's;^\(LIBS=\).*;\1`%{l_prefix}/bin/pkg-config --libs libconfuse`;' \ 1.376 + modules/carrierroute/Makefile 1.377 + %{l_shtool} subst \ 1.378 + -e 's;\(LIBS = .*-L\$(shell pg_config --libdir) -lpq\);\1 $(shell pg_config --libs);' \ 1.379 + modules/db_postgres/Makefile 1.380 + %{l_shtool} subst \ 1.381 + -e 's;-I\$(LOCALBASE)/BerkeleyDB[0-9\.\-]*/include[\t ]*;;' \ 1.382 + -e 's;-L\$(LOCALBASE)/BerkeleyDB[0-9\.\-]*/lib[\t ]*;;' \ 1.383 + modules/db_berkeley/Makefile \ 1.384 + utils/db_berkeley/Makefile 1.385 + %{l_shtool} subst \ 1.386 + -e 's;\(\$(cfg-prefix)\)\$(shell net-snmp-config --prefix);\1;' \ 1.387 + modules/snmpstats/Makefile 1.388 + %{l_shtool} subst \ 1.389 + -e 's;LM_WARN(\(\"uac does not spread across\);LM_NOTICE(\1;' \ 1.390 + modules/tm/uac.c 1.391 + %{l_shtool} subst \ 1.392 + -e 's;\(#define MAX_SSL_RETRIES\) 32;\1 1024;' \ 1.393 + tls/tls_server.c 1.394 + %{l_shtool} subst \ 1.395 + -e 's;^\(default_bits[ \t]*=[ \t]*\)2048;\14096;' \ 1.396 + etc/tls/ca.conf 1.397 + %{l_shtool} subst \ 1.398 + -e '1,2d' \ 1.399 + etc/tls/README 1.400 + %{l_shtool} subst \ 1.401 + -e 's;\(radiusclient\)-ng;\1;g' \ 1.402 + -e 's;/usr/local\(/etc/radiusclient/radiusclient.conf\);%{l_prefix}\1;' \ 1.403 + radius.h 1.404 1.405 %build 1.406 + # select modules 1.407 + modslist='b2b_entities b2b_logic cpl-c db_http dialplan identity jabber perl perlvdb presence presence_dialoginfo presence_mwi presence_xml pua pua_bla pua_dialoginfo pua_mi pua_usrloc pua_xmpp regex rls tlsops xcap_client xmpp' 1.408 +%if "%{with_croute}" == "yes" 1.409 + modslist="$modslist carrierroute" 1.410 +%endif 1.411 +%if "%{with_json}" == "yes" 1.412 + modslist="$modslist json" 1.413 +%endif 1.414 +%if "%{with_ldap}" == "yes" 1.415 + modslist="$modslist h350 ldap" 1.416 +%endif 1.417 +%if "%{with_memcached}" == "yes" 1.418 + modslist="$modslist memcached" 1.419 +%endif 1.420 +%if "%{with_osp}" == "yes" 1.421 + modslist="$modslist osp" 1.422 +%endif 1.423 +%if "%{with_radius}" == "yes" 1.424 + modslist="$modslist aaa_radius auth_aaa group uri" 1.425 +%endif 1.426 +%if "%{with_snmp}" == "yes" 1.427 + modslist="$modslist snmpstats" 1.428 +%endif 1.429 +%if "%{with_bdb}" == "yes" 1.430 + modslist="$modslist db_berkeley" 1.431 +%endif 1.432 +%if "%{with_mysql}" == "yes" 1.433 + modslist="$modslist db_mysql" 1.434 +%endif 1.435 +%if "%{with_pgsql}" == "yes" 1.436 + modslist="$modslist db_postgres" 1.437 +%endif 1.438 +%if "%{with_odbc}" == "yes" 1.439 + modslist="$modslist db_unixodbc" 1.440 +%endif 1.441 +%if "%{with_geoip}" == "yes" 1.442 + modslist="$modslist mmgeoip" 1.443 +%endif 1.444 + 1.445 # build dependencies 1.446 %{l_make} %{l_mflags} \ 1.447 - CC="%{l_cc} %{l_cflags} %{l_cppflags}" \ 1.448 + CC="%{l_cc}" \ 1.449 +%if "%{with_sctp}" == "yes" 1.450 + SCTP=1 \ 1.451 +%endif 1.452 %if "%{with_ssl}" == "yes" 1.453 TLS=1 \ 1.454 %endif 1.455 @@ -103,22 +450,43 @@ 1.456 dep >/dev/null 2>&1 || true 1.457 1.458 # build program 1.459 - %{l_make} %{l_mflags} \ 1.460 - CC="%{l_cc} %{l_cflags} %{l_cppflags}" \ 1.461 -%if "%{with_ssl}" == "yes" 1.462 - TLS=1 \ 1.463 + %{l_make} %{l_mflags -O} \ 1.464 + CC="%{l_cc}" \ 1.465 +%if "%{with_sctp}" == "yes" 1.466 + SCTP=1 \ 1.467 %endif 1.468 - prefix=%{l_prefix} 1.469 - 1.470 - # build modules 1.471 - %{l_make} %{l_mflags} \ 1.472 - CC="%{l_cc} %{l_cflags} %{l_cppflags}" \ 1.473 %if "%{with_ssl}" == "yes" 1.474 TLS=1 \ 1.475 %endif 1.476 prefix=%{l_prefix} \ 1.477 - modules \ 1.478 - skip_modules="mysql jabber" 1.479 + opensips 1.480 + 1.481 + # build utilities 1.482 + %{l_make} %{l_mflags -O} \ 1.483 + CC="%{l_cc}" \ 1.484 +%if "%{with_sctp}" == "yes" 1.485 + SCTP=1 \ 1.486 +%endif 1.487 +%if "%{with_ssl}" == "yes" 1.488 + TLS=1 \ 1.489 +%endif 1.490 + prefix=%{l_prefix} \ 1.491 + modules="$modslist" \ 1.492 + utils 1.493 + 1.494 + # build modules 1.495 + %{l_make} %{l_mflags -O} \ 1.496 + CC="%{l_cc}" \ 1.497 +%if "%{with_sctp}" == "yes" 1.498 + SCTP=1 \ 1.499 +%endif 1.500 +%if "%{with_ssl}" == "yes" 1.501 + TLS=1 \ 1.502 +%endif 1.503 + include_modules="$modslist" \ 1.504 + skip_modules="" \ 1.505 + prefix=%{l_prefix} \ 1.506 + modules 1.507 1.508 # build rtpproxy extension 1.509 ( cd rtpproxy-%{V_rtpproxy} 1.510 @@ -128,62 +496,96 @@ 1.511 case "%{l_platform -t}" in 1.512 *-sunos* ) LIBS="$LIBS -lsocket -lnsl -lrt" ;; 1.513 esac 1.514 + export GREP="grep" 1.515 ./configure 1.516 - %{l_make} %{l_mflags} 1.517 + %{l_make} %{l_mflags -O} 1.518 ) || exit $? 1.519 1.520 %install 1.521 + rm -rf $RPM_BUILD_ROOT 1.522 1.523 - # install program 1.524 + # select modules 1.525 + modslist='b2b_entities b2b_logic cpl-c db_http identity jabber perl perlvdb presence presence_dialoginfo presence_mwi presence_xml pua pua_bla pua_dialoginfo pua_mi pua_usrloc pua_xmpp regex rls tlsops xcap_client xmpp' 1.526 +%if "%{with_croute}" == "yes" 1.527 + modslist="$modslist carrierroute" 1.528 +%endif 1.529 +%if "%{with_json}" == "yes" 1.530 + modslist="$modslist json" 1.531 +%endif 1.532 +%if "%{with_ldap}" == "yes" 1.533 + modslist="$modslist h350 ldap" 1.534 +%endif 1.535 +%if "%{with_memcached}" == "yes" 1.536 + modslist="$modslist memcached" 1.537 +%endif 1.538 +%if "%{with_osp}" == "yes" 1.539 + modslist="$modslist osp" 1.540 +%endif 1.541 +%if "%{with_radius}" == "yes" 1.542 + modslist="$modslist aaa_radius auth_aaa group uri" 1.543 +%endif 1.544 +%if "%{with_snmp}" == "yes" 1.545 + modslist="$modslist snmpstats" 1.546 +%endif 1.547 +%if "%{with_bdb}" == "yes" 1.548 + modslist="$modslist db_berkeley" 1.549 +%endif 1.550 +%if "%{with_mysql}" == "yes" 1.551 + modslist="$modslist db_mysql" 1.552 +%endif 1.553 +%if "%{with_pgsql}" == "yes" 1.554 + modslist="$modslist db_postgres" 1.555 +%endif 1.556 +%if "%{with_odbc}" == "yes" 1.557 + modslist="$modslist db_unixodbc" 1.558 +%endif 1.559 +%if "%{with_geoip}" == "yes" 1.560 + modslist="$modslist mmgeoip" 1.561 +%endif 1.562 + 1.563 + # install program, utils, and modules 1.564 %{l_make} %{l_mflags} \ 1.565 INSTALL="%{l_shtool} install%{l_nil} -c" \ 1.566 basedir=$RPM_BUILD_ROOT \ 1.567 prefix=%{l_prefix} \ 1.568 - cfg-prefix=$RPM_BUILD_ROOT \ 1.569 - cfg-target=%{l_prefix}/etc/opensips/ \ 1.570 - doc-dir=share/opensips/doc/ \ 1.571 - man-dir=man/ \ 1.572 + doc-dir=share/opensips/doc \ 1.573 + man-dir=man \ 1.574 + data-dir=share/opensips \ 1.575 + include_modules="$modslist" \ 1.576 + skip_modules="" \ 1.577 install 1.578 1.579 - # install modules 1.580 - %{l_make} %{l_mflags} \ 1.581 - INSTALL="%{l_shtool} install%{l_nil} -c" \ 1.582 - basedir=$RPM_BUILD_ROOT \ 1.583 - prefix=%{l_prefix} \ 1.584 - cfg-prefix=$RPM_BUILD_ROOT \ 1.585 - cfg-target=%{l_prefix}/etc/opensips/ \ 1.586 - doc-dir=share/opensips/doc/ \ 1.587 - man-dir=man/ \ 1.588 - install-modules \ 1.589 - skip_modules="mysql jabber" 1.590 - 1.591 - # install rtpproxy extension 1.592 + # install rtpproxy software 1.593 %{l_shtool} install -c -s -m 755 \ 1.594 - rtpproxy-%{V_rtpproxy}/rtpproxy $RPM_BUILD_ROOT%{l_prefix}/sbin/opensips_rtpproxy 1.595 + rtpproxy-%{V_rtpproxy}/rtpproxy \ 1.596 + $RPM_BUILD_ROOT%{l_prefix}/sbin/rtpproxy 1.597 1.598 # strip down installation 1.599 strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true 1.600 - rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/opensips_mysql.sh 1.601 1.602 - # post-adjust installation 1.603 - %{l_shtool} subst \ 1.604 - -e 's;/etc/opensips/opensipsctlrc;%{l_prefix}/etc/opensips/opensipsctlrc;g' \ 1.605 - $RPM_BUILD_ROOT%{l_prefix}/sbin/opensipsctl 1.606 - %{l_shtool} mkdir -f -p -m 755 \ 1.607 - $RPM_BUILD_ROOT%{l_prefix}/etc/opensips 1.608 - %{l_shtool} install -c -m 644 \ 1.609 - -e 's;^# \(PID_FILE\)=.*;\1=%{l_prefix}/var/opensips/opensips.pid;' \ 1.610 - -e 's;^# \(OSIPS_FIFO\)=.*;\1=%{l_prefix}/var/opensips/opensips.fifo;' \ 1.611 - scripts/opensipsctlrc \ 1.612 - $RPM_BUILD_ROOT%{l_prefix}/etc/opensips/opensipsctlrc 1.613 + # create installation hierarchy 1.614 + %{l_shtool} mkdir -f -p -m 700 \ 1.615 + $RPM_BUILD_ROOT%{l_prefix}/var/opensips/acc \ 1.616 + $RPM_BUILD_ROOT%{l_prefix}/var/opensips/tmp 1.617 1.618 # install default configuration 1.619 %{l_shtool} mkdir -f -p -m 755 \ 1.620 $RPM_BUILD_ROOT%{l_prefix}/etc/opensips 1.621 - %{l_shtool} install -c -m 755 %{l_value -s -a} \ 1.622 + %{l_shtool} install -c -m 644 %{l_value -s -a} \ 1.623 %{SOURCE opensips.cfg} \ 1.624 + %{SOURCE opensipsctlrc} \ 1.625 + %{SOURCE osipsconsolerc} \ 1.626 $RPM_BUILD_ROOT%{l_prefix}/etc/opensips/ 1.627 1.628 + # conditionally install osipsconsole resources 1.629 +%if "%{with_cons}" == "yes" 1.630 + %{l_shtool} install -c -m 644 %{l_value -s -a} \ 1.631 + %{SOURCE osipsconsolerc} \ 1.632 + $RPM_BUILD_ROOT%{l_prefix}/etc/opensips/ 1.633 +%else 1.634 + rm $RPM_BUILD_ROOT%{l_prefix}/sbin/osipsconsole 1.635 +%endif 1.636 + 1.637 # install OSSP fsl configuration 1.638 %{l_shtool} mkdir -f -p -m 755 \ 1.639 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl 1.640 @@ -191,23 +593,17 @@ 1.641 %{SOURCE fsl.opensips} \ 1.642 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/ 1.643 1.644 - # install run-command script 1.645 + # install runcommand script 1.646 %{l_shtool} mkdir -f -p -m 755 \ 1.647 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d 1.648 %{l_shtool} install -c -m 755 %{l_value -s -a} \ 1.649 %{SOURCE rc.opensips} \ 1.650 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ 1.651 1.652 - # create database directory and install database schema definitions 1.653 - %{l_shtool} mkdir -f -p -m 755 \ 1.654 - $RPM_BUILD_ROOT%{l_prefix}/var/opensips 1.655 - %{l_shtool} install -c -m 644 \ 1.656 - %{SOURCE opensips.schema-dbtext.txt} \ 1.657 - $RPM_BUILD_ROOT%{l_prefix}/share/opensips/ 1.658 - 1.659 # determine installation files 1.660 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ 1.661 %{l_files_std} \ 1.662 + '%not %dir %{l_prefix}/etc/fsl' \ 1.663 '%config %{l_prefix}/etc/fsl/*' \ 1.664 '%config %{l_prefix}/etc/opensips/*' \ 1.665 '%doc %{l_prefix}/share/opensips/doc/*' \ 1.666 @@ -216,20 +612,17 @@ 1.667 %files -f files 1.668 1.669 %clean 1.670 + rm -rf $RPM_BUILD_ROOT 1.671 1.672 %post 1.673 - # on install, setup database 1.674 + # on install, setup database (osipsconsole db create /pfx/var/opensips/db) 1.675 if [ ! -d $RPM_INSTALL_PREFIX/var/opensips/db ]; then 1.676 - mkdir $RPM_INSTALL_PREFIX/var/opensips/db 1.677 - chown %{l_rusr}:%{l_rgrp} $RPM_INSTALL_PREFIX/var/opensips/db 1.678 - chmod 755 $RPM_INSTALL_PREFIX/var/opensips/db 1.679 - schema="$RPM_INSTALL_PREFIX/share/opensips/opensips.schema-dbtext.txt" 1.680 - for table in `sed -e '/^#.*/d' -e '/^$/d' -e 's;\([^:]*\):.*;\1;' <$schema | sort -u`; do 1.681 - grep "^${table}:" $schema | sed -e "s;^${table}: *;;" \ 1.682 - >$RPM_INSTALL_PREFIX/var/opensips/db/$table 1.683 - done 1.684 - chown %{l_rusr}:%{l_rgrp} $RPM_INSTALL_PREFIX/var/opensips/db/* 2>/dev/null || true 1.685 - chmod 644 $RPM_INSTALL_PREFIX/var/opensips/db/* 2>/dev/null || true 1.686 + %{l_shtool} mkdir -f -p -m 700 -o %{l_rusr} -g %{l_rgrp} \ 1.687 + $RPM_INSTALL_PREFIX/var/opensips/db 1.688 + rm -f $RPM_INSTALL_PREFIX/share/opensips/dbtext/*.orig 1.689 + %{l_shtool} install -c -m 600 -o %{l_rusr} -g %{l_rgrp} \ 1.690 + $RPM_INSTALL_PREFIX/share/opensips/dbtext/* \ 1.691 + $RPM_INSTALL_PREFIX/var/opensips/db/ 1.692 fi 1.693 1.694 # after upgrade, restart service