]>
Commit | Line | Data |
---|---|---|
beed1a42 AM |
1 | # TODO: |
2 | # - package all deps (tarballs 10-29) into separate spec files | |
3 | # (like in fedora) | |
e9f604ed | 4 | # Conditional build: |
5 | %bcond_with pam # PAM authentication support | |
046546ef | 6 | %bcond_without logdb # enable mod_logdb (server-side message logging) |
c4f8aa56 | 7 | %bcond_with weaker_crypto # enable SSLv3 |
eddf5b64 | 8 | |
fb70a56e | 9 | Summary: Fault-tolerant distributed Jabber/XMPP server |
7abad569 | 10 | Summary(pl.UTF-8): Odporny na awarie rozproszony serwer Jabbera/XMPP |
d798517a | 11 | Name: ejabberd |
beed1a42 AM |
12 | Version: 16.08 |
13 | Release: 1 | |
fb70a56e JK |
14 | License: GPL |
15 | Group: Applications/Communications | |
d798517a | 16 | Source0: http://www.process-one.net/downloads/ejabberd/%{version}/%{name}-%{version}.tgz |
beed1a42 | 17 | # Source0-md5: a225e99c50e91464cf8f78bd8d129664 |
d798517a JK |
18 | Source1: %{name}.init |
19 | Source2: %{name}.sysconfig | |
20 | Source3: %{name}.service | |
f20002e6 | 21 | Source4: %{name}.logrotate |
e2bda3a7 JK |
22 | # |
23 | # Archives created with the ejabberd-pack_deps.sh script (in this repo) | |
beed1a42 AM |
24 | Source10: ejabberd-cache_tab-20160630.tar.gz |
25 | # Source10-md5: 28c7b761c5bdc70bbfa3c1d85fff9825 | |
26 | Source11: ejabberd-elixir-20150928.tar.gz | |
27 | # Source11-md5: 1a0cba08de1687affe590e5abbc993cc | |
28 | Source12: ejabberd-esip-20160708.tar.gz | |
29 | # Source12-md5: 759e70d30fc1c5adbae3976e28c8c659 | |
30 | Source13: ejabberd-ezlib-20160122.tar.gz | |
31 | # Source13-md5: 41907afdd7195014b1e4cf4764564a37 | |
32 | Source14: ejabberd-fast_tls-20160708.tar.gz | |
33 | # Source14-md5: e4f56b9dce6fc68f9eb58417554fe24a | |
34 | Source15: ejabberd-fast_xml-20160708.tar.gz | |
35 | # Source15-md5: f26c98665fe7370262412084d802a310 | |
36 | Source16: ejabberd-fast_yaml-20160708.tar.gz | |
37 | # Source16-md5: 815111ff387608a9c0a41898d8fe0ad6 | |
38 | Source17: ejabberd-goldrush-20151116.tar.gz | |
39 | # Source17-md5: 61324bdee5d304a7189c305a6b4fe39e | |
40 | Source18: ejabberd-iconv-20160708.tar.gz | |
41 | # Source18-md5: 5b8ad7ada3f46b766e4be985322225f9 | |
42 | Source19: ejabberd-jiffy-20160106.tar.gz | |
43 | # Source19-md5: 50a03a4289ab5c37c3263e73c15873ef | |
44 | Source20: ejabberd-lager-20160610.tar.gz | |
45 | # Source20-md5: 395b1fd4d056684c8b92d50d9916b7ed | |
46 | Source21: ejabberd-luerl-20151210.tar.gz | |
47 | # Source21-md5: 180f8ff3f24d00cbdabbf28c7e415f85 | |
48 | Source22: ejabberd-p1_mysql-20160122.tar.gz | |
49 | # Source22-md5: 40b984a50b7d3a7bd00dd15aafd7a44a | |
50 | Source23: ejabberd-p1_oauth2-20160123.tar.gz | |
51 | # Source23-md5: 8dda6e87a6551724b0bc7d21b7a59357 | |
52 | Source24: ejabberd-p1_pgsql-20160223.tar.gz | |
53 | # Source24-md5: 739c03ac9089f7f86d55cea3ee5bee25 | |
54 | Source25: ejabberd-p1_utils-20160701.tar.gz | |
55 | # Source25-md5: 8a8734d8dd773ec0cf808e1a8bbdbde3 | |
56 | Source26: ejabberd-p1_xmlrpc-20160123.tar.gz | |
57 | # Source26-md5: 8ec9db8add5754738f2272d690adb75c | |
58 | Source27: ejabberd-rebar_elixir_plugin-20160105.tar.gz | |
59 | # Source27-md5: 40f41b936c8c774174c953895f132f98 | |
60 | Source28: ejabberd-stringprep-20160708.tar.gz | |
61 | # Source28-md5: e9432b08b37602e54e8716c2b9e2edab | |
62 | Source29: ejabberd-stun-20160708.tar.gz | |
63 | # Source29-md5: fea7f6b75606d51478a468ae664f0d64 | |
e2bda3a7 | 64 | # |
d798517a JK |
65 | Patch0: %{name}-paths.patch |
66 | Patch1: %{name}-config.patch | |
e2bda3a7 | 67 | # not available for 13.10 |
d798517a | 68 | #Patch2: %{name}-vcard-access-get.patch |
33af2120 | 69 | # http://www.dp.uz.gov.ua/o.palij/mod_logdb/patch-mod_logdb-13.12.diff |
d798517a | 70 | Patch3: %{name}-mod_logdb.patch |
c4f8aa56 | 71 | Patch4: %{name}-no_sslv3_or_3des.patch |
3f2196e7 | 72 | URL: http://www.ejabberd.im/ |
fb70a56e | 73 | BuildRequires: autoconf |
1a2644b6 | 74 | BuildRequires: automake |
a306e2ac | 75 | BuildRequires: erlang >= 1:R16B03 |
6f0d08c1 | 76 | BuildRequires: expat-devel >= 1.95 |
77 | BuildRequires: openssl-devel | |
e9f604ed | 78 | %if %{with pam} |
79 | BuildRequires: pam-devel | |
80 | %endif | |
67271627 | 81 | BuildRequires: rpmbuild(macros) >= 1.671 |
60c3a68c | 82 | BuildRequires: yaml-devel |
01f61704 | 83 | BuildRequires: zlib-devel |
8e141538 | 84 | BuildRequires: git-core |
27b10c8b | 85 | Requires(post): /usr/bin/perl |
b15a901d | 86 | Requires(post): jabber-common |
0d54398f | 87 | Requires(post): sed >= 4.0 |
fb70a56e | 88 | Requires(post): textutils |
fb70a56e | 89 | Requires(post,preun): /sbin/chkconfig |
67271627 | 90 | Requires(post,preun,postun): systemd-units >= 38 |
9a105ba4 | 91 | Requires: erlang >= 1:R15B01 |
bb159536 | 92 | Requires: expat >= 1.95 |
27b10c8b | 93 | Requires: rc-scripts |
67271627 | 94 | Requires: systemd-units >= 38 |
028763ab | 95 | Conflicts: logrotate < 3.8.0 |
fb70a56e JK |
96 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
97 | ||
fcf4c7a2 JK |
98 | %define _noautoprovfiles %{_libdir}/%{name}/priv/lib/ |
99 | ||
fb70a56e | 100 | %description |
472227c5 | 101 | ejabberd is a Free and Open Source fault-tolerant distributed Jabber |
102 | server. It is written mostly in Erlang. | |
fb70a56e | 103 | |
e0166ea5 JR |
104 | %description -l pl.UTF-8 |
105 | ejabberd to darmowy, z otwartymi źródłami, odporny na awarie | |
106 | rozproszony serwer Jabbera. Jest napisany w większości w Erlangu. | |
378431cb | 107 | |
cba58599 | 108 | %package logdb |
1a2644b6 | 109 | Summary: Server-side logging module |
cba58599 | 110 | Group: Applications/Communications |
111 | Requires: %{name} = %{version}-%{release} | |
112 | ||
113 | %description logdb | |
114 | Server-side logging module. | |
115 | ||
fb70a56e | 116 | %prep |
beed1a42 | 117 | %setup -q -a 10 -a 11 -a 12 -a 13 -a 14 -a 15 -a 16 -a 17 -a 18 -a 19 -a 20 -a 21 -a 22 -a 23 -a 24 -a 25 -a 26 -a 27 -a 28 -a 29 |
fb70a56e | 118 | %patch0 -p1 |
7f71a53c JK |
119 | %patch1 -p1 |
120 | #%%patch2 -p1 | |
9953f9cb | 121 | %if %{with logdb} |
046546ef | 122 | %patch3 -p1 |
9953f9cb | 123 | %endif |
c4f8aa56 JK |
124 | %if %{without weaker_crypto} |
125 | %patch4 -p1 | |
126 | %endif | |
fb70a56e | 127 | |
8e141538 JK |
128 | # Various parts of the build system use 'git describe' |
129 | # which returns nonsense on manual builds using the builder script | |
130 | # and which fails on the PLD builders | |
131 | # I was not able to locate all 'git describe' invocation, sot let's | |
132 | # fool them with this dummy repository | |
133 | unset GIT_DIR GIT_WORK_TREE | |
134 | git init | |
d798661f JK |
135 | git config user.email "dummy@example.com" |
136 | git config user.name "Dummy" | |
8e141538 JK |
137 | git add configure.ac |
138 | git commit -a -m "dummy commit" | |
139 | git tag "%{version}" | |
fb8f9840 | 140 | |
fb70a56e | 141 | %build |
8e141538 | 142 | unset GIT_DIR GIT_WORK_TREE |
e2bda3a7 | 143 | %{__aclocal} -I m4 |
fb70a56e | 144 | %{__autoconf} |
6b419144 | 145 | %configure \ |
5613d9b6 | 146 | %{?with_pam --enable-pam} \ |
e4f8c955 | 147 | --enable-user=jabber \ |
8311848d | 148 | --enable-elixir \ |
e2bda3a7 | 149 | --enable-full-xml \ |
e2bda3a7 JK |
150 | --enable-odbc \ |
151 | --enable-mysql \ | |
152 | --enable-pgsql \ | |
153 | %{?with_pam:--enable-pam} \ | |
154 | --enable-zlib \ | |
beed1a42 | 155 | --enable-iconv |
5e08a6fd | 156 | |
e2bda3a7 JK |
157 | touch deps/.got |
158 | ||
beed1a42 | 159 | cd deps/iconv |
e2bda3a7 JK |
160 | %configure |
161 | cd ../.. | |
beed1a42 | 162 | cd deps/stringprep |
e2bda3a7 JK |
163 | %configure |
164 | cd ../.. | |
beed1a42 | 165 | cd deps/fast_tls |
e2bda3a7 JK |
166 | %configure |
167 | cd ../.. | |
beed1a42 AM |
168 | cd deps/fast_xml |
169 | %configure | |
e2bda3a7 | 170 | cd ../.. |
beed1a42 | 171 | cd deps/fast_yaml |
e2bda3a7 JK |
172 | %configure |
173 | cd ../.. | |
beed1a42 | 174 | cd deps/ezlib |
e2bda3a7 JK |
175 | %configure |
176 | cd ../.. | |
c6f5b587 AM |
177 | cd deps/esip |
178 | %configure | |
179 | cd ../.. | |
e2bda3a7 | 180 | |
beed1a42 AM |
181 | # for elixir VM |
182 | LC_ALL=en_US.UTF-8; export LC_ALL | |
92a38251 | 183 | %{__make} -j1 |
fb70a56e JK |
184 | |
185 | %install | |
186 | rm -rf $RPM_BUILD_ROOT | |
d798517a | 187 | install -d $RPM_BUILD_ROOT{/var/lib/%{name},/etc/{sysconfig,rc.d/init.d}} \ |
f20002e6 | 188 | $RPM_BUILD_ROOT{%{systemdunitdir},%{_sbindir}} \ |
028763ab | 189 | $RPM_BUILD_ROOT{/etc/logrotate.d,/var/log/archive/%{name}} |
fb70a56e | 190 | |
8e141538 JK |
191 | unset GIT_DIR GIT_WORK_TREE |
192 | ||
e2bda3a7 | 193 | %{__make} install -j1 \ |
e4f8c955 JK |
194 | CHOWN_COMMAND=true \ |
195 | O_USER="" \ | |
196 | G_USER="" \ | |
27b10c8b | 197 | DESTDIR=$RPM_BUILD_ROOT |
fb70a56e | 198 | |
d798517a JK |
199 | sed -e's,@libdir@,%{_libdir},g' -e 's,@EJABBERD_DOC_PATH@,%{_docdir}/%{name}-%{version}/doc,g' %{SOURCE1} > $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} |
200 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name} | |
67271627 | 201 | install %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service |
f20002e6 | 202 | install %{SOURCE4} $RPM_BUILD_ROOT/etc/logrotate.d/%{name} |
fb70a56e | 203 | |
d798517a | 204 | chmod u+rw $RPM_BUILD_ROOT%{_sbindir}/%{name}* |
fb70a56e | 205 | |
beed1a42 | 206 | chmod 755 $RPM_BUILD_ROOT%{_libdir}/*/priv/lib/*.so |
5613d9b6 | 207 | |
e2bda3a7 JK |
208 | rm -rf _doc 2>/dev/null || : |
209 | mv $RPM_BUILD_ROOT%{_docdir}/%{name} _doc | |
059c0bab | 210 | |
fcf4c7a2 JK |
211 | touch $RPM_BUILD_ROOT%{_sysconfdir}/jabber/ejabberd.cfg |
212 | touch $RPM_BUILD_ROOT/var/lib/ejabberd/.erlang.cookie | |
213 | ||
fb70a56e JK |
214 | %clean |
215 | rm -rf $RPM_BUILD_ROOT | |
216 | ||
e2bda3a7 JK |
217 | %pre |
218 | if [ -e /etc/jabber/ejabberd.cfg ] ; then | |
fcf4c7a2 JK |
219 | %banner -e %{name} <<'EOF' |
220 | Old-style /etc/jabber/ejabberd.cfg configuration file exists. You should | |
221 | consider converting it to the new YAML format. You can do this with the | |
27161f77 | 222 | 'ejabberdctl convert_to_yaml' command (ejabberd must be already running). |
fcf4c7a2 | 223 | EOF |
e2bda3a7 JK |
224 | fi |
225 | ||
fb70a56e | 226 | %post |
0d54398f | 227 | if [ -f %{_sysconfdir}/jabber/secret ] ; then |
7f71a53c | 228 | SECRET="$(cat %{_sysconfdir}/jabber/secret)" |
fb70a56e | 229 | if [ -n "$SECRET" ] ; then |
7f71a53c JK |
230 | echo -n "Updating component authentication secret in ejabberd config file..." >&2 |
231 | %{__sed} -i -e "s/@service_secret@/$SECRET/" /etc/jabber/ejabberd.yml | |
232 | echo "done" >&2 | |
fb70a56e JK |
233 | fi |
234 | fi | |
fb70a56e | 235 | /sbin/chkconfig --add ejabberd |
7102eb90 JK |
236 | if [ -e /var/run/%{name}-upgrade-trigger ] ; then |
237 | # service will be restarted in the postun trigger | |
238 | rm -f /var/run/%{name}-upgrade-trigger || : | |
239 | else | |
240 | %service ejabberd restart "ejabberd server" | |
241 | %systemd_post %{name}.service | |
242 | fi | |
67271627 | 243 | |
fb70a56e JK |
244 | %preun |
245 | if [ "$1" = "0" ]; then | |
b15a901d | 246 | %service ejabberd stop |
fb70a56e JK |
247 | /sbin/chkconfig --del ejabberd |
248 | fi | |
67271627 JK |
249 | %systemd_preun %{name}.service |
250 | ||
251 | %postun | |
252 | %systemd_reload | |
253 | ||
254 | %triggerprein -- %{name} < 13.10 | |
7102eb90 JK |
255 | if [ -e /etc/jabber/ejabberd.cfg ] ; then |
256 | if grep -Eq '^[^%]*access_get' /etc/jabber/ejabberd.cfg ; then | |
257 | echo "Your 'ejabberd.cfg' config file seems to use 'access_get' option of mod_vcard" >&2 | |
258 | echo "this is not supported by this ejabberd version in PLD" >&2 | |
259 | exit 1 | |
260 | fi | |
261 | rm -f /etc/jabber/ejabberd.yml.rpmnew 2>/dev/null || : | |
262 | fi | |
263 | if [ -e /var/lock/subsys/ejabberd ] ; then | |
67271627 JK |
264 | # old init script won't stop ejabberd correctly |
265 | # stop it's all processes here | |
266 | # we assume any 'epmd', 'beam', 'beam.smp' or 'heart' process | |
267 | # running with uid of jabber is ejabberd process | |
268 | pids="$(ps -C "epmd beam beam.smp heart" -o pid=,user= | awk '/jabber/ { print $1 }')" || : | |
269 | if [ -n "$pids" ] ; then | |
270 | %banner -e %{name} <<'EOF' | |
271 | Killing all 'epmd, beam, beam.smp, heart' processed owned by the 'jabber' user to make sure old ejabberd is down. | |
7102eb90 | 272 | |
67271627 JK |
273 | EOF |
274 | kill $pids || : | |
275 | fi | |
276 | fi | |
7102eb90 | 277 | touch /var/run/%{name}-upgrade-trigger || : |
fb70a56e | 278 | |
fcf4c7a2 JK |
279 | %triggerpostun -- %{name} < 13.10 |
280 | # convert old 'NODENAME' in /etc/sysconfig/ejabberd | |
281 | # to 'ERLANG_NODE' in /etc/jabber/ejabberdctl.cfg | |
282 | # and move other settings | |
283 | NODENAME="$(hostname)" | |
284 | if [ -e /etc/sysconfig/ejabberd ] ; then | |
285 | . /etc/sysconfig/ejabberd || : | |
286 | fi | |
287 | subst="s/^#ERLANG_NODE=.*/ERLANG_NODE=ejabberd@${NODENAME}/" | |
7102eb90 JK |
288 | if [ "$NODENAME" != "localhost" ] ; then |
289 | %banner -e %{name} <<'EOF' | |
290 | Configured node name (ejabberd@${NODENAME}) is not at 'localhost'. | |
291 | – setting INET_DIST_INTERFACE=0.0.0.0 in /etc/jabber/ejabberdctl.cfg. | |
292 | You should consider tuning that or your firewall configuration. | |
293 | ||
294 | EOF | |
295 | subst="$subst;s/^#INET_DIST_INTERFACE=.*/INET_DIST_INTERFACE=0.0.0.0/" | |
296 | fi | |
fcf4c7a2 JK |
297 | if [ -n "$ERL_MAX_PORTS" ] ; then |
298 | subst="$subst;s/^#ERL_MAX_PORTS=.*/ERL_MAX_PORTS=${ERL_MAX_PORTS}/" | |
299 | fi | |
300 | sed -i -e"$subst" /etc/jabber/ejabberdctl.cfg || : | |
301 | if [ -e /etc/sysconfig/ejabberd ] ; then | |
302 | sed -i.rpmsave \ | |
303 | -e'/^[#[:space:]]*NODENAME=/d;/^# Node name/d' \ | |
304 | -e'/^[#[:space:]]*ERL_MAX_PORTS=/d;/^# uncomment this to allow more then 1024 connections/d' \ | |
305 | -e'/^[#[:space:]]*ERL_FULLSWEEP_AFTER=/d;/^# uncomment this to limit memory usage/d' \ | |
306 | /etc/sysconfig/ejabberd || : | |
307 | fi | |
308 | cp %{_sysconfdir}/jabber/cookie /var/lib/ejabberd/.erlang.cookie || : | |
7102eb90 JK |
309 | chown jabber:jabber /var/lib/ejabberd/.erlang.cookie || : |
310 | chmod 400 /var/lib/ejabberd/.erlang.cookie || : | |
311 | if [ -e /etc/jabber/ejabberd.cfg -a ! -e /etc/jabber/ejabberd.yml.rpmnew ] ; then | |
312 | mv /etc/jabber/ejabberd.yml /etc/jabber/ejabberd.yml.rpmnew | |
313 | echo 'include_config_file: "/etc/jabber/ejabberd.cfg"' > /etc/jabber/ejabberd.yml || : | |
314 | fi | |
315 | ||
316 | # post action postponed here | |
317 | %service ejabberd restart "ejabberd server" | |
318 | %systemd_post %{name}.service | |
319 | ||
67271627 | 320 | %systemd_trigger %{name}.service |
fcf4c7a2 | 321 | |
fb70a56e JK |
322 | %files |
323 | %defattr(644,root,root,755) | |
e2bda3a7 | 324 | %doc sql _doc/* |
fb70a56e | 325 | %attr(755,root,root) %{_sbindir}/* |
fcf4c7a2 JK |
326 | %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberd-inetrc |
327 | %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberd.yml | |
328 | %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberdctl.cfg | |
329 | # legacy config may still be there | |
330 | %attr(640,root,jabber) %ghost %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberd.cfg | |
028763ab JK |
331 | %attr(770,root,jabber) /var/log/%{name} |
332 | %attr(770,root,jabber) /var/log/archive/%{name} | |
61f3ef21 | 333 | %if %{with logdb} |
beed1a42 | 334 | %exclude %{_libdir}/ejabberd-%{version}/ebin/mod_logdb* |
61f3ef21 | 335 | %endif |
beed1a42 AM |
336 | %{_libdir}/ejabberd-%{version} |
337 | %{_libdir}/cache_tab-* | |
338 | %{_libdir}/elixir-* | |
339 | %{_libdir}/esip-* | |
340 | %{_libdir}/ezlib-* | |
341 | %{_libdir}/fast_tls-* | |
342 | %{_libdir}/fast_xml-* | |
343 | %{_libdir}/fast_yaml-* | |
344 | %{_libdir}/goldrush-* | |
345 | %{_libdir}/iconv-* | |
346 | %{_libdir}/jiffy-* | |
347 | %{_libdir}/lager-* | |
348 | %{_libdir}/luerl-* | |
349 | %{_libdir}/p1_mysql-* | |
350 | %{_libdir}/p1_oauth2-* | |
351 | %{_libdir}/p1_pgsql-* | |
352 | %{_libdir}/p1_utils-* | |
353 | %{_libdir}/p1_xmlrpc-* | |
354 | %{_libdir}/rebar_elixir_plugin-* | |
355 | %{_libdir}/stringprep-* | |
356 | %{_libdir}/stun-* | |
fb70a56e | 357 | %dir %attr(770,root,jabber) /var/lib/ejabberd |
fcf4c7a2 | 358 | %ghost %attr(400,jabber,jabber) %ghost %config(noreplace) %verify(not md5 mtime size) /var/lib/ejabberd/.erlang.cookie |
d798517a JK |
359 | %attr(754,root,root) /etc/rc.d/init.d/%{name} |
360 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} | |
67271627 | 361 | %{systemdunitdir}/%{name}.service |
f20002e6 | 362 | /etc/logrotate.d/%{name} |
cba58599 | 363 | |
61f3ef21 | 364 | %if %{with logdb} |
cba58599 | 365 | %files logdb |
366 | %defattr(644,root,root,755) | |
beed1a42 | 367 | %{_libdir}/ejabberd-%{version}/ebin/mod_logdb* |
61f3ef21 | 368 | %endif |