1 Summary: Fault-tolerant distributed Jabber/XMPP server
2 Summary(pl): Odporny na awarie rozproszony serwer Jabbera/XMPP
7 Group: Applications/Communications
8 Source0: http://www.process-one.net/en/projects/ejabberd/download/%{version}/%{name}-%{version}.tar.gz
9 # Source0-md5: 9c349cddb6d0b144c12d277b17ce5e65
11 Source2: %{name}.sysconfig
13 Source4: %{name}ctl.sh
14 Patch0: %{name}-makefile.patch
15 Patch1: %{name}-config.patch
16 Patch3: %{name}-mod_muc.patch
17 URL: http://ejabberd.jabberstudio.org/
18 BuildRequires: autoconf
19 BuildRequires: erlang >= R8B
20 BuildRequires: expat >= 1.95
22 Requires(post): jabber-common
23 Requires(post): textutils
24 Requires(post): /usr/bin/perl
25 Requires(post,preun): /sbin/chkconfig
27 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30 ejabberd is a Free and Open Source fault-tolerant distributed Jabber
31 server. It is written mostly in Erlang.
34 ejabberd to darmowy, z otwartymi ¼ród³ami, odporny na awarie
35 rozproszony serwer Jabbera. Jest napisany w wiêkszo¶ci w Erlangu.
51 rm -rf $RPM_BUILD_ROOT
52 install -d $RPM_BUILD_ROOT{/var/lib/%{name},/etc/{sysconfig,rc.d/init.d},%{_sbindir}}
54 %{__make} -C src install \
55 DESTDIR=$RPM_BUILD_ROOT
57 sed -e's,@libdir@,%{_libdir},g' %{SOURCE1} > $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
58 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
60 sed -e's,@libdir@,%{_libdir},g' %{SOURCE3} > $RPM_BUILD_ROOT/%{_sbindir}/%{name}
61 sed -e's,@libdir@,%{_libdir},g' %{SOURCE4} > $RPM_BUILD_ROOT/%{_sbindir}/%{name}ctl
64 rm -rf $RPM_BUILD_ROOT
67 if [ -f /etc/jabber/secret ] ; then
68 SECRET=`cat /etc/jabber/secret`
69 if [ -n "$SECRET" ] ; then
70 echo "Updating component authentication secret in ejabberd config file..."
71 perl -pi -e "s/>secret</$SECRET/" /etc/jabber/ejabberd.cfg
75 if [ ! -f /etc/jabber/cookie ] ; then
76 echo "Generating erl authentication cookie..."
78 perl -e 'open R,"/dev/urandom"; read R,$r,16;
79 printf "%02x",ord(chop $r) while($r);' > /etc/jabber/cookie
82 /sbin/chkconfig --add ejabberd
83 if [ -r /var/lock/subsys/ejabberd ]; then
84 /etc/rc.d/init.d/ejabberd restart >&2
86 echo "Run \"/etc/rc.d/init.d/ejabberd start\" to start ejabberd server."
90 if [ "$1" = "0" ]; then
91 if [ -r /var/lock/subsys/ejabberd ]; then
92 /etc/rc.d/init.d/ejabberd stop >&2
94 /sbin/chkconfig --del ejabberd
98 %defattr(644,root,root,755)
100 %attr(755,root,root) %{_sbindir}/*
101 %attr(640,root,jabber) %config(noreplace) %verify(not md5 size mtime) /etc/jabber/*
102 %attr(770,root,jabber) /var/log/ejabberd
104 %dir %attr(770,root,jabber) /var/lib/ejabberd
105 %attr(754,root,root) /etc/rc.d/init.d/%{name}
106 %attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/%{name}