Blob Blame History Raw
Name:           ejabberd
Version:        1.1.3
Release:        7%{?dist}
Summary:        A distributed, fault-tolerant Jabber/XMPP server

Group:          Applications/Internet
License:        GPL
URL:            http://ejabberd.jabber.ru/
Source0:        http://www.process-one.net/en/projects/ejabberd/download/%{version}/ejabberd-%{version}.tar.gz
Source1:        ejabberd.init
Source2:        ejabberd.logrotate
Source3:        inetrc

# http://ejabberd.jabber.ru/ejabberdctl-extra
Source4:        https://svn.process-one.net/ejabberd-modules/mod_ctlextra/trunk/src/mod_ctlextra.erl

# The following were extracted from a patch found on http://realloc.spb.ru/share/ejabberdad.html
Source5:        ejabberd_auth_ad.erl
Source6:        mod_shared_roster_ad.erl
Source7:        mod_vcard_ad.erl

Source8:        ejabberdctl
Source9:        ejabberdctl.pam
Source10:       ejabberdctl.apps

Patch1:         ejabberd-1.1.3-ldapfix.patch

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  expat-devel
BuildRequires:  openssl-devel
BuildRequires:  erlang
BuildRequires:  hevea

Requires:       erlang
Requires:       usermode

Requires(pre): fedora-usermgmt
Requires(post): /sbin/chkconfig
Requires(preun): /sbin/chkconfig
Requires(preun): /sbin/service
Requires(postun): /sbin/service

# don't build on ppc64 since hevea hasn't been built on ppc64 yet
# https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=250253
ExcludeArch: ppc64

%description
ejabberd is a Free and Open Source distributed fault-tolerant
Jabber/XMPP server. It is mostly written in Erlang, and runs on many
platforms (tested on Linux, FreeBSD, NetBSD, Solaris, Mac OS X and
Windows NT/2000/XP).

%package doc
Summary: Documentation for ejabberd
Group: Documentation

%description doc
Documentation for ejabberd.

%pre
/usr/sbin/fedora-groupadd 27 -r ejabberd &>/dev/null || :
/usr/sbin/fedora-useradd  27 -r -s /sbin/nologin -d /var/lib/ejabberd -M \
                             -c 'ejabberd' -g ejabberd ejabberd &>/dev/null || :

%post
/sbin/chkconfig --add ejabberd

%preun
if [ $1 = 0 ]; then
        /sbin/service ejabberd stop >/dev/null 2>&1
        /sbin/chkconfig --del ejabberd
fi

%postun
if [ "$1" -ge "1" ]; then
        /sbin/service ejabberd condrestart >/dev/null 2>&1
fi

%prep
%setup -q

%patch1 -p1

%{__perl} -pi -e "s!/var/lib/ejabberd!%{_libdir}/ejabberd-%{version}!g" src/Makefile.in
%{__perl} -pi -e "s!/etc!%{_sysconfdir}!g" src/Makefile.in
%{__perl} -pi -e "s!\@prefix\@!!g" src/Makefile.in

cp %{S:4} src
cp %{S:5} src
cp %{S:6} src
cp %{S:7} src

%build
pushd src
%configure --enable-odbc
make %{?_smp_mflags}
popd
pushd doc
make html pdf
popd

%install
rm -rf %{buildroot}

pushd src
make install DESTDIR=%{buildroot}
popd

