]> git.pld-linux.org Git - packages/ejabberd.git/blame_incremental - ejabberd.spec
Up to 23.10
[packages/ejabberd.git] / ejabberd.spec
... / ...
CommitLineData
1# TODO:
2# - package all deps (tarballs 10-29) into separate spec files
3# (like in fedora)
4# Conditional build:
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
8
9Summary: Fault-tolerant distributed Jabber/XMPP server
10Summary(pl.UTF-8): Odporny na awarie rozproszony serwer Jabbera/XMPP
11Name: ejabberd
12Version: 23.10
13Release: 1
14License: GPL
15Group: Applications/Communications
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: c91ae2f93c4c4cd7b00e9cb30ac6044d
19Source1: %{name}.init
20Source2: %{name}.sysconfig
21Source3: %{name}.service
22Source4: %{name}.logrotate
23
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
39Source17: ejabberd-fast_yaml-20230117.tar.gz
40# Source17-md5: 13633fe81d32198c216f5e516f3ef9ee
41Source18: ejabberd-idna-20180830.tar.gz
42# Source18-md5: e34174d5c5e2e91611d3249c690f6d2d
43Source19: ejabberd-jiffy-20220223.tar.gz
44# Source19-md5: b98489245dadf5a36ac3408be21d835a
45Source20: ejabberd-jose-20221216.tar.gz
46# Source20-md5: 1240b886ef9d9102e8df1193f2ebcd4e
47Source21: ejabberd-mqtree-20220502.tar.gz
48# Source21-md5: 1f1b175534eb917780e89e4c7d49c710
49Source22: ejabberd-p1_acme-20230117.tar.gz
50# Source22-md5: 0a0170413d2cf6cf3c083835f18bd380
51Source23: ejabberd-p1_mysql-20231016.tar.gz
52# Source23-md5: 304d139651cc2f14769fc2d7f81b3e66
53Source24: ejabberd-p1_oauth2-20220502.tar.gz
54# Source24-md5: bade7f8e1d18c9f6149b70268c73087b
55Source25: ejabberd-p1_pgsql-20231016.tar.gz
56# Source25-md5: 6afd5c5763af4a744115d31c3d31eab8
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
63Source29: ejabberd-sqlite3-20230117.tar.gz
64# Source29-md5: f9457e450712ef06a6157b23e1ebccee
65Source30: ejabberd-stringprep-20221012.tar.gz
66# Source30-md5: b2931baf14b779c718dcd5c42c87f8d5
67Source31: ejabberd-stun-20231016.tar.gz
68# Source31-md5: d9520616dd0331efaabb05c901cee249
69Source32: ejabberd-unicode_util_compat-20170729.tar.gz
70# Source32-md5: 1b348fdf38dba88ebed2f65125ad8590
71Source33: ejabberd-xmpp-20231016.tar.gz
72# Source33-md5: d2dc96824f02642a02c94fb5712d7f69
73Source34: ejabberd-yconf-20230117.tar.gz
74# Source34-md5: 6f064bf9d6ad4cbabb44879edd2d1c9e
75
76Patch0: %{name}-paths.patch
77Patch1: %{name}-config.patch
78# https://paleg.github.io/mod_logdb/
79# https://github.com/paleg/ejabberd/compare/paleg:19.08...paleg:19.08-mod_logdb.patch
80Patch3: %{name}-mod_logdb.patch
81URL: http://www.ejabberd.im/
82BuildRequires: autoconf
83BuildRequires: automake
84BuildRequires: erlang >= 2:22.2
85BuildRequires: expat-devel >= 1.95
86BuildRequires: openssl-devel
87%if %{with pam}
88BuildRequires: pam-devel
89%endif
90BuildRequires: git-core
91BuildRequires: rpmbuild(macros) >= 1.671
92BuildRequires: sqlite3-devel
93BuildRequires: yaml-devel
94BuildRequires: zlib-devel
95Requires(post): /usr/bin/perl
96Requires(post): jabber-common
97Requires(post): sed >= 4.0
98Requires(post): textutils
99Requires(post,preun): /sbin/chkconfig
100Requires(post,preun,postun): systemd-units >= 38
101Requires: erlang >= 2:22.2
102Requires: expat >= 1.95
103Requires: rc-scripts
104Requires: systemd-units >= 38
105Conflicts: logrotate < 3.8.0
106BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
107
108%define _noautoprovfiles %{_libdir}/%{name}/priv/lib/
109
110%description
111ejabberd is a Free and Open Source fault-tolerant distributed Jabber
112server. It is written mostly in Erlang.
113
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.
117
118%package logdb
119Summary: Server-side logging module
120Group: Applications/Communications
121Requires: %{name} = %{version}-%{release}
122
123%description logdb
124Server-side logging module.
125
126%prep
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%patch0 -p1
129%patch1 -p1
130%if %{with logdb}
131%patch3 -p1
132%endif
133
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
141git config user.email "dummy@example.com"
142git config user.name "Dummy"
143git add configure.ac
144git commit -a -m "dummy commit"
145git tag "%{version}"
146
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
149%build
150unset GIT_DIR GIT_WORK_TREE
151%{__aclocal} -I m4
152%{__autoconf}
153%configure \
154 %{?with_pam --enable-pam} \
155 --enable-user=jabber \
156 %{__enable_disable new_sql_schema new-sql-schema} \
157 --enable-elixir \
158 --enable-full-xml \
159 --enable-odbc \
160 --enable-mysql \
161 --enable-pgsql \
162 --enable-sqlite --with-sqlite3 \
163 %{?with_pam:--enable-pam} \
164 --enable-zlib
165
166touch deps/.got
167
168cd deps/stringprep
169%configure
170cd ../..
171cd deps/fast_tls
172%configure
173cd ../..
174cd deps/fast_xml
175%configure
176cd ../..
177cd deps/fast_yaml
178%configure
179cd ../..
180cd deps/ezlib
181%configure
182cd ../..
183
184# for elixir VM
185LC_ALL=en_US.UTF-8; export LC_ALL
186%{__make} -j1
187
188%install
189rm -rf $RPM_BUILD_ROOT
190install -d $RPM_BUILD_ROOT{/var/lib/%{name},/etc/{sysconfig,rc.d/init.d}} \
191 $RPM_BUILD_ROOT{%{systemdunitdir},%{_sbindir}} \
192 $RPM_BUILD_ROOT{/etc/logrotate.d,/var/log/archive/%{name}}
193
194unset GIT_DIR GIT_WORK_TREE
195
196%{__make} install -j1 \
197 CHOWN_COMMAND=true \
198 O_USER="" \
199 G_USER="" \
200 DESTDIR=$RPM_BUILD_ROOT
201
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}
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}
206
207chmod u+rw $RPM_BUILD_ROOT%{_sbindir}/%{name}*
208
209chmod 755 $RPM_BUILD_ROOT%{_libdir}/*/priv/lib/*.so
210
211rm -rf _doc 2>/dev/null || :
212mv $RPM_BUILD_ROOT%{_docdir}/%{name} _doc
213
214touch $RPM_BUILD_ROOT%{_sysconfdir}/jabber/ejabberd.cfg
215touch $RPM_BUILD_ROOT/var/lib/ejabberd/.erlang.cookie
216
217%clean
218rm -rf $RPM_BUILD_ROOT
219
220%pre
221if [ -e /etc/jabber/ejabberd.cfg ] ; then
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
225'ejabberdctl convert_to_yaml' command (ejabberd must be already running).
226EOF
227fi
228
229%post
230if [ -f %{_sysconfdir}/jabber/secret ] ; then
231 SECRET="$(cat %{_sysconfdir}/jabber/secret)"
232 if [ -n "$SECRET" ] ; then
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
236 fi
237fi
238/sbin/chkconfig --add ejabberd
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
246
247%preun
248if [ "$1" = "0" ]; then
249 %service ejabberd stop
250 /sbin/chkconfig --del ejabberd
251fi
252%systemd_preun %{name}.service
253
254%postun
255%systemd_reload
256
257%triggerprein -- %{name} < 13.10
258if [ -e %{_sysconfdir}/jabber/ejabberd.cfg ] ; then
259if grep -Eq '^[^%]*access_get' %{_sysconfdir}/jabber/ejabberd.cfg ; then
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
264rm -f %{_sysconfdir}/jabber/ejabberd.yml.rpmnew 2>/dev/null || :
265fi
266if [ -e /var/lock/subsys/ejabberd ] ; then
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.
275
276EOF
277 kill $pids || :
278 fi
279fi
280touch /var/run/%{name}-upgrade-trigger || :
281
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}/"
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
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 || :
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
323%systemd_trigger %{name}.service
324
325%files
326%defattr(644,root,root,755)
327%doc sql _doc/*
328%attr(755,root,root) %{_sbindir}/*
329%attr(755,root,root) %{_bindir}/elixir
330%attr(755,root,root) %{_bindir}/iex
331%attr(755,root,root) %{_bindir}/mix
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
337%attr(770,root,jabber) /var/log/%{name}
338%attr(770,root,jabber) /var/log/archive/%{name}
339%if %{with logdb}
340%exclude %{_libdir}/ejabberd-%{version}/ebin/mod_logdb*
341%endif
342%{_libdir}/ejabberd-%{version}
343%{_libdir}/base64url-*
344%{_libdir}/cache_tab-*
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
351%{_libdir}/elixir-*
352%{_libdir}/ezlib-*
353%{_libdir}/fast_tls-*
354%{_libdir}/fast_xml-*
355%{_libdir}/fast_yaml-*
356%{_libdir}/idna-*
357%{_libdir}/jiffy-*
358%{_libdir}/jose-*
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
364%{_libdir}/p1_acme-*
365%{_libdir}/p1_mysql-*
366%{_libdir}/p1_oauth2-*
367%{_libdir}/p1_pgsql-*
368%{_libdir}/p1_utils-*
369%dir %{_libdir}/pkix-*
370%{_libdir}/pkix-*/ebin
371%{_libdir}/pkix-*/LICENSE
372%{_libdir}/rebar_elixir_plugin-*
373%{_libdir}/sqlite3-*/ebin
374%dir %{_libdir}/sqlite3-*
375%dir %{_libdir}/sqlite3-*/priv
376%attr(755,root,root) %{_libdir}/sqlite3-*/priv/sqlite3_drv.so
377%{_libdir}/stringprep-*
378%{_libdir}/stun-*
379%{_libdir}/unicode_util_compat-*
380%{_libdir}/xmpp-*
381%{_libdir}/yconf-*
382%dir %attr(770,root,jabber) /var/lib/ejabberd
383%ghost %attr(400,jabber,jabber) %ghost %config(noreplace) %verify(not md5 mtime size) /var/lib/ejabberd/.erlang.cookie
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}
386%{systemdunitdir}/%{name}.service
387/etc/logrotate.d/%{name}
388%{_mandir}/man5/ejabberd.yml.5*
389
390%if %{with logdb}
391%files logdb
392%defattr(644,root,root,755)
393%{_libdir}/ejabberd-%{version}/ebin/mod_logdb*
394%endif
This page took 0.069969 seconds and 5 git commands to generate.