2 # - package all deps (tarballs 10-29) into separate spec files
5 %bcond_with pam # PAM authentication support
6 %bcond_without 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-md5: 0ad4ca190161b18cf9d923f6abb3c44a
19 Source2: %{name}.sysconfig
20 Source3: %{name}.service
21 Source4: %{name}.logrotate
23 # Archives created with the ejabberd-pack_deps.sh script (in this repo)
24 Source10: ejabberd-base64url-20150806.tar.gz
25 # Source10-md5: 380365a24cbd8cff33115fd7ae696db4
26 Source11: ejabberd-cache_tab-20190226.tar.gz
27 # Source11-md5: 601a809bea3037253412abb5e9497236
28 Source12: ejabberd-eimp-20190226.tar.gz
29 # Source12-md5: a490c92b9ff8505a69cb591dd5a8faa3
30 Source13: ejabberd-elixir-20170515.tar.gz
31 # Source13-md5: 73be42f7d0cda7aeee5c0e6dadc0c451
32 Source14: ejabberd-ezlib-20190226.tar.gz
33 # Source14-md5: ef779ed1f0e56746ff81a42397f66168
34 Source15: ejabberd-fast_tls-20190226.tar.gz
35 # Source15-md5: 75aabc6f73cacaeea627424b7e3b8177
36 Source16: ejabberd-fast_xml-20190226.tar.gz
37 # Source16-md5: 22ff10a6d53075becd59c57fe845844a
38 Source17: ejabberd-fast_yaml-20190226.tar.gz
39 # Source17-md5: 7de2c0c783ef7f7a47d53caa10c559e1
40 Source18: ejabberd-goldrush-20160531.tar.gz
41 # Source18-md5: acac73f0fc85d23671f0c49c68f8df8a
42 Source19: ejabberd-jiffy-20160331.tar.gz
43 # Source19-md5: 78f31a7dea7538ef3e63f77351f4d0b7
44 Source20: ejabberd-jose-20170518.tar.gz
45 # Source20-md5: b1675bfc57c1b3b7e154270e2bcd4559
46 Source21: ejabberd-lager-20181014.tar.gz
47 # Source21-md5: ebe0b027d39ade9b99dbc77740b2c7fe
48 Source22: ejabberd-mqtree-20190226.tar.gz
49 # Source22-md5: 1d3c328f1c008e5b62e6657951665cf6
50 Source23: ejabberd-p1_mysql-20180723.tar.gz
51 # Source23-md5: 801894f56f9118a077bb6c4d4f10701d
52 Source24: ejabberd-p1_oauth2-20190226.tar.gz
53 # Source24-md5: 19d4659a50b2b728dc9a1fd40f047758
54 Source25: ejabberd-p1_pgsql-20190226.tar.gz
55 # Source25-md5: 4889ca18dd619168a65c7bfb8ba97977
56 Source26: ejabberd-p1_utils-20190226.tar.gz
57 # Source26-md5: 83a273540bd0e4482c4a4d702ab2d2a9
58 Source27: ejabberd-pkix-20190226.tar.gz
59 # Source27-md5: 23dbf61b04f415a5ae880b1e209cc498
60 Source28: ejabberd-rebar_elixir_plugin-20160105.tar.gz
61 # Source28-md5: 6a069a566d71c3daa45fc4736364adf0
62 Source29: ejabberd-sqlite3-20180130.tar.gz
63 # Source29-md5: cc8950eb769eb6ceb13723a7b61fe507
64 Source30: ejabberd-stringprep-20190226.tar.gz
65 # Source30-md5: cec9cabb413973fc2ea1e904f5be7ee7
66 Source31: ejabberd-xmpp-20190226.tar.gz
67 # Source31-md5: 7bdf3e5c5d3e6acb2837357137cdf27f
69 Patch0: %{name}-paths.patch
70 Patch1: %{name}-config.patch
71 # https://paleg.github.io/mod_logdb/
72 # https://github.com/paleg/ejabberd/tree/18.06-mod_logdb
73 Patch3: %{name}-mod_logdb.patch
74 URL: http://www.ejabberd.im/
75 BuildRequires: autoconf
76 BuildRequires: automake
77 BuildRequires: erlang >= 1:R16B03
78 BuildRequires: expat-devel >= 1.95
79 BuildRequires: openssl-devel
81 BuildRequires: pam-devel
83 BuildRequires: git-core
84 BuildRequires: rpmbuild(macros) >= 1.671
85 BuildRequires: sqlite3-devel
86 BuildRequires: yaml-devel
87 BuildRequires: zlib-devel
88 Requires(post): /usr/bin/perl
89 Requires(post): jabber-common
90 Requires(post): sed >= 4.0
91 Requires(post): textutils
92 Requires(post,preun): /sbin/chkconfig
93 Requires(post,preun,postun): systemd-units >= 38
94 Requires: erlang >= 1:R15B01
95 Requires: expat >= 1.95
97 Requires: systemd-units >= 38
98 Conflicts: logrotate < 3.8.0
99 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
101 %define _noautoprovfiles %{_libdir}/%{name}/priv/lib/
104 ejabberd is a Free and Open Source fault-tolerant distributed Jabber
105 server. It is written mostly in Erlang.
107 %description -l pl.UTF-8
108 ejabberd to darmowy, z otwartymi źródłami, odporny na awarie
109 rozproszony serwer Jabbera. Jest napisany w większości w Erlangu.
112 Summary: Server-side logging module
113 Group: Applications/Communications
114 Requires: %{name} = %{version}-%{release}
117 Server-side logging module.
120 %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
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
135 git config user.email "dummy@example.com"
136 git config user.name "Dummy"
138 git commit -a -m "dummy commit"
142 unset GIT_DIR GIT_WORK_TREE
146 %{?with_pam --enable-pam} \
147 --enable-user=jabber \
148 %{__enable_disable new_sql_schema new-sql-schema} \
154 --enable-sqlite --with-sqlite3 \
155 %{?with_pam:--enable-pam} \
177 LC_ALL=en_US.UTF-8; export LC_ALL
181 rm -rf $RPM_BUILD_ROOT
182 install -d $RPM_BUILD_ROOT{/var/lib/%{name},/etc/{sysconfig,rc.d/init.d}} \
183 $RPM_BUILD_ROOT{%{systemdunitdir},%{_sbindir}} \
184 $RPM_BUILD_ROOT{/etc/logrotate.d,/var/log/archive/%{name}}
186 unset GIT_DIR GIT_WORK_TREE
188 %{__make} install -j1 \
192 DESTDIR=$RPM_BUILD_ROOT
194 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}
195 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
196 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
197 cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
199 chmod u+rw $RPM_BUILD_ROOT%{_sbindir}/%{name}*
201 chmod 755 $RPM_BUILD_ROOT%{_libdir}/*/priv/lib/*.so
203 rm -rf _doc 2>/dev/null || :
204 mv $RPM_BUILD_ROOT%{_docdir}/%{name} _doc
206 touch $RPM_BUILD_ROOT%{_sysconfdir}/jabber/ejabberd.cfg
207 touch $RPM_BUILD_ROOT/var/lib/ejabberd/.erlang.cookie
210 rm -rf $RPM_BUILD_ROOT
213 if [ -e /etc/jabber/ejabberd.cfg ] ; then
214 %banner -e %{name} <<'EOF'
215 Old-style /etc/jabber/ejabberd.cfg configuration file exists. You should
216 consider converting it to the new YAML format. You can do this with the
217 'ejabberdctl convert_to_yaml' command (ejabberd must be already running).
222 if [ -f %{_sysconfdir}/jabber/secret ] ; then
223 SECRET="$(cat %{_sysconfdir}/jabber/secret)"
224 if [ -n "$SECRET" ] ; then
225 echo -n "Updating component authentication secret in ejabberd config file..." >&2
226 %{__sed} -i -e "s/@service_secret@/$SECRET/" /etc/jabber/ejabberd.yml
230 /sbin/chkconfig --add ejabberd
231 if [ -e /var/run/%{name}-upgrade-trigger ] ; then
232 # service will be restarted in the postun trigger
233 rm -f /var/run/%{name}-upgrade-trigger || :
235 %service ejabberd restart "ejabberd server"
236 %systemd_post %{name}.service
240 if [ "$1" = "0" ]; then
241 %service ejabberd stop
242 /sbin/chkconfig --del ejabberd
244 %systemd_preun %{name}.service
249 %triggerprein -- %{name} < 13.10
250 if [ -e /etc/jabber/ejabberd.cfg ] ; then
251 if grep -Eq '^[^%]*access_get' /etc/jabber/ejabberd.cfg ; then
252 echo "Your 'ejabberd.cfg' config file seems to use 'access_get' option of mod_vcard" >&2
253 echo "this is not supported by this ejabberd version in PLD" >&2
256 rm -f /etc/jabber/ejabberd.yml.rpmnew 2>/dev/null || :
258 if [ -e /var/lock/subsys/ejabberd ] ; then
259 # old init script won't stop ejabberd correctly
260 # stop it's all processes here
261 # we assume any 'epmd', 'beam', 'beam.smp' or 'heart' process
262 # running with uid of jabber is ejabberd process
263 pids="$(ps -C "epmd beam beam.smp heart" -o pid=,user= | awk '/jabber/ { print $1 }')" || :
264 if [ -n "$pids" ] ; then
265 %banner -e %{name} <<'EOF'
266 Killing all 'epmd, beam, beam.smp, heart' processed owned by the 'jabber' user to make sure old ejabberd is down.
272 touch /var/run/%{name}-upgrade-trigger || :
274 %triggerpostun -- %{name} < 13.10
275 # convert old 'NODENAME' in /etc/sysconfig/ejabberd
276 # to 'ERLANG_NODE' in /etc/jabber/ejabberdctl.cfg
277 # and move other settings
278 NODENAME="$(hostname)"
279 if [ -e /etc/sysconfig/ejabberd ] ; then
280 . /etc/sysconfig/ejabberd || :
282 subst="s/^#ERLANG_NODE=.*/ERLANG_NODE=ejabberd@${NODENAME}/"
283 if [ "$NODENAME" != "localhost" ] ; then
284 %banner -e %{name} <<'EOF'
285 Configured node name (ejabberd@${NODENAME}) is not at 'localhost'.
286 – setting INET_DIST_INTERFACE=0.0.0.0 in /etc/jabber/ejabberdctl.cfg.
287 You should consider tuning that or your firewall configuration.
290 subst="$subst;s/^#INET_DIST_INTERFACE=.*/INET_DIST_INTERFACE=0.0.0.0/"
292 if [ -n "$ERL_MAX_PORTS" ] ; then
293 subst="$subst;s/^#ERL_MAX_PORTS=.*/ERL_MAX_PORTS=${ERL_MAX_PORTS}/"
295 sed -i -e"$subst" /etc/jabber/ejabberdctl.cfg || :
296 if [ -e /etc/sysconfig/ejabberd ] ; then
298 -e'/^[#[:space:]]*NODENAME=/d;/^# Node name/d' \
299 -e'/^[#[:space:]]*ERL_MAX_PORTS=/d;/^# uncomment this to allow more then 1024 connections/d' \
300 -e'/^[#[:space:]]*ERL_FULLSWEEP_AFTER=/d;/^# uncomment this to limit memory usage/d' \
301 /etc/sysconfig/ejabberd || :
303 cp %{_sysconfdir}/jabber/cookie /var/lib/ejabberd/.erlang.cookie || :
304 chown jabber:jabber /var/lib/ejabberd/.erlang.cookie || :
305 chmod 400 /var/lib/ejabberd/.erlang.cookie || :
306 if [ -e /etc/jabber/ejabberd.cfg -a ! -e /etc/jabber/ejabberd.yml.rpmnew ] ; then
307 mv /etc/jabber/ejabberd.yml /etc/jabber/ejabberd.yml.rpmnew
308 echo 'include_config_file: "/etc/jabber/ejabberd.cfg"' > /etc/jabber/ejabberd.yml || :
311 # post action postponed here
312 %service ejabberd restart "ejabberd server"
313 %systemd_post %{name}.service
315 %systemd_trigger %{name}.service
318 %defattr(644,root,root,755)
320 %attr(755,root,root) %{_sbindir}/*
321 %attr(755,root,root) %{_bindir}/elixir
322 %attr(755,root,root) %{_bindir}/iex
323 %attr(755,root,root) %{_bindir}/mix
324 %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberd-inetrc
325 %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberd.yml
326 %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberdctl.cfg
327 # legacy config may still be there
328 %attr(640,root,jabber) %ghost %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberd.cfg
329 %attr(770,root,jabber) /var/log/%{name}
330 %attr(770,root,jabber) /var/log/archive/%{name}
332 %exclude %{_libdir}/ejabberd-%{version}/ebin/mod_logdb*
334 %{_libdir}/ejabberd-%{version}
335 %{_libdir}/base64url-*
336 %{_libdir}/cache_tab-*
337 %dir %{_libdir}/eimp-*
338 %dir %{_libdir}/eimp-*/priv
339 %dir %{_libdir}/eimp-*/priv/bin
340 %attr(755,root,root) %{_libdir}/eimp-*/priv/bin/eimp
341 %{_libdir}/eimp-*/ebin
342 %{_libdir}/eimp-*/LICENSE.txt
345 %{_libdir}/fast_tls-*
346 %{_libdir}/fast_xml-*
347 %{_libdir}/fast_yaml-*
348 %{_libdir}/goldrush-*
352 %dir %{_libdir}/mqtree-*
353 %{_libdir}/mqtree-*/ebin
354 %dir %{_libdir}/mqtree-*/priv
355 %dir %{_libdir}/mqtree-*/priv/lib
356 %attr(755,root,root) %{_libdir}/mqtree-*/priv/lib/mqtree.so
357 %{_libdir}/p1_mysql-*
358 %{_libdir}/p1_oauth2-*
359 %{_libdir}/p1_pgsql-*
360 %{_libdir}/p1_utils-*
361 %dir %{_libdir}/pkix-*
362 %{_libdir}/pkix-*/ebin
363 %{_libdir}/pkix-*/LICENSE
364 %{_libdir}/rebar_elixir_plugin-*
365 %{_libdir}/sqlite3-*/ebin
366 %dir %{_libdir}/sqlite3-*
367 %dir %{_libdir}/sqlite3-*/priv
368 %attr(755,root,root) %{_libdir}/sqlite3-*/priv/sqlite3_drv.so
369 %{_libdir}/stringprep-*
371 %dir %attr(770,root,jabber) /var/lib/ejabberd
372 %ghost %attr(400,jabber,jabber) %ghost %config(noreplace) %verify(not md5 mtime size) /var/lib/ejabberd/.erlang.cookie
373 %attr(754,root,root) /etc/rc.d/init.d/%{name}
374 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
375 %{systemdunitdir}/%{name}.service
376 /etc/logrotate.d/%{name}
380 %defattr(644,root,root,755)
381 %{_libdir}/ejabberd-%{version}/ebin/mod_logdb*