# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 inherit eutils DESCRIPTION="The Erlang Jabber Daemon" HOMEPAGE="http://ejabberd.jabber.ru/" #Mirror from jabberstudio is a pain SRC_URI="http://process-one.net/en/projects/ejabberd/download/1.0.0/${P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="x86 ~amd64 ~sparc" IUSE="irc ldap ssl odbc msn oscar yahoo icq postgres" DEPEND=">=dev-libs/expat-1.95 >=dev-lang/erlang-8b ssl? ( >=dev-libs/openssl-0.9.6 ) ldap? ( =net-nds/openldap-2* )" PDEPEND="msn? ( net-im/msn-transport ) oscar? ( net-im/aim-transport ) yahoo? ( net-im/yahoo-transport ) icq? ( net-im/jit ) postgres? ( dev-db/postgresql ) odbc? ( dev-db/unixODBC )" PROVIDE="virtual/jabber-server" S=${WORKDIR}/${P}/src src_compile() { local myconf use irc || myconf="${myconf} --disable-mod_irc" use ldap || myconf="${myconf} --disable-eldap" use ssl || myconf="${myconf} --disable-tls" use odbc && myconf="${myconf} --enable-odbc" use icq && myconf="${myconf} --enable-roster-gateway-workaround" econf ${myconf} || die emake || die "emake failed" } src_install() { local test_group=`grep ^jabber: /etc/group | cut -d: -f1` if [ -z $test_group ] then enewgroup jabber fi local test_user=`grep ^jabber: /etc/passwd | cut -d: -f1` if [ -z $test_user ] then enewuser ejabberd -1 -1 /var/spool/ejabberd jabber fi make DESTDIR=${D} install || die "install failed" # This configuration file contains configurations for all modules, # including ones that were potentially not built due to USE flags, # so we'll have to move it out of the way so it isn't accidentally # used. mv ${D}/etc/ejabberd/ejabberd.cfg ${D}/etc/ejabberd/ejabberd.cfg.example # Database dodir /var/spool/ejabberd fowners ejabberd:jabber /var/spool/ejabberd fperms 700 /var/spool/ejabberd # Home dodir /var/run/ejabberd fowners ejabberd:jabber /var/run/ejabberd # Logs dodir /var/log/ejabberd fowners ejabberd:jabber /var/log/ejabberd cd .. insinto /usr/share/doc/${PF} doins doc/*.txt if use postgres ; then doins src/odbc/pg.sql fi dohtml doc/*.html doc/*.png dobin ${FILESDIR}/ejabberdctl dobin ${FILESDIR}/ejabberd newinitd ${FILESDIR}/ejabberd-1.0.0.initd ejabberd if use ssl ; then insinto /etc/ejabberd doins ${FILESDIR}/self-cert.sh fi newconfd ${FILESDIR}/ejabberd-1.0.0.confd ejabberd # # This file is required to make ejabberd use SRV records for # # server-to-server connections, according to # # # insinto /etc/ejabberd # doins ${FILESDIR}/inetrc } pkg_postinst() { if [ ! -e /etc/ejabberd/ejabberd.cfg ] then einfo "A sample configuration file has been installed in /etc/ejabberd/ejabberd.cfg.example." einfo "Please copy it to /etc/ejabberd/ejabberd.cfg and edit it according to your needs." einfo "For configuration instructions, please see /usr/share/doc/${P}/html/guide.html" fi if use ssl ; then einfo "A script to generate a ssl key has been installed in" einfo "/etc/ejabberd/self-cert.sh . Use it and change the config file to" einfo "point to the full path" fi }