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: f9a49230810c94328a0dc01c63a24b22
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: 6173689227956f8a60951a8791facf31
26 Source11: ejabberd-cache_tab-20180924.tar.gz
27 # Source11-md5: 69965f1816be4f708e259f24a973e502
28 Source12: ejabberd-eimp-20180924.tar.gz
29 # Source12-md5: c920c320c8512bdbb31a2e834b02ca7d
30 Source13: ejabberd-elixir-20170515.tar.gz
31 # Source13-md5: 4a637973eab83b07e8cc4b24564c0f5c
32 Source14: ejabberd-ezlib-20180322.tar.gz
33 # Source14-md5: e36b09a55a7d972694fcd24882da05c7
34 Source15: ejabberd-fast_tls-20180924.tar.gz
35 # Source15-md5: d369c70c9ae7e89680d1c909a46e2087
36 Source16: ejabberd-fast_xml-20180924.tar.gz
37 # Source16-md5: 65c980e9a77f00b8a1a0357f51a3ed38
38 Source17: ejabberd-fast_yaml-20180924.tar.gz
39 # Source17-md5: 0d419e5b6694ed6410e6258a2f4c9b47
40 Source18: ejabberd-goldrush-20160531.tar.gz
41 # Source18-md5: 06ec6d9ff4686590716b8b017504a16f
42 Source19: ejabberd-iconv-20180924.tar.gz
43 # Source19-md5: 8b19bcd50a7158b21d8527fe7a757590
44 Source20: ejabberd-jiffy-20160331.tar.gz
45 # Source20-md5: 5870143655d179e584c66048939d1e90
46 Source21: ejabberd-jose-20170518.tar.gz
47 # Source21-md5: 5fcabb971cb0aed4cfdd8ffb29da8b2b
48 Source22: ejabberd-lager-20180903.tar.gz
49 # Source22-md5: 2002e520d7b3de16658d0f350e7ebb89
50 Source23: ejabberd-p1_mysql-20180723.tar.gz
51 # Source23-md5: 2cb927e43c1ce1c2009a69da0aebeff4
52 Source24: ejabberd-p1_oauth2-20180425.tar.gz
53 # Source24-md5: 16883be155a73786d504a1ed9dcb4d40
54 Source25: ejabberd-p1_pgsql-20180628.tar.gz
55 # Source25-md5: 9b41c1653f583812a5d22890ac364baa
56 Source26: ejabberd-p1_utils-20180924.tar.gz
57 # Source26-md5: 5f94c266a3fe2ededfaedfbd612d80bf
58 Source27: ejabberd-rebar_elixir_plugin-20160105.tar.gz
59 # Source27-md5: 080553b9e073ca3f3622432ea03ad1c3
60 Source28: ejabberd-stringprep-20180924.tar.gz
61 # Source28-md5: c12bd4c434e423ef93b87f6b26bd635c
62 Source29: ejabberd-xmpp-20180925.tar.gz
63 # Source29-md5: dd9a94fab67c516bffbcd0845819b8d4
65 Patch0: %{name}-paths.patch
66 Patch1: %{name}-config.patch
67 # https://paleg.github.io/mod_logdb/
68 # https://github.com/paleg/ejabberd/tree/18.06-mod_logdb
69 Patch3: %{name}-mod_logdb.patch
70 URL: http://www.ejabberd.im/
71 BuildRequires: autoconf
72 BuildRequires: automake
73 BuildRequires: erlang >= 1:R16B03
74 BuildRequires: expat-devel >= 1.95
75 BuildRequires: openssl-devel
77 BuildRequires: pam-devel
79 BuildRequires: git-core
80 BuildRequires: rpmbuild(macros) >= 1.671
81 BuildRequires: yaml-devel
82 BuildRequires: zlib-devel
83 Requires(post): /usr/bin/perl
84 Requires(post): jabber-common
85 Requires(post): sed >= 4.0
86 Requires(post): textutils
87 Requires(post,preun): /sbin/chkconfig
88 Requires(post,preun,postun): systemd-units >= 38
89 Requires: erlang >= 1:R15B01
90 Requires: expat >= 1.95
92 Requires: systemd-units >= 38
93 Conflicts: logrotate < 3.8.0
94 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
96 %define _noautoprovfiles %{_libdir}/%{name}/priv/lib/
99 ejabberd is a Free and Open Source fault-tolerant distributed Jabber
100 server. It is written mostly in Erlang.
102 %description -l pl.UTF-8
103 ejabberd to darmowy, z otwartymi źródłami, odporny na awarie
104 rozproszony serwer Jabbera. Jest napisany w większości w Erlangu.
107 Summary: Server-side logging module
108 Group: Applications/Communications
109 Requires: %{name} = %{version}-%{release}
112 Server-side logging module.
115 %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
123 # Various parts of the build system use 'git describe'
124 # which returns nonsense on manual builds using the builder script
125 # and which fails on the PLD builders
126 # I was not able to locate all 'git describe' invocation, sot let's
127 # fool them with this dummy repository
128 unset GIT_DIR GIT_WORK_TREE
130 git config user.email "dummy@example.com"
131 git config user.name "Dummy"
133 git commit -a -m "dummy commit"
137 unset GIT_DIR GIT_WORK_TREE
141 %{?with_pam --enable-pam} \
142 --enable-user=jabber \
143 %{__enable_disable new_sql_schema new-sql-schema} \
149 %{?with_pam:--enable-pam} \
175 LC_ALL=en_US.UTF-8; export LC_ALL
179 rm -rf $RPM_BUILD_ROOT
180 install -d $RPM_BUILD_ROOT{/var/lib/%{name},/etc/{sysconfig,rc.d/init.d}} \
181 $RPM_BUILD_ROOT{%{systemdunitdir},%{_sbindir}} \
182 $RPM_BUILD_ROOT{/etc/logrotate.d,/var/log/archive/%{name}}
184 unset GIT_DIR GIT_WORK_TREE
186 %{__make} install -j1 \
190 DESTDIR=$RPM_BUILD_ROOT
192 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}
193 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
194 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
195 cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
197 chmod u+rw $RPM_BUILD_ROOT%{_sbindir}/%{name}*
199 chmod 755 $RPM_BUILD_ROOT%{_libdir}/*/priv/lib/*.so
201 rm -rf _doc 2>/dev/null || :
202 mv $RPM_BUILD_ROOT%{_docdir}/%{name} _doc
204 touch $RPM_BUILD_ROOT%{_sysconfdir}/jabber/ejabberd.cfg
205 touch $RPM_BUILD_ROOT/var/lib/ejabberd/.erlang.cookie
208 rm -rf $RPM_BUILD_ROOT
211 if [ -e /etc/jabber/ejabberd.cfg ] ; then
212 %banner -e %{name} <<'EOF'
213 Old-style /etc/jabber/ejabberd.cfg configuration file exists. You should
214 consider converting it to the new YAML format. You can do this with the
215 'ejabberdctl convert_to_yaml' command (ejabberd must be already running).
220 if [ -f %{_sysconfdir}/jabber/secret ] ; then
221 SECRET="$(cat %{_sysconfdir}/jabber/secret)"
222 if [ -n "$SECRET" ] ; then
223 echo -n "Updating component authentication secret in ejabberd config file..." >&2
224 %{__sed} -i -e "s/@service_secret@/$SECRET/" /etc/jabber/ejabberd.yml
228 /sbin/chkconfig --add ejabberd
229 if [ -e /var/run/%{name}-upgrade-trigger ] ; then
230 # service will be restarted in the postun trigger
231 rm -f /var/run/%{name}-upgrade-trigger || :
233 %service ejabberd restart "ejabberd server"
234 %systemd_post %{name}.service
238 if [ "$1" = "0" ]; then
239 %service ejabberd stop
240 /sbin/chkconfig --del ejabberd
242 %systemd_preun %{name}.service
247 %triggerprein -- %{name} < 13.10
248 if [ -e /etc/jabber/ejabberd.cfg ] ; then
249 if grep -Eq '^[^%]*access_get' /etc/jabber/ejabberd.cfg ; then
250 echo "Your 'ejabberd.cfg' config file seems to use 'access_get' option of mod_vcard" >&2
251 echo "this is not supported by this ejabberd version in PLD" >&2
254 rm -f /etc/jabber/ejabberd.yml.rpmnew 2>/dev/null || :
256 if [ -e /var/lock/subsys/ejabberd ] ; then
257 # old init script won't stop ejabberd correctly
258 # stop it's all processes here
259 # we assume any 'epmd', 'beam', 'beam.smp' or 'heart' process
260 # running with uid of jabber is ejabberd process
261 pids="$(ps -C "epmd beam beam.smp heart" -o pid=,user= | awk '/jabber/ { print $1 }')" || :
262 if [ -n "$pids" ] ; then
263 %banner -e %{name} <<'EOF'
264 Killing all 'epmd, beam, beam.smp, heart' processed owned by the 'jabber' user to make sure old ejabberd is down.
270 touch /var/run/%{name}-upgrade-trigger || :
272 %triggerpostun -- %{name} < 13.10
273 # convert old 'NODENAME' in /etc/sysconfig/ejabberd
274 # to 'ERLANG_NODE' in /etc/jabber/ejabberdctl.cfg
275 # and move other settings
276 NODENAME="$(hostname)"
277 if [ -e /etc/sysconfig/ejabberd ] ; then
278 . /etc/sysconfig/ejabberd || :
280 subst="s/^#ERLANG_NODE=.*/ERLANG_NODE=ejabberd@${NODENAME}/"
281 if [ "$NODENAME" != "localhost" ] ; then
282 %banner -e %{name} <<'EOF'
283 Configured node name (ejabberd@${NODENAME}) is not at 'localhost'.
284 – setting INET_DIST_INTERFACE=0.0.0.0 in /etc/jabber/ejabberdctl.cfg.
285 You should consider tuning that or your firewall configuration.
288 subst="$subst;s/^#INET_DIST_INTERFACE=.*/INET_DIST_INTERFACE=0.0.0.0/"
290 if [ -n "$ERL_MAX_PORTS" ] ; then
291 subst="$subst;s/^#ERL_MAX_PORTS=.*/ERL_MAX_PORTS=${ERL_MAX_PORTS}/"
293 sed -i -e"$subst" /etc/jabber/ejabberdctl.cfg || :
294 if [ -e /etc/sysconfig/ejabberd ] ; then
296 -e'/^[#[:space:]]*NODENAME=/d;/^# Node name/d' \
297 -e'/^[#[:space:]]*ERL_MAX_PORTS=/d;/^# uncomment this to allow more then 1024 connections/d' \
298 -e'/^[#[:space:]]*ERL_FULLSWEEP_AFTER=/d;/^# uncomment this to limit memory usage/d' \
299 /etc/sysconfig/ejabberd || :
301 cp %{_sysconfdir}/jabber/cookie /var/lib/ejabberd/.erlang.cookie || :
302 chown jabber:jabber /var/lib/ejabberd/.erlang.cookie || :
303 chmod 400 /var/lib/ejabberd/.erlang.cookie || :
304 if [ -e /etc/jabber/ejabberd.cfg -a ! -e /etc/jabber/ejabberd.yml.rpmnew ] ; then
305 mv /etc/jabber/ejabberd.yml /etc/jabber/ejabberd.yml.rpmnew
306 echo 'include_config_file: "/etc/jabber/ejabberd.cfg"' > /etc/jabber/ejabberd.yml || :
309 # post action postponed here
310 %service ejabberd restart "ejabberd server"
311 %systemd_post %{name}.service
313 %systemd_trigger %{name}.service
316 %defattr(644,root,root,755)
318 %attr(755,root,root) %{_sbindir}/*
319 %attr(755,root,root) %{_bindir}/elixir
320 %attr(755,root,root) %{_bindir}/iex
321 %attr(755,root,root) %{_bindir}/mix
322 %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberd-inetrc
323 %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberd.yml
324 %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberdctl.cfg
325 # legacy config may still be there
326 %attr(640,root,jabber) %ghost %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberd.cfg
327 %attr(770,root,jabber) /var/log/%{name}
328 %attr(770,root,jabber) /var/log/archive/%{name}
330 %exclude %{_libdir}/ejabberd-%{version}/ebin/mod_logdb*
332 %{_libdir}/ejabberd-%{version}
333 %{_libdir}/base64url-*
334 %{_libdir}/cache_tab-*
335 %dir %{_libdir}/eimp-*
336 %dir %{_libdir}/eimp-*/priv
337 %dir %{_libdir}/eimp-*/priv/bin
338 %attr(755,root,root) %{_libdir}/eimp-*/priv/bin/eimp
339 %{_libdir}/eimp-*/ebin
340 %{_libdir}/eimp-*/LICENSE.txt
343 %{_libdir}/fast_tls-*
344 %{_libdir}/fast_xml-*
345 %{_libdir}/fast_yaml-*
346 %{_libdir}/goldrush-*
351 %{_libdir}/p1_mysql-*
352 %{_libdir}/p1_oauth2-*
353 %{_libdir}/p1_pgsql-*
354 %{_libdir}/p1_utils-*
355 %{_libdir}/rebar_elixir_plugin-*
356 %{_libdir}/stringprep-*
358 %dir %attr(770,root,jabber) /var/lib/ejabberd
359 %ghost %attr(400,jabber,jabber) %ghost %config(noreplace) %verify(not md5 mtime size) /var/lib/ejabberd/.erlang.cookie
360 %attr(754,root,root) /etc/rc.d/init.d/%{name}
361 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
362 %{systemdunitdir}/%{name}.service
363 /etc/logrotate.d/%{name}
367 %defattr(644,root,root,755)
368 %{_libdir}/ejabberd-%{version}/ebin/mod_logdb*