]> git.pld-linux.org Git - packages/ejabberd.git/blame - ejabberd.spec
More helpful messages in ejabberd-pack_deps.sh
[packages/ejabberd.git] / ejabberd.spec
CommitLineData
e9f604ed 1#
e2bda3a7
JK
2# TODO:
3# - config migration from old versions
4# - check/udpate the init script
5# - add systemd unit
6
e9f604ed 7# Conditional build:
8%bcond_with pam # PAM authentication support
e2bda3a7 9%bcond_with logdb # enable mod_logdb (server-side message logging)
e9f604ed 10#
eddf5b64 11
12%define realname ejabberd
13
fb70a56e 14Summary: Fault-tolerant distributed Jabber/XMPP server
7abad569 15Summary(pl.UTF-8): Odporny na awarie rozproszony serwer Jabbera/XMPP
cba58599 16Name: %{realname}
e2bda3a7
JK
17Version: 13.10
18Release: 0.1
fb70a56e
JK
19License: GPL
20Group: Applications/Communications
3f2196e7 21Source0: http://www.process-one.net/downloads/ejabberd/%{version}/%{realname}-%{version}.tgz
e2bda3a7 22# Source0-md5: 94ce4fe244ee72771eeafe27209d6d3c
eddf5b64 23Source1: %{realname}.init
24Source2: %{realname}.sysconfig
25Source3: %{realname}.sh
26Source4: %{realname}ctl.sh
27Source5: %{realname}-inetrc
e2bda3a7
JK
28#
29# Archives created with the ejabberd-pack_deps.sh script (in this repo)
30Source10: ejabberd-goldrush-20131108.tar.gz
31# Source10-md5: 3f61708d20fcee2e7d47036cc470f4e9
32Source11: ejabberd-lager-20131111.tar.gz
33# Source11-md5: e0933da9d0462b045f6b9c4bbd320d3e
34Source12: ejabberd-p1_cache_tab-20130515.tar.gz
35# Source12-md5: f2500cffdaff434b354d01eeb24d136d
36Source13: ejabberd-p1_iconv-20130602.tar.gz
37# Source13-md5: ab0118d4097ee756f65fd087265c88ae
38Source14: ejabberd-p1_stringprep-20131113.tar.gz
39# Source14-md5: 282d70c792a78ea9a7415b0b4e65e157
40Source15: ejabberd-p1_tls-20130717.tar.gz
41# Source15-md5: 1211c5d8f0a95b58dfc5fb5bf4e13ded
42Source16: ejabberd-p1_xml-20131017.tar.gz
43# Source16-md5: dc7ebd7ed1ed6340ff0e7739173d4438
44Source17: ejabberd-p1_yaml-20131031.tar.gz
45# Source17-md5: 82d4bb5c5d56ab93a60f5d1c6e583dc1
46Source18: ejabberd-p1_zlib-20130515.tar.gz
47# Source18-md5: a203d9359122ead64966eeb0bd1c8cf7
48Source19: ejabberd-xmlrpc-20130116.tar.gz
49# Source19-md5: 22e02ff7ca174b4ac225005f63da10ad
50Source20: ejabberd-jiffy-20130702.tar.gz
51# Source20-md5: 01b156e97005f07ce8bb46ecf27471ff
52Source21: ejabberd-p1_mysql-20131024.tar.gz
53# Source21-md5: c02921f21ba030357d2cbbbf182af54a
54Source22: ejabberd-p1_pam-20130515.tar.gz
55# Source22-md5: 0ca31094d93dfb047f05c7539136433a
56Source23: ejabberd-p1_pgsql-20130515.tar.gz
57# Source23-md5: 1958be8e59d1b472499ef1bdf8edc1db
58Source24: ejabberd-p1_stun-20130624.tar.gz
59# Source24-md5: 9a1c5ad9b3b95364d3f76446fcf58dc3
60#
eddf5b64 61Patch0: %{realname}-makefile.patch
e2bda3a7
JK
62# not available for 13.10
63#Patch1: %{realname}-vcard-access-get.patch
0d78319d 64# http://www.dp.uz.gov.ua/o.palij/mod_logdb/patch-mod_logdb-2.1.12.diff
e2bda3a7 65Patch2: %{realname}-mod_logdb.patch
3f2196e7 66URL: http://www.ejabberd.im/
fb70a56e 67BuildRequires: autoconf
1a2644b6 68BuildRequires: automake
60c3a68c 69BuildRequires: erlang >= 1:R15B01
6f0d08c1 70BuildRequires: expat-devel >= 1.95
71BuildRequires: openssl-devel
e9f604ed 72%if %{with pam}
73BuildRequires: pam-devel
74%endif
b15a901d 75BuildRequires: rpmbuild(macros) >= 1.268
60c3a68c 76BuildRequires: yaml-devel
01f61704 77BuildRequires: zlib-devel
27b10c8b 78Requires(post): /usr/bin/perl
b15a901d 79Requires(post): jabber-common
0d54398f 80Requires(post): sed >= 4.0
fb70a56e 81Requires(post): textutils
fb70a56e
JK
82Requires(post,preun): /sbin/chkconfig
83Requires: erlang
bb159536 84Requires: expat >= 1.95
27b10c8b 85Requires: rc-scripts
fb70a56e
JK
86BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
87
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
e2bda3a7 107#%%patch1 -p1
9953f9cb 108%if %{with logdb}
e2bda3a7 109%patch2 -p0
9953f9cb 110%endif
fb70a56e
JK
111
112%build
e2bda3a7 113%{__aclocal} -I m4
fb70a56e 114%{__autoconf}
6b419144 115%configure \
5613d9b6
AM
116 %{?with_pam --enable-pam} \
117 --with-openssl=%{_prefix} \
e4f8c955 118 --enable-user=jabber \
e2bda3a7
JK
119 --enable-full-xml \
120 --enable-nif \
121 --enable-odbc \
122 --enable-mysql \
123 --enable-pgsql \
124 %{?with_pam:--enable-pam} \
125 --enable-zlib \
126 --enable-stun \
127 --enable-json \
128 --enable-iconv \
129 --enable-lager
130touch deps/.got
131
132cd deps/p1_iconv
133%configure
134cd ../..
135cd deps/p1_stringprep
136%configure
137cd ../..
138cd deps/p1_tls
139%configure
140cd ../..
141cd deps/p1_xml
142%configure \
143 --enable-nif \
144 --enable-full-xml
145cd ../..
146cd deps/p1_yaml
147%configure
148cd ../..
149cd deps/p1_zlib
150%configure
151cd ../..
152
92a38251 153%{__make} -j1
fb70a56e
JK
154
155%install
156rm -rf $RPM_BUILD_ROOT
eddf5b64 157install -d $RPM_BUILD_ROOT{/var/lib/%{realname},/etc/{sysconfig,rc.d/init.d},%{_sbindir}}
fb70a56e 158
e2bda3a7 159%{__make} install -j1 \
e4f8c955
JK
160 CHOWN_COMMAND=true \
161 O_USER="" \
162 G_USER="" \
27b10c8b 163 DESTDIR=$RPM_BUILD_ROOT
fb70a56e 164
8ce6995f 165sed -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 166install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{realname}
fb70a56e 167
4dea86b0 168chmod u+rw $RPM_BUILD_ROOT%{_sbindir}/%{realname}*
eddf5b64 169sed -e's,@libdir@,%{_libdir},g' %{SOURCE3} > $RPM_BUILD_ROOT%{_sbindir}/%{realname}
d8e4e49a 170sed -e's,@libdir@,%{_libdir},g' %{SOURCE4} > $RPM_BUILD_ROOT%{_sbindir}/%{realname}ctl
27b10c8b 171install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/jabber
fb70a56e 172
5613d9b6
AM
173chmod 755 $RPM_BUILD_ROOT%{_libdir}/ejabberd/priv/lib/*.so
174
e2bda3a7
JK
175rm -rf _doc 2>/dev/null || :
176mv $RPM_BUILD_ROOT%{_docdir}/%{name} _doc
059c0bab 177
fb70a56e
JK
178%clean
179rm -rf $RPM_BUILD_ROOT
180
e2bda3a7
JK
181%pre
182if [ -e /etc/jabber/ejabberd.cfg ] ; then
183 if grep -Eq '^[^#]*access_get' ; then
184 echo "Your 'ejabberd.cfg' config file seems to use 'access_get' option of mod_vcard" >&2
185 echo "this is not supported by this ejabberd version in PLD" >&2
186 exit 1
187 fi
188fi
189
fb70a56e 190%post
0d54398f
ER
191if [ -f %{_sysconfdir}/jabber/secret ] ; then
192 SECRET=`cat %{_sysconfdir}/jabber/secret`
fb70a56e
JK
193 if [ -n "$SECRET" ] ; then
194 echo "Updating component authentication secret in ejabberd config file..."
0d54398f 195 %{__sed} -i -e "s/>secret</>$SECRET</" /etc/jabber/ejabberd.cfg
fb70a56e
JK
196 fi
197fi
198
0d54398f
ER
199if [ ! -f %{_sysconfdir}/jabber/cookie ] ; then
200 echo "Generating erl authentication cookie..."
201 umask 066
202 perl -e 'open R,"/dev/urandom"; read R,$r,16;
203 printf "%02x",ord(chop $r) while($r);' > %{_sysconfdir}/jabber/cookie
7f0fa4be 204fi
205
fb70a56e 206/sbin/chkconfig --add ejabberd
b15a901d 207%service ejabberd restart "ejabberd server"
fb70a56e
JK
208
209%preun
210if [ "$1" = "0" ]; then
b15a901d 211 %service ejabberd stop
fb70a56e
JK
212 /sbin/chkconfig --del ejabberd
213fi
214
215%files
216%defattr(644,root,root,755)
e2bda3a7 217%doc sql _doc/*
fb70a56e 218%attr(755,root,root) %{_sbindir}/*
27b10c8b 219%attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/*
67ffd871 220%attr(770,root,jabber) /var/log/ejabberd
61f3ef21 221%if %{with logdb}
cba58599 222%exclude %{_libdir}/ejabberd/ebin/mod_logdb*
61f3ef21 223%endif
fb70a56e
JK
224%{_libdir}/ejabberd
225%dir %attr(770,root,jabber) /var/lib/ejabberd
eddf5b64 226%attr(754,root,root) /etc/rc.d/init.d/%{realname}
227%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{realname}
cba58599 228
61f3ef21 229%if %{with logdb}
cba58599 230%files logdb
231%defattr(644,root,root,755)
232%{_libdir}/ejabberd/ebin/mod_logdb*
61f3ef21 233%endif
This page took 0.073011 seconds and 4 git commands to generate.