]> git.pld-linux.org Git - packages/ejabberd.git/blame - ejabberd.spec
- rel 1; logdb works
[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
046546ef 6%bcond_without 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
08278fc0 12Version: 19.08
dd02533f 13Release: 1
fb70a56e
JK
14License: GPL
15Group: Applications/Communications
d798517a 16Source0: http://www.process-one.net/downloads/ejabberd/%{version}/%{name}-%{version}.tgz
08278fc0 17# Source0-md5: c8a3215a85bc3c5f021306747f76b730
d798517a
JK
18Source1: %{name}.init
19Source2: %{name}.sysconfig
20Source3: %{name}.service
f20002e6 21Source4: %{name}.logrotate
e2bda3a7
JK
22#
23# Archives created with the ejabberd-pack_deps.sh script (in this repo)
08278fc0 24Source10: %{name}-base64url-20190617.tar.gz
dd02533f 25# Source10-md5: 5a12fd2fb1f992c850aba5115aab3dd4
08278fc0 26Source11: %{name}-cache_tab-20190802.tar.gz
dd02533f 27# Source11-md5: cf0e72d17802d2e10d850f0e339a1c11
08278fc0 28Source12: %{name}-eimp-20190802.tar.gz
dd02533f 29# Source12-md5: ec256209f4c1798f1fc4c863881f9e43
08278fc0 30Source13: %{name}-elixir-20170515.tar.gz
dd02533f 31# Source13-md5: 73be42f7d0cda7aeee5c0e6dadc0c451
08278fc0 32Source14: %{name}-ezlib-20190523.tar.gz
dd02533f 33# Source14-md5: e521f10bba8fd2208aa5c15272050399
08278fc0 34Source15: %{name}-fast_tls-20190802.tar.gz
dd02533f 35# Source15-md5: 80359622cc6d929923d5c316f9b9061f
08278fc0 36Source16: %{name}-fast_xml-20190802.tar.gz
dd02533f 37# Source16-md5: 628bc356a896e6921818700738d977e5
08278fc0 38Source17: %{name}-fast_yaml-20190802.tar.gz
dd02533f 39# Source17-md5: 9a277749887e10ef34a50ff08c6b2d82
08278fc0 40Source18: %{name}-goldrush-20160531.tar.gz
dd02533f 41# Source18-md5: acac73f0fc85d23671f0c49c68f8df8a
08278fc0 42Source19: %{name}-jiffy-20160331.tar.gz
dd02533f 43# Source19-md5: 78f31a7dea7538ef3e63f77351f4d0b7
08278fc0 44Source20: %{name}-jose-20170518.tar.gz
dd02533f 45# Source20-md5: b1675bfc57c1b3b7e154270e2bcd4559
08278fc0 46Source21: %{name}-lager-20190430.tar.gz
dd02533f 47# Source21-md5: 66205d931dd27b496529c19addf6d7d9
08278fc0 48Source22: %{name}-mqtree-20190802.tar.gz
dd02533f
AM
49# Source22-md5: 16cd0ea398c505e12bd886c5fd311012
50Source23: %{name}-p1_mysql-20190831.tar.gz
51# Source23-md5: 8cc96c4fcc8341b2c0565f818de2ba6d
08278fc0 52Source24: %{name}-p1_oauth2-20190523.tar.gz
dd02533f 53# Source24-md5: 5a1284f4e055d414f5867fdf54baf164
08278fc0 54Source25: %{name}-p1_pgsql-20190523.tar.gz
dd02533f 55# Source25-md5: 348772eb0ccb9952cb202a7900eb905d
08278fc0 56Source26: %{name}-p1_utils-20190802.tar.gz
dd02533f 57# Source26-md5: 19c97dcdc6a37a4b574f67bdce6b9566
08278fc0 58Source27: %{name}-pkix-20190802.tar.gz
dd02533f 59# Source27-md5: 96c39ddde79ccce22e3ed3785be4861d
08278fc0 60Source28: %{name}-rebar_elixir_plugin-20160105.tar.gz
dd02533f 61# Source28-md5: 6a069a566d71c3daa45fc4736364adf0
08278fc0 62Source29: %{name}-sqlite3-20180130.tar.gz
dd02533f 63# Source29-md5: cc8950eb769eb6ceb13723a7b61fe507
08278fc0 64Source30: %{name}-stringprep-20190802.tar.gz
dd02533f 65# Source30-md5: cd354de1ee12712a2434c39241cf5488
08278fc0 66Source31: %{name}-xmpp-20190802.tar.gz
dd02533f 67# Source31-md5: 73587aa235b062e592d5f043b32fe3b8
08278fc0 68Source32: %{name}-yconf-20190802.tar.gz
dd02533f 69# Source32-md5: 8ad82ed92e339c67a63f3ef5e3f95a2c
ac7e9a78 70
d798517a
JK
71Patch0: %{name}-paths.patch
72Patch1: %{name}-config.patch
3f23be8e 73# https://paleg.github.io/mod_logdb/
dd02533f 74# https://github.com/paleg/ejabberd/compare/paleg:19.08...paleg:19.08-mod_logdb.patch
d798517a 75Patch3: %{name}-mod_logdb.patch
3f2196e7 76URL: http://www.ejabberd.im/
fb70a56e 77BuildRequires: autoconf
1a2644b6 78BuildRequires: automake
a306e2ac 79BuildRequires: erlang >= 1:R16B03
6f0d08c1 80BuildRequires: expat-devel >= 1.95
81BuildRequires: openssl-devel
e9f604ed 82%if %{with pam}
83BuildRequires: pam-devel
84%endif
126fba49 85BuildRequires: git-core
67271627 86BuildRequires: rpmbuild(macros) >= 1.671
f0222aaa 87BuildRequires: sqlite3-devel
60c3a68c 88BuildRequires: yaml-devel
01f61704 89BuildRequires: zlib-devel
27b10c8b 90Requires(post): /usr/bin/perl
b15a901d 91Requires(post): jabber-common
0d54398f 92Requires(post): sed >= 4.0
fb70a56e 93Requires(post): textutils
fb70a56e 94Requires(post,preun): /sbin/chkconfig
67271627 95Requires(post,preun,postun): systemd-units >= 38
9a105ba4 96Requires: erlang >= 1:R15B01
bb159536 97Requires: expat >= 1.95
27b10c8b 98Requires: rc-scripts
67271627 99Requires: systemd-units >= 38
028763ab 100Conflicts: logrotate < 3.8.0
fb70a56e
JK
101BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
102
fcf4c7a2
JK
103%define _noautoprovfiles %{_libdir}/%{name}/priv/lib/
104
fb70a56e 105%description
472227c5 106ejabberd is a Free and Open Source fault-tolerant distributed Jabber
107server. It is written mostly in Erlang.
fb70a56e 108
e0166ea5
JR
109%description -l pl.UTF-8
110ejabberd to darmowy, z otwartymi źródłami, odporny na awarie
111rozproszony serwer Jabbera. Jest napisany w większości w Erlangu.
378431cb 112
cba58599 113%package logdb
1a2644b6 114Summary: Server-side logging module
cba58599 115Group: Applications/Communications
116Requires: %{name} = %{version}-%{release}
117
118%description logdb
119Server-side logging module.
120
fb70a56e 121%prep
08278fc0 122%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
fb70a56e 123%patch0 -p1
7f71a53c
JK
124%patch1 -p1
125#%%patch2 -p1
9953f9cb 126%if %{with logdb}
046546ef 127%patch3 -p1
9953f9cb 128%endif
fb70a56e 129
8e141538
JK
130# Various parts of the build system use 'git describe'
131# which returns nonsense on manual builds using the builder script
132# and which fails on the PLD builders
133# I was not able to locate all 'git describe' invocation, sot let's
134# fool them with this dummy repository
135unset GIT_DIR GIT_WORK_TREE
136git init
d798661f
JK
137git config user.email "dummy@example.com"
138git config user.name "Dummy"
8e141538
JK
139git add configure.ac
140git commit -a -m "dummy commit"
141git tag "%{version}"
fb8f9840 142
fb70a56e 143%build
8e141538 144unset GIT_DIR GIT_WORK_TREE
e2bda3a7 145%{__aclocal} -I m4
fb70a56e 146%{__autoconf}
6b419144 147%configure \
5613d9b6 148 %{?with_pam --enable-pam} \
e4f8c955 149 --enable-user=jabber \
e0a49cef 150 %{__enable_disable new_sql_schema new-sql-schema} \
8311848d 151 --enable-elixir \
e2bda3a7 152 --enable-full-xml \
e2bda3a7
JK
153 --enable-odbc \
154 --enable-mysql \
155 --enable-pgsql \
f0222aaa 156 --enable-sqlite --with-sqlite3 \
e2bda3a7 157 %{?with_pam:--enable-pam} \
9682d4d5 158 --enable-zlib
5e08a6fd 159
e2bda3a7
JK
160touch deps/.got
161
beed1a42 162cd deps/stringprep
e2bda3a7
JK
163%configure
164cd ../..
beed1a42 165cd deps/fast_tls
e2bda3a7
JK
166%configure
167cd ../..
beed1a42
AM
168cd deps/fast_xml
169%configure
e2bda3a7 170cd ../..
beed1a42 171cd deps/fast_yaml
e2bda3a7
JK
172%configure
173cd ../..
beed1a42 174cd deps/ezlib
e2bda3a7
JK
175%configure
176cd ../..
177
beed1a42
AM
178# for elixir VM
179LC_ALL=en_US.UTF-8; export LC_ALL
92a38251 180%{__make} -j1
fb70a56e
JK
181
182%install
183rm -rf $RPM_BUILD_ROOT
d798517a 184install -d $RPM_BUILD_ROOT{/var/lib/%{name},/etc/{sysconfig,rc.d/init.d}} \
f20002e6 185 $RPM_BUILD_ROOT{%{systemdunitdir},%{_sbindir}} \
028763ab 186 $RPM_BUILD_ROOT{/etc/logrotate.d,/var/log/archive/%{name}}
fb70a56e 187
8e141538
JK
188unset GIT_DIR GIT_WORK_TREE
189
e2bda3a7 190%{__make} install -j1 \
e4f8c955
JK
191 CHOWN_COMMAND=true \
192 O_USER="" \
193 G_USER="" \
27b10c8b 194 DESTDIR=$RPM_BUILD_ROOT
fb70a56e 195
d798517a 196sed -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
197cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
198cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
199cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
fb70a56e 200
d798517a 201chmod u+rw $RPM_BUILD_ROOT%{_sbindir}/%{name}*
fb70a56e 202
beed1a42 203chmod 755 $RPM_BUILD_ROOT%{_libdir}/*/priv/lib/*.so
5613d9b6 204
e2bda3a7
JK
205rm -rf _doc 2>/dev/null || :
206mv $RPM_BUILD_ROOT%{_docdir}/%{name} _doc
059c0bab 207
fcf4c7a2
JK
208touch $RPM_BUILD_ROOT%{_sysconfdir}/jabber/ejabberd.cfg
209touch $RPM_BUILD_ROOT/var/lib/ejabberd/.erlang.cookie
210
fb70a56e
JK
211%clean
212rm -rf $RPM_BUILD_ROOT
213
e2bda3a7
JK
214%pre
215if [ -e /etc/jabber/ejabberd.cfg ] ; then
fcf4c7a2
JK
216 %banner -e %{name} <<'EOF'
217Old-style /etc/jabber/ejabberd.cfg configuration file exists. You should
218consider converting it to the new YAML format. You can do this with the
27161f77 219'ejabberdctl convert_to_yaml' command (ejabberd must be already running).
fcf4c7a2 220EOF
e2bda3a7
JK
221fi
222
fb70a56e 223%post
0d54398f 224if [ -f %{_sysconfdir}/jabber/secret ] ; then
7f71a53c 225 SECRET="$(cat %{_sysconfdir}/jabber/secret)"
fb70a56e 226 if [ -n "$SECRET" ] ; then
7f71a53c
JK
227 echo -n "Updating component authentication secret in ejabberd config file..." >&2
228 %{__sed} -i -e "s/@service_secret@/$SECRET/" /etc/jabber/ejabberd.yml
229 echo "done" >&2
fb70a56e
JK
230 fi
231fi
fb70a56e 232/sbin/chkconfig --add ejabberd
7102eb90
JK
233if [ -e /var/run/%{name}-upgrade-trigger ] ; then
234 # service will be restarted in the postun trigger
235 rm -f /var/run/%{name}-upgrade-trigger || :
236else
237 %service ejabberd restart "ejabberd server"
238 %systemd_post %{name}.service
239fi
67271627 240
fb70a56e
JK
241%preun
242if [ "$1" = "0" ]; then
b15a901d 243 %service ejabberd stop
fb70a56e
JK
244 /sbin/chkconfig --del ejabberd
245fi
67271627
JK
246%systemd_preun %{name}.service
247
248%postun
249%systemd_reload
250
251%triggerprein -- %{name} < 13.10
7102eb90
JK
252if [ -e /etc/jabber/ejabberd.cfg ] ; then
253 if grep -Eq '^[^%]*access_get' /etc/jabber/ejabberd.cfg ; then
254 echo "Your 'ejabberd.cfg' config file seems to use 'access_get' option of mod_vcard" >&2
255 echo "this is not supported by this ejabberd version in PLD" >&2
256 exit 1
257 fi
258 rm -f /etc/jabber/ejabberd.yml.rpmnew 2>/dev/null || :
259fi
260if [ -e /var/lock/subsys/ejabberd ] ; then
67271627
JK
261 # old init script won't stop ejabberd correctly
262 # stop it's all processes here
263 # we assume any 'epmd', 'beam', 'beam.smp' or 'heart' process
264 # running with uid of jabber is ejabberd process
265 pids="$(ps -C "epmd beam beam.smp heart" -o pid=,user= | awk '/jabber/ { print $1 }')" || :
266 if [ -n "$pids" ] ; then
267 %banner -e %{name} <<'EOF'
268Killing all 'epmd, beam, beam.smp, heart' processed owned by the 'jabber' user to make sure old ejabberd is down.
7102eb90 269
67271627
JK
270EOF
271 kill $pids || :
272 fi
273fi
7102eb90 274touch /var/run/%{name}-upgrade-trigger || :
fb70a56e 275
fcf4c7a2
JK
276%triggerpostun -- %{name} < 13.10
277# convert old 'NODENAME' in /etc/sysconfig/ejabberd
278# to 'ERLANG_NODE' in /etc/jabber/ejabberdctl.cfg
279# and move other settings
280NODENAME="$(hostname)"
281if [ -e /etc/sysconfig/ejabberd ] ; then
282 . /etc/sysconfig/ejabberd || :
283fi
284subst="s/^#ERLANG_NODE=.*/ERLANG_NODE=ejabberd@${NODENAME}/"
7102eb90
JK
285if [ "$NODENAME" != "localhost" ] ; then
286 %banner -e %{name} <<'EOF'
287Configured node name (ejabberd@${NODENAME}) is not at 'localhost'.
288– setting INET_DIST_INTERFACE=0.0.0.0 in /etc/jabber/ejabberdctl.cfg.
289You should consider tuning that or your firewall configuration.
290
291EOF
292 subst="$subst;s/^#INET_DIST_INTERFACE=.*/INET_DIST_INTERFACE=0.0.0.0/"
293fi
fcf4c7a2
JK
294if [ -n "$ERL_MAX_PORTS" ] ; then
295 subst="$subst;s/^#ERL_MAX_PORTS=.*/ERL_MAX_PORTS=${ERL_MAX_PORTS}/"
296fi
297sed -i -e"$subst" /etc/jabber/ejabberdctl.cfg || :
298if [ -e /etc/sysconfig/ejabberd ] ; then
299 sed -i.rpmsave \
300 -e'/^[#[:space:]]*NODENAME=/d;/^# Node name/d' \
301 -e'/^[#[:space:]]*ERL_MAX_PORTS=/d;/^# uncomment this to allow more then 1024 connections/d' \
302 -e'/^[#[:space:]]*ERL_FULLSWEEP_AFTER=/d;/^# uncomment this to limit memory usage/d' \
303 /etc/sysconfig/ejabberd || :
304fi
305cp %{_sysconfdir}/jabber/cookie /var/lib/ejabberd/.erlang.cookie || :
7102eb90
JK
306chown jabber:jabber /var/lib/ejabberd/.erlang.cookie || :
307chmod 400 /var/lib/ejabberd/.erlang.cookie || :
308if [ -e /etc/jabber/ejabberd.cfg -a ! -e /etc/jabber/ejabberd.yml.rpmnew ] ; then
309 mv /etc/jabber/ejabberd.yml /etc/jabber/ejabberd.yml.rpmnew
310 echo 'include_config_file: "/etc/jabber/ejabberd.cfg"' > /etc/jabber/ejabberd.yml || :
311fi
312
313# post action postponed here
314%service ejabberd restart "ejabberd server"
315%systemd_post %{name}.service
316
67271627 317%systemd_trigger %{name}.service
fcf4c7a2 318
fb70a56e
JK
319%files
320%defattr(644,root,root,755)
e2bda3a7 321%doc sql _doc/*
fb70a56e 322%attr(755,root,root) %{_sbindir}/*
4852a36b
AM
323%attr(755,root,root) %{_bindir}/elixir
324%attr(755,root,root) %{_bindir}/iex
325%attr(755,root,root) %{_bindir}/mix
fcf4c7a2
JK
326%attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberd-inetrc
327%attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberd.yml
328%attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberdctl.cfg
329# legacy config may still be there
330%attr(640,root,jabber) %ghost %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberd.cfg
028763ab
JK
331%attr(770,root,jabber) /var/log/%{name}
332%attr(770,root,jabber) /var/log/archive/%{name}
61f3ef21 333%if %{with logdb}
beed1a42 334%exclude %{_libdir}/ejabberd-%{version}/ebin/mod_logdb*
61f3ef21 335%endif
beed1a42 336%{_libdir}/ejabberd-%{version}
ac7e9a78 337%{_libdir}/base64url-*
beed1a42 338%{_libdir}/cache_tab-*
105db1e0
JK
339%dir %{_libdir}/eimp-*
340%dir %{_libdir}/eimp-*/priv
341%dir %{_libdir}/eimp-*/priv/bin
342%attr(755,root,root) %{_libdir}/eimp-*/priv/bin/eimp
343%{_libdir}/eimp-*/ebin
344%{_libdir}/eimp-*/LICENSE.txt
beed1a42 345%{_libdir}/elixir-*
beed1a42
AM
346%{_libdir}/ezlib-*
347%{_libdir}/fast_tls-*
348%{_libdir}/fast_xml-*
349%{_libdir}/fast_yaml-*
350%{_libdir}/goldrush-*
beed1a42 351%{_libdir}/jiffy-*
ac7e9a78 352%{_libdir}/jose-*
beed1a42 353%{_libdir}/lager-*
9682d4d5
AM
354%dir %{_libdir}/mqtree-*
355%{_libdir}/mqtree-*/ebin
356%dir %{_libdir}/mqtree-*/priv
357%dir %{_libdir}/mqtree-*/priv/lib
358%attr(755,root,root) %{_libdir}/mqtree-*/priv/lib/mqtree.so
beed1a42
AM
359%{_libdir}/p1_mysql-*
360%{_libdir}/p1_oauth2-*
361%{_libdir}/p1_pgsql-*
362%{_libdir}/p1_utils-*
418fc4bb 363%dir %{_libdir}/pkix-*
f55bab44
AM
364%{_libdir}/pkix-*/ebin
365%{_libdir}/pkix-*/LICENSE
beed1a42 366%{_libdir}/rebar_elixir_plugin-*
f0222aaa
AM
367%{_libdir}/sqlite3-*/ebin
368%dir %{_libdir}/sqlite3-*
369%dir %{_libdir}/sqlite3-*/priv
370%attr(755,root,root) %{_libdir}/sqlite3-*/priv/sqlite3_drv.so
beed1a42 371%{_libdir}/stringprep-*
4852a36b 372%{_libdir}/xmpp-*
08278fc0 373%{_libdir}/yconf-*
fb70a56e 374%dir %attr(770,root,jabber) /var/lib/ejabberd
fcf4c7a2 375%ghost %attr(400,jabber,jabber) %ghost %config(noreplace) %verify(not md5 mtime size) /var/lib/ejabberd/.erlang.cookie
d798517a
JK
376%attr(754,root,root) /etc/rc.d/init.d/%{name}
377%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
67271627 378%{systemdunitdir}/%{name}.service
f20002e6 379/etc/logrotate.d/%{name}
cba58599 380
61f3ef21 381%if %{with logdb}
cba58599 382%files logdb
383%defattr(644,root,root,755)
beed1a42 384%{_libdir}/ejabberd-%{version}/ebin/mod_logdb*
61f3ef21 385%endif
This page took 0.131273 seconds and 4 git commands to generate.