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