2 # - package all deps (tarballs 10-29) into separate spec files
5 %bcond_with pam # PAM authentication support
6 %bcond_with logdb # enable mod_logdb (server-side message logging)
7 %bcond_with new_sql_schema # build with the new SQL schema
9 Summary: Fault-tolerant distributed Jabber/XMPP server
10 Summary(pl.UTF-8): Odporny na awarie rozproszony serwer Jabbera/XMPP
15 Group: Applications/Communications
16 # Source0: https://www.process-one.net/downloads/downloads-action.php?file=/%{version}/%{name}-%{version}.tar.gz
17 Source0: https://github.com/processone/ejabberd/archive/refs/tags/%{version}.tar.gz
18 # Source0-md5: 4ebfd038cda9cb5ab34c95b49cff1bc8
20 Source2: %{name}.sysconfig
21 Source3: %{name}.service
22 Source4: %{name}.logrotate
24 Source10: ejabberd-base64url-20190617.tar.gz
25 # Source10-md5: 5a12fd2fb1f992c850aba5115aab3dd4
26 Source11: ejabberd-cache_tab-20220502.tar.gz
27 # Source11-md5: 822bec23631e956ce927ecc5ae31e24d
28 Source12: ejabberd-eimp-20220502.tar.gz
29 # Source12-md5: 39b7de8ad391da8fb12ff9b76301ced5
30 Source13: ejabberd-elixir-20170515.tar.gz
31 # Source13-md5: 73be42f7d0cda7aeee5c0e6dadc0c451
32 Source14: ejabberd-ezlib-20220502.tar.gz
33 # Source14-md5: 32dadbeff189a0fa18c21aa42258fa1a
34 Source15: ejabberd-fast_tls-20220502.tar.gz
35 # Source15-md5: 1f341267a7d0bd953e961ccbe098e438
36 Source16: ejabberd-fast_xml-20220502.tar.gz
37 # Source16-md5: 1288d6e5ea055784634367a0991adc3b
38 Source17: ejabberd-fast_yaml-20220502.tar.gz
39 # Source17-md5: 1a513d2a074fc67678eecfbfc36c58b2
40 Source18: ejabberd-idna-20180830.tar.gz
41 # Source18-md5: e34174d5c5e2e91611d3249c690f6d2d
42 Source19: ejabberd-jiffy-20220223.tar.gz
43 # Source19-md5: b98489245dadf5a36ac3408be21d835a
44 Source20: ejabberd-jose-20201223.tar.gz
45 # Source20-md5: 6e5c9910dc1e1894e31882d49f78967d
46 Source21: ejabberd-mqtree-20220502.tar.gz
47 # Source21-md5: 1f1b175534eb917780e89e4c7d49c710
48 Source22: ejabberd-p1_acme-20220502.tar.gz
49 # Source22-md5: ada7344c8192e1999a73110ead29a704
50 Source23: ejabberd-p1_mysql-20210721.tar.gz
51 # Source23-md5: 346f98e9eb7e098d91aef99af47ad3e3
52 Source24: ejabberd-p1_oauth2-20220502.tar.gz
53 # Source24-md5: bade7f8e1d18c9f6149b70268c73087b
54 Source25: ejabberd-p1_pgsql-20220502.tar.gz
55 # Source25-md5: 052db14b243601591477abde6be1c74e
56 Source26: ejabberd-p1_utils-20220502.tar.gz
57 # Source26-md5: 0eab972a4a247519e5a898d8da6054c1
58 Source27: ejabberd-pkix-20220502.tar.gz
59 # Source27-md5: 88fd008dca6cf2208678fbf50b47a21a
60 Source28: ejabberd-rebar_elixir_plugin-20160105.tar.gz
61 # Source28-md5: 6a069a566d71c3daa45fc4736364adf0
62 Source29: ejabberd-sqlite3-20210721.tar.gz
63 # Source29-md5: a81afbe7543f58fbb2cef732d73b3d3c
64 Source30: ejabberd-stringprep-20220502.tar.gz
65 # Source30-md5: 721468fde880de8821c916c2534c9525
66 Source31: ejabberd-stun-20220502.tar.gz
67 # Source31-md5: 27a002c7a5b3a6af6deb2a1eff281cfd
68 Source32: ejabberd-unicode_util_compat-20170729.tar.gz
69 # Source32-md5: 1b348fdf38dba88ebed2f65125ad8590
70 Source33: ejabberd-xmpp-20220502.tar.gz
71 # Source33-md5: 02378d906436ed5d5ece87419ff007ce
72 Source34: ejabberd-yconf-20220502.tar.gz
73 # Source34-md5: 878e4993a860cc6384313e301b63a09b
75 Patch0: %{name}-paths.patch
76 Patch1: %{name}-config.patch
77 Patch2: ejabberd-bug-3819.patch
78 # https://paleg.github.io/mod_logdb/
79 # https://github.com/paleg/ejabberd/compare/paleg:19.08...paleg:19.08-mod_logdb.patch
80 Patch3: %{name}-mod_logdb.patch
81 URL: http://www.ejabberd.im/
82 BuildRequires: autoconf
83 BuildRequires: automake
84 BuildRequires: erlang >= 2:22.2
85 BuildRequires: expat-devel >= 1.95
86 BuildRequires: openssl-devel
88 BuildRequires: pam-devel
90 BuildRequires: git-core
91 BuildRequires: rpmbuild(macros) >= 1.671
92 BuildRequires: sqlite3-devel
93 BuildRequires: yaml-devel
94 BuildRequires: zlib-devel
95 Requires(post): /usr/bin/perl
96 Requires(post): jabber-common
97 Requires(post): sed >= 4.0
98 Requires(post): textutils
99 Requires(post,preun): /sbin/chkconfig
100 Requires(post,preun,postun): systemd-units >= 38
101 Requires: erlang >= 2:22.2
102 Requires: expat >= 1.95
104 Requires: systemd-units >= 38
105 Conflicts: logrotate < 3.8.0
106 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
108 %define _noautoprovfiles %{_libdir}/%{name}/priv/lib/
111 ejabberd is a Free and Open Source fault-tolerant distributed Jabber
112 server. It is written mostly in Erlang.
114 %description -l pl.UTF-8
115 ejabberd to darmowy, z otwartymi źródłami, odporny na awarie
116 rozproszony serwer Jabbera. Jest napisany w większości w Erlangu.
119 Summary: Server-side logging module
120 Group: Applications/Communications
121 Requires: %{name} = %{version}-%{release}
124 Server-side logging module.
127 %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 -a 30 -a 31 -a 32 -a 33 -a 34
135 # Various parts of the build system use 'git describe'
136 # which returns nonsense on manual builds using the builder script
137 # and which fails on the PLD builders
138 # I was not able to locate all 'git describe' invocation, sot let's
139 # fool them with this dummy repository
140 unset GIT_DIR GIT_WORK_TREE
142 git config user.email "dummy@example.com"
143 git config user.name "Dummy"
145 git commit -a -m "dummy commit"
148 sed -i -e 's,#!.*/usr/bin/env.*elixir,#!/usr/bin/elixir,' deps/elixir/bin/mix deps/elixir/lib/mix/lib/mix/tasks/escript.build.ex
151 unset GIT_DIR GIT_WORK_TREE
155 %{?with_pam --enable-pam} \
156 --enable-user=jabber \
157 %{__enable_disable new_sql_schema new-sql-schema} \
163 --enable-sqlite --with-sqlite3 \
164 %{?with_pam:--enable-pam} \
186 LC_ALL=en_US.UTF-8; export LC_ALL
190 rm -rf $RPM_BUILD_ROOT
191 install -d $RPM_BUILD_ROOT{/var/lib/%{name},/etc/{sysconfig,rc.d/init.d}} \
192 $RPM_BUILD_ROOT{%{systemdunitdir},%{_sbindir}} \
193 $RPM_BUILD_ROOT{/etc/logrotate.d,/var/log/archive/%{name}}
195 unset GIT_DIR GIT_WORK_TREE
197 %{__make} install -j1 \
201 DESTDIR=$RPM_BUILD_ROOT
203 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}
204 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
205 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
206 cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
208 chmod u+rw $RPM_BUILD_ROOT%{_sbindir}/%{name}*
210 chmod 755 $RPM_BUILD_ROOT%{_libdir}/*/priv/lib/*.so
212 rm -rf _doc 2>/dev/null || :
213 mv $RPM_BUILD_ROOT%{_docdir}/%{name} _doc
215 touch $RPM_BUILD_ROOT%{_sysconfdir}/jabber/ejabberd.cfg
216 touch $RPM_BUILD_ROOT/var/lib/ejabberd/.erlang.cookie
219 rm -rf $RPM_BUILD_ROOT
222 if [ -e /etc/jabber/ejabberd.cfg ] ; then
223 %banner -e %{name} <<'EOF'
224 Old-style /etc/jabber/ejabberd.cfg configuration file exists. You should
225 consider converting it to the new YAML format. You can do this with the
226 'ejabberdctl convert_to_yaml' command (ejabberd must be already running).
231 if [ -f %{_sysconfdir}/jabber/secret ] ; then
232 SECRET="$(cat %{_sysconfdir}/jabber/secret)"
233 if [ -n "$SECRET" ] ; then
234 echo -n "Updating component authentication secret in ejabberd config file..." >&2
235 %{__sed} -i -e "s/@service_secret@/$SECRET/" /etc/jabber/ejabberd.yml
239 /sbin/chkconfig --add ejabberd
240 if [ -e /var/run/%{name}-upgrade-trigger ] ; then
241 # service will be restarted in the postun trigger
242 rm -f /var/run/%{name}-upgrade-trigger || :
244 %service ejabberd restart "ejabberd server"
245 %systemd_post %{name}.service
249 if [ "$1" = "0" ]; then
250 %service ejabberd stop
251 /sbin/chkconfig --del ejabberd
253 %systemd_preun %{name}.service
258 %triggerprein -- %{name} < 13.10
259 if [ -e %{_sysconfdir}/jabber/ejabberd.cfg ] ; then
260 if grep -Eq '^[^%]*access_get' %{_sysconfdir}/jabber/ejabberd.cfg ; then
261 echo "Your 'ejabberd.cfg' config file seems to use 'access_get' option of mod_vcard" >&2
262 echo "this is not supported by this ejabberd version in PLD" >&2
265 rm -f %{_sysconfdir}/jabber/ejabberd.yml.rpmnew 2>/dev/null || :
267 if [ -e /var/lock/subsys/ejabberd ] ; then
268 # old init script won't stop ejabberd correctly
269 # stop it's all processes here
270 # we assume any 'epmd', 'beam', 'beam.smp' or 'heart' process
271 # running with uid of jabber is ejabberd process
272 pids="$(ps -C "epmd beam beam.smp heart" -o pid=,user= | awk '/jabber/ { print $1 }')" || :
273 if [ -n "$pids" ] ; then
274 %banner -e %{name} <<'EOF'
275 Killing all 'epmd, beam, beam.smp, heart' processed owned by the 'jabber' user to make sure old ejabberd is down.
281 touch /var/run/%{name}-upgrade-trigger || :
283 %triggerpostun -- %{name} < 13.10
284 # convert old 'NODENAME' in /etc/sysconfig/ejabberd
285 # to 'ERLANG_NODE' in /etc/jabber/ejabberdctl.cfg
286 # and move other settings
287 NODENAME="$(hostname)"
288 if [ -e /etc/sysconfig/ejabberd ] ; then
289 . /etc/sysconfig/ejabberd || :
291 subst="s/^#ERLANG_NODE=.*/ERLANG_NODE=ejabberd@${NODENAME}/"
292 if [ "$NODENAME" != "localhost" ] ; then
293 %banner -e %{name} <<'EOF'
294 Configured node name (ejabberd@${NODENAME}) is not at 'localhost'.
295 – setting INET_DIST_INTERFACE=0.0.0.0 in /etc/jabber/ejabberdctl.cfg.
296 You should consider tuning that or your firewall configuration.
299 subst="$subst;s/^#INET_DIST_INTERFACE=.*/INET_DIST_INTERFACE=0.0.0.0/"
301 if [ -n "$ERL_MAX_PORTS" ] ; then
302 subst="$subst;s/^#ERL_MAX_PORTS=.*/ERL_MAX_PORTS=${ERL_MAX_PORTS}/"
304 sed -i -e"$subst" /etc/jabber/ejabberdctl.cfg || :
305 if [ -e /etc/sysconfig/ejabberd ] ; then
307 -e'/^[#[:space:]]*NODENAME=/d;/^# Node name/d' \
308 -e'/^[#[:space:]]*ERL_MAX_PORTS=/d;/^# uncomment this to allow more then 1024 connections/d' \
309 -e'/^[#[:space:]]*ERL_FULLSWEEP_AFTER=/d;/^# uncomment this to limit memory usage/d' \
310 /etc/sysconfig/ejabberd || :
312 cp %{_sysconfdir}/jabber/cookie /var/lib/ejabberd/.erlang.cookie || :
313 chown jabber:jabber /var/lib/ejabberd/.erlang.cookie || :
314 chmod 400 /var/lib/ejabberd/.erlang.cookie || :
315 if [ -e /etc/jabber/ejabberd.cfg -a ! -e /etc/jabber/ejabberd.yml.rpmnew ] ; then
316 mv /etc/jabber/ejabberd.yml /etc/jabber/ejabberd.yml.rpmnew
317 echo 'include_config_file: "/etc/jabber/ejabberd.cfg"' > /etc/jabber/ejabberd.yml || :
320 # post action postponed here
321 %service ejabberd restart "ejabberd server"
322 %systemd_post %{name}.service
324 %systemd_trigger %{name}.service
327 %defattr(644,root,root,755)
329 %attr(755,root,root) %{_sbindir}/*
330 %attr(755,root,root) %{_bindir}/elixir
331 %attr(755,root,root) %{_bindir}/iex
332 %attr(755,root,root) %{_bindir}/mix
333 %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberd-inetrc
334 %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberd.yml
335 %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberdctl.cfg
336 # legacy config may still be there
337 %attr(640,root,jabber) %ghost %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberd.cfg
338 %attr(770,root,jabber) /var/log/%{name}
339 %attr(770,root,jabber) /var/log/archive/%{name}
341 %exclude %{_libdir}/ejabberd-%{version}/ebin/mod_logdb*
343 %{_libdir}/ejabberd-%{version}
344 %{_libdir}/base64url-*
345 %{_libdir}/cache_tab-*
346 %dir %{_libdir}/eimp-*
347 %dir %{_libdir}/eimp-*/priv
348 %dir %{_libdir}/eimp-*/priv/bin
349 %attr(755,root,root) %{_libdir}/eimp-*/priv/bin/eimp
350 %{_libdir}/eimp-*/ebin
351 %{_libdir}/eimp-*/LICENSE.txt
354 %{_libdir}/fast_tls-*
355 %{_libdir}/fast_xml-*
356 %{_libdir}/fast_yaml-*
360 %dir %{_libdir}/mqtree-*
361 %{_libdir}/mqtree-*/ebin
362 %dir %{_libdir}/mqtree-*/priv
363 %dir %{_libdir}/mqtree-*/priv/lib
364 %attr(755,root,root) %{_libdir}/mqtree-*/priv/lib/mqtree.so
366 %{_libdir}/p1_mysql-*
367 %{_libdir}/p1_oauth2-*
368 %{_libdir}/p1_pgsql-*
369 %{_libdir}/p1_utils-*
370 %dir %{_libdir}/pkix-*
371 %{_libdir}/pkix-*/ebin
372 %{_libdir}/pkix-*/LICENSE
373 %{_libdir}/rebar_elixir_plugin-*
374 %{_libdir}/sqlite3-*/ebin
375 %dir %{_libdir}/sqlite3-*
376 %dir %{_libdir}/sqlite3-*/priv
377 %attr(755,root,root) %{_libdir}/sqlite3-*/priv/sqlite3_drv.so
378 %{_libdir}/stringprep-*
380 %{_libdir}/unicode_util_compat-*
383 %dir %attr(770,root,jabber) /var/lib/ejabberd
384 %ghost %attr(400,jabber,jabber) %ghost %config(noreplace) %verify(not md5 mtime size) /var/lib/ejabberd/.erlang.cookie
385 %attr(754,root,root) /etc/rc.d/init.d/%{name}
386 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
387 %{systemdunitdir}/%{name}.service
388 /etc/logrotate.d/%{name}
389 %{_mandir}/man5/ejabberd.yml.5*
393 %defattr(644,root,root,755)
394 %{_libdir}/ejabberd-%{version}/ebin/mod_logdb*