]> git.pld-linux.org Git - packages/ejabberd.git/blame - ejabberd.spec
Up to 22.05.
[packages/ejabberd.git] / ejabberd.spec
CommitLineData
beed1a42
AM
1# TODO:
2# - package all deps (tarballs 10-29) into separate spec files
3# (like in fedora)
e9f604ed 4# Conditional build:
5%bcond_with pam # PAM authentication support
79e489a1 6%bcond_with logdb # enable mod_logdb (server-side message logging)
e0a49cef 7%bcond_with new_sql_schema # build with the new SQL schema
eddf5b64 8
fb70a56e 9Summary: Fault-tolerant distributed Jabber/XMPP server
7abad569 10Summary(pl.UTF-8): Odporny na awarie rozproszony serwer Jabbera/XMPP
d798517a 11Name: ejabberd
db5a5860 12Version: 22.05
3133cbf5 13Release: 1
fb70a56e
JK
14License: GPL
15Group: Applications/Communications
db5a5860
AM
16# Source0: https://www.process-one.net/downloads/downloads-action.php?file=/%{version}/%{name}-%{version}.tar.gz
17Source0: https://github.com/processone/ejabberd/archive/refs/tags/%{version}.tar.gz
18# Source0-md5: 4ebfd038cda9cb5ab34c95b49cff1bc8
d798517a
JK
19Source1: %{name}.init
20Source2: %{name}.sysconfig
21Source3: %{name}.service
f20002e6 22Source4: %{name}.logrotate
59e0d76f 23
db5a5860 24Source10: ejabberd-base64url-20190617.tar.gz
59e0d76f 25# Source10-md5: 5a12fd2fb1f992c850aba5115aab3dd4
db5a5860
AM
26Source11: ejabberd-cache_tab-20220502.tar.gz
27# Source11-md5: 822bec23631e956ce927ecc5ae31e24d
28Source12: ejabberd-eimp-20220502.tar.gz
29# Source12-md5: 39b7de8ad391da8fb12ff9b76301ced5
30Source13: ejabberd-elixir-20170515.tar.gz
59e0d76f 31# Source13-md5: 73be42f7d0cda7aeee5c0e6dadc0c451
db5a5860
AM
32Source14: ejabberd-ezlib-20220502.tar.gz
33# Source14-md5: 32dadbeff189a0fa18c21aa42258fa1a
34Source15: ejabberd-fast_tls-20220502.tar.gz
35# Source15-md5: 1f341267a7d0bd953e961ccbe098e438
36Source16: ejabberd-fast_xml-20220502.tar.gz
37# Source16-md5: 1288d6e5ea055784634367a0991adc3b
38Source17: ejabberd-fast_yaml-20220502.tar.gz
39# Source17-md5: 1a513d2a074fc67678eecfbfc36c58b2
40Source18: ejabberd-idna-20180830.tar.gz
41# Source18-md5: e34174d5c5e2e91611d3249c690f6d2d
42Source19: ejabberd-jiffy-20220223.tar.gz
43# Source19-md5: b98489245dadf5a36ac3408be21d835a
44Source20: ejabberd-jose-20201223.tar.gz
45# Source20-md5: 6e5c9910dc1e1894e31882d49f78967d
46Source21: ejabberd-mqtree-20220502.tar.gz
47# Source21-md5: 1f1b175534eb917780e89e4c7d49c710
48Source22: ejabberd-p1_acme-20220502.tar.gz
49# Source22-md5: ada7344c8192e1999a73110ead29a704
50Source23: ejabberd-p1_mysql-20210721.tar.gz
51# Source23-md5: 346f98e9eb7e098d91aef99af47ad3e3
52Source24: ejabberd-p1_oauth2-20220502.tar.gz
53# Source24-md5: bade7f8e1d18c9f6149b70268c73087b
54Source25: ejabberd-p1_pgsql-20220502.tar.gz
55# Source25-md5: 052db14b243601591477abde6be1c74e
56Source26: ejabberd-p1_utils-20220502.tar.gz
57# Source26-md5: 0eab972a4a247519e5a898d8da6054c1
58Source27: ejabberd-pkix-20220502.tar.gz
59# Source27-md5: 88fd008dca6cf2208678fbf50b47a21a
60Source28: ejabberd-rebar_elixir_plugin-20160105.tar.gz
61# Source28-md5: 6a069a566d71c3daa45fc4736364adf0
62Source29: ejabberd-sqlite3-20210721.tar.gz
63# Source29-md5: a81afbe7543f58fbb2cef732d73b3d3c
64Source30: ejabberd-stringprep-20220502.tar.gz
65# Source30-md5: 721468fde880de8821c916c2534c9525
66Source31: ejabberd-stun-20220502.tar.gz
67# Source31-md5: 27a002c7a5b3a6af6deb2a1eff281cfd
68Source32: ejabberd-unicode_util_compat-20170729.tar.gz
69# Source32-md5: 1b348fdf38dba88ebed2f65125ad8590
70Source33: ejabberd-xmpp-20220502.tar.gz
71# Source33-md5: 02378d906436ed5d5ece87419ff007ce
72Source34: ejabberd-yconf-20220502.tar.gz
73# Source34-md5: 878e4993a860cc6384313e301b63a09b
ac7e9a78 74
d798517a
JK
75Patch0: %{name}-paths.patch
76Patch1: %{name}-config.patch
db5a5860 77Patch2: ejabberd-bug-3819.patch
3f23be8e 78# https://paleg.github.io/mod_logdb/
dd02533f 79# https://github.com/paleg/ejabberd/compare/paleg:19.08...paleg:19.08-mod_logdb.patch
d798517a 80Patch3: %{name}-mod_logdb.patch
3f2196e7 81URL: http://www.ejabberd.im/
fb70a56e 82BuildRequires: autoconf
1a2644b6 83BuildRequires: automake
de2dcb11 84BuildRequires: erlang >= 2:22.2
6f0d08c1 85BuildRequires: expat-devel >= 1.95
86BuildRequires: openssl-devel
e9f604ed 87%if %{with pam}
88BuildRequires: pam-devel
89%endif
126fba49 90BuildRequires: git-core
67271627 91BuildRequires: rpmbuild(macros) >= 1.671
f0222aaa 92BuildRequires: sqlite3-devel
60c3a68c 93BuildRequires: yaml-devel
01f61704 94BuildRequires: zlib-devel
27b10c8b 95Requires(post): /usr/bin/perl
b15a901d 96Requires(post): jabber-common
0d54398f 97Requires(post): sed >= 4.0
fb70a56e 98Requires(post): textutils
fb70a56e 99Requires(post,preun): /sbin/chkconfig
67271627 100Requires(post,preun,postun): systemd-units >= 38
de2dcb11 101Requires: erlang >= 2:22.2
bb159536 102Requires: expat >= 1.95
27b10c8b 103Requires: rc-scripts
67271627 104Requires: systemd-units >= 38
028763ab 105Conflicts: logrotate < 3.8.0
fb70a56e
JK
106BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
107
fcf4c7a2
JK
108%define _noautoprovfiles %{_libdir}/%{name}/priv/lib/
109
fb70a56e 110%description
472227c5 111ejabberd is a Free and Open Source fault-tolerant distributed Jabber
112server. It is written mostly in Erlang.
fb70a56e 113
e0166ea5
JR
114%description -l pl.UTF-8
115ejabberd to darmowy, z otwartymi źródłami, odporny na awarie
116rozproszony serwer Jabbera. Jest napisany w większości w Erlangu.
378431cb 117
cba58599 118%package logdb
1a2644b6 119Summary: Server-side logging module
cba58599 120Group: Applications/Communications
121Requires: %{name} = %{version}-%{release}
122
123%description logdb
124Server-side logging module.
125
fb70a56e 126%prep
db5a5860
AM
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
128%patch2 -p1
fb70a56e 129%patch0 -p1
7f71a53c 130%patch1 -p1
9953f9cb 131%if %{with logdb}
046546ef 132%patch3 -p1
9953f9cb 133%endif
fb70a56e 134
8e141538
JK
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
140unset GIT_DIR GIT_WORK_TREE
141git init
d798661f
JK
142git config user.email "dummy@example.com"
143git config user.name "Dummy"
8e141538
JK
144git add configure.ac
145git commit -a -m "dummy commit"
146git tag "%{version}"
fb8f9840 147
de2dcb11
AM
148sed -i -e 's,#!.*/usr/bin/env.*elixir,#!/usr/bin/elixir,' deps/elixir/bin/mix deps/elixir/lib/mix/lib/mix/tasks/escript.build.ex
149
fb70a56e 150%build
8e141538 151unset GIT_DIR GIT_WORK_TREE
e2bda3a7 152%{__aclocal} -I m4
fb70a56e 153%{__autoconf}
6b419144 154%configure \
5613d9b6 155 %{?with_pam --enable-pam} \
e4f8c955 156 --enable-user=jabber \
e0a49cef 157 %{__enable_disable new_sql_schema new-sql-schema} \
8311848d 158 --enable-elixir \
e2bda3a7 159 --enable-full-xml \
e2bda3a7
JK
160 --enable-odbc \
161 --enable-mysql \
162 --enable-pgsql \
f0222aaa 163 --enable-sqlite --with-sqlite3 \
e2bda3a7 164 %{?with_pam:--enable-pam} \
9682d4d5 165 --enable-zlib
5e08a6fd 166
e2bda3a7
JK
167touch deps/.got
168
beed1a42 169cd deps/stringprep
e2bda3a7
JK
170%configure
171cd ../..
beed1a42 172cd deps/fast_tls
e2bda3a7
JK
173%configure
174cd ../..
beed1a42
AM
175cd deps/fast_xml
176%configure
e2bda3a7 177cd ../..
beed1a42 178cd deps/fast_yaml
e2bda3a7
JK
179%configure
180cd ../..
beed1a42 181cd deps/ezlib
e2bda3a7
JK
182%configure
183cd ../..
184
beed1a42
AM
185# for elixir VM
186LC_ALL=en_US.UTF-8; export LC_ALL
92a38251 187%{__make} -j1
fb70a56e
JK
188
189%install
190rm -rf $RPM_BUILD_ROOT
d798517a 191install -d $RPM_BUILD_ROOT{/var/lib/%{name},/etc/{sysconfig,rc.d/init.d}} \
f20002e6 192 $RPM_BUILD_ROOT{%{systemdunitdir},%{_sbindir}} \
028763ab 193 $RPM_BUILD_ROOT{/etc/logrotate.d,/var/log/archive/%{name}}
fb70a56e 194
8e141538
JK
195unset GIT_DIR GIT_WORK_TREE
196
e2bda3a7 197%{__make} install -j1 \
e4f8c955
JK
198 CHOWN_COMMAND=true \
199 O_USER="" \
200 G_USER="" \
27b10c8b 201 DESTDIR=$RPM_BUILD_ROOT
fb70a56e 202
d798517a 203sed -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}
126fba49
AM
204cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
205cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
206cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
fb70a56e 207
d798517a 208chmod u+rw $RPM_BUILD_ROOT%{_sbindir}/%{name}*
fb70a56e 209
beed1a42 210chmod 755 $RPM_BUILD_ROOT%{_libdir}/*/priv/lib/*.so
5613d9b6 211
e2bda3a7
JK
212rm -rf _doc 2>/dev/null || :
213mv $RPM_BUILD_ROOT%{_docdir}/%{name} _doc
059c0bab 214
fcf4c7a2
JK
215touch $RPM_BUILD_ROOT%{_sysconfdir}/jabber/ejabberd.cfg
216touch $RPM_BUILD_ROOT/var/lib/ejabberd/.erlang.cookie
217
fb70a56e
JK
218%clean
219rm -rf $RPM_BUILD_ROOT
220
e2bda3a7
JK
221%pre
222if [ -e /etc/jabber/ejabberd.cfg ] ; then
fcf4c7a2
JK
223 %banner -e %{name} <<'EOF'
224Old-style /etc/jabber/ejabberd.cfg configuration file exists. You should
225consider converting it to the new YAML format. You can do this with the
27161f77 226'ejabberdctl convert_to_yaml' command (ejabberd must be already running).
fcf4c7a2 227EOF
e2bda3a7
JK
228fi
229
fb70a56e 230%post
0d54398f 231if [ -f %{_sysconfdir}/jabber/secret ] ; then
7f71a53c 232 SECRET="$(cat %{_sysconfdir}/jabber/secret)"
fb70a56e 233 if [ -n "$SECRET" ] ; then
7f71a53c
JK
234 echo -n "Updating component authentication secret in ejabberd config file..." >&2
235 %{__sed} -i -e "s/@service_secret@/$SECRET/" /etc/jabber/ejabberd.yml
236 echo "done" >&2
fb70a56e
JK
237 fi
238fi
fb70a56e 239/sbin/chkconfig --add ejabberd
7102eb90
JK
240if [ -e /var/run/%{name}-upgrade-trigger ] ; then
241 # service will be restarted in the postun trigger
242 rm -f /var/run/%{name}-upgrade-trigger || :
243else
244 %service ejabberd restart "ejabberd server"
245 %systemd_post %{name}.service
246fi
67271627 247
fb70a56e
JK
248%preun
249if [ "$1" = "0" ]; then
b15a901d 250 %service ejabberd stop
fb70a56e
JK
251 /sbin/chkconfig --del ejabberd
252fi
67271627
JK
253%systemd_preun %{name}.service
254
255%postun
256%systemd_reload
257
258%triggerprein -- %{name} < 13.10
3133cbf5
AM
259if [ -e %{_sysconfdir}/jabber/ejabberd.cfg ] ; then
260if grep -Eq '^[^%]*access_get' %{_sysconfdir}/jabber/ejabberd.cfg ; then
7102eb90
JK
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
263 exit 1
264 fi
3133cbf5 265rm -f %{_sysconfdir}/jabber/ejabberd.yml.rpmnew 2>/dev/null || :
7102eb90
JK
266fi
267if [ -e /var/lock/subsys/ejabberd ] ; then
67271627
JK
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'
275Killing all 'epmd, beam, beam.smp, heart' processed owned by the 'jabber' user to make sure old ejabberd is down.
7102eb90 276
67271627
JK
277EOF
278 kill $pids || :
279 fi
280fi
7102eb90 281touch /var/run/%{name}-upgrade-trigger || :
fb70a56e 282
fcf4c7a2
JK
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
287NODENAME="$(hostname)"
288if [ -e /etc/sysconfig/ejabberd ] ; then
289 . /etc/sysconfig/ejabberd || :
290fi
291subst="s/^#ERLANG_NODE=.*/ERLANG_NODE=ejabberd@${NODENAME}/"
7102eb90
JK
292if [ "$NODENAME" != "localhost" ] ; then
293 %banner -e %{name} <<'EOF'
294Configured node name (ejabberd@${NODENAME}) is not at 'localhost'.
295– setting INET_DIST_INTERFACE=0.0.0.0 in /etc/jabber/ejabberdctl.cfg.
296You should consider tuning that or your firewall configuration.
297
298EOF
299 subst="$subst;s/^#INET_DIST_INTERFACE=.*/INET_DIST_INTERFACE=0.0.0.0/"
300fi
fcf4c7a2
JK
301if [ -n "$ERL_MAX_PORTS" ] ; then
302 subst="$subst;s/^#ERL_MAX_PORTS=.*/ERL_MAX_PORTS=${ERL_MAX_PORTS}/"
303fi
304sed -i -e"$subst" /etc/jabber/ejabberdctl.cfg || :
305if [ -e /etc/sysconfig/ejabberd ] ; then
306 sed -i.rpmsave \
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 || :
311fi
312cp %{_sysconfdir}/jabber/cookie /var/lib/ejabberd/.erlang.cookie || :
7102eb90
JK
313chown jabber:jabber /var/lib/ejabberd/.erlang.cookie || :
314chmod 400 /var/lib/ejabberd/.erlang.cookie || :
315if [ -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 || :
318fi
319
320# post action postponed here
321%service ejabberd restart "ejabberd server"
322%systemd_post %{name}.service
323
67271627 324%systemd_trigger %{name}.service
fcf4c7a2 325
fb70a56e
JK
326%files
327%defattr(644,root,root,755)
e2bda3a7 328%doc sql _doc/*
fb70a56e 329%attr(755,root,root) %{_sbindir}/*
4852a36b
AM
330%attr(755,root,root) %{_bindir}/elixir
331%attr(755,root,root) %{_bindir}/iex
332%attr(755,root,root) %{_bindir}/mix
fcf4c7a2
JK
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
028763ab
JK
338%attr(770,root,jabber) /var/log/%{name}
339%attr(770,root,jabber) /var/log/archive/%{name}
61f3ef21 340%if %{with logdb}
beed1a42 341%exclude %{_libdir}/ejabberd-%{version}/ebin/mod_logdb*
61f3ef21 342%endif
beed1a42 343%{_libdir}/ejabberd-%{version}
ac7e9a78 344%{_libdir}/base64url-*
beed1a42 345%{_libdir}/cache_tab-*
105db1e0
JK
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
beed1a42 352%{_libdir}/elixir-*
beed1a42
AM
353%{_libdir}/ezlib-*
354%{_libdir}/fast_tls-*
355%{_libdir}/fast_xml-*
356%{_libdir}/fast_yaml-*
89e7e566 357%{_libdir}/idna-*
beed1a42 358%{_libdir}/jiffy-*
ac7e9a78 359%{_libdir}/jose-*
9682d4d5
AM
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
89e7e566 365%{_libdir}/p1_acme-*
beed1a42
AM
366%{_libdir}/p1_mysql-*
367%{_libdir}/p1_oauth2-*
368%{_libdir}/p1_pgsql-*
369%{_libdir}/p1_utils-*
418fc4bb 370%dir %{_libdir}/pkix-*
f55bab44
AM
371%{_libdir}/pkix-*/ebin
372%{_libdir}/pkix-*/LICENSE
beed1a42 373%{_libdir}/rebar_elixir_plugin-*
f0222aaa
AM
374%{_libdir}/sqlite3-*/ebin
375%dir %{_libdir}/sqlite3-*
376%dir %{_libdir}/sqlite3-*/priv
377%attr(755,root,root) %{_libdir}/sqlite3-*/priv/sqlite3_drv.so
beed1a42 378%{_libdir}/stringprep-*
79e489a1 379%{_libdir}/stun-*
89e7e566 380%{_libdir}/unicode_util_compat-*
4852a36b 381%{_libdir}/xmpp-*
08278fc0 382%{_libdir}/yconf-*
fb70a56e 383%dir %attr(770,root,jabber) /var/lib/ejabberd
fcf4c7a2 384%ghost %attr(400,jabber,jabber) %ghost %config(noreplace) %verify(not md5 mtime size) /var/lib/ejabberd/.erlang.cookie
d798517a
JK
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}
67271627 387%{systemdunitdir}/%{name}.service
f20002e6 388/etc/logrotate.d/%{name}
cc994b3c 389%{_mandir}/man5/ejabberd.yml.5*
cba58599 390
61f3ef21 391%if %{with logdb}
cba58599 392%files logdb
393%defattr(644,root,root,755)
beed1a42 394%{_libdir}/ejabberd-%{version}/ebin/mod_logdb*
61f3ef21 395%endif
This page took 0.150929 seconds and 4 git commands to generate.