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