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