]> git.pld-linux.org Git - packages/ejabberd.git/blame - ejabberd.spec
Up to 23.10
[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
96ef12ae 12Version: 23.10
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
96ef12ae 18# Source0-md5: c91ae2f93c4c4cd7b00e9cb30ac6044d
d798517a
JK
19Source1: %{name}.init
20Source2: %{name}.sysconfig
21Source3: %{name}.service
f20002e6 22Source4: %{name}.logrotate
59e0d76f 23
849acdac
AM
24# Archives created with the ejabberd-pack_deps.sh script (in this repo)
25Source10: ejabberd-base64url-20190617.tar.gz
26# Source10-md5: 5a12fd2fb1f992c850aba5115aab3dd4
27Source11: ejabberd-cache_tab-20220502.tar.gz
28# Source11-md5: 822bec23631e956ce927ecc5ae31e24d
29Source12: ejabberd-eimp-20220502.tar.gz
30# Source12-md5: 39b7de8ad391da8fb12ff9b76301ced5
31Source13: ejabberd-elixir-20170515.tar.gz
32# Source13-md5: 73be42f7d0cda7aeee5c0e6dadc0c451
33Source14: ejabberd-ezlib-20220502.tar.gz
34# Source14-md5: 32dadbeff189a0fa18c21aa42258fa1a
35Source15: ejabberd-fast_tls-20221012.tar.gz
36# Source15-md5: 440590e5d8e16009d4ff9b38c25cea01
37Source16: ejabberd-fast_xml-20220502.tar.gz
38# Source16-md5: 1288d6e5ea055784634367a0991adc3b
27238f13
AM
39Source17: ejabberd-fast_yaml-20230117.tar.gz
40# Source17-md5: 13633fe81d32198c216f5e516f3ef9ee
849acdac
AM
41Source18: ejabberd-idna-20180830.tar.gz
42# Source18-md5: e34174d5c5e2e91611d3249c690f6d2d
43Source19: ejabberd-jiffy-20220223.tar.gz
44# Source19-md5: b98489245dadf5a36ac3408be21d835a
27238f13
AM
45Source20: ejabberd-jose-20221216.tar.gz
46# Source20-md5: 1240b886ef9d9102e8df1193f2ebcd4e
849acdac
AM
47Source21: ejabberd-mqtree-20220502.tar.gz
48# Source21-md5: 1f1b175534eb917780e89e4c7d49c710
27238f13
AM
49Source22: ejabberd-p1_acme-20230117.tar.gz
50# Source22-md5: 0a0170413d2cf6cf3c083835f18bd380
96ef12ae
AM
51Source23: ejabberd-p1_mysql-20231016.tar.gz
52# Source23-md5: 304d139651cc2f14769fc2d7f81b3e66
849acdac
AM
53Source24: ejabberd-p1_oauth2-20220502.tar.gz
54# Source24-md5: bade7f8e1d18c9f6149b70268c73087b
96ef12ae
AM
55Source25: ejabberd-p1_pgsql-20231016.tar.gz
56# Source25-md5: 6afd5c5763af4a744115d31c3d31eab8
849acdac
AM
57Source26: ejabberd-p1_utils-20220502.tar.gz
58# Source26-md5: 0eab972a4a247519e5a898d8da6054c1
59Source27: ejabberd-pkix-20220502.tar.gz
60# Source27-md5: 88fd008dca6cf2208678fbf50b47a21a
61Source28: ejabberd-rebar_elixir_plugin-20160105.tar.gz
62# Source28-md5: 6a069a566d71c3daa45fc4736364adf0
27238f13
AM
63Source29: ejabberd-sqlite3-20230117.tar.gz
64# Source29-md5: f9457e450712ef06a6157b23e1ebccee
849acdac
AM
65Source30: ejabberd-stringprep-20221012.tar.gz
66# Source30-md5: b2931baf14b779c718dcd5c42c87f8d5
96ef12ae
AM
67Source31: ejabberd-stun-20231016.tar.gz
68# Source31-md5: d9520616dd0331efaabb05c901cee249
849acdac
AM
69Source32: ejabberd-unicode_util_compat-20170729.tar.gz
70# Source32-md5: 1b348fdf38dba88ebed2f65125ad8590
96ef12ae
AM
71Source33: ejabberd-xmpp-20231016.tar.gz
72# Source33-md5: d2dc96824f02642a02c94fb5712d7f69
27238f13
AM
73Source34: ejabberd-yconf-20230117.tar.gz
74# Source34-md5: 6f064bf9d6ad4cbabb44879edd2d1c9e
ac7e9a78 75
d798517a
JK
76Patch0: %{name}-paths.patch
77Patch1: %{name}-config.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 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
fb70a56e 128%patch0 -p1
7f71a53c 129%patch1 -p1
9953f9cb 130%if %{with logdb}
046546ef 131%patch3 -p1
9953f9cb 132%endif
fb70a56e 133
8e141538
JK
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
139unset GIT_DIR GIT_WORK_TREE
140git init
d798661f
JK
141git config user.email "dummy@example.com"
142git config user.name "Dummy"
8e141538
JK
143git add configure.ac
144git commit -a -m "dummy commit"
145git tag "%{version}"
fb8f9840 146
de2dcb11
AM
147sed -i -e 's,#!.*/usr/bin/env.*elixir,#!/usr/bin/elixir,' deps/elixir/bin/mix deps/elixir/lib/mix/lib/mix/tasks/escript.build.ex
148
fb70a56e 149%build
8e141538 150unset GIT_DIR GIT_WORK_TREE
e2bda3a7 151%{__aclocal} -I m4
fb70a56e 152%{__autoconf}
6b419144 153%configure \
5613d9b6 154 %{?with_pam --enable-pam} \
e4f8c955 155 --enable-user=jabber \
e0a49cef 156 %{__enable_disable new_sql_schema new-sql-schema} \
8311848d 157 --enable-elixir \
e2bda3a7 158 --enable-full-xml \
e2bda3a7
JK
159 --enable-odbc \
160 --enable-mysql \
161 --enable-pgsql \
f0222aaa 162 --enable-sqlite --with-sqlite3 \
e2bda3a7 163 %{?with_pam:--enable-pam} \
9682d4d5 164 --enable-zlib
5e08a6fd 165
e2bda3a7
JK
166touch deps/.got
167
beed1a42 168cd deps/stringprep
e2bda3a7
JK
169%configure
170cd ../..
beed1a42 171cd deps/fast_tls
e2bda3a7
JK
172%configure
173cd ../..
beed1a42
AM
174cd deps/fast_xml
175%configure
e2bda3a7 176cd ../..
beed1a42 177cd deps/fast_yaml
e2bda3a7
JK
178%configure
179cd ../..
beed1a42 180cd deps/ezlib
e2bda3a7
JK
181%configure
182cd ../..
183
beed1a42
AM
184# for elixir VM
185LC_ALL=en_US.UTF-8; export LC_ALL
92a38251 186%{__make} -j1
fb70a56e
JK
187
188%install
189rm -rf $RPM_BUILD_ROOT
d798517a 190install -d $RPM_BUILD_ROOT{/var/lib/%{name},/etc/{sysconfig,rc.d/init.d}} \
f20002e6 191 $RPM_BUILD_ROOT{%{systemdunitdir},%{_sbindir}} \
028763ab 192 $RPM_BUILD_ROOT{/etc/logrotate.d,/var/log/archive/%{name}}
fb70a56e 193
8e141538
JK
194unset GIT_DIR GIT_WORK_TREE
195
e2bda3a7 196%{__make} install -j1 \
e4f8c955
JK
197 CHOWN_COMMAND=true \
198 O_USER="" \
199 G_USER="" \
27b10c8b 200 DESTDIR=$RPM_BUILD_ROOT
fb70a56e 201
d798517a 202sed -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
203cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
204cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
205cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
fb70a56e 206
d798517a 207chmod u+rw $RPM_BUILD_ROOT%{_sbindir}/%{name}*
fb70a56e 208
beed1a42 209chmod 755 $RPM_BUILD_ROOT%{_libdir}/*/priv/lib/*.so
5613d9b6 210
e2bda3a7
JK
211rm -rf _doc 2>/dev/null || :
212mv $RPM_BUILD_ROOT%{_docdir}/%{name} _doc
059c0bab 213
fcf4c7a2
JK
214touch $RPM_BUILD_ROOT%{_sysconfdir}/jabber/ejabberd.cfg
215touch $RPM_BUILD_ROOT/var/lib/ejabberd/.erlang.cookie
216
fb70a56e
JK
217%clean
218rm -rf $RPM_BUILD_ROOT
219
e2bda3a7
JK
220%pre
221if [ -e /etc/jabber/ejabberd.cfg ] ; then
fcf4c7a2
JK
222 %banner -e %{name} <<'EOF'
223Old-style /etc/jabber/ejabberd.cfg configuration file exists. You should
224consider converting it to the new YAML format. You can do this with the
27161f77 225'ejabberdctl convert_to_yaml' command (ejabberd must be already running).
fcf4c7a2 226EOF
e2bda3a7
JK
227fi
228
fb70a56e 229%post
0d54398f 230if [ -f %{_sysconfdir}/jabber/secret ] ; then
7f71a53c 231 SECRET="$(cat %{_sysconfdir}/jabber/secret)"
fb70a56e 232 if [ -n "$SECRET" ] ; then
7f71a53c
JK
233 echo -n "Updating component authentication secret in ejabberd config file..." >&2
234 %{__sed} -i -e "s/@service_secret@/$SECRET/" /etc/jabber/ejabberd.yml
235 echo "done" >&2
fb70a56e
JK
236 fi
237fi
fb70a56e 238/sbin/chkconfig --add ejabberd
7102eb90
JK
239if [ -e /var/run/%{name}-upgrade-trigger ] ; then
240 # service will be restarted in the postun trigger
241 rm -f /var/run/%{name}-upgrade-trigger || :
242else
243 %service ejabberd restart "ejabberd server"
244 %systemd_post %{name}.service
245fi
67271627 246
fb70a56e
JK
247%preun
248if [ "$1" = "0" ]; then
b15a901d 249 %service ejabberd stop
fb70a56e
JK
250 /sbin/chkconfig --del ejabberd
251fi
67271627
JK
252%systemd_preun %{name}.service
253
254%postun
255%systemd_reload
256
257%triggerprein -- %{name} < 13.10
3133cbf5
AM
258if [ -e %{_sysconfdir}/jabber/ejabberd.cfg ] ; then
259if grep -Eq '^[^%]*access_get' %{_sysconfdir}/jabber/ejabberd.cfg ; then
7102eb90
JK
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
262 exit 1
263 fi
3133cbf5 264rm -f %{_sysconfdir}/jabber/ejabberd.yml.rpmnew 2>/dev/null || :
7102eb90
JK
265fi
266if [ -e /var/lock/subsys/ejabberd ] ; then
67271627
JK
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'
274Killing all 'epmd, beam, beam.smp, heart' processed owned by the 'jabber' user to make sure old ejabberd is down.
7102eb90 275
67271627
JK
276EOF
277 kill $pids || :
278 fi
279fi
7102eb90 280touch /var/run/%{name}-upgrade-trigger || :
fb70a56e 281
fcf4c7a2
JK
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
286NODENAME="$(hostname)"
287if [ -e /etc/sysconfig/ejabberd ] ; then
288 . /etc/sysconfig/ejabberd || :
289fi
290subst="s/^#ERLANG_NODE=.*/ERLANG_NODE=ejabberd@${NODENAME}/"
7102eb90
JK
291if [ "$NODENAME" != "localhost" ] ; then
292 %banner -e %{name} <<'EOF'
293Configured node name (ejabberd@${NODENAME}) is not at 'localhost'.
294– setting INET_DIST_INTERFACE=0.0.0.0 in /etc/jabber/ejabberdctl.cfg.
295You should consider tuning that or your firewall configuration.
296
297EOF
298 subst="$subst;s/^#INET_DIST_INTERFACE=.*/INET_DIST_INTERFACE=0.0.0.0/"
299fi
fcf4c7a2
JK
300if [ -n "$ERL_MAX_PORTS" ] ; then
301 subst="$subst;s/^#ERL_MAX_PORTS=.*/ERL_MAX_PORTS=${ERL_MAX_PORTS}/"
302fi
303sed -i -e"$subst" /etc/jabber/ejabberdctl.cfg || :
304if [ -e /etc/sysconfig/ejabberd ] ; then
305 sed -i.rpmsave \
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 || :
310fi
311cp %{_sysconfdir}/jabber/cookie /var/lib/ejabberd/.erlang.cookie || :
7102eb90
JK
312chown jabber:jabber /var/lib/ejabberd/.erlang.cookie || :
313chmod 400 /var/lib/ejabberd/.erlang.cookie || :
314if [ -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 || :
317fi
318
319# post action postponed here
320%service ejabberd restart "ejabberd server"
321%systemd_post %{name}.service
322
67271627 323%systemd_trigger %{name}.service
fcf4c7a2 324
fb70a56e
JK
325%files
326%defattr(644,root,root,755)
e2bda3a7 327%doc sql _doc/*
fb70a56e 328%attr(755,root,root) %{_sbindir}/*
4852a36b
AM
329%attr(755,root,root) %{_bindir}/elixir
330%attr(755,root,root) %{_bindir}/iex
331%attr(755,root,root) %{_bindir}/mix
fcf4c7a2
JK
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
028763ab
JK
337%attr(770,root,jabber) /var/log/%{name}
338%attr(770,root,jabber) /var/log/archive/%{name}
61f3ef21 339%if %{with logdb}
beed1a42 340%exclude %{_libdir}/ejabberd-%{version}/ebin/mod_logdb*
61f3ef21 341%endif
beed1a42 342%{_libdir}/ejabberd-%{version}
ac7e9a78 343%{_libdir}/base64url-*
beed1a42 344%{_libdir}/cache_tab-*
105db1e0
JK
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
beed1a42 351%{_libdir}/elixir-*
beed1a42
AM
352%{_libdir}/ezlib-*
353%{_libdir}/fast_tls-*
354%{_libdir}/fast_xml-*
355%{_libdir}/fast_yaml-*
89e7e566 356%{_libdir}/idna-*
beed1a42 357%{_libdir}/jiffy-*
ac7e9a78 358%{_libdir}/jose-*
9682d4d5
AM
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
89e7e566 364%{_libdir}/p1_acme-*
beed1a42
AM
365%{_libdir}/p1_mysql-*
366%{_libdir}/p1_oauth2-*
367%{_libdir}/p1_pgsql-*
368%{_libdir}/p1_utils-*
418fc4bb 369%dir %{_libdir}/pkix-*
f55bab44
AM
370%{_libdir}/pkix-*/ebin
371%{_libdir}/pkix-*/LICENSE
beed1a42 372%{_libdir}/rebar_elixir_plugin-*
f0222aaa
AM
373%{_libdir}/sqlite3-*/ebin
374%dir %{_libdir}/sqlite3-*
375%dir %{_libdir}/sqlite3-*/priv
376%attr(755,root,root) %{_libdir}/sqlite3-*/priv/sqlite3_drv.so
beed1a42 377%{_libdir}/stringprep-*
79e489a1 378%{_libdir}/stun-*
89e7e566 379%{_libdir}/unicode_util_compat-*
4852a36b 380%{_libdir}/xmpp-*
08278fc0 381%{_libdir}/yconf-*
fb70a56e 382%dir %attr(770,root,jabber) /var/lib/ejabberd
fcf4c7a2 383%ghost %attr(400,jabber,jabber) %ghost %config(noreplace) %verify(not md5 mtime size) /var/lib/ejabberd/.erlang.cookie
d798517a
JK
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}
67271627 386%{systemdunitdir}/%{name}.service
f20002e6 387/etc/logrotate.d/%{name}
cc994b3c 388%{_mandir}/man5/ejabberd.yml.5*
cba58599 389
61f3ef21 390%if %{with logdb}
cba58599 391%files logdb
392%defattr(644,root,root,755)
beed1a42 393%{_libdir}/ejabberd-%{version}/ebin/mod_logdb*
61f3ef21 394%endif
This page took 0.202847 seconds and 4 git commands to generate.