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