]>
Commit | Line | Data |
---|---|---|
91565b21 JK |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without mysql # mysql support | |
4 | %bcond_without pgsql # PostgreSQL support | |
5 | %bcond_without odbc # ODBC support | |
6 | %bcond_without radius # radius support | |
39033727 | 7 | %bcond_without carrierroute # carrierroute support |
e12422e8 | 8 | %bcond_without ldap # LDAP support |
91565b21 JK |
9 | %bcond_with osp # ETSI OSP VoIP Peering support |
10 | # | |
11 | Summary: SIP proxy, redirect and registrar server | |
12 | Summary(pl.UTF-8): Serwer SIP rejestrujący, przekierowujący i robiący proxy | |
13 | Name: opensips | |
14 | Version: 1.4.1 | |
15 | Release: 1 | |
16 | License: GPL v2 | |
17 | Group: Networking/Daemons | |
18 | Source0: http://opensips.org/pub/opensips/%{version}/src/%{name}-%{version}-tls_src.tar.gz | |
19 | # Source0-md5: c5479825be16170b014da66d06dfdf04 | |
20 | Source1: %{name}.init | |
21 | Source2: %{name}.sysconfig | |
91565b21 JK |
22 | URL: http://www.opensips.org/ |
23 | %{?with_osp:BuildRequires: OSPToolkit} | |
24 | BuildRequires: bison | |
25 | BuildRequires: expat-devel | |
26 | BuildRequires: flex | |
39033727 | 27 | %{?with_carrierroute:BuildRequires: libconfuse-devel} |
91565b21 JK |
28 | %{?with_pgsql:BuildRequires: libpqxx-devel} |
29 | BuildRequires: libxml2-devel | |
30 | %{?with_mysql:BuildRequires: mysql-devel} | |
31 | BuildRequires: net-snmp-devel | |
e12422e8 | 32 | %{?with_ldap:BuildRequires: openldap-devel} |
91565b21 JK |
33 | BuildRequires: openssl-devel |
34 | BuildRequires: perl-devel | |
35 | %{?with_radius:BuildRequires: radiusclient-ng-devel} | |
36 | BuildRequires: rpmbuild(macros) >= 1.268 | |
37 | %{?with_odbc:BuildRequires: unixODBC-devel} | |
38 | #BuildRequires: xmlrpc-c-devel >= 1.10.0 | |
39 | BuildRequires: zlib-devel | |
40 | Requires(post,preun): /sbin/chkconfig | |
41 | Requires: rc-scripts | |
42 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
43 | ||
44 | # mi_xmlrpc requires xmlrpc-c-devel in version 1.9 only | |
45 | %define exclude_modules mi_xmlrpc db_oracle | |
46 | ||
47 | %description | |
48 | OpenSIPS (Open SIP Server) is a mature Open Source implementation of a | |
49 | SIP server. OpenSIPS is more than a SIP proxy/router as it includes | |
50 | application-level functionalities. OpenSIPS, as a SIP server, is the | |
51 | core component of any SIP-based VoIP solution. With a very flexible | |
52 | and customizable routing engine, OpenSIPS 'unifies voice, video, IM | |
53 | and presence services in a highly efficient way, thanks to its | |
54 | scalable (modular) design. | |
55 | ||
56 | %package mysql | |
57 | Summary: openSIPS MySQL module | |
58 | Summary(pl.UTF-8): Moduł MySQL do openSIPS | |
59 | Group: Networking/Daemons | |
60 | Requires: %{name} = %{version}-%{release} | |
61 | ||
62 | %description mysql | |
63 | MySQL module for openSIPS. | |
64 | ||
65 | %description mysql -l pl.UTF-8 | |
66 | Moduł MySQL do openSIPS. | |
67 | ||
68 | %package postgres | |
69 | Summary: openSIPS PostgreSQL module | |
70 | Summary(pl.UTF-8): Moduł PostgreSQL do openSIPS | |
71 | Group: Networking/Daemons | |
72 | Requires: %{name} = %{version}-%{release} | |
73 | ||
74 | %description postgres | |
75 | PostgreSQL module for openSIPS. | |
76 | ||
77 | %description postgres -l pl.UTF-8 | |
78 | Moduł PostgreSQL do openSIPS. | |
79 | ||
80 | %package radius | |
81 | Summary: openSIPS Radius module | |
82 | Summary(pl.UTF-8): Moduł Radius do openSIPS | |
83 | Group: Networking/Daemons | |
84 | Requires: %{name} = %{version}-%{release} | |
85 | ||
86 | %description radius | |
87 | Radius module for openSIPS. | |
88 | ||
89 | %description radius -l pl.UTF-8 | |
90 | Moduł Radius do openSIPS. | |
91 | ||
92 | %package odbc | |
93 | Summary: openSIPS ODBC module | |
94 | Summary(pl.UTF-8): Moduł ODBC do openSIPS | |
95 | Group: Networking/Daemons | |
96 | Requires: %{name} = %{version}-%{release} | |
97 | ||
98 | %description odbc | |
99 | ODBC module for openSIPS. | |
100 | ||
101 | %description odbc -l pl.UTF-8 | |
102 | Moduł ODBC do openSIPS. | |
103 | ||
104 | %package perl | |
105 | Summary: openSIPS perl and perlvdb modules | |
106 | Summary(pl.UTF-8): Moduły perl i perlvdb do openSIPS | |
107 | Group: Networking/Daemons | |
108 | Requires: %{name} = %{version}-%{release} | |
109 | ||
110 | %description perl | |
111 | Perl modules (perl & perlvdb) for openSIPS. | |
112 | ||
113 | %description perl -l pl.UTF-8 | |
114 | Moduły perl i perlvdb do openSIPS. | |
115 | ||
116 | %package xmpp | |
117 | Summary: openSIPS XMPP/Jabber modules | |
118 | Summary(pl.UTF-8): Moduły XMPP/Jabber do openSIPS | |
119 | Group: Networking/Daemons | |
120 | Requires: %{name} = %{version}-%{release} | |
121 | Obsoletes: opensips-jabber | |
122 | ||
123 | %description xmpp | |
124 | XMPP/Jabber modules for openSIPS. | |
125 | ||
126 | %description xmpp -l pl.UTF-8 | |
127 | Moduły XMPP/Jabber do openSIPS. | |
128 | ||
129 | %package snmpstats | |
130 | Summary: openSIPS SNMP statistics module | |
131 | Summary(pl.UTF-8): Moduł do statystyk SNMP do openSIPS | |
132 | Group: Networking/Daemons | |
133 | Requires: %{name} = %{version}-%{release} | |
134 | ||
135 | %description snmpstats | |
136 | openSIPS SNMP statistics module. | |
137 | ||
138 | %description snmpstats -l pl.UTF-8 | |
139 | Moduł do statystyk SNMP do openSIPS. | |
140 | ||
141 | %package mibs | |
142 | Summary: MIBs for openSIPS | |
143 | Summary(pl.UTF-8): MIB-y dla openSIPS | |
144 | Group: Applications/System | |
145 | Requires: net-snmp-mibs | |
146 | BuildArch: noarch | |
147 | ||
148 | %description mibs | |
149 | MIBs for openSIPS. | |
150 | ||
151 | %description mibs -l pl.UTF-8 | |
152 | MIB-y dla openSIPS. | |
153 | ||
154 | %prep | |
155 | %setup -q -n %{name}-%{version}-tls | |
91565b21 JK |
156 | |
157 | find -type d -name CVS | xargs rm -rf | |
158 | ||
159 | %build | |
160 | exclude_modules="%{exclude_modules}" | |
e12422e8 JK |
161 | %if %{without ldap} |
162 | exclude_modules="$exclude_modules h350 ldap" | |
163 | %endif | |
39033727 JK |
164 | %if %{without carrierroute} |
165 | exclude_modules="$exclude_modules carrierroute" | |
166 | %endif | |
91565b21 JK |
167 | %if %{without osp} |
168 | exclude_modules="$exclude_modules osp" | |
169 | %endif | |
170 | %if %{without mysql} | |
e151e7fa | 171 | exclude_modules="$exclude_modules db_mysql" |
91565b21 JK |
172 | %endif |
173 | %if %{without pgsql} | |
e151e7fa | 174 | exclude_modules="$exclude_modules db_postgres" |
91565b21 JK |
175 | %endif |
176 | %if %{without odbc} | |
e151e7fa | 177 | exclude_modules="$exclude_modules db_unixodbc" |
91565b21 JK |
178 | %endif |
179 | %if %{without radius} | |
180 | exclude_modules="$exclude_modules auth_radius avp_radius group_radius uri_radius" | |
181 | %endif | |
182 | echo "$exclude_modules" > exclude_modules | |
183 | %{__make} all \ | |
184 | exclude_modules="$exclude_modules" \ | |
185 | prefix="%{_prefix}" \ | |
186 | cfg-prefix=$RPM_BUILD_ROOT \ | |
187 | cfg-target=/etc/opensips/ \ | |
188 | CC="%{__cc}" \ | |
189 | PREFIX="%{_prefix}" \ | |
190 | CFLAGS="%{rpmcflags} -Wcast-align -fPIC" \ | |
191 | TLS=1 | |
192 | ||
193 | %install | |
194 | rm -rf $RPM_BUILD_ROOT | |
195 | install -d $RPM_BUILD_ROOT%{_sysconfdir}/{ser,sysconfig,rc.d/init.d} | |
196 | ||
197 | exclude_modules="$(cat exclude_modules)" | |
198 | %{__make} install \ | |
199 | exclude_modules="$exclude_modules" \ | |
200 | prefix="%{_prefix}" \ | |
201 | basedir=$RPM_BUILD_ROOT \ | |
202 | cfg-prefix=$RPM_BUILD_ROOT \ | |
203 | cfg-target=/etc/opensips/ | |
204 | ||
205 | for i in modules/*; do \ | |
206 | i=$(basename $i) | |
207 | [ -f modules/$i/README ] && cp -f modules/$i/README README.$i; \ | |
208 | done | |
209 | ||
210 | install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} | |
211 | install $RPM_BUILD_ROOT%{_docdir}/%{name}/* \ | |
212 | $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} | |
213 | rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name} | |
214 | ||
215 | #cd doc/serdev | |
216 | #docbook2html serdev.sgml | |
217 | #rm -f serdev.sgml | |
218 | #cd ../seruser | |
219 | #docbook2html seruser.sgml | |
220 | #rm -f seruser.sgml | |
221 | #cd ../.. | |
222 | ||
223 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/opensips | |
224 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/opensips | |
225 | ||
226 | %clean | |
227 | rm -rf $RPM_BUILD_ROOT | |
228 | ||
229 | %post | |
230 | /sbin/chkconfig --add opensips | |
231 | %service opensips restart "sip Daemon" | |
232 | ||
233 | %preun | |
234 | if [ "$1" = "0" ]; then | |
235 | %service opensips stop | |
236 | /sbin/chkconfig --del opensips | |
237 | fi | |
238 | ||
239 | %files | |
240 | %defattr(644,root,root,755) | |
241 | %doc README* TODO scripts examples | |
242 | %attr(755,root,root) %{_sbindir}/* | |
243 | %dir %{_sysconfdir}/opensips | |
244 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/opensips/opensips.cfg | |
245 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/opensips/opensipsctlrc | |
246 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/opensips | |
247 | %attr(754,root,root) /etc/rc.d/init.d/opensips | |
248 | %dir %{_libdir}/opensips | |
249 | %{_libdir}/opensips/opensipsctl | |
250 | %dir %{_libdir}/opensips/modules | |
251 | # explict list here, no globs please (to avoid mistakes) | |
252 | %attr(755,root,root) %{_libdir}/opensips/modules/acc.so | |
253 | %attr(755,root,root) %{_libdir}/opensips/modules/alias_db.so | |
254 | %attr(755,root,root) %{_libdir}/opensips/modules/auth.so | |
255 | %attr(755,root,root) %{_libdir}/opensips/modules/auth_db.so | |
256 | %attr(755,root,root) %{_libdir}/opensips/modules/auth_diameter.so | |
257 | %attr(755,root,root) %{_libdir}/opensips/modules/avpops.so | |
258 | %attr(755,root,root) %{_libdir}/opensips/modules/benchmark.so | |
39033727 | 259 | %if %{with carrierroute} |
91565b21 | 260 | %attr(755,root,root) %{_libdir}/opensips/modules/carrierroute.so |
39033727 | 261 | %endif |
91565b21 JK |
262 | %attr(755,root,root) %{_libdir}/opensips/modules/cfgutils.so |
263 | %attr(755,root,root) %{_libdir}/opensips/modules/cpl-c.so | |
264 | %attr(755,root,root) %{_libdir}/opensips/modules/db_berkeley.so | |
265 | %attr(755,root,root) %{_libdir}/opensips/modules/db_flatstore.so | |
266 | %attr(755,root,root) %{_libdir}/opensips/modules/db_text.so | |
267 | %attr(755,root,root) %{_libdir}/opensips/modules/dialog.so | |
268 | %attr(755,root,root) %{_libdir}/opensips/modules/dialplan.so | |
269 | %attr(755,root,root) %{_libdir}/opensips/modules/dispatcher.so | |
270 | %attr(755,root,root) %{_libdir}/opensips/modules/diversion.so | |
271 | %attr(755,root,root) %{_libdir}/opensips/modules/domain.so | |
272 | %attr(755,root,root) %{_libdir}/opensips/modules/domainpolicy.so | |
273 | %attr(755,root,root) %{_libdir}/opensips/modules/enum.so | |
274 | %attr(755,root,root) %{_libdir}/opensips/modules/exec.so | |
275 | %attr(755,root,root) %{_libdir}/opensips/modules/gflags.so | |
276 | %attr(755,root,root) %{_libdir}/opensips/modules/group.so | |
e12422e8 | 277 | %if %{with ldap} |
91565b21 | 278 | %attr(755,root,root) %{_libdir}/opensips/modules/h350.so |
e12422e8 | 279 | %endif |
91565b21 JK |
280 | %attr(755,root,root) %{_libdir}/opensips/modules/imc.so |
281 | %attr(755,root,root) %{_libdir}/opensips/modules/lcr.so | |
e12422e8 | 282 | %if %{with ldap} |
91565b21 | 283 | %attr(755,root,root) %{_libdir}/opensips/modules/ldap.so |
e12422e8 | 284 | %endif |
91565b21 JK |
285 | %attr(755,root,root) %{_libdir}/opensips/modules/mangler.so |
286 | %attr(755,root,root) %{_libdir}/opensips/modules/maxfwd.so | |
287 | %attr(755,root,root) %{_libdir}/opensips/modules/mediaproxy.so | |
288 | %attr(755,root,root) %{_libdir}/opensips/modules/mi_datagram.so | |
289 | %attr(755,root,root) %{_libdir}/opensips/modules/mi_fifo.so | |
290 | %attr(755,root,root) %{_libdir}/opensips/modules/msilo.so | |
291 | %attr(755,root,root) %{_libdir}/opensips/modules/nat_traversal.so | |
292 | %attr(755,root,root) %{_libdir}/opensips/modules/nathelper.so | |
293 | %attr(755,root,root) %{_libdir}/opensips/modules/options.so | |
294 | %if %{with osp} | |
295 | %attr(755,root,root) %{_libdir}/opensips/modules/osp.so | |
296 | %endif | |
297 | %attr(755,root,root) %{_libdir}/opensips/modules/path.so | |
298 | %attr(755,root,root) %{_libdir}/opensips/modules/pdt.so | |
299 | %attr(755,root,root) %{_libdir}/opensips/modules/permissions.so | |
300 | %attr(755,root,root) %{_libdir}/opensips/modules/pike.so | |
301 | %attr(755,root,root) %{_libdir}/opensips/modules/presence.so | |
302 | %attr(755,root,root) %{_libdir}/opensips/modules/presence_mwi.so | |
303 | %attr(755,root,root) %{_libdir}/opensips/modules/presence_xml.so | |
304 | %attr(755,root,root) %{_libdir}/opensips/modules/pua.so | |
305 | %attr(755,root,root) %{_libdir}/opensips/modules/pua_bla.so | |
306 | %attr(755,root,root) %{_libdir}/opensips/modules/pua_mi.so | |
307 | %attr(755,root,root) %{_libdir}/opensips/modules/pua_usrloc.so | |
308 | %attr(755,root,root) %{_libdir}/opensips/modules/ratelimit.so | |
309 | %attr(755,root,root) %{_libdir}/opensips/modules/registrar.so | |
310 | %attr(755,root,root) %{_libdir}/opensips/modules/rls.so | |
311 | %attr(755,root,root) %{_libdir}/opensips/modules/rr.so | |
312 | %attr(755,root,root) %{_libdir}/opensips/modules/seas.so | |
313 | %attr(755,root,root) %{_libdir}/opensips/modules/siptrace.so | |
314 | %attr(755,root,root) %{_libdir}/opensips/modules/sl.so | |
315 | %attr(755,root,root) %{_libdir}/opensips/modules/sms.so | |
316 | %attr(755,root,root) %{_libdir}/opensips/modules/speeddial.so | |
317 | %attr(755,root,root) %{_libdir}/opensips/modules/sst.so | |
318 | %attr(755,root,root) %{_libdir}/opensips/modules/statistics.so | |
319 | %attr(755,root,root) %{_libdir}/opensips/modules/textops.so | |
320 | %attr(755,root,root) %{_libdir}/opensips/modules/tlsops.so | |
321 | %attr(755,root,root) %{_libdir}/opensips/modules/tm.so | |
322 | %attr(755,root,root) %{_libdir}/opensips/modules/uac.so | |
323 | %attr(755,root,root) %{_libdir}/opensips/modules/uac_redirect.so | |
324 | %attr(755,root,root) %{_libdir}/opensips/modules/uri.so | |
325 | %attr(755,root,root) %{_libdir}/opensips/modules/uri_db.so | |
326 | %attr(755,root,root) %{_libdir}/opensips/modules/userblacklist.so | |
327 | %attr(755,root,root) %{_libdir}/opensips/modules/usrloc.so | |
328 | %attr(755,root,root) %{_libdir}/opensips/modules/xcap_client.so | |
329 | %attr(755,root,root) %{_libdir}/opensips/modules/xlog.so | |
330 | %dir %{_datadir}/%{name} | |
331 | %{_datadir}/%{name}/db_berkeley | |
332 | %{_datadir}/%{name}/dbtext | |
333 | %{_mandir}/man*/* | |
334 | ||
335 | %files xmpp | |
336 | %defattr(644,root,root,755) | |
337 | %attr(755,root,root) %{_libdir}/opensips/modules/jabber.so | |
338 | %attr(755,root,root) %{_libdir}/opensips/modules/xmpp.so | |
339 | %attr(755,root,root) %{_libdir}/opensips/modules/pua_xmpp.so | |
340 | ||
341 | %if %{with mysql} | |
342 | %files mysql | |
343 | %defattr(644,root,root,755) | |
344 | %attr(755,root,root) %{_libdir}/opensips/modules/db_mysql.so | |
345 | %{_datadir}/%{name}/mysql | |
346 | %endif | |
347 | ||
348 | %if %{with pgsql} | |
349 | %files postgres | |
350 | %defattr(644,root,root,755) | |
351 | %attr(755,root,root) %{_libdir}/opensips/modules/db_postgres.so | |
352 | %{_datadir}/%{name}/postgres | |
353 | %endif | |
354 | ||
355 | %if %{with radius} | |
356 | %files radius | |
357 | %defattr(644,root,root,755) | |
358 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/opensips/dictionary.radius | |
359 | %attr(755,root,root) %{_libdir}/opensips/modules/auth_radius.so | |
360 | %attr(755,root,root) %{_libdir}/opensips/modules/avp_radius.so | |
361 | %attr(755,root,root) %{_libdir}/opensips/modules/group_radius.so | |
362 | %attr(755,root,root) %{_libdir}/opensips/modules/uri_radius.so | |
363 | %attr(755,root,root) %{_libdir}/opensips/modules/peering.so | |
364 | %endif | |
365 | ||
366 | %if %{with odbc} | |
367 | %files odbc | |
368 | %defattr(644,root,root,755) | |
369 | %attr(755,root,root) %{_libdir}/opensips/modules/db_unixodbc.so | |
370 | %endif | |
371 | ||
372 | %files snmpstats | |
373 | %defattr(644,root,root,755) | |
374 | %attr(755,root,root) %{_libdir}/opensips/modules/snmpstats.so | |
375 | ||
376 | %files perl | |
377 | %defattr(644,root,root,755) | |
378 | %attr(755,root,root) %{_libdir}/opensips/modules/perl.so | |
379 | %attr(755,root,root) %{_libdir}/opensips/modules/perlvdb.so | |
380 | ||
381 | %files mibs | |
382 | %defattr(644,root,root,755) | |
383 | %{_datadir}/snmp/mibs/* |