-
Notifications
You must be signed in to change notification settings - Fork 0
/
sipxconfig.spec.in
337 lines (294 loc) · 10.5 KB
/
sipxconfig.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
#!BuildIgnore: post-build-checks
%define debug_package %{nil}
Name: @PACKAGE@
Version: @VERSION@
Release: @PACKAGE_REVISION@
Summary: Configuration Management for SIP
License: LGPL
Group: Productivity/Telephony/SIP/Servers
Vendor: SIPfoundry
Packager: SIPfoundry <sipx-dev@list.sipfoundry.org>
Url: http://www.sipfoundry.org/
BuildRequires: automake
BuildRequires: java-1.7.0-openjdk-devel
%if %{_vendor} == redhat
BuildRequires: shadow-utils
%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7
BuildRequires: cronie
%else
BuildRequires: vixie-cron
%endif
%endif
%if %{_vendor} == suse
BuildRequires: pwdutils
BuildRequires: cron
%endif
BuildRequires: zip
BuildRequires: libxslt
BuildRequires: ruby-devel
BuildRequires: dart-sdk
BuildRequires: rubygems
BuildRequires: httpd
BuildRequires: net-snmp-libs >= 5.7.1
BuildRequires: net-snmp-devel >= 5.7.1
BuildRequires: net-snmp-agent-libs >= 5.7.1
BuildRequires: pcre-devel
BuildRequires: sipxcommons >= %version
BuildRequires: sipxcdr-client >= %version
%define sipxpbxlog %{_localstatedir}/log/sipxpbx
%define sipxpbxrun %{_localstatedir}/run/sipxpbx
%define sipxpbxconf %{_sysconfdir}/sipxpbx
%define sipxpbxvarlib %{_var}/lib/sipxpbx
%define sipxconfiglib %{_datadir}/sipXecs/sipXconfig
%define tftproot /tftpboot
%define devicefilesdir %{_datadir}/sipxecs/devicefiles
# Should match sipXlib.m4:SIPX_CONFIGPHONEDIR
%define phonedir %{_localstatedir}/sipxdata/configserver/phone
# disable JAR repacking
%define __jar_repack %{nil}
Source: %name-%version.tar.gz
Requires: httpd
# not installed by default on centos 6
Requires: mod_ssl
%if 0%{?fedora} <= 17 && 0%{?fedora} > 0
Requires: pymongo
%else
Requires: python-pymongo
%endif
Requires: python-argparse
Requires: js
Requires: net-snmp >= 5.7.1
Requires: net-snmp-sysvinit >= 5.7.1
Requires: net-snmp-utils >= 5.7.1
Requires: net-snmp-python
Requires: sipxcommons >= %version
Requires: sipxtacklib >= %version
Requires: sipxcommserverlib >= %version
Requires: sipxcdr-client >= %version
Requires: sipxsupervisor >= %version
Requires: chkconfig
Requires: ruby
Requires: rubygems
Requires: elasticsearch >= 1.7.1
# XX-10822 Required EPEL rpms are now found in build. Pointing to this repo has
# proven to be dangerous
Obsoletes: epel-release
Obsoletes: sipx-jasperreports-deps
Obsoletes: sipxfreeswitch
Obsoletes: sipx-freeswitch
Obsoletes: sipx-freeswitch-codec-passthru-g723_1
Obsoletes: sipx-freeswitch-codec-passthru-amr
Obsoletes: sipx-freeswitch-codec-passthru-g729
Obsoletes: sipxopenacd
Obsoletes: sipxacdstatistics
Obsoletes: sipxacdstatistics-client
Obsoletes: openacd
Obsoletes: erlang-oacd_dialplan
Obsoletes: erlang-oacd_freeswitch
Obsoletes: erlang-oacd_ouc
Obsoletes: erlang-oacd_spx
Obsoletes: erlang-oacd_web
Obsoletes: erlang-openacd
# 4.6 packages that turned out to not be useful as separate pkgs so
# projects merged into sipxconfig
Obsoletes: sipxpostgres
Obsoletes: sipxdns
Obsoletes: sipxmongo
Obsoletes: sipxmongo-server
Obsoletes: sipxtunnel
Obsoletes: sipxsnmp
Obsoletes: sipxhttpd
# UC-1846 - sipXsbc is not supported, might be enabled later
Obsoletes: sipxsbc
Obsoletes: sipxsbc-config
Obsoletes: sipxpark
# XX-11486 - obsolete sipxevent (event notifier) service should be removed
Obsoletes: sipxevent
%if %{_vendor} == suse
Requires: apache2-prefork
Requires: pwdutils
%endif
%if %{?use_ibm_jvm}0
Requires: java-ibm >= 1.6
%if %{_vendor} == redhat
Requires: java-fonts >= 1.6
%endif
Requires: java-ibm-unrestricted
%endif
# jasperreports
Requires: fontconfig
%if %{_vendor} == redhat
Requires: dejavu-serif-fonts
%endif
%if %{_vendor} == redhat
# only used to serve phone profiles under http devices
Requires: httpd >= 2.0
%endif
Requires: bind
# Server. sipxconfig will disable server this by default automatically
# unless admin specifically turns it on
Requires: dhcp
Prefix: %_prefix
BuildRoot: %{_tmppath}/%name-%version-root
%description
Configuring one phone can be a daunting task, configuring a hundred
phones can be maddening. sipXconfig leverages Jetty, Axis
SOAP, postgresql and other JEE technologies to get the job done.
# For phones that use TFTP to server profiles
%package tftp
%if %{_vendor} == redhat
Requires: tftp-server
%endif
%if %{_vendor} == suse
Requires: tftp
%endif
Requires: %{name} >= %{version}
Group: Productivity/Telephony/SIP/Servers
Vendor: SIPfoundry
Summary: Configures/enables TFTP for devices controlled by %{name}
%description tftp
* requires tftp-server
* turns on xinit.d/tftp service on
* redirects /tftpboot to %{phonedir}/profile/tftproot
%package ftp
Requires: vsftpd
Requires: %{name} >= %{version}
Group: Productivity/Telephony/SIP/Servers
Vendor: SIPfoundry
Summary: Configures/enables FTP for devices controlled by %{name}
%description ftp
* installs and configures vsftpd server
* turns on xinit.d/vsftpd service on
* add a user account w/default account for polycom phones
%prep
%setup -q
# suse and obs build system
mv %{_builddir}/%name-%version/%name-rpmlintrc %{_sourcedir}
%build
%configure --enable-rpmbuild @SIPX_RPM_CONFIGURE_OPTIONS@
cp config.log %name.configlog
make
%install
export NO_BRP_CHECK_BYTECODE_VERSION=true
# makeinstall RPM macro doesn't leverage DESTDIR but instead overrides
# libdir, bindir, etc just for make install. This not copesetic w/how
# our makefiles are built, they'd rather preserve libdir, and use
# DESTDIR when copying/moving/creating files. The approach we're taking
# is quite standard, so it's surprising RPM's makeinstall macro is
# the way it is.
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
%doc README NOTICE ChangeLog %name.configlog
%attr(755,root,root) %{_sysconfdir}/init.d/*
%{_datadir}/sipxecs/cfinputs/plugin.d/*.cf
%{_datadir}/sipxecs/cfinputs/plugin.d/lib/*.cf
%attr(755,sipx,sipx) %{_bindir}/*
%attr(755,root,root) %{_libexecdir}/sipXecs/*
%attr(755,sipx,sipx) %{_datadir}/java/sipXecs/sipXconfig/.java-dep
%attr(755,sipx,sipx) %{_datadir}/java/sipXecs/sipXconfig/*.jar
%attr(755,sipx,sipx) %{_datadir}/java/sipXecs/sipXconfig/*.war
%attr(755,sipx,sipx) %{_datadir}/java/sipXecs/sipXconfig/plugins
%dir %attr(775,sipx,sipx) %{phonedir}
%dir %attr(775,sipx,sipx) %{phonedir}/acd/audio
%dir %attr(775,sipx,sipx) %{phonedir}/profile
%dir %attr(775,sipx,sipx) %{phonedir}/profile/docroot
%dir %attr(775,sipx,sipx) %{phonedir}/profile/tftproot
%dir %attr(775,sipx,sipx) %{_localstatedir}/sipxdata/unitelite
%dir %{_localstatedir}
# Install configserver config files, directory only is created by pbx
#
# NOTE: Need to declare both
# %dir %attr(755,sipx,sipx) /somedir
# %config(noreplace) %/somedir/somefile
# otherwise /somedir will have root permissions
# see http://lists.rpm.org/pipermail/rpm-list/2011-July/000946.html
%defattr(644,root,root,755)
%config(noreplace) %{sipxpbxconf}/VM_global_library.vm
%config(noreplace) %{sipxpbxconf}/acme/*
%config(noreplace) %{sipxpbxconf}/acmePhone/*
%config(noreplace) %{sipxpbxconf}/apache/*
%config(noreplace) %{sipxpbxconf}/backup/*
%config(noreplace) %{sipxpbxconf}/certificate/*
%config(noreplace) %{sipxpbxconf}/commserver/*
%config(noreplace) %{sipxpbxconf}/database/*
%config(noreplace) %{sipxpbxconf}/dhcp/*
%config(noreplace) %{sipxpbxconf}/fail2ban/*
%config(noreplace) %{sipxpbxconf}/firewall/*
%config(noreplace) %{sipxpbxconf}/freeswitch/*
%config(noreplace) %{sipxpbxconf}/ftp/*
%config(noreplace) %{sipxpbxconf}/itspTemplates/*
%config(noreplace) %{sipxpbxconf}/mailbox/*
%config(noreplace) %{sipxpbxconf}/moh/*
%config(noreplace) %{sipxpbxconf}/mongo/*
%config(noreplace) %{sipxpbxconf}/nattraversal/*
%config(noreplace) %{sipxpbxconf}/ntp/*
%config(noreplace) %{sipxpbxconf}/setting.dtd
%config(noreplace) %{sipxpbxconf}/setting.xsl
%config(noreplace) %{sipxpbxconf}/sipxacccode/*
%config(noreplace) %{sipxpbxconf}/sipxbridge/*
%config(noreplace) %{sipxpbxconf}/sipxcallresolver/*
%config(noreplace) %{sipxpbxconf}/sipxconference/*
%config(noreplace) %{sipxpbxconf}/sipxconfig-jetty.xml
%config(noreplace) %{sipxpbxconf}/hz-config.vm
%config(noreplace) %{sipxpbxconf}/sipxconfig/*
%config(noreplace) %{sipxpbxconf}/sipxdns/*
%config(noreplace) %{sipxpbxconf}/sipximbot/*
%config(noreplace) %{sipxpbxconf}/sipxivr/*
%config(noreplace) %{sipxpbxconf}/sipxlogwatcher/*
%config(noreplace) %{sipxpbxconf}/sipxpage/*
%config(noreplace) %{sipxpbxconf}/sipxpark/*
%config(noreplace) %{sipxpbxconf}/sipxpresence/*
%config(noreplace) %{sipxpbxconf}/sipxproxy/*
%config(noreplace) %{sipxpbxconf}/sipxregistrar/*
%config(noreplace) %{sipxpbxconf}/sipxrest/*
%config(noreplace) %{sipxpbxconf}/sipxrls/*
%config(noreplace) %{sipxpbxconf}/sipxsaa/*
%config(noreplace) %{sipxpbxconf}/sipxstatus/*
%config(noreplace) %{sipxpbxconf}/sipxsqa/*
%config(noreplace) %{sipxpbxconf}/sipxvxml/*
%config(noreplace) %{sipxpbxconf}/sipxwebsocket/*
%config(noreplace) %{sipxpbxconf}/snmp/*
%config(noreplace) %{sipxpbxconf}/test.d/*
%config(noreplace) %{sipxpbxconf}/unmanaged/*
%config(noreplace) %{sipxpbxconf}/unmanagedPhone/*
%config(noreplace) %{sipxpbxconf}/sipxcallback/*
%config(noreplace) %{sipxpbxconf}/unite/unitelite.conf
%config(noreplace) %attr(755,sipx,sipx) %{_localstatedir}/sipxdata/parkserver/music
%config(noreplace) %{sipxpbxconf}/sipxtcpdumplog/*
%dir %attr(755,sipx,sipx) %{_localstatedir}/sipxdata/cfdata
%{_localstatedir}/sipxdata/cfdata/defaults/*.cfdat
%dir %attr(775,sipx,sipx) %{_localstatedir}/sipxdata/reports
%config(noreplace) %{_localstatedir}/sipxdata/reports/*
%dir %attr(775,sipx,sipx) %{_localstatedir}/sipxdata/upload
%dir %attr(775,sipx,sipx) %{_localstatedir}/sipxdata/backup
%dir %attr(775,sipx,sipx) %{_localstatedir}/sipxdata/configserver/web-cert
%dir %attr(775,sipx,sipx) %{devicefilesdir}
%{_datadir}/snmp/mibs/SIPXECS-ALARM-NOTIFICATION-MIB.txt
%{_localstatedir}/sipxdata/unitelite/*
%post
if test -e %{_sysconfdir}/logrotate.d/freeswitch; then rm -f %{_sysconfdir}/logrotate.d/freeswitch; fi
# XX-10812 - Note some centos machines seemed to re-adjust sysv startup orders
# automatically, but others did not so we do it here. This was to fix systems
# that installed 4.6 update 9 or below but harmless for any other machines.
if grep -q :on <<<`/sbin/chkconfig sipxconfig --list 2>&1`; then
/sbin/chkconfig --del sipxconfig
/sbin/chkconfig sipxconfig off
fi
%triggerin -- freeswitch
%if %{_vendor} == redhat
/sbin/chkconfig freeswitch off
%endif
# may not be running, so eat stderr
/etc/init.d/freeswitch stop 1>/dev/null
%postun
# uninstall lucene index and Jetty scratch dir on every install
rm -rf /var/sipxdata/tmp/index 2> /dev/null
rm -rf /var/sipxdata/tmp/Jetty__8443__sipxconfig 2> /dev/null
# empty but required to generate RPM
%files tftp
# empty but required to generate RPM
%files ftp