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