forked from resiprocate/resiprocate
-
Notifications
You must be signed in to change notification settings - Fork 4
/
resiprocate.spec.in
391 lines (353 loc) · 13.3 KB
/
resiprocate.spec.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
Name: @PACKAGE@
Version: @VERSION@
Release: 1%{?dist}
Summary: SIP and TURN stacks, with SIP proxy and TURN server implementations
License: VSL
Url: http://www.resiprocate.org
Source: https://www.resiprocate.org/files/pub/reSIProcate/releases/%name-%version.tar.gz
BuildRequires: libtool automake autoconf
BuildRequires: asio-devel
BuildRequires: boost-devel
BuildRequires: cajun-jsonapi-devel
BuildRequires: c-ares-devel
BuildRequires: cppunit-devel
BuildRequires: gperf
%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7
BuildRequires: db4-cxx-devel
%endif
%define use_systemd 0%{?fedora} >= 17 || 0%{?rhel} >= 7
%if %use_systemd
BuildRequires: systemd
%endif
BuildRequires: db4-devel
BuildRequires: openssl-devel >= 0.9.8
BuildRequires: mysql-devel
BuildRequires: pcre-devel
BuildRequires: perl
BuildRequires: popt-devel
BuildRequires: postgresql-devel
BuildRequires: python-devel
BuildRequires: python-pycxx-devel
%define use_freeradius_client 0%{?fedora} == 0 || 0%{?fedora} >= 21 || 0%{?rhel} >= 7
%if %use_freeradius_client
BuildRequires: freeradius-client-devel
%else
BuildRequires: radiusclient-ng-devel
%endif
BuildRequires: xerces-c-devel
Requires: openssl >= 0.9.8
%if %use_systemd
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
%else
Requires: chkconfig
Requires(preun): initscripts
%endif
Obsoletes: resiprocate-b2bua
%description
The reSIProcate components, particularly the SIP stack, are in use in both
commercial and open-source products. The project is dedicated to maintaining
a complete, correct, and commercially usable implementation of SIP and a few
related protocols.
%package libs
Summary: Shared libraries http://www.resiprocate.org
%description libs
reSIProcate is a framework that aims to fully implement the SIP protocol
in first class C++. It is intended for use in other applications,
such as the repro SIP proxy.
This package provides the core libraries: librutil (utilities),
libresip (SIP stack/RFC compliant message parsing) and
libdum (SIP Dialog Usage Manager, a state machine for SIP dialogs).
%package devel
Summary: reSIProcate development files
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%description devel
Resiprocate SIP Stack development files.
%package repro
Summary: SIP proxy
Requires(pre): shadow-utils
%description repro
repro is the SIP proxy developed as part of the reSIProcate project.
It provides a high-quality, low maintenance solution for serving
small and large IP telephony installations.
reSIProcate is a framework that aims to fully implement the SIP protocol
in first class C++. It is intended for use in other applications,
such as the repro SIP proxy.
%package turn-server
Summary: ICE/STUN/TURN server
Requires(pre): shadow-utils
%description turn-server
reTurn is the TURN server developed as part of the reSIProcate project.
TURN (RFC 5766) provides a standardised solution for VoIP applications
to find the most efficient way to route media streams when NAT and
firewall devices may be present.
reTurn provides a high-quality, low maintenance solution for serving
small and large IP telephony installations. It has been used successfully
with a variety of SIP and Jabber applications, including Lumicall,
Jitsi, Empathy and Psi.
reSIProcate is a framework that aims to fully implement the SIP protocol
in first class C++. It is intended for use in other applications,
such as the repro SIP proxy.
%package turn-server-psql
Summary: ICE/STUN/TURN server PostgreSQL users script
Requires: python-psycopg2
%description turn-server-psql
reTurn is the TURN server developed as part of the reSIProcate project.
This packages provides a Python script to synchronize the reTurn
users.txt file from a PostgreSQL table.
%package sipdialer
Summary: Click-to-call utility
%description sipdialer
sipdialer is a click-to-call application that uses the SIP REFER
method to force a SIP phone (for example, the phone on your desk)
to dial another number. It can be registered in GConf to handle
clicks on sip:, sips: and tel: URIs in other applications and the
web browser.
reSIProcate is a framework that aims to fully implement the SIP protocol
in first class C++. It is intended for use in other applications,
such as the repro SIP proxy.
%package clicktocall
Summary: Click-to-call server process
%description clicktocall
Provides a simple SIP click-to-call service.
reSIProcate is a framework that aims to fully implement the SIP protocol
in first class C++. It is intended for use in other applications,
such as the repro SIP proxy.
%prep
%setup -q
%build
PYCONFIG=/usr/bin/python2.7-config
[ -x $PYCONFIG ] || PYCONFIG=/usr/bin/python2.6-config
if [ ! -x $PYCONFIG ] ; then echo "python*-config not found" ; exit 1 ; fi
%if %use_freeradius_client
RADIUS_CFG=--with-freeradius
%else
RADIUS_CFG=--with-radius
%endif
export LDFLAGS="${LDFLAGS} -L%{_libdir}/mysql -L%{_libdir}/libdb4"
CXXFLAGS="%{optflags} -I%{_includedir}/libdb4 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS" %configure --with-c-ares --with-ssl --with-mysql --with-postgresql ${RADIUS_CFG} --with-repro --enable-repro-plugins --with-apps --enable-ipv6 --enable-dtls --with-python DEPS_PYTHON_CFLAGS="`${PYCONFIG} --cflags`" DEPS_PYTHON_LIBS="`${PYCONFIG} --ldflags`" PYCXX_SRCDIR=/usr/src/CXX/Python2 --enable-assert-syslog
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
make %{?_smp_mflags}
%install
make DESTDIR=%{buildroot} install
%if %use_systemd
install -p -D -m644 repro/pkg/common/repro.service %{buildroot}%{_unitdir}/repro.service
install -p -D -m644 reTurn/pkg/common/resiprocate-turn-server.service %{buildroot}%{_unitdir}/resiprocate-turn-server.service
%else
install -p -D -m755 repro/pkg/fedora/repro.init %{buildroot}%{_initddir}/repro
install -p -D -m755 reTurn/pkg/fedora/resiprocate-turn-server.init %{buildroot}%{_initddir}/resiprocate-turn-server
%endif
install -m 0755 -d %{buildroot}%{_sysconfdir}/repro
install -p -D -m640 repro/repro.config %{buildroot}%{_sysconfdir}/repro/repro.config
install -p -D -m640 repro/users.txt %{buildroot}%{_sysconfdir}/repro/users.txt
sed -i \
-e 's!^#CAFile = /etc/pki/tls/cert.pem$!CAFile = /etc/pki/tls/cert.pem!' \
-e 's!^LoggingType = cout$!LoggingType = syslog!' \
-e 's!^LogLevel = INFO$!LogLevel = DEBUG!' \
-e 's!^LogFilename = repro.log$!LogFilename = %{_localstatedir}/log/repro/repro.log!' \
-e 's!^LogFileMaxBytes = 5242880!LogFileMaxBytes = 0!' \
-e 's!^TlsDHParamsFilename = dh2048.pem!TlsDHParamsFilename = %{_sysconfdir}/repro/dh2048.pem!' \
-e 's!^HttpAdminUserFile = users.txt$!HttpAdminUserFile = %{_sysconfdir}/repro/users.txt!' \
-e 's!^#PluginDirectory = /usr/lib/repro/plugins$!PluginDirectory = %{_libdir}/@PACKAGE@/repro/plugins!' \
-e 's!^#RunAsUser = repro$!RunAsUser = repro!' \
-e 's!^#RunAsGroup = repro$!RunAsGroup = repro!' \
-e 's!^Daemonize = false$!Daemonize = true!' \
-e 's!^Database1Path = ./$!Database1Path = %{_sharedstatedir}/repro!' \
-e 's!^ChallengeThirdPartiesCallingLocalDomains = true$!ChallengeThirdPartiesCallingLocalDomains = false!' \
%{buildroot}%{_sysconfdir}/repro/repro.config
install -p -D -m640 reTurn/reTurnServer.config %{buildroot}%{_sysconfdir}/reTurn/reTurnServer.config
install -p -D -m640 reTurn/users.txt %{buildroot}%{_sysconfdir}/reTurn/users.txt
sed -i -e 's/1234/6078a36f89704d83763c9e174b3e87a4/' %{buildroot}%{_sysconfdir}/reTurn/users.txt
sed -i \
-e 's!^TlsTurnPort = 5349!TlsTurnPort = 0!' \
-e 's!^LoggingType = file$!LoggingType = syslog!' \
-e 's!^LogFilename = reTurnServer.log!LogFilename = %{_localstatedir}/log/reTurnServer/reTurnServer.log!' \
-e 's!^LogFileMaxLines = 50000!LogFileMaxLines = 0!' \
-e 's!^Daemonize = false!Daemonize = true!' \
-e 's!^#RunAsUser = return!RunAsUser = return!' \
-e 's!^#RunAsGroup = return!RunAsGroup = return!' \
-e 's!^UserDatabaseFile = users.txt!UserDatabaseFile = %{_sysconfdir}/reTurn/users.txt!' \
-e 's!^UserDatabaseHashedPasswords = false!UserDatabaseHashedPasswords = true!' \
-e 's!^TlsTempDhFilename = dh2048.pem!TlsTempDhFilename = %{_sysconfdir}/reTurn/dh2048.pem!' \
%{buildroot}%{_sysconfdir}/reTurn/reTurnServer.config
install -m 0755 -d %{buildroot}%{_sharedstatedir}/repro
rm -f %{buildroot}%{_libdir}/lib*.a
rm -f %{buildroot}%{_libdir}/lib*.la
rm -f %{buildroot}%{_libdir}/resiprocate/repro/plugins/lib*.a
rm -f %{buildroot}%{_libdir}/resiprocate/repro/plugins/lib*.la
install -m 0755 -d %{buildroot}/%{_docdir}/repro/examples/pyroute
install -p -D -m644 repro/plugins/pyroute/*.py %{buildroot}/%{_docdir}/repro/examples/pyroute
install -p -D -m644 repro/plugins/pyroute/README.txt %{buildroot}/%{_docdir}/repro/examples/pyroute
%pre repro
getent group repro >/dev/null || groupadd -r repro
getent passwd repro >/dev/null || \
useradd -r -g repro -d %{_sharedstatedir}/repro -s /sbin/nologin \
-c "repro SIP proxy" repro
%pre turn-server
getent group return >/dev/null || groupadd -r return
getent passwd return >/dev/null || \
useradd -r -g return -d / -s /sbin/nologin \
-c "reTurn TURN server" return
%post libs -p /sbin/ldconfig
%post repro
/sbin/ldconfig
%if %use_systemd
%systemd_post repro.service
%else
if [ $1 -eq 1 ] ; then
# Initial installation
/sbin/chkconfig --add repro
fi
%endif
if [ ! -e %{_sysconfdir}/repro/dh2048.pem ] ;
then
/usr/bin/openssl dhparam -outform PEM -out %{_sysconfdir}/repro/dh2048.pem 2048
chown root:repro %{_sysconfdir}/repro/dh2048.pem
chmod 0640 %{_sysconfdir}/repro/dh2048.pem
fi
%post turn-server
%if %use_systemd
%systemd_post resiprocate-turn-server.service
%else
if [ $1 -eq 1 ] ; then
# Initial installation
/sbin/chkconfig --add resiprocate-turn-server
fi
%endif
if [ ! -e %{_sysconfdir}/reTurn/dh2048.pem ] ;
then
/usr/bin/openssl dhparam -outform PEM -out %{_sysconfdir}/reTurn/dh2048.pem 2048
chown root:return %{_sysconfdir}/reTurn/dh2048.pem
chmod 0640 %{_sysconfdir}/reTurn/dh2048.pem
fi
%preun repro
%if %use_systemd
%systemd_preun repro.service
%else
if [ "$1" = 0 ]
then
# Package removal, not upgrade
/sbin/service repro stop
/sbin/chkconfig --del repro
fi
%endif
%preun turn-server
%if %use_systemd
%systemd_preun resiprocate-turn-server.service
%else
if [ "$1" = 0 ]
then
# Package removal, not upgrade
/sbin/service resiprocate-turn-server stop
/sbin/chkconfig --del resiprocate-turn-server
fi
%endif
%postun libs -p /sbin/ldconfig
%postun repro
/sbin/ldconfig
%if %use_systemd
%systemd_postun_with_restart repro.service
%else
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
/sbin/service repro try-restart
fi
%endif
%postun turn-server
%if %use_systemd
%systemd_postun_with_restart resiprocate-turn-server.service
%else
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
/sbin/service resiprocate-turn-server try-restart
fi
%endif
%clean
rm -rf $RPM_BUILD_ROOT
%files libs
%doc COPYING
%{_libdir}/libdum-*.so
%{_libdir}/librepro-*.so
%{_libdir}/libresip-*.so
%{_libdir}/libreTurnClient-*.so
%{_libdir}/librutil-*.so
%{_libdir}/libsipdial-*.so
%files devel
%dir %{_includedir}/clicktocall/
%dir %{_includedir}/reTurn/
%dir %{_includedir}/reTurn/client/
%dir %{_includedir}/repro/
%dir %{_includedir}/repro/monkeys/
%dir %{_includedir}/repro/stateAgents/
%dir %{_includedir}/resip/
%dir %{_includedir}/resip/dum/
%dir %{_includedir}/resip/dum/ssl/
%dir %{_includedir}/resip/stack/
%dir %{_includedir}/resip/stack/ssl/
%dir %{_includedir}/rutil/
%dir %{_includedir}/rutil/dns/
%dir %{_includedir}/rutil/ssl/
%dir %{_includedir}/rutil/stun/
%dir %{_includedir}/rutil/wince/
%dir %{_includedir}/sipdial/
%{_includedir}/clicktocall/*.hxx
%{_includedir}/reTurn/*.hxx
%{_includedir}/reTurn/client/*.hxx
%{_includedir}/repro/*.hxx
%{_includedir}/repro/*/*.hxx
%{_includedir}/resip/dum/*.hxx
%{_includedir}/resip/dum/ssl/*.hxx
%{_includedir}/resip/stack/*.hxx
%{_includedir}/resip/stack/ssl/*.hxx
%{_includedir}/rutil/*.hxx
%{_includedir}/rutil/*.h
%{_includedir}/rutil/*/*.hxx
%{_includedir}/sipdial/*.hxx
%{_libdir}/libdum.so
%{_libdir}/librepro.so
%{_libdir}/libresip.so
%{_libdir}/libreTurnClient.so
%{_libdir}/librutil.so
%{_libdir}/libsipdial.so
%files repro
%attr(0750,repro,repro) %dir %{_sharedstatedir}/repro
%attr(0640,root,repro) %config(noreplace) %{_sysconfdir}/repro/repro.config
%attr(0640,root,repro) %config(noreplace) %{_sysconfdir}/repro/users.txt
%config(missingok) %ghost %{_sysconfdir}/repro/dh2048.pem
%if %use_systemd
%{_unitdir}/repro.service
%else
%{_initddir}/repro
%endif
%{_sbindir}/repro
%{_sbindir}/reprocmd
%{_sbindir}/queuetostream
%{_mandir}/man8/repro*.8*
%dir %{_libdir}/@PACKAGE@/repro/plugins
%{_libdir}/@PACKAGE@/repro/plugins/*.so
%{_docdir}/repro
%files turn-server
%attr(0640,root,return) %config(noreplace) %{_sysconfdir}/reTurn/reTurnServer.config
%attr(0640,root,return) %config(noreplace) %{_sysconfdir}/reTurn/users.txt
%config(missingok) %ghost %{_sysconfdir}/reTurn/dh2048.pem
%dir %{_libdir}/@PACKAGE@/reTurnServer
%if %use_systemd
%{_unitdir}/resiprocate-turn-server.service
%else
%{_initddir}/resiprocate-turn-server
%endif
%{_sbindir}/reTurnServer
%{_mandir}/man8/reTurnServer.8*
%files turn-server-psql
%{_libdir}/@PACKAGE@/reTurnServer/psql-user-extract
%files sipdialer
%{_bindir}/sipdialer
%{_mandir}/man1/sipdialer.1*
%files clicktocall
%{_sbindir}/clicktocall
%changelog
* Sat Nov 24 2012 Daniel Pocock <[email protected]> - @VERSION@-1
- Produce multiple packages for stack/libs, daemons, sipdialer
- Initial build based on autotools