opensips/opensips.spec

changeset 397
c98ae03f4266
parent 395
41738a0e98d1
child 410
b1bf69b8f573
equal deleted inserted replaced
6:52e56c387df5 7:a4e88f3c3939
20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
21 ## SUCH DAMAGE. 21 ## SUCH DAMAGE.
22 ## 22 ##
23 23
24 # package options 24 # package options
25 %define V_major 1.6.4
26 %define V_minor 2
27 %define V_rtpproxy 1.2.1 25 %define V_rtpproxy 1.2.1
28 26
29 # package information 27 # package information
30 Name: opensips 28 Name: opensips
31 Summary: Open SIP Router 29 Summary: Open SIP Router
34 Packager: OpenPKG Foundation e.V. 32 Packager: OpenPKG Foundation e.V.
35 Distribution: OpenPKG Community 33 Distribution: OpenPKG Community
36 Class: PLUS 34 Class: PLUS
37 Group: VoIP 35 Group: VoIP
38 License: GPL 36 License: GPL
39 Version: %{V_major}.%{V_minor} 37 Version: 1.7.1
40 Release: 20111128 38 Release: 20111120
41 39
42 # package options 40 # package options
43 %option with_cons yes 41 %option with_cons yes
44 %option with_fsl yes 42 %option with_fsl yes
45 %option with_ssl yes 43 %option with_ssl yes
57 %option with_odbc no 55 %option with_odbc no
58 %option with_geoip no 56 %option with_geoip no
59 %option with_dbgmem no 57 %option with_dbgmem no
60 58
61 # list of sources 59 # list of sources
62 Source0: http://www.opensips.org/pub/opensips/%{V_major}/src/opensips-%{V_major}-%{V_minor}-tls_src.tar.gz 60 Source0: http://www.opensips.org/pub/opensips/%{version}/src/opensips-%{version}_src.tar.gz
63 Source1: http://www.b2bua.org/chrome/site/rtpproxy-%{V_rtpproxy}.tar.gz 61 Source1: http://www.b2bua.org/chrome/site/rtpproxy-%{V_rtpproxy}.tar.gz
64 Source2: rc.opensips 62 Source2: rc.opensips
65 Source3: fsl.opensips 63 Source3: fsl.opensips
66 Source4: opensips.cfg 64 Source4: opensips.cfg
67 Patch0: opensips.patch 65 Patch0: opensips.patch
68 Patch1: opensips.patch.dict 66 Patch1: opensips.patch.dict
69 Patch2: opensips.patch.uac 67 Patch2: opensips.patch.uac
70 Patch3: opensips.patch.lcr 68 Patch3: opensips.patch.reg
71 Patch4: opensips.patch.reg 69 Patch4: opensips.patch.rtpproxy
72 Patch5: opensips.patch.rtpproxy
73 70
74 # build information 71 # build information
75 Prefix: %{l_prefix} 72 Prefix: %{l_prefix}
76 BuildRoot: %{l_buildroot} 73 BuildRoot: %{l_buildroot}
77 BuildPreReq: OpenPKG, openpkg >= 20060823, make, gcc, flex, bison, sed 74 BuildPreReq: OpenPKG, openpkg >= 20060823, make, gcc, flex, bison, sed
167 NAT traversal unit 164 NAT traversal unit
168 Application server 165 Application server
169 166
170 %track 167 %track
171 prog opensips = { 168 prog opensips = {
172 version = %{V_major}-%{V_minor} 169 version = %{version}
173 url = http://www.opensips.org/pub/opensips/ 170 url = http://www.opensips.org/pub/opensips/
174 regex = (\d+\.\d+\.\d+)/ 171 regex = (\d+\.\d+\.\d+)/
175 url = http://www.opensips.org/pub/opensips/__NEWVER__/src/ 172 url = http://www.opensips.org/pub/opensips/__NEWVER__/src/
176 regex = opensips-(__VER__)-tls_src\.tar\.gz 173 regex = opensips-(__VER__)_src\.tar\.gz
177 } 174 }
178 prog opensips:rtpproxy = { 175 prog opensips:rtpproxy = {
179 version = %{V_rtpproxy} 176 version = %{V_rtpproxy}
180 url = http://www.rtpproxy.org/ 177 url = http://www.rtpproxy.org/
181 regex = rtpproxy-(\d+(?:\.\d+)+)\.tar\.gz 178 regex = rtpproxy-(\d+(?:\.\d+)+)\.tar\.gz
182 } 179 }
183 180
184 %prep 181 %prep
185 %setup -q -n opensips-%{V_major}-%{V_minor}-tls 182 %setup -q -n opensips-%{version}-tls
186 %setup -q -n opensips-%{V_major}-%{V_minor}-tls -T -D -a 1 183 %setup -q -n opensips-%{version}-tls -T -D -a 1
187 %patch -p0 184 %patch -p0
188 %patch -p0 -P 1 185 %patch -p0 -P 1
189 %patch -p0 -P 2 186 %patch -p0 -P 2
190 %patch -p0 -P 3 187 %patch -p0 -P 3
191 %patch -p0 -P 4
192 ( cd rtpproxy-%{V_rtpproxy} 188 ( cd rtpproxy-%{V_rtpproxy}
193 %patch -p0 -P 5 189 %patch -p0 -P 4
194 ) || exit $? 190 ) || exit $?
195 %{l_shtool} subst \ 191 %{l_shtool} subst \
196 -e 's;^#! */bin/sh;#! %{l_prefix}/bin/bash;' \ 192 -e 's;^#! */bin/sh;#! %{l_prefix}/bin/bash;' \
197 scripts/opensipsctl 193 scripts/opensipsctl
198 %{l_shtool} subst \ 194 %{l_shtool} subst \
252 -e 's;PATH=\$PATH:/usr/local/sbin;PATH=%{l_prefix}/sbin:$PATH;' \ 248 -e 's;PATH=\$PATH:/usr/local/sbin;PATH=%{l_prefix}/sbin:$PATH;' \
253 scripts/opensipsdbctl \ 249 scripts/opensipsdbctl \
254 scripts/opensipsctl 250 scripts/opensipsctl
255 %{l_shtool} subst \ 251 %{l_shtool} subst \
256 -e 's;\(DB_PATH="\)[^"][^"]*;\1%{l_prefix}/var/opensips/db;' \ 252 -e 's;\(DB_PATH="\)[^"][^"]*;\1%{l_prefix}/var/opensips/db;' \
253 -e 's;start opensips \(with 64MB share memory\).*;start \1 instead of default 32MB;' \
254 -e 's;\(# STARTOPTIONS=.*\);\1"-m 64";' \
257 scripts/osipsconsolerc \ 255 scripts/osipsconsolerc \
258 scripts/opensipsctlrc 256 scripts/opensipsctlrc
259 %{l_shtool} subst \ 257 %{l_shtool} subst \
258 -e 's;=/var/run/\(opensips.pid\);=%{l_prefix}/var/opensips/\1;g' \
260 -e 's;/var/run/\(opensips.pid\);%{l_prefix}/var/opensips/\1;g' \ 259 -e 's;/var/run/\(opensips.pid\);%{l_prefix}/var/opensips/\1;g' \
261 -e 's;\(my \$fifo_reply_path\) = "/tmp/";\1 = "%{l_prefix}/var/opensips/";' \ 260 -e 's;\(my \$fifo_reply_path\) = "/tmp/";\1 = "%{l_prefix}/var/opensips/";' \
262 -e 's;\(my \$HISTORY_FILE\) = "/tmp/osipsconsole_history";\1 = "%{l_prefix}/var/opensips/osipsconsole_history";' \ 261 -e 's;\(my \$HISTORY_FILE\) = "/tmp/osipsconsole_history";\1 = "%{l_prefix}/var/opensips/osipsconsole_history";' \
263 scripts/opensipsctl \ 262 scripts/opensipsctl \
264 scripts/opensipsctlrc \ 263 scripts/opensipsctlrc \
302 scripts/opensipsdbctl.mysql \ 301 scripts/opensipsdbctl.mysql \
303 scripts/opensipsdbctl.pgsql 302 scripts/opensipsdbctl.pgsql
304 %{l_shtool} subst \ 303 %{l_shtool} subst \
305 -e 's;\(script_flags(int\));\1,null);' \ 304 -e 's;\(script_flags(int\));\1,null);' \
306 scripts/dbtext/opensips/dialog 305 scripts/dbtext/opensips/dialog
307 %{l_shtool} subst \
308 -e 's;\(gw_name(string).*\) *$;\1 user(string,null) realm(string,null) passwd(string,null);' \
309 scripts/dbtext/opensips/gw
310 %{l_shtool} subst \ 306 %{l_shtool} subst \
311 -e 's;body(string);body(blob);' \ 307 -e 's;body(string);body(blob);' \
312 -e 's;sender(string);sender(string,null);' \ 308 -e 's;sender(string);sender(string,null);' \
313 scripts/dbtext/opensips/presentity 309 scripts/dbtext/opensips/presentity
314 %{l_shtool} subst \ 310 %{l_shtool} subst \
479 prefix=%{l_prefix} \ 475 prefix=%{l_prefix} \
480 modules="$modslist" \ 476 modules="$modslist" \
481 utils 477 utils
482 478
483 # build modules 479 # build modules
484 %{l_make} %{l_mflags} \ 480 %{l_make} %{l_mflags -O} \
485 CC="%{l_cc}" \ 481 CC="%{l_cc}" \
486 %if "%{with_sctp}" == "yes" 482 %if "%{with_sctp}" == "yes"
487 SCTP=1 \ 483 SCTP=1 \
488 %endif 484 %endif
489 %if "%{with_ssl}" == "yes" 485 %if "%{with_ssl}" == "yes"
509 505
510 %install 506 %install
511 rm -rf $RPM_BUILD_ROOT 507 rm -rf $RPM_BUILD_ROOT
512 508
513 # select modules 509 # select modules
514 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' 510 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'
515 %if "%{with_croute}" == "yes" 511 %if "%{with_croute}" == "yes"
516 modslist="$modslist carrierroute" 512 modslist="$modslist carrierroute"
517 %endif 513 %endif
518 %if "%{with_json}" == "yes" 514 %if "%{with_json}" == "yes"
519 modslist="$modslist json" 515 modslist="$modslist json"
577 # install default configuration 573 # install default configuration
578 %{l_shtool} mkdir -f -p -m 755 \ 574 %{l_shtool} mkdir -f -p -m 755 \
579 $RPM_BUILD_ROOT%{l_prefix}/etc/opensips 575 $RPM_BUILD_ROOT%{l_prefix}/etc/opensips
580 %{l_shtool} install -c -m 644 %{l_value -s -a} \ 576 %{l_shtool} install -c -m 644 %{l_value -s -a} \
581 %{SOURCE opensips.cfg} \ 577 %{SOURCE opensips.cfg} \
582 %{SOURCE opensipsctlrc} \
583 $RPM_BUILD_ROOT%{l_prefix}/etc/opensips/ 578 $RPM_BUILD_ROOT%{l_prefix}/etc/opensips/
584 579
585 # conditionally install osipsconsole resources 580 # conditionally remove osipsconsole resources
586 %if "%{with_cons}" == "yes" 581 %if "%{with_cons}" != "yes"
587 %{l_shtool} install -c -m 644 %{l_value -s -a} \
588 %{SOURCE osipsconsolerc} \
589 $RPM_BUILD_ROOT%{l_prefix}/etc/opensips/
590 %else
591 rm $RPM_BUILD_ROOT%{l_prefix}/sbin/osipsconsole 582 rm $RPM_BUILD_ROOT%{l_prefix}/sbin/osipsconsole
583 rm $RPM_BUILD_ROOT%{l_prefix}/etc/opensips/osipsconsolerc
592 %endif 584 %endif
593 585
594 # install OSSP fsl configuration 586 # install OSSP fsl configuration
595 %{l_shtool} mkdir -f -p -m 755 \ 587 %{l_shtool} mkdir -f -p -m 755 \
596 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl 588 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl

mercurial