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