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: c91ae2f93c4c4cd7b00e9cb30ac6044d
20 Source2: %{name}.sysconfig
21 Source3: %{name}.service
22 Source4: %{name}.logrotate
24 # Archives created with the ejabberd-pack_deps.sh script (in this repo)
25 Source10: ejabberd-base64url-20190617.tar.gz
26 # Source10-md5: 5a12fd2fb1f992c850aba5115aab3dd4
27 Source11: ejabberd-cache_tab-20220502.tar.gz
28 # Source11-md5: 822bec23631e956ce927ecc5ae31e24d
29 Source12: ejabberd-eimp-20220502.tar.gz
30 # Source12-md5: 39b7de8ad391da8fb12ff9b76301ced5
31 Source13: ejabberd-elixir-20170515.tar.gz
32 # Source13-md5: 73be42f7d0cda7aeee5c0e6dadc0c451
33 Source14: ejabberd-ezlib-20220502.tar.gz
34 # Source14-md5: 32dadbeff189a0fa18c21aa42258fa1a
35 Source15: ejabberd-fast_tls-20221012.tar.gz
36 # Source15-md5: 440590e5d8e16009d4ff9b38c25cea01
37 Source16: ejabberd-fast_xml-20220502.tar.gz
38 # Source16-md5: 1288d6e5ea055784634367a0991adc3b
39 Source17: ejabberd-fast_yaml-20230117.tar.gz
40 # Source17-md5: 13633fe81d32198c216f5e516f3ef9ee
41 Source18: ejabberd-idna-20180830.tar.gz
42 # Source18-md5: e34174d5c5e2e91611d3249c690f6d2d
43 Source19: ejabberd-jiffy-20220223.tar.gz
44 # Source19-md5: b98489245dadf5a36ac3408be21d835a
45 Source20: ejabberd-jose-20221216.tar.gz
46 # Source20-md5: 1240b886ef9d9102e8df1193f2ebcd4e
47 Source21: ejabberd-mqtree-20220502.tar.gz
48 # Source21-md5: 1f1b175534eb917780e89e4c7d49c710
49 Source22: ejabberd-p1_acme-20230117.tar.gz
50 # Source22-md5: 0a0170413d2cf6cf3c083835f18bd380
51 Source23: ejabberd-p1_mysql-20231016.tar.gz
52 # Source23-md5: 304d139651cc2f14769fc2d7f81b3e66
53 Source24: ejabberd-p1_oauth2-20220502.tar.gz
54 # Source24-md5: bade7f8e1d18c9f6149b70268c73087b
55 Source25: ejabberd-p1_pgsql-20231016.tar.gz
56 # Source25-md5: 6afd5c5763af4a744115d31c3d31eab8
57 Source26: ejabberd-p1_utils-20220502.tar.gz
58 # Source26-md5: 0eab972a4a247519e5a898d8da6054c1
59 Source27: ejabberd-pkix-20220502.tar.gz
60 # Source27-md5: 88fd008dca6cf2208678fbf50b47a21a
61 Source28: ejabberd-rebar_elixir_plugin-20160105.tar.gz
62 # Source28-md5: 6a069a566d71c3daa45fc4736364adf0
63 Source29: ejabberd-sqlite3-20230117.tar.gz
64 # Source29-md5: f9457e450712ef06a6157b23e1ebccee
65 Source30: ejabberd-stringprep-20221012.tar.gz
66 # Source30-md5: b2931baf14b779c718dcd5c42c87f8d5
67 Source31: ejabberd-stun-20231016.tar.gz
68 # Source31-md5: d9520616dd0331efaabb05c901cee249
69 Source32: ejabberd-unicode_util_compat-20170729.tar.gz
70 # Source32-md5: 1b348fdf38dba88ebed2f65125ad8590
71 Source33: ejabberd-xmpp-20231016.tar.gz
72 # Source33-md5: d2dc96824f02642a02c94fb5712d7f69
73 Source34: ejabberd-yconf-20230117.tar.gz
74 # Source34-md5: 6f064bf9d6ad4cbabb44879edd2d1c9e
76 Patch0: %{name}-paths.patch
77 Patch1: %{name}-config.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
134 # Various parts of the build system use 'git describe'
135 # which returns nonsense on manual builds using the builder script
136 # and which fails on the PLD builders
137 # I was not able to locate all 'git describe' invocation, sot let's
138 # fool them with this dummy repository
139 unset GIT_DIR GIT_WORK_TREE
141 git config user.email "dummy@example.com"
142 git config user.name "Dummy"
144 git commit -a -m "dummy commit"
147 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
150 unset GIT_DIR GIT_WORK_TREE
154 %{?with_pam --enable-pam} \
155 --enable-user=jabber \
156 %{__enable_disable new_sql_schema new-sql-schema} \
162 --enable-sqlite --with-sqlite3 \
163 %{?with_pam:--enable-pam} \
185 LC_ALL=en_US.UTF-8; export LC_ALL
189 rm -rf $RPM_BUILD_ROOT
190 install -d $RPM_BUILD_ROOT{/var/lib/%{name},/etc/{sysconfig,rc.d/init.d}} \
191 $RPM_BUILD_ROOT{%{systemdunitdir},%{_sbindir}} \
192 $RPM_BUILD_ROOT{/etc/logrotate.d,/var/log/archive/%{name}}
194 unset GIT_DIR GIT_WORK_TREE
196 %{__make} install -j1 \
200 DESTDIR=$RPM_BUILD_ROOT
202 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}
203 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
204 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
205 cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
207 chmod u+rw $RPM_BUILD_ROOT%{_sbindir}/%{name}*
209 chmod 755 $RPM_BUILD_ROOT%{_libdir}/*/priv/lib/*.so
211 rm -rf _doc 2>/dev/null || :
212 mv $RPM_BUILD_ROOT%{_docdir}/%{name} _doc
214 touch $RPM_BUILD_ROOT%{_sysconfdir}/jabber/ejabberd.cfg
215 touch $RPM_BUILD_ROOT/var/lib/ejabberd/.erlang.cookie
218 rm -rf $RPM_BUILD_ROOT
221 if [ -e /etc/jabber/ejabberd.cfg ] ; then
222 %banner -e %{name} <<'EOF'
223 Old-style /etc/jabber/ejabberd.cfg configuration file exists. You should
224 consider converting it to the new YAML format. You can do this with the
225 'ejabberdctl convert_to_yaml' command (ejabberd must be already running).
230 if [ -f %{_sysconfdir}/jabber/secret ] ; then
231 SECRET="$(cat %{_sysconfdir}/jabber/secret)"
232 if [ -n "$SECRET" ] ; then
233 echo -n "Updating component authentication secret in ejabberd config file..." >&2
234 %{__sed} -i -e "s/@service_secret@/$SECRET/" /etc/jabber/ejabberd.yml
238 /sbin/chkconfig --add ejabberd
239 if [ -e /var/run/%{name}-upgrade-trigger ] ; then
240 # service will be restarted in the postun trigger
241 rm -f /var/run/%{name}-upgrade-trigger || :
243 %service ejabberd restart "ejabberd server"
244 %systemd_post %{name}.service
248 if [ "$1" = "0" ]; then
249 %service ejabberd stop
250 /sbin/chkconfig --del ejabberd
252 %systemd_preun %{name}.service
257 %triggerprein -- %{name} < 13.10
258 if [ -e %{_sysconfdir}/jabber/ejabberd.cfg ] ; then
259 if grep -Eq '^[^%]*access_get' %{_sysconfdir}/jabber/ejabberd.cfg ; then
260 echo "Your 'ejabberd.cfg' config file seems to use 'access_get' option of mod_vcard" >&2
261 echo "this is not supported by this ejabberd version in PLD" >&2
264 rm -f %{_sysconfdir}/jabber/ejabberd.yml.rpmnew 2>/dev/null || :
266 if [ -e /var/lock/subsys/ejabberd ] ; then
267 # old init script won't stop ejabberd correctly
268 # stop it's all processes here
269 # we assume any 'epmd', 'beam', 'beam.smp' or 'heart' process
270 # running with uid of jabber is ejabberd process
271 pids="$(ps -C "epmd beam beam.smp heart" -o pid=,user= | awk '/jabber/ { print $1 }')" || :
272 if [ -n "$pids" ] ; then
273 %banner -e %{name} <<'EOF'
274 Killing all 'epmd, beam, beam.smp, heart' processed owned by the 'jabber' user to make sure old ejabberd is down.
280 touch /var/run/%{name}-upgrade-trigger || :
282 %triggerpostun -- %{name} < 13.10
283 # convert old 'NODENAME' in /etc/sysconfig/ejabberd
284 # to 'ERLANG_NODE' in /etc/jabber/ejabberdctl.cfg
285 # and move other settings
286 NODENAME="$(hostname)"
287 if [ -e /etc/sysconfig/ejabberd ] ; then
288 . /etc/sysconfig/ejabberd || :
290 subst="s/^#ERLANG_NODE=.*/ERLANG_NODE=ejabberd@${NODENAME}/"
291 if [ "$NODENAME" != "localhost" ] ; then
292 %banner -e %{name} <<'EOF'
293 Configured node name (ejabberd@${NODENAME}) is not at 'localhost'.
294 – setting INET_DIST_INTERFACE=0.0.0.0 in /etc/jabber/ejabberdctl.cfg.
295 You should consider tuning that or your firewall configuration.
298 subst="$subst;s/^#INET_DIST_INTERFACE=.*/INET_DIST_INTERFACE=0.0.0.0/"
300 if [ -n "$ERL_MAX_PORTS" ] ; then
301 subst="$subst;s/^#ERL_MAX_PORTS=.*/ERL_MAX_PORTS=${ERL_MAX_PORTS}/"
303 sed -i -e"$subst" /etc/jabber/ejabberdctl.cfg || :
304 if [ -e /etc/sysconfig/ejabberd ] ; then
306 -e'/^[#[:space:]]*NODENAME=/d;/^# Node name/d' \
307 -e'/^[#[:space:]]*ERL_MAX_PORTS=/d;/^# uncomment this to allow more then 1024 connections/d' \
308 -e'/^[#[:space:]]*ERL_FULLSWEEP_AFTER=/d;/^# uncomment this to limit memory usage/d' \
309 /etc/sysconfig/ejabberd || :
311 cp %{_sysconfdir}/jabber/cookie /var/lib/ejabberd/.erlang.cookie || :
312 chown jabber:jabber /var/lib/ejabberd/.erlang.cookie || :
313 chmod 400 /var/lib/ejabberd/.erlang.cookie || :
314 if [ -e /etc/jabber/ejabberd.cfg -a ! -e /etc/jabber/ejabberd.yml.rpmnew ] ; then
315 mv /etc/jabber/ejabberd.yml /etc/jabber/ejabberd.yml.rpmnew
316 echo 'include_config_file: "/etc/jabber/ejabberd.cfg"' > /etc/jabber/ejabberd.yml || :
319 # post action postponed here
320 %service ejabberd restart "ejabberd server"
321 %systemd_post %{name}.service
323 %systemd_trigger %{name}.service
326 %defattr(644,root,root,755)
328 %attr(755,root,root) %{_sbindir}/*
329 %attr(755,root,root) %{_bindir}/elixir
330 %attr(755,root,root) %{_bindir}/iex
331 %attr(755,root,root) %{_bindir}/mix
332 %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberd-inetrc
333 %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberd.yml
334 %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberdctl.cfg
335 # legacy config may still be there
336 %attr(640,root,jabber) %ghost %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberd.cfg
337 %attr(770,root,jabber) /var/log/%{name}
338 %attr(770,root,jabber) /var/log/archive/%{name}
340 %exclude %{_libdir}/ejabberd-%{version}/ebin/mod_logdb*
342 %{_libdir}/ejabberd-%{version}
343 %{_libdir}/base64url-*
344 %{_libdir}/cache_tab-*
345 %dir %{_libdir}/eimp-*
346 %dir %{_libdir}/eimp-*/priv
347 %dir %{_libdir}/eimp-*/priv/bin
348 %attr(755,root,root) %{_libdir}/eimp-*/priv/bin/eimp
349 %{_libdir}/eimp-*/ebin
350 %{_libdir}/eimp-*/LICENSE.txt
353 %{_libdir}/fast_tls-*
354 %{_libdir}/fast_xml-*
355 %{_libdir}/fast_yaml-*
359 %dir %{_libdir}/mqtree-*
360 %{_libdir}/mqtree-*/ebin
361 %dir %{_libdir}/mqtree-*/priv
362 %dir %{_libdir}/mqtree-*/priv/lib
363 %attr(755,root,root) %{_libdir}/mqtree-*/priv/lib/mqtree.so
365 %{_libdir}/p1_mysql-*
366 %{_libdir}/p1_oauth2-*
367 %{_libdir}/p1_pgsql-*
368 %{_libdir}/p1_utils-*
369 %dir %{_libdir}/pkix-*
370 %{_libdir}/pkix-*/ebin
371 %{_libdir}/pkix-*/LICENSE
372 %{_libdir}/rebar_elixir_plugin-*
373 %{_libdir}/sqlite3-*/ebin
374 %dir %{_libdir}/sqlite3-*
375 %dir %{_libdir}/sqlite3-*/priv
376 %attr(755,root,root) %{_libdir}/sqlite3-*/priv/sqlite3_drv.so
377 %{_libdir}/stringprep-*
379 %{_libdir}/unicode_util_compat-*
382 %dir %attr(770,root,jabber) /var/lib/ejabberd
383 %ghost %attr(400,jabber,jabber) %ghost %config(noreplace) %verify(not md5 mtime size) /var/lib/ejabberd/.erlang.cookie
384 %attr(754,root,root) /etc/rc.d/init.d/%{name}
385 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
386 %{systemdunitdir}/%{name}.service
387 /etc/logrotate.d/%{name}
388 %{_mandir}/man5/ejabberd.yml.5*
392 %defattr(644,root,root,755)
393 %{_libdir}/ejabberd-%{version}/ebin/mod_logdb*