]> git.pld-linux.org Git - packages/ejabberd.git/blame - ejabberd.spec
- already included in ejabberd 2.0.0
[packages/ejabberd.git] / ejabberd.spec
CommitLineData
e9f604ed 1#
f7da6ac5
JK
2# TODO:
3# - drop or update logdb bcond (the patch doesn't apply to 2.0.0)
4#
e9f604ed 5# Conditional build:
6%bcond_with pam # PAM authentication support
9953f9cb 7%bcond_with logdb # enable mod_logdb (server-side message logging)
e9f604ed 8#
eddf5b64 9%define _alt_name %{nil}
10%if %{with logdb}
11%define _alt_name -logdb
12%endif
13
14%define realname ejabberd
15
fb70a56e 16Summary: Fault-tolerant distributed Jabber/XMPP server
7abad569 17Summary(pl.UTF-8): Odporny na awarie rozproszony serwer Jabbera/XMPP
eddf5b64 18Name: %{realname}%{_alt_name}
f7da6ac5
JK
19Version: 2.0.0
20Release: 1
fb70a56e
JK
21License: GPL
22Group: Applications/Communications
eddf5b64 23Source0: http://www.process-one.net/en/projects/ejabberd/download/%{version}/%{realname}-%{version}.tar.gz
f7da6ac5 24# Source0-md5: 93b21f2fa0ca6074bd22ab924e7dced8
eddf5b64 25Source1: %{realname}.init
26Source2: %{realname}.sysconfig
27Source3: %{realname}.sh
28Source4: %{realname}ctl.sh
29Source5: %{realname}-inetrc
30Patch0: %{realname}-makefile.patch
31Patch1: %{realname}-config.patch
32Patch2: %{realname}-mod_muc.patch
f7da6ac5 33Patch3: %{realname}-mod_logdb.patch
fc7c8497 34URL: http://ejabberd.jabber.ru/
fb70a56e 35BuildRequires: autoconf
f7da6ac5 36BuildRequires: erlang >= R10B_5
6f0d08c1 37BuildRequires: expat-devel >= 1.95
38BuildRequires: openssl-devel
e9f604ed 39%if %{with pam}
40BuildRequires: pam-devel
41%endif
b15a901d 42BuildRequires: rpmbuild(macros) >= 1.268
01f61704 43BuildRequires: zlib-devel
27b10c8b 44Requires(post): /usr/bin/perl
b15a901d 45Requires(post): jabber-common
0d54398f 46Requires(post): sed >= 4.0
fb70a56e 47Requires(post): textutils
fb70a56e
JK
48Requires(post,preun): /sbin/chkconfig
49Requires: erlang
27b10c8b 50Requires: rc-scripts
eddf5b64 51%if %{with logdb}
52Obsoletes: ejabberd
53Conflicts: ejabberd
54%else
55Obsoletes: ejabberd-logdb
56Conflicts: ejabberd-logdb
57%endif
fb70a56e
JK
58BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
59
60%description
472227c5 61ejabberd is a Free and Open Source fault-tolerant distributed Jabber
62server. It is written mostly in Erlang.
fb70a56e 63
e0166ea5
JR
64%description -l pl.UTF-8
65ejabberd to darmowy, z otwartymi źródłami, odporny na awarie
66rozproszony serwer Jabbera. Jest napisany w większości w Erlangu.
378431cb 67
fb70a56e 68%prep
eddf5b64 69%setup -q -n %{realname}-%{version}
fb70a56e 70%patch0 -p1
8652777e 71%patch1 -p1
e068fa54 72%patch2 -p1
9953f9cb 73%if %{with logdb}
f7da6ac5 74%patch3 -p0
9953f9cb 75%endif
fb70a56e
JK
76
77%build
78cd src
79%{__autoconf}
6b419144 80%configure \
e9f604ed 81 --enable-odbc %{?with_pam --enable-pam}
fb70a56e
JK
82%{__make}
83cd ..
84
85%install
86rm -rf $RPM_BUILD_ROOT
eddf5b64 87install -d $RPM_BUILD_ROOT{/var/lib/%{realname},/etc/{sysconfig,rc.d/init.d},%{_sbindir}}
fb70a56e 88
378431cb 89%{__make} -C src install \
27b10c8b 90 DESTDIR=$RPM_BUILD_ROOT
fb70a56e 91
eddf5b64 92sed -e's,@libdir@,%{_libdir},g' %{SOURCE1} > $RPM_BUILD_ROOT/etc/rc.d/init.d/%{realname}
93install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{realname}
fb70a56e 94
eddf5b64 95sed -e's,@libdir@,%{_libdir},g' %{SOURCE3} > $RPM_BUILD_ROOT%{_sbindir}/%{realname}
96sed -e's,@libdir@,%{_libdir},g' %{SOURCE4} > $RPM_BUILD_ROOT%{_sbindir}/%{realname}ctl
27b10c8b 97install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/jabber
fb70a56e
JK
98
99%clean
100rm -rf $RPM_BUILD_ROOT
101
102%post
0d54398f
ER
103if [ -f %{_sysconfdir}/jabber/secret ] ; then
104 SECRET=`cat %{_sysconfdir}/jabber/secret`
fb70a56e
JK
105 if [ -n "$SECRET" ] ; then
106 echo "Updating component authentication secret in ejabberd config file..."
0d54398f 107 %{__sed} -i -e "s/>secret</>$SECRET</" /etc/jabber/ejabberd.cfg
fb70a56e
JK
108 fi
109fi
110
0d54398f
ER
111if [ ! -f %{_sysconfdir}/jabber/cookie ] ; then
112 echo "Generating erl authentication cookie..."
113 umask 066
114 perl -e 'open R,"/dev/urandom"; read R,$r,16;
115 printf "%02x",ord(chop $r) while($r);' > %{_sysconfdir}/jabber/cookie
7f0fa4be 116fi
117
fb70a56e 118/sbin/chkconfig --add ejabberd
b15a901d 119%service ejabberd restart "ejabberd server"
fb70a56e
JK
120
121%preun
122if [ "$1" = "0" ]; then
b15a901d 123 %service ejabberd stop
fb70a56e
JK
124 /sbin/chkconfig --del ejabberd
125fi
126
127%files
128%defattr(644,root,root,755)
6bc26531 129%doc ChangeLog doc src/odbc/pg.sql src/odbc/mysql.sql src/odbc/mssql.sql
fb70a56e 130%attr(755,root,root) %{_sbindir}/*
27b10c8b 131%attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/*
67ffd871 132%attr(770,root,jabber) /var/log/ejabberd
fb70a56e
JK
133%{_libdir}/ejabberd
134%dir %attr(770,root,jabber) /var/lib/ejabberd
eddf5b64 135%attr(754,root,root) /etc/rc.d/init.d/%{realname}
136%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{realname}
This page took 0.073477 seconds and 4 git commands to generate.