68 Patch3: opensips.patch.uac |
68 Patch3: opensips.patch.uac |
69 Patch4: opensips.patch.reg |
69 Patch4: opensips.patch.reg |
70 Patch5: opensips.patch.rtpproxy |
70 Patch5: opensips.patch.rtpproxy |
71 |
71 |
72 # build information |
72 # build information |
73 Prefix: %{l_prefix} |
73 BuildPreReq: OpenPKG, openpkg >= 20100101, make, gcc, flex, bison, sed |
74 BuildRoot: %{l_buildroot} |
74 PreReq: OpenPKG, openpkg >= 20100101, bash |
75 BuildPreReq: OpenPKG, openpkg >= 20060823, make, gcc, flex, bison, sed |
75 BuildPreReq: libxml, expat, curl, ncurses, pkgconfig |
76 PreReq: OpenPKG, openpkg >= 20060823, bash |
76 PreReq: libxml, expat, curl, ncurses |
77 BuildPreReq: libxml, expat, curl, pkgconfig |
|
78 PreReq: libxml, expat, curl |
|
79 %if "%{with_cons}" == "yes" |
77 %if "%{with_cons}" == "yes" |
80 PreReq: perl-dbi, perl-term |
78 PreReq: perl-dbi, perl-term |
81 %endif |
79 %endif |
82 %if "%{with_fsl}" == "yes" |
80 %if "%{with_fsl}" == "yes" |
83 BuildPreReq: fsl |
81 BuildPreReq: fsl |
133 %endif |
131 %endif |
134 %if "%{with_geoip}" == "yes" |
132 %if "%{with_geoip}" == "yes" |
135 BuildPreReq: geoip |
133 BuildPreReq: geoip |
136 PreReq: geoip |
134 PreReq: geoip |
137 %endif |
135 %endif |
138 AutoReq: no |
|
139 AutoReqProv: no |
|
140 |
136 |
141 %description |
137 %description |
142 OpenSIPS is (beside Kamailio) a successor to OpenSER, which in |
138 OpenSIPS is (beside Kamailio) a successor to OpenSER, which in |
143 turn was spawned from FhG FOKUS's SIP Express Router (SER). It |
139 turn was spawned from FhG FOKUS's SIP Express Router (SER). It |
144 provides SIP (RFC3621) registrar, proxy and routing functionality. |
140 provides SIP (RFC3621) registrar, proxy and routing functionality. |
204 %{l_shtool} subst \ |
200 %{l_shtool} subst \ |
205 %if "%{with_dbgmem}" == "yes" |
201 %if "%{with_dbgmem}" == "yes" |
206 -e 's;\(-DF_MALLOC\);#\1;' \ |
202 -e 's;\(-DF_MALLOC\);#\1;' \ |
207 -e 's;#\(-DDBG_QM_MALLOC\);\1;' \ |
203 -e 's;#\(-DDBG_QM_MALLOC\);\1;' \ |
208 %endif |
204 %endif |
209 -e 's;\(#define PKG_MEM_POOL_SIZE\) \(1024\*1024\);\1 4*\2;' \ |
205 -e 's;\(#define PKG_MEM_SIZE\) 2;\1 4;' \ |
210 Makefile.defs \ |
|
211 config.h |
206 config.h |
212 %{l_shtool} subst \ |
207 %{l_shtool} subst \ |
213 %if "%{with_fsl}" == "yes" |
208 %if "%{with_fsl}" == "yes" |
214 -e 's;@fslldflags@;-L$(prefix)/lib;g' \ |
209 -e 's;@fslldflags@;-L$(prefix)/lib;g' \ |
215 -e 's;@fsllibs@;-lfsl;g' \ |
210 -e 's;@fsllibs@;-lfsl;g' \ |
234 -e 's;\(\$(data-dir)\)/\(db_berkeley\)/opensips;\1/\2;g' \ |
229 -e 's;\(\$(data-dir)\)/\(db_berkeley\)/opensips;\1/\2;g' \ |
235 -e 's;\(/usr/local/etc/opensips\);\1/*;g' \ |
230 -e 's;\(/usr/local/etc/opensips\);\1/*;g' \ |
236 -e 's;\(s#/usr/local/sbin\)#;\1/*#;g' \ |
231 -e 's;\(s#/usr/local/sbin\)#;\1/*#;g' \ |
237 -e 's;\(s#/usr/share/doc/$(NAME)/#$(doc-target)\)#;\1/#;g' \ |
232 -e 's;\(s#/usr/share/doc/$(NAME)/#$(doc-target)\)#;\1/#;g' \ |
238 -e 's;\(\$(MAKE).*\) \(install_module_custom\);\1 makefile_defs=0 \2;' \ |
233 -e 's;\(\$(MAKE).*\) \(install_module_custom\);\1 makefile_defs=0 \2;' \ |
|
234 -e 's#\(cd menuconfig;\)\$(MAKE) proper;#\1 CC="%{l_cc}" CPPFLAGS="%{l_cppflags ncurses}" LDFLAGS="%{l_ldflags}" LIBS="-lncurses" #' \ |
239 Makefile |
235 Makefile |
240 %{l_shtool} subst \ |
236 %{l_shtool} subst \ |
241 -e 's;^\(LIBS=\).*;\1-L`%{l_prefix}/bin/pkg-config --libs db`;' \ |
237 -e 's;^\(LIBS=\).*;\1-L`%{l_prefix}/bin/pkg-config --libs db`;' \ |
242 utils/db_berkeley/Makefile |
238 utils/db_berkeley/Makefile |
243 %{l_shtool} subst \ |
239 %{l_shtool} subst \ |
256 %{l_shtool} subst \ |
252 %{l_shtool} subst \ |
257 -e 's;/var/run/\(opensips.pid\);%{l_prefix}/var/opensips/\1;g' \ |
253 -e 's;/var/run/\(opensips.pid\);%{l_prefix}/var/opensips/\1;g' \ |
258 -e 's;\(my \$fifo_reply_path\) = "/tmp/";\1 = "%{l_prefix}/var/opensips/";' \ |
254 -e 's;\(my \$fifo_reply_path\) = "/tmp/";\1 = "%{l_prefix}/var/opensips/";' \ |
259 -e 's;\(my \$HISTORY_FILE\) = "/tmp/osipsconsole_history";\1 = "%{l_prefix}/var/opensips/osipsconsole_history";' \ |
255 -e 's;\(my \$HISTORY_FILE\) = "/tmp/osipsconsole_history";\1 = "%{l_prefix}/var/opensips/osipsconsole_history";' \ |
260 scripts/opensipsctl \ |
256 scripts/opensipsctl \ |
261 scripts/osipsconsole \ |
257 scripts/osipsconsole |
262 %{l_shtool} subst \ |
258 %{l_shtool} subst \ |
263 -e 's;/usr/local;;g' \ |
259 -e 's;/usr/local;;g' \ |
264 -e 's;\(/etc/opensips/\)\.\(opensipsctlrc\);%{l_prefix}\1\2;g' \ |
260 -e 's;\(/etc/opensips/\)\.\(opensipsctlrc\);%{l_prefix}\1\2;g' \ |
265 scripts/opensipsctl.8 |
261 scripts/opensipsctl.8 |
266 %{l_shtool} subst \ |
262 %{l_shtool} subst \ |
490 include_modules="$modslist" \ |
486 include_modules="$modslist" \ |
491 skip_modules="" \ |
487 skip_modules="" \ |
492 prefix=%{l_prefix} \ |
488 prefix=%{l_prefix} \ |
493 modules |
489 modules |
494 |
490 |
|
491 # build menuconfig |
|
492 %{l_make} %{l_mflags} \ |
|
493 prefix=%{l_prefix} \ |
|
494 cfg-prefix=$RPM_BUILD_ROOT%{l_prefix}/etc \ |
|
495 data-prefix=$RPM_BUILD_ROOT%{l_prefix}/share \ |
|
496 opensipsmc |
|
497 |
495 # build rtpproxy extension |
498 # build rtpproxy extension |
496 ( cd rtpproxy-%{V_rtpproxy} |
499 ( cd rtpproxy-%{V_rtpproxy} |
497 export CC="%{l_cc}" |
500 export CC="%{l_cc}" |
498 export CFLAGS="%{l_cflags -O}" |
501 export CFLAGS="%{l_cflags -O}" |
|
502 export CPPFLAGS="" |
|
503 case "%{l_platform -t}" in |
|
504 *-sunos5.11 ) CPPFLAGS="$CPPFLAGS -DGE_SOL11" ;; |
|
505 esac |
499 export LIBS="" |
506 export LIBS="" |
500 case "%{l_platform -t}" in |
507 case "%{l_platform -t}" in |
501 *-sunos* ) LIBS="$LIBS -lsocket -lnsl -lrt" ;; |
508 *-sunos* ) LIBS="$LIBS -lsocket -lnsl -lrt" ;; |
502 esac |
509 esac |
503 export GREP="grep" |
510 export GREP="grep" |
504 ./configure |
511 ./configure |
505 %{l_make} %{l_mflags -O} |
512 %{l_make} %{l_mflags -O} |
506 ) || exit $? |
513 ) || exit $? |
507 |
514 |
508 %install |
515 %install |
509 # clean build cruft |
|
510 rm -rf $RPM_BUILD_ROOT |
|
511 |
|
512 # select modules |
516 # select modules |
513 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' |
517 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' |
514 %if "%{with_croute}" == "yes" |
518 %if "%{with_croute}" == "yes" |
515 modslist="$modslist carrierroute" |
519 modslist="$modslist carrierroute" |
516 %endif |
520 %endif |
610 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/opensips' |
614 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/opensips' |
611 |
615 |
612 %files -f files |
616 %files -f files |
613 |
617 |
614 %clean |
618 %clean |
615 rm -rf $RPM_BUILD_ROOT |
|
616 |
619 |
617 %post |
620 %post |
618 # on install, setup database (osipsconsole db create /pfx/var/opensips/db) |
621 # on install, setup database (osipsconsole db create /pfx/var/opensips/db) |
619 if [ ! -d $RPM_INSTALL_PREFIX/var/opensips/db ]; then |
622 if [ ! -d $RPM_INSTALL_PREFIX/var/opensips/db ]; then |
620 %{l_shtool} mkdir -f -p -m 700 -o %{l_rusr} -g %{l_rgrp} \ |
623 %{l_shtool} mkdir -f -p -m 700 -o %{l_rusr} -g %{l_rgrp} \ |