# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils MY_P=${P/_rc*/-rc1} DESCRIPTION="This software block SMTP sessions used by e-mail worms and viruses on the NA(P)T router. It depends on netfilter framework of Linux, or ipfw on FreeBSD." HOMEPAGE="http://smtp-proxy.klolik.org/" SRC_URI="http://smtp-proxy.klolik.org/${MY_P}.tar.gz" LICENSE="GPL-2" SLOT="0" IUSE="nat econnreset clamav spamassassin debug" KEYWORDS="~x86" DEPEND="virtual/libc clamav? ( app-antivirus/clamav ) spamassassin? ( mail-filter/spamassassin )" pkg_setup() { # setup smtp-gated user and group enewgroup smtp-gated enewuser smtp-gated -1 -1 /dev/null smtp-gated } src_unpack() { unpack ${MY_P}.tar.gz || die } src_compile() { cd ${WORKDIR}/${MY_P} econf \ --disable-chunking \ $(use_enable nat) \ $(use_enable econnreset silent-econnreset) \ $(use_enable debug debugger) || die emake || die } src_install() { cd ${WORKDIR}/${MY_P} make DESTDIR=${D} install || die dodoc AUTHORS COPYING ChangeLog INSTALL NEWS README README.PL TODO docinto examples dodoc lib/fixed.conf lib/nat.conf newinitd "${FILESDIR}/smtp-gated.initd" smtp-gated insinto /etc/conf.d newins "${FILESDIR}/smtp-gated.confd" smtp-gated insinto /etc newins "${FILESDIR}/smtp-gated.conf" smtp-gated.conf dodir /var/run/smtp-gated fowners smtp-gated:smtp-gated /var/run/smtp-gated/ dodir /var/spool/smtp-gated/{msg,lock} fperms 750 /var/spool/smtp-gated/{msg,lock} fowners smtp-gated:smtp-gated /var/spool/smtp-gated/ fowners smtp-gated:smtp-gated /var/spool/smtp-gated/{msg,lock} } pkg_postinst() { # setup smtp-gated user and group enewgroup smtp-gated enewuser smtp-gated -1 -1 /dev/null smtp-gated if ! use clamav; then einfo "" einfo "If you want to use smtp-gated with clamav you should add" einfo "clamav user to smtp-gated group using command" einfo "gpasswd -a clamav smtp-gated" einfo "" fi }