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