]> git.pld-linux.org Git - packages/ejabberd.git/blame - ejabberd.spec
- needs erlang >= R16B03
[packages/ejabberd.git] / ejabberd.spec
CommitLineData
e2bda3a7 1
e9f604ed 2# Conditional build:
3%bcond_with pam # PAM authentication support
046546ef 4%bcond_without logdb # enable mod_logdb (server-side message logging)
c4f8aa56 5%bcond_with weaker_crypto # enable SSLv3
eddf5b64 6
fb70a56e 7Summary: Fault-tolerant distributed Jabber/XMPP server
7abad569 8Summary(pl.UTF-8): Odporny na awarie rozproszony serwer Jabbera/XMPP
d798517a 9Name: ejabberd
f2bb2ec1 10Version: 15.04
9a49bff8 11Release: 1
fb70a56e
JK
12License: GPL
13Group: Applications/Communications
d798517a 14Source0: http://www.process-one.net/downloads/ejabberd/%{version}/%{name}-%{version}.tgz
f2bb2ec1 15# Source0-md5: 0a914f14ccb7f2d0a45e641efed21afd
d798517a
JK
16Source1: %{name}.init
17Source2: %{name}.sysconfig
18Source3: %{name}.service
f20002e6 19Source4: %{name}.logrotate
e2bda3a7
JK
20#
21# Archives created with the ejabberd-pack_deps.sh script (in this repo)
9a49bff8 22Source10: ejabberd-ehyperloglog-20131012.tar.gz
f2bb2ec1
AM
23# Source10-md5: 2cfc1b3aa27657093561a0db353729ef
24Source11: ejabberd-elixir-20150414.tar.gz
25# Source11-md5: 4d8051174896753120d908350afde614
26Source12: ejabberd-esip-20150417.tar.gz
27# Source12-md5: c423d6e3239e61c4ad33a51d42d76ab2
8311848d 28Source13: ejabberd-goldrush-20140123.tar.gz
f2bb2ec1 29# Source13-md5: 6bc03a399ccffa90e28e5652281311de
8311848d 30Source14: ejabberd-jiffy-20150203.tar.gz
f2bb2ec1 31# Source14-md5: 2eba276e4020db79c671ca5a8579e98d
8311848d 32Source15: ejabberd-lager-20150212.tar.gz
f2bb2ec1
AM
33# Source15-md5: ddb1d51fc4571d29670658d00770a75f
34Source16: ejabberd-p1_cache_tab-20150331.tar.gz
35# Source16-md5: bd6c7e0514dd25821c8aa3999d091357
36Source17: ejabberd-p1_iconv-20150406.tar.gz
37# Source17-md5: 4a9a767814bcc7ee6270b9a3565c56b4
8311848d 38Source18: ejabberd-p1_mysql-20150204.tar.gz
f2bb2ec1 39# Source18-md5: 5154bc83d3a2fb48f39758c95d2877bc
8311848d 40Source19: ejabberd-p1_pgsql-20150204.tar.gz
f2bb2ec1 41# Source19-md5: 3d9c26bee05e6ebf242406291ec6018c
8311848d 42Source20: ejabberd-p1_stringprep-20150204.tar.gz
f2bb2ec1
AM
43# Source20-md5: 1a74552cf7be8cb17389a36cb8730f0b
44Source21: ejabberd-p1_stun-20150404.tar.gz
45# Source21-md5: 375244720bf70a8c0ebd0a05f16500b6
46Source22: ejabberd-p1_tls-20150406.tar.gz
47# Source22-md5: e688514472cce3045f5c35836b4871e2
8311848d 48Source23: ejabberd-p1_utils-20150204.tar.gz
f2bb2ec1
AM
49# Source23-md5: aa9c8d70730498b2476bff018a6dc8ef
50Source24: ejabberd-p1_xml-20150415.tar.gz
51# Source24-md5: 7cc0d484fa53705ac18509da38e0cd84
8311848d 52Source25: ejabberd-p1_yaml-20150204.tar.gz
f2bb2ec1 53# Source25-md5: 72a7a6b865b93acdb2d21a3e928bebd7
8311848d 54Source26: ejabberd-p1_zlib-20150223.tar.gz
f2bb2ec1
AM
55# Source26-md5: de707b3a2309870165f0b5949d5f5dd1
56Source27: ejabberd-rebar_elixir_plugin-20150420.tar.gz
57# Source27-md5: 190e4578840a44d4a790b9be92fc345c
e2bda3a7 58#
d798517a
JK
59Patch0: %{name}-paths.patch
60Patch1: %{name}-config.patch
e2bda3a7 61# not available for 13.10
d798517a 62#Patch2: %{name}-vcard-access-get.patch
33af2120 63# http://www.dp.uz.gov.ua/o.palij/mod_logdb/patch-mod_logdb-13.12.diff
d798517a 64Patch3: %{name}-mod_logdb.patch
c4f8aa56 65Patch4: %{name}-no_sslv3_or_3des.patch
3f2196e7 66URL: http://www.ejabberd.im/
fb70a56e 67BuildRequires: autoconf
1a2644b6 68BuildRequires: automake
a306e2ac 69BuildRequires: erlang >= 1:R16B03
6f0d08c1 70BuildRequires: expat-devel >= 1.95
71BuildRequires: openssl-devel
e9f604ed 72%if %{with pam}
73BuildRequires: pam-devel
74%endif
67271627 75BuildRequires: rpmbuild(macros) >= 1.671
60c3a68c 76BuildRequires: yaml-devel
01f61704 77BuildRequires: zlib-devel
8e141538 78BuildRequires: git-core
27b10c8b 79Requires(post): /usr/bin/perl
b15a901d 80Requires(post): jabber-common
0d54398f 81Requires(post): sed >= 4.0
fb70a56e 82Requires(post): textutils
fb70a56e 83Requires(post,preun): /sbin/chkconfig
67271627 84Requires(post,preun,postun): systemd-units >= 38
9a105ba4 85Requires: erlang >= 1:R15B01
bb159536 86Requires: expat >= 1.95
27b10c8b 87Requires: rc-scripts
67271627 88Requires: systemd-units >= 38
028763ab 89Conflicts: logrotate < 3.8.0
fb70a56e
JK
90BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
91
fcf4c7a2
JK
92%define _noautoprovfiles %{_libdir}/%{name}/priv/lib/
93
fb70a56e 94%description
472227c5 95ejabberd is a Free and Open Source fault-tolerant distributed Jabber
96server. It is written mostly in Erlang.
fb70a56e 97
e0166ea5
JR
98%description -l pl.UTF-8
99ejabberd to darmowy, z otwartymi źródłami, odporny na awarie
100rozproszony serwer Jabbera. Jest napisany w większości w Erlangu.
378431cb 101
cba58599 102%package logdb
1a2644b6 103Summary: Server-side logging module
cba58599 104Group: Applications/Communications
105Requires: %{name} = %{version}-%{release}
106
107%description logdb
108Server-side logging module.
109
fb70a56e 110%prep
8311848d 111%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
fb70a56e 112%patch0 -p1
7f71a53c
JK
113%patch1 -p1
114#%%patch2 -p1
9953f9cb 115%if %{with logdb}
046546ef 116%patch3 -p1
9953f9cb 117%endif
c4f8aa56
JK
118%if %{without weaker_crypto}
119%patch4 -p1
120%endif
fb70a56e 121
8e141538
JK
122# Various parts of the build system use 'git describe'
123# which returns nonsense on manual builds using the builder script
124# and which fails on the PLD builders
125# I was not able to locate all 'git describe' invocation, sot let's
126# fool them with this dummy repository
127unset GIT_DIR GIT_WORK_TREE
128git init
d798661f
JK
129git config user.email "dummy@example.com"
130git config user.name "Dummy"
8e141538
JK
131git add configure.ac
132git commit -a -m "dummy commit"
133git tag "%{version}"
fb8f9840 134
fb70a56e 135%build
8e141538 136unset GIT_DIR GIT_WORK_TREE
e2bda3a7 137%{__aclocal} -I m4
fb70a56e 138%{__autoconf}
6b419144 139%configure \
5613d9b6 140 %{?with_pam --enable-pam} \
e4f8c955 141 --enable-user=jabber \
8311848d 142 --enable-elixir \
e2bda3a7
JK
143 --enable-full-xml \
144 --enable-nif \
145 --enable-odbc \
146 --enable-mysql \
147 --enable-pgsql \
148 %{?with_pam:--enable-pam} \
149 --enable-zlib \
e2bda3a7
JK
150 --enable-json \
151 --enable-iconv \
152 --enable-lager
5e08a6fd 153
e2bda3a7
JK
154touch deps/.got
155
156cd deps/p1_iconv
157%configure
158cd ../..
159cd deps/p1_stringprep
160%configure
161cd ../..
162cd deps/p1_tls
163%configure
164cd ../..
165cd deps/p1_xml
166%configure \
167 --enable-nif \
168 --enable-full-xml
169cd ../..
170cd deps/p1_yaml
171%configure
172cd ../..
173cd deps/p1_zlib
174%configure
175cd ../..
c6f5b587
AM
176cd deps/esip
177%configure
178cd ../..
e2bda3a7 179
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
JK
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}
197install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
67271627 198install %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
f20002e6 199install %{SOURCE4} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
fb70a56e 200
d798517a 201chmod u+rw $RPM_BUILD_ROOT%{_sbindir}/%{name}*
fb70a56e 202
5613d9b6
AM
203chmod 755 $RPM_BUILD_ROOT%{_libdir}/ejabberd/priv/lib/*.so
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}/*
fcf4c7a2
JK
323%attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberd-inetrc
324%attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberd.yml
325%attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberdctl.cfg
326# legacy config may still be there
327%attr(640,root,jabber) %ghost %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberd.cfg
028763ab
JK
328%attr(770,root,jabber) /var/log/%{name}
329%attr(770,root,jabber) /var/log/archive/%{name}
61f3ef21 330%if %{with logdb}
cba58599 331%exclude %{_libdir}/ejabberd/ebin/mod_logdb*
61f3ef21 332%endif
fb70a56e
JK
333%{_libdir}/ejabberd
334%dir %attr(770,root,jabber) /var/lib/ejabberd
fcf4c7a2 335%ghost %attr(400,jabber,jabber) %ghost %config(noreplace) %verify(not md5 mtime size) /var/lib/ejabberd/.erlang.cookie
d798517a
JK
336%attr(754,root,root) /etc/rc.d/init.d/%{name}
337%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
67271627 338%{systemdunitdir}/%{name}.service
f20002e6 339/etc/logrotate.d/%{name}
cba58599 340
61f3ef21 341%if %{with logdb}
cba58599 342%files logdb
343%defattr(644,root,root,755)
344%{_libdir}/ejabberd/ebin/mod_logdb*
61f3ef21 345%endif
This page took 0.103304 seconds and 4 git commands to generate.