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: http://www.process-one.net/downloads/ejabberd/%{version}/%{name}-%{version}.tgz
17 Source0: https://www.process-one.net/downloads/downloads-action.php?file=/%{version}/%{name}-%{version}.tgz
18 # Source0-md5: e25e36985621f3a1a23ded3191be39e5
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-20210324.tar.gz
27 # Source11-md5: 818140d399728c545387b034098153bf
28 Source12: ejabberd-eimp-20210324.tar.gz
29 # Source12-md5: 796a31eca78b372dbf71553a46b981e7
30 Source13: ejabberd-elixir-20170515.tar.gz
31 # Source13-md5: 73be42f7d0cda7aeee5c0e6dadc0c451
32 Source14: ejabberd-ezlib-20201111.tar.gz
33 # Source14-md5: c4bc9c91ed5e802a3ce1d920ba71d188
34 Source15: ejabberd-fast_tls-20210324.tar.gz
35 # Source15-md5: 0067d2327f8c2e1fd0b8424677e766ce
36 Source16: ejabberd-fast_xml-20210324.tar.gz
37 # Source16-md5: 3f543238cd21c42a116ed4c452161a56
38 Source17: ejabberd-fast_yaml-20210324.tar.gz
39 # Source17-md5: 8c4ff955ee55e21b881ff5ac9de02e85
40 Source18: ejabberd-goldrush-20160531.tar.gz
41 # Source18-md5: acac73f0fc85d23671f0c49c68f8df8a
42 Source19: ejabberd-idna-20180830.tar.gz
43 # Source19-md5: e34174d5c5e2e91611d3249c690f6d2d
44 Source20: ejabberd-jiffy-20200630.tar.gz
45 # Source20-md5: e99a512a9c4395bda77f07990aa9aa97
46 Source21: ejabberd-jose-20181231.tar.gz
47 # Source21-md5: 406b7ceab1b2d3843440dfbdd85f2e79
48 Source22: ejabberd-lager-20190430.tar.gz
49 # Source22-md5: 66205d931dd27b496529c19addf6d7d9
50 Source23: ejabberd-mqtree-20210324.tar.gz
51 # Source23-md5: 85cff1a3f08f98978a6ed691d7dd1e2a
52 Source24: ejabberd-p1_acme-20210324.tar.gz
53 # Source24-md5: e3f5a625786556eb10497d9419f81874
54 Source25: ejabberd-p1_mysql-20210324.tar.gz
55 # Source25-md5: c850984c1dfc0e6af4672afdace75813
56 Source26: ejabberd-p1_oauth2-20210324.tar.gz
57 # Source26-md5: d93d5ee18fdc0de9b7cd12d6aa3b9aa4
58 Source27: ejabberd-p1_pgsql-20210324.tar.gz
59 # Source27-md5: 2f8c3341ac8e49b774c5bad9f2272e23
60 Source28: ejabberd-p1_utils-20210324.tar.gz
61 # Source28-md5: b48ebc4e4342e51f4dca833a93615a6a
62 Source29: ejabberd-pkix-20201208.tar.gz
63 # Source29-md5: 14639c53d33057bf4edc7ebfbfc02c11
64 Source30: ejabberd-rebar_elixir_plugin-20160105.tar.gz
65 # Source30-md5: 6a069a566d71c3daa45fc4736364adf0
66 Source31: ejabberd-sqlite3-20210324.tar.gz
67 # Source31-md5: df130aec0c3eca906eba05340723cf5f
68 Source32: ejabberd-stringprep-20210324.tar.gz
69 # Source32-md5: f94cf702e4b04538b2feddcb40406da3
70 Source33: ejabberd-stun-20210324.tar.gz
71 # Source33-md5: 2e4c4eadd1c53b8ad73701477bb098f9
72 Source34: ejabberd-unicode_util_compat-20170729.tar.gz
73 # Source34-md5: 1b348fdf38dba88ebed2f65125ad8590
74 Source35: ejabberd-xmpp-20210324.tar.gz
75 # Source35-md5: 6d929a75424b90edfab5df1b3a114dd3
76 Source36: ejabberd-yconf-20210324.tar.gz
77 # Source36-md5: 39672c345eb3ae06d8ed9f882a9e09fa
79 Patch0: %{name}-paths.patch
80 Patch1: %{name}-config.patch
81 # https://paleg.github.io/mod_logdb/
82 # https://github.com/paleg/ejabberd/compare/paleg:19.08...paleg:19.08-mod_logdb.patch
83 Patch3: %{name}-mod_logdb.patch
84 URL: http://www.ejabberd.im/
85 BuildRequires: autoconf
86 BuildRequires: automake
87 BuildRequires: erlang >= 2:22.2
88 BuildRequires: expat-devel >= 1.95
89 BuildRequires: openssl-devel
91 BuildRequires: pam-devel
93 BuildRequires: git-core
94 BuildRequires: rpmbuild(macros) >= 1.671
95 BuildRequires: sqlite3-devel
96 BuildRequires: yaml-devel
97 BuildRequires: zlib-devel
98 Requires(post): /usr/bin/perl
99 Requires(post): jabber-common
100 Requires(post): sed >= 4.0
101 Requires(post): textutils
102 Requires(post,preun): /sbin/chkconfig
103 Requires(post,preun,postun): systemd-units >= 38
104 Requires: erlang >= 2:22.2
105 Requires: expat >= 1.95
107 Requires: systemd-units >= 38
108 Conflicts: logrotate < 3.8.0
109 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
111 %define _noautoprovfiles %{_libdir}/%{name}/priv/lib/
114 ejabberd is a Free and Open Source fault-tolerant distributed Jabber
115 server. It is written mostly in Erlang.
117 %description -l pl.UTF-8
118 ejabberd to darmowy, z otwartymi źródłami, odporny na awarie
119 rozproszony serwer Jabbera. Jest napisany w większości w Erlangu.
122 Summary: Server-side logging module
123 Group: Applications/Communications
124 Requires: %{name} = %{version}-%{release}
127 Server-side logging module.
130 %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 -a 35 -a 36
138 # Various parts of the build system use 'git describe'
139 # which returns nonsense on manual builds using the builder script
140 # and which fails on the PLD builders
141 # I was not able to locate all 'git describe' invocation, sot let's
142 # fool them with this dummy repository
143 unset GIT_DIR GIT_WORK_TREE
145 git config user.email "dummy@example.com"
146 git config user.name "Dummy"
148 git commit -a -m "dummy commit"
151 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
154 unset GIT_DIR GIT_WORK_TREE
158 %{?with_pam --enable-pam} \
159 --enable-user=jabber \
160 %{__enable_disable new_sql_schema new-sql-schema} \
166 --enable-sqlite --with-sqlite3 \
167 %{?with_pam:--enable-pam} \
189 LC_ALL=en_US.UTF-8; export LC_ALL
193 rm -rf $RPM_BUILD_ROOT
194 install -d $RPM_BUILD_ROOT{/var/lib/%{name},/etc/{sysconfig,rc.d/init.d}} \
195 $RPM_BUILD_ROOT{%{systemdunitdir},%{_sbindir}} \
196 $RPM_BUILD_ROOT{/etc/logrotate.d,/var/log/archive/%{name}}
198 unset GIT_DIR GIT_WORK_TREE
200 %{__make} install -j1 \
204 DESTDIR=$RPM_BUILD_ROOT
206 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}
207 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
208 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
209 cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
211 chmod u+rw $RPM_BUILD_ROOT%{_sbindir}/%{name}*
213 chmod 755 $RPM_BUILD_ROOT%{_libdir}/*/priv/lib/*.so
215 rm -rf _doc 2>/dev/null || :
216 mv $RPM_BUILD_ROOT%{_docdir}/%{name} _doc
218 touch $RPM_BUILD_ROOT%{_sysconfdir}/jabber/ejabberd.cfg
219 touch $RPM_BUILD_ROOT/var/lib/ejabberd/.erlang.cookie
222 rm -rf $RPM_BUILD_ROOT
225 if [ -e /etc/jabber/ejabberd.cfg ] ; then
226 %banner -e %{name} <<'EOF'
227 Old-style /etc/jabber/ejabberd.cfg configuration file exists. You should
228 consider converting it to the new YAML format. You can do this with the
229 'ejabberdctl convert_to_yaml' command (ejabberd must be already running).
234 if [ -f %{_sysconfdir}/jabber/secret ] ; then
235 SECRET="$(cat %{_sysconfdir}/jabber/secret)"
236 if [ -n "$SECRET" ] ; then
237 echo -n "Updating component authentication secret in ejabberd config file..." >&2
238 %{__sed} -i -e "s/@service_secret@/$SECRET/" /etc/jabber/ejabberd.yml
242 /sbin/chkconfig --add ejabberd
243 if [ -e /var/run/%{name}-upgrade-trigger ] ; then
244 # service will be restarted in the postun trigger
245 rm -f /var/run/%{name}-upgrade-trigger || :
247 %service ejabberd restart "ejabberd server"
248 %systemd_post %{name}.service
252 if [ "$1" = "0" ]; then
253 %service ejabberd stop
254 /sbin/chkconfig --del ejabberd
256 %systemd_preun %{name}.service
261 %triggerprein -- %{name} < 13.10
262 if [ -e /etc/jabber/ejabberd.cfg ] ; then
263 if grep -Eq '^[^%]*access_get' /etc/jabber/ejabberd.cfg ; then
264 echo "Your 'ejabberd.cfg' config file seems to use 'access_get' option of mod_vcard" >&2
265 echo "this is not supported by this ejabberd version in PLD" >&2
268 rm -f /etc/jabber/ejabberd.yml.rpmnew 2>/dev/null || :
270 if [ -e /var/lock/subsys/ejabberd ] ; then
271 # old init script won't stop ejabberd correctly
272 # stop it's all processes here
273 # we assume any 'epmd', 'beam', 'beam.smp' or 'heart' process
274 # running with uid of jabber is ejabberd process
275 pids="$(ps -C "epmd beam beam.smp heart" -o pid=,user= | awk '/jabber/ { print $1 }')" || :
276 if [ -n "$pids" ] ; then
277 %banner -e %{name} <<'EOF'
278 Killing all 'epmd, beam, beam.smp, heart' processed owned by the 'jabber' user to make sure old ejabberd is down.
284 touch /var/run/%{name}-upgrade-trigger || :
286 %triggerpostun -- %{name} < 13.10
287 # convert old 'NODENAME' in /etc/sysconfig/ejabberd
288 # to 'ERLANG_NODE' in /etc/jabber/ejabberdctl.cfg
289 # and move other settings
290 NODENAME="$(hostname)"
291 if [ -e /etc/sysconfig/ejabberd ] ; then
292 . /etc/sysconfig/ejabberd || :
294 subst="s/^#ERLANG_NODE=.*/ERLANG_NODE=ejabberd@${NODENAME}/"
295 if [ "$NODENAME" != "localhost" ] ; then
296 %banner -e %{name} <<'EOF'
297 Configured node name (ejabberd@${NODENAME}) is not at 'localhost'.
298 – setting INET_DIST_INTERFACE=0.0.0.0 in /etc/jabber/ejabberdctl.cfg.
299 You should consider tuning that or your firewall configuration.
302 subst="$subst;s/^#INET_DIST_INTERFACE=.*/INET_DIST_INTERFACE=0.0.0.0/"
304 if [ -n "$ERL_MAX_PORTS" ] ; then
305 subst="$subst;s/^#ERL_MAX_PORTS=.*/ERL_MAX_PORTS=${ERL_MAX_PORTS}/"
307 sed -i -e"$subst" /etc/jabber/ejabberdctl.cfg || :
308 if [ -e /etc/sysconfig/ejabberd ] ; then
310 -e'/^[#[:space:]]*NODENAME=/d;/^# Node name/d' \
311 -e'/^[#[:space:]]*ERL_MAX_PORTS=/d;/^# uncomment this to allow more then 1024 connections/d' \
312 -e'/^[#[:space:]]*ERL_FULLSWEEP_AFTER=/d;/^# uncomment this to limit memory usage/d' \
313 /etc/sysconfig/ejabberd || :
315 cp %{_sysconfdir}/jabber/cookie /var/lib/ejabberd/.erlang.cookie || :
316 chown jabber:jabber /var/lib/ejabberd/.erlang.cookie || :
317 chmod 400 /var/lib/ejabberd/.erlang.cookie || :
318 if [ -e /etc/jabber/ejabberd.cfg -a ! -e /etc/jabber/ejabberd.yml.rpmnew ] ; then
319 mv /etc/jabber/ejabberd.yml /etc/jabber/ejabberd.yml.rpmnew
320 echo 'include_config_file: "/etc/jabber/ejabberd.cfg"' > /etc/jabber/ejabberd.yml || :
323 # post action postponed here
324 %service ejabberd restart "ejabberd server"
325 %systemd_post %{name}.service
327 %systemd_trigger %{name}.service
330 %defattr(644,root,root,755)
332 %attr(755,root,root) %{_sbindir}/*
333 %attr(755,root,root) %{_bindir}/elixir
334 %attr(755,root,root) %{_bindir}/iex
335 %attr(755,root,root) %{_bindir}/mix
336 %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberd-inetrc
337 %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberd.yml
338 %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberdctl.cfg
339 # legacy config may still be there
340 %attr(640,root,jabber) %ghost %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberd.cfg
341 %attr(770,root,jabber) /var/log/%{name}
342 %attr(770,root,jabber) /var/log/archive/%{name}
344 %exclude %{_libdir}/ejabberd-%{version}/ebin/mod_logdb*
346 %{_libdir}/ejabberd-%{version}
347 %{_libdir}/base64url-*
348 %{_libdir}/cache_tab-*
349 %dir %{_libdir}/eimp-*
350 %dir %{_libdir}/eimp-*/priv
351 %dir %{_libdir}/eimp-*/priv/bin
352 %attr(755,root,root) %{_libdir}/eimp-*/priv/bin/eimp
353 %{_libdir}/eimp-*/ebin
354 %{_libdir}/eimp-*/LICENSE.txt
357 %{_libdir}/fast_tls-*
358 %{_libdir}/fast_xml-*
359 %{_libdir}/fast_yaml-*
360 %{_libdir}/goldrush-*
365 %dir %{_libdir}/mqtree-*
366 %{_libdir}/mqtree-*/ebin
367 %dir %{_libdir}/mqtree-*/priv
368 %dir %{_libdir}/mqtree-*/priv/lib
369 %attr(755,root,root) %{_libdir}/mqtree-*/priv/lib/mqtree.so
371 %{_libdir}/p1_mysql-*
372 %{_libdir}/p1_oauth2-*
373 %{_libdir}/p1_pgsql-*
374 %{_libdir}/p1_utils-*
375 %dir %{_libdir}/pkix-*
376 %{_libdir}/pkix-*/ebin
377 %{_libdir}/pkix-*/LICENSE
378 %{_libdir}/rebar_elixir_plugin-*
379 %{_libdir}/sqlite3-*/ebin
380 %dir %{_libdir}/sqlite3-*
381 %dir %{_libdir}/sqlite3-*/priv
382 %attr(755,root,root) %{_libdir}/sqlite3-*/priv/sqlite3_drv.so
383 %{_libdir}/stringprep-*
385 %{_libdir}/unicode_util_compat-*
388 %dir %attr(770,root,jabber) /var/lib/ejabberd
389 %ghost %attr(400,jabber,jabber) %ghost %config(noreplace) %verify(not md5 mtime size) /var/lib/ejabberd/.erlang.cookie
390 %attr(754,root,root) /etc/rc.d/init.d/%{name}
391 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
392 %{systemdunitdir}/%{name}.service
393 /etc/logrotate.d/%{name}
394 %{_mandir}/man5/ejabberd.yml.5*
398 %defattr(644,root,root,755)
399 %{_libdir}/ejabberd-%{version}/ebin/mod_logdb*