]> git.pld-linux.org Git - packages/ejabberd.git/blame - ejabberd.spec
- up to 16.08; huge TODO added
[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)
c4f8aa56 7%bcond_with weaker_crypto # enable SSLv3
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
beed1a42
AM
12Version: 16.08
13Release: 1
fb70a56e
JK
14License: GPL
15Group: Applications/Communications
d798517a 16Source0: http://www.process-one.net/downloads/ejabberd/%{version}/%{name}-%{version}.tgz
beed1a42 17# Source0-md5: a225e99c50e91464cf8f78bd8d129664
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)
beed1a42
AM
24Source10: ejabberd-cache_tab-20160630.tar.gz
25# Source10-md5: 28c7b761c5bdc70bbfa3c1d85fff9825
26Source11: ejabberd-elixir-20150928.tar.gz
27# Source11-md5: 1a0cba08de1687affe590e5abbc993cc
28Source12: ejabberd-esip-20160708.tar.gz
29# Source12-md5: 759e70d30fc1c5adbae3976e28c8c659
30Source13: ejabberd-ezlib-20160122.tar.gz
31# Source13-md5: 41907afdd7195014b1e4cf4764564a37
32Source14: ejabberd-fast_tls-20160708.tar.gz
33# Source14-md5: e4f56b9dce6fc68f9eb58417554fe24a
34Source15: ejabberd-fast_xml-20160708.tar.gz
35# Source15-md5: f26c98665fe7370262412084d802a310
36Source16: ejabberd-fast_yaml-20160708.tar.gz
37# Source16-md5: 815111ff387608a9c0a41898d8fe0ad6
38Source17: ejabberd-goldrush-20151116.tar.gz
39# Source17-md5: 61324bdee5d304a7189c305a6b4fe39e
40Source18: ejabberd-iconv-20160708.tar.gz
41# Source18-md5: 5b8ad7ada3f46b766e4be985322225f9
42Source19: ejabberd-jiffy-20160106.tar.gz
43# Source19-md5: 50a03a4289ab5c37c3263e73c15873ef
44Source20: ejabberd-lager-20160610.tar.gz
45# Source20-md5: 395b1fd4d056684c8b92d50d9916b7ed
46Source21: ejabberd-luerl-20151210.tar.gz
47# Source21-md5: 180f8ff3f24d00cbdabbf28c7e415f85
48Source22: ejabberd-p1_mysql-20160122.tar.gz
49# Source22-md5: 40b984a50b7d3a7bd00dd15aafd7a44a
50Source23: ejabberd-p1_oauth2-20160123.tar.gz
51# Source23-md5: 8dda6e87a6551724b0bc7d21b7a59357
52Source24: ejabberd-p1_pgsql-20160223.tar.gz
53# Source24-md5: 739c03ac9089f7f86d55cea3ee5bee25
54Source25: ejabberd-p1_utils-20160701.tar.gz
55# Source25-md5: 8a8734d8dd773ec0cf808e1a8bbdbde3
56Source26: ejabberd-p1_xmlrpc-20160123.tar.gz
57# Source26-md5: 8ec9db8add5754738f2272d690adb75c
58Source27: ejabberd-rebar_elixir_plugin-20160105.tar.gz
59# Source27-md5: 40f41b936c8c774174c953895f132f98
60Source28: ejabberd-stringprep-20160708.tar.gz
61# Source28-md5: e9432b08b37602e54e8716c2b9e2edab
62Source29: ejabberd-stun-20160708.tar.gz
63# Source29-md5: fea7f6b75606d51478a468ae664f0d64
e2bda3a7 64#
d798517a
JK
65Patch0: %{name}-paths.patch
66Patch1: %{name}-config.patch
e2bda3a7 67# not available for 13.10
d798517a 68#Patch2: %{name}-vcard-access-get.patch
33af2120 69# http://www.dp.uz.gov.ua/o.palij/mod_logdb/patch-mod_logdb-13.12.diff
d798517a 70Patch3: %{name}-mod_logdb.patch
c4f8aa56 71Patch4: %{name}-no_sslv3_or_3des.patch
3f2196e7 72URL: http://www.ejabberd.im/
fb70a56e 73BuildRequires: autoconf
1a2644b6 74BuildRequires: automake
a306e2ac 75BuildRequires: erlang >= 1:R16B03
6f0d08c1 76BuildRequires: expat-devel >= 1.95
77BuildRequires: openssl-devel
e9f604ed 78%if %{with pam}
79BuildRequires: pam-devel
80%endif
67271627 81BuildRequires: rpmbuild(macros) >= 1.671
60c3a68c 82BuildRequires: yaml-devel
01f61704 83BuildRequires: zlib-devel
8e141538 84BuildRequires: git-core
27b10c8b 85Requires(post): /usr/bin/perl
b15a901d 86Requires(post): jabber-common
0d54398f 87Requires(post): sed >= 4.0
fb70a56e 88Requires(post): textutils
fb70a56e 89Requires(post,preun): /sbin/chkconfig
67271627 90Requires(post,preun,postun): systemd-units >= 38
9a105ba4 91Requires: erlang >= 1:R15B01
bb159536 92Requires: expat >= 1.95
27b10c8b 93Requires: rc-scripts
67271627 94Requires: systemd-units >= 38
028763ab 95Conflicts: logrotate < 3.8.0
fb70a56e
JK
96BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
97
fcf4c7a2
JK
98%define _noautoprovfiles %{_libdir}/%{name}/priv/lib/
99
fb70a56e 100%description
472227c5 101ejabberd is a Free and Open Source fault-tolerant distributed Jabber
102server. It is written mostly in Erlang.
fb70a56e 103
e0166ea5
JR
104%description -l pl.UTF-8
105ejabberd to darmowy, z otwartymi źródłami, odporny na awarie
106rozproszony serwer Jabbera. Jest napisany w większości w Erlangu.
378431cb 107
cba58599 108%package logdb
1a2644b6 109Summary: Server-side logging module
cba58599 110Group: Applications/Communications
111Requires: %{name} = %{version}-%{release}
112
113%description logdb
114Server-side logging module.
115
fb70a56e 116%prep
beed1a42 117%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
fb70a56e 118%patch0 -p1
7f71a53c
JK
119%patch1 -p1
120#%%patch2 -p1
9953f9cb 121%if %{with logdb}
046546ef 122%patch3 -p1
9953f9cb 123%endif
c4f8aa56
JK
124%if %{without weaker_crypto}
125%patch4 -p1
126%endif
fb70a56e 127
8e141538
JK
128# Various parts of the build system use 'git describe'
129# which returns nonsense on manual builds using the builder script
130# and which fails on the PLD builders
131# I was not able to locate all 'git describe' invocation, sot let's
132# fool them with this dummy repository
133unset GIT_DIR GIT_WORK_TREE
134git init
d798661f
JK
135git config user.email "dummy@example.com"
136git config user.name "Dummy"
8e141538
JK
137git add configure.ac
138git commit -a -m "dummy commit"
139git tag "%{version}"
fb8f9840 140
fb70a56e 141%build
8e141538 142unset GIT_DIR GIT_WORK_TREE
e2bda3a7 143%{__aclocal} -I m4
fb70a56e 144%{__autoconf}
6b419144 145%configure \
5613d9b6 146 %{?with_pam --enable-pam} \
e4f8c955 147 --enable-user=jabber \
8311848d 148 --enable-elixir \
e2bda3a7 149 --enable-full-xml \
e2bda3a7
JK
150 --enable-odbc \
151 --enable-mysql \
152 --enable-pgsql \
153 %{?with_pam:--enable-pam} \
154 --enable-zlib \
beed1a42 155 --enable-iconv
5e08a6fd 156
e2bda3a7
JK
157touch deps/.got
158
beed1a42 159cd deps/iconv
e2bda3a7
JK
160%configure
161cd ../..
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 ../..
c6f5b587
AM
177cd deps/esip
178%configure
179cd ../..
e2bda3a7 180
beed1a42
AM
181# for elixir VM
182LC_ALL=en_US.UTF-8; export LC_ALL
92a38251 183%{__make} -j1
fb70a56e
JK
184
185%install
186rm -rf $RPM_BUILD_ROOT
d798517a 187install -d $RPM_BUILD_ROOT{/var/lib/%{name},/etc/{sysconfig,rc.d/init.d}} \
f20002e6 188 $RPM_BUILD_ROOT{%{systemdunitdir},%{_sbindir}} \
028763ab 189 $RPM_BUILD_ROOT{/etc/logrotate.d,/var/log/archive/%{name}}
fb70a56e 190
8e141538
JK
191unset GIT_DIR GIT_WORK_TREE
192
e2bda3a7 193%{__make} install -j1 \
e4f8c955
JK
194 CHOWN_COMMAND=true \
195 O_USER="" \
196 G_USER="" \
27b10c8b 197 DESTDIR=$RPM_BUILD_ROOT
fb70a56e 198
d798517a
JK
199sed -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}
200install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
67271627 201install %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
f20002e6 202install %{SOURCE4} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
fb70a56e 203
d798517a 204chmod u+rw $RPM_BUILD_ROOT%{_sbindir}/%{name}*
fb70a56e 205
beed1a42 206chmod 755 $RPM_BUILD_ROOT%{_libdir}/*/priv/lib/*.so
5613d9b6 207
e2bda3a7
JK
208rm -rf _doc 2>/dev/null || :
209mv $RPM_BUILD_ROOT%{_docdir}/%{name} _doc
059c0bab 210
fcf4c7a2
JK
211touch $RPM_BUILD_ROOT%{_sysconfdir}/jabber/ejabberd.cfg
212touch $RPM_BUILD_ROOT/var/lib/ejabberd/.erlang.cookie
213
fb70a56e
JK
214%clean
215rm -rf $RPM_BUILD_ROOT
216
e2bda3a7
JK
217%pre
218if [ -e /etc/jabber/ejabberd.cfg ] ; then
fcf4c7a2
JK
219 %banner -e %{name} <<'EOF'
220Old-style /etc/jabber/ejabberd.cfg configuration file exists. You should
221consider converting it to the new YAML format. You can do this with the
27161f77 222'ejabberdctl convert_to_yaml' command (ejabberd must be already running).
fcf4c7a2 223EOF
e2bda3a7
JK
224fi
225
fb70a56e 226%post
0d54398f 227if [ -f %{_sysconfdir}/jabber/secret ] ; then
7f71a53c 228 SECRET="$(cat %{_sysconfdir}/jabber/secret)"
fb70a56e 229 if [ -n "$SECRET" ] ; then
7f71a53c
JK
230 echo -n "Updating component authentication secret in ejabberd config file..." >&2
231 %{__sed} -i -e "s/@service_secret@/$SECRET/" /etc/jabber/ejabberd.yml
232 echo "done" >&2
fb70a56e
JK
233 fi
234fi
fb70a56e 235/sbin/chkconfig --add ejabberd
7102eb90
JK
236if [ -e /var/run/%{name}-upgrade-trigger ] ; then
237 # service will be restarted in the postun trigger
238 rm -f /var/run/%{name}-upgrade-trigger || :
239else
240 %service ejabberd restart "ejabberd server"
241 %systemd_post %{name}.service
242fi
67271627 243
fb70a56e
JK
244%preun
245if [ "$1" = "0" ]; then
b15a901d 246 %service ejabberd stop
fb70a56e
JK
247 /sbin/chkconfig --del ejabberd
248fi
67271627
JK
249%systemd_preun %{name}.service
250
251%postun
252%systemd_reload
253
254%triggerprein -- %{name} < 13.10
7102eb90
JK
255if [ -e /etc/jabber/ejabberd.cfg ] ; then
256 if grep -Eq '^[^%]*access_get' /etc/jabber/ejabberd.cfg ; then
257 echo "Your 'ejabberd.cfg' config file seems to use 'access_get' option of mod_vcard" >&2
258 echo "this is not supported by this ejabberd version in PLD" >&2
259 exit 1
260 fi
261 rm -f /etc/jabber/ejabberd.yml.rpmnew 2>/dev/null || :
262fi
263if [ -e /var/lock/subsys/ejabberd ] ; then
67271627
JK
264 # old init script won't stop ejabberd correctly
265 # stop it's all processes here
266 # we assume any 'epmd', 'beam', 'beam.smp' or 'heart' process
267 # running with uid of jabber is ejabberd process
268 pids="$(ps -C "epmd beam beam.smp heart" -o pid=,user= | awk '/jabber/ { print $1 }')" || :
269 if [ -n "$pids" ] ; then
270 %banner -e %{name} <<'EOF'
271Killing all 'epmd, beam, beam.smp, heart' processed owned by the 'jabber' user to make sure old ejabberd is down.
7102eb90 272
67271627
JK
273EOF
274 kill $pids || :
275 fi
276fi
7102eb90 277touch /var/run/%{name}-upgrade-trigger || :
fb70a56e 278
fcf4c7a2
JK
279%triggerpostun -- %{name} < 13.10
280# convert old 'NODENAME' in /etc/sysconfig/ejabberd
281# to 'ERLANG_NODE' in /etc/jabber/ejabberdctl.cfg
282# and move other settings
283NODENAME="$(hostname)"
284if [ -e /etc/sysconfig/ejabberd ] ; then
285 . /etc/sysconfig/ejabberd || :
286fi
287subst="s/^#ERLANG_NODE=.*/ERLANG_NODE=ejabberd@${NODENAME}/"
7102eb90
JK
288if [ "$NODENAME" != "localhost" ] ; then
289 %banner -e %{name} <<'EOF'
290Configured node name (ejabberd@${NODENAME}) is not at 'localhost'.
291– setting INET_DIST_INTERFACE=0.0.0.0 in /etc/jabber/ejabberdctl.cfg.
292You should consider tuning that or your firewall configuration.
293
294EOF
295 subst="$subst;s/^#INET_DIST_INTERFACE=.*/INET_DIST_INTERFACE=0.0.0.0/"
296fi
fcf4c7a2
JK
297if [ -n "$ERL_MAX_PORTS" ] ; then
298 subst="$subst;s/^#ERL_MAX_PORTS=.*/ERL_MAX_PORTS=${ERL_MAX_PORTS}/"
299fi
300sed -i -e"$subst" /etc/jabber/ejabberdctl.cfg || :
301if [ -e /etc/sysconfig/ejabberd ] ; then
302 sed -i.rpmsave \
303 -e'/^[#[:space:]]*NODENAME=/d;/^# Node name/d' \
304 -e'/^[#[:space:]]*ERL_MAX_PORTS=/d;/^# uncomment this to allow more then 1024 connections/d' \
305 -e'/^[#[:space:]]*ERL_FULLSWEEP_AFTER=/d;/^# uncomment this to limit memory usage/d' \
306 /etc/sysconfig/ejabberd || :
307fi
308cp %{_sysconfdir}/jabber/cookie /var/lib/ejabberd/.erlang.cookie || :
7102eb90
JK
309chown jabber:jabber /var/lib/ejabberd/.erlang.cookie || :
310chmod 400 /var/lib/ejabberd/.erlang.cookie || :
311if [ -e /etc/jabber/ejabberd.cfg -a ! -e /etc/jabber/ejabberd.yml.rpmnew ] ; then
312 mv /etc/jabber/ejabberd.yml /etc/jabber/ejabberd.yml.rpmnew
313 echo 'include_config_file: "/etc/jabber/ejabberd.cfg"' > /etc/jabber/ejabberd.yml || :
314fi
315
316# post action postponed here
317%service ejabberd restart "ejabberd server"
318%systemd_post %{name}.service
319
67271627 320%systemd_trigger %{name}.service
fcf4c7a2 321
fb70a56e
JK
322%files
323%defattr(644,root,root,755)
e2bda3a7 324%doc sql _doc/*
fb70a56e 325%attr(755,root,root) %{_sbindir}/*
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
AM
336%{_libdir}/ejabberd-%{version}
337%{_libdir}/cache_tab-*
338%{_libdir}/elixir-*
339%{_libdir}/esip-*
340%{_libdir}/ezlib-*
341%{_libdir}/fast_tls-*
342%{_libdir}/fast_xml-*
343%{_libdir}/fast_yaml-*
344%{_libdir}/goldrush-*
345%{_libdir}/iconv-*
346%{_libdir}/jiffy-*
347%{_libdir}/lager-*
348%{_libdir}/luerl-*
349%{_libdir}/p1_mysql-*
350%{_libdir}/p1_oauth2-*
351%{_libdir}/p1_pgsql-*
352%{_libdir}/p1_utils-*
353%{_libdir}/p1_xmlrpc-*
354%{_libdir}/rebar_elixir_plugin-*
355%{_libdir}/stringprep-*
356%{_libdir}/stun-*
fb70a56e 357%dir %attr(770,root,jabber) /var/lib/ejabberd
fcf4c7a2 358%ghost %attr(400,jabber,jabber) %ghost %config(noreplace) %verify(not md5 mtime size) /var/lib/ejabberd/.erlang.cookie
d798517a
JK
359%attr(754,root,root) /etc/rc.d/init.d/%{name}
360%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
67271627 361%{systemdunitdir}/%{name}.service
f20002e6 362/etc/logrotate.d/%{name}
cba58599 363
61f3ef21 364%if %{with logdb}
cba58599 365%files logdb
366%defattr(644,root,root,755)
beed1a42 367%{_libdir}/ejabberd-%{version}/ebin/mod_logdb*
61f3ef21 368%endif
This page took 0.084808 seconds and 4 git commands to generate.