chmod a+x %{buildroot}%{_libdir}/ejabberd-%{version}/priv/lib/*.so

%{__perl} -pi -e 's!./ssl.pem!/etc/ejabberd/ejabberd.pem!g' %{buildroot}/etc/ejabberd/ejabberd.cfg

mkdir -p %{buildroot}/var/log/ejabberd
mkdir -p %{buildroot}/var/lib/ejabberd/spool

mkdir -p %{buildroot}%{_bindir}
ln -s consolehelper %{buildroot}%{_bindir}/ejabberdctl
install -D -p -m 0755 %{S:8} %{buildroot}%{_sbindir}/ejabberdctl
install -D -p -m 0644 %{S:9} %{buildroot}%{_sysconfdir}/pam.d/ejabberdctl
install -D -p -m 0644 %{S:10} %{buildroot}%{_sysconfdir}/security/console.apps/ejabberdctl

mkdir -p %{buildroot}%{_initrddir}
install -p -m 0755 %{S:1} %{buildroot}%{_initrddir}/ejabberd
chmod a+x %{buildroot}%{_initrddir}/ejabberd

mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
cp -p %{S:2} %{buildroot}%{_sysconfdir}/logrotate.d/ejabberd

%{__perl} -pi -e 's!\@libdir\@!%{_libdir}!g' %{buildroot}%{_initrddir}/ejabberd %{buildroot}%{_sysconfdir}/logrotate.d/ejabberd %{buildroot}%{_sbindir}/ejabberdctl
%{__perl} -pi -e 's!\@version\@!%{version}!g' %{buildroot}%{_initrddir}/ejabberd %{buildroot}%{_sysconfdir}/logrotate.d/ejabberd %{buildroot}%{_sbindir}/ejabberdctl

cp %{S:3} %{buildroot}%{_sysconfdir}/ejabberd/inetrc

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%doc COPYING

%attr(750,ejabberd,ejabberd) %dir %{_sysconfdir}/ejabberd
%attr(640,ejabberd,ejabberd) %config(noreplace) %{_sysconfdir}/ejabberd/ejabberd.cfg
%attr(640,ejabberd,ejabberd) %config(noreplace) %{_sysconfdir}/ejabberd/inetrc

%{_initrddir}/ejabberd
%config(noreplace) %{_sysconfdir}/logrotate.d/ejabberd

%config(noreplace) %{_sysconfdir}/pam.d/ejabberdctl
%config(noreplace) %{_sysconfdir}/security/console.apps/ejabberdctl
%{_bindir}/ejabberdctl
%{_sbindir}/ejabberdctl

%dir %{_libdir}/ejabberd-%{version}
%dir %{_libdir}/ejabberd-%{version}/ebin
%{_libdir}/ejabberd-%{version}/ebin/*.app
%{_libdir}/ejabberd-%{version}/ebin/*.beam

%dir %{_libdir}/ejabberd-%{version}/priv

%dir %{_libdir}/ejabberd-%{version}/priv/lib
%{_libdir}/ejabberd-%{version}/priv/lib/*.so

%dir %{_libdir}/ejabberd-%{version}/priv/msgs
%{_libdir}/ejabberd-%{version}/priv/msgs/*.msg

%attr(750,ejabberd,ejabberd) %dir /var/lib/ejabberd
%attr(750,ejabberd,ejabberd) %dir /var/lib/ejabberd/spool

%attr(750,ejabberd,ejabberd) %dir /var/log/ejabberd

%files doc
%defattr(-,root,root,-)
%doc ChangeLog COPYING TODO doc/*.pdf doc/*.html doc/*.png doc/release_notes_*

%changelog
* Tue Jul 31 2007 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.1.3-7
- Bump release and rebuild due to Koji hiccups.

* Tue Jul 31 2007 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.1.3-6
- Don't try building on PPC64 since hevea isn't available on PPC64.

* Tue Jul 31 2007 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.1.3-5
- Sigh...

* Tue Jul 31 2007 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.1.3-4
- Don't forget to add patch.

* Thu Jul 26 2007 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.1.3-3
- Add ejabberdctl (#199873)
- Add patch to fix LDAP authentication. (#248268)
- Add a sleep in init script between stop/start when restarting.
- LSB compliance cleanups for init script. (#246917)
- Don't mention "reload" in the init script usage string. (#227254)

* Tue Jul 24 2007 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.1.3-2
- Update mod_ctlextra

* Fri Feb  2 2007 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.1.3-1
- Update to 1.1.3

* Wed Oct 11 2006 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.1.2-2
- Fix logrotate script (BZ#210366)

* Mon Aug 28 2006 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.1.1-10
- Bump release and rebuild.

* Mon Jul 3 2006 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.1.1-9
- Updated init script - should hopefully fix some problems with status & stop commands.

* Mon Jun 26 2006 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.1.1-8
- Bump release to that tagging works on FC-5.

* Thu Jun 22 2006 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.1.1-7
- Oops drop bad patch.

* Thu Jun 22 2006 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.1.1-6
- Split documentation off to a subpackage.
- Own %{_libdir}/ejabberd-%{version}
- Mark %{_sysconfdir}/logrotate.d/ejabberd as %config

* Thu Jun  8 2006 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.1.1-5
- Patch the makefile so that it adds a soname to shared libs.

* Fri May 26 2006 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.1.1-4
- Modify AD modules not to check for group membership.

* Thu May 25 2006 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.1.1-3
- Add some extra modules

* Wed May 24 2006 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.1.1-2
- Munge Makefile.in a bit more...
- Change ownership/permissions - not *everything* needs to be owned by ejabberd

* Wed May 24 2006 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.1.1-1
- First version for Fedora Extras