# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils flag-o-matic DESCRIPTION="clapf is a modular network filter for postfix." HOMEPAGE="http://clapf.acts.hu/" SRC_URI="http://clapf.acts.hu/${PN}-${PV}.tar.gz" LICENSE="ZLIB" SLOT="0" KEYWORDS="~x86" IUSE="clamav mysql cgi rrdtool" DEPEND="clamav? (>=app-antivirus/clamav-0.80) mysql? (>=dev-db/mysql-4 dev-perl/DBD-mysql) rrdtool? (>=net-analyzer/rrdtool) dev-perl/CDB_File >=dev-db/tinycdb-0.74" S=${WORKDIR}/${P} pkg_preinst() { enewgroup clapf enewuser clapf -1 -1 /dev/null clapf } src_unpack() { unpack ${A} cd ${S} epatch ${FILESDIR}/${PV}/gentoo-tinycdb.patch epatch ${FILESDIR}/${PV}/gentoo-config.patch } src_compile() { if use mysql ; then export CPPFLAGS=`mysql_config --include` append-ldflags `mysql_config --libs` einfo "blackhole feature enabled" fi econf --sysconfdir="/etc/mail/clapf" $(use_enable clamav) || die "econf failed" emake || die "emake failed" if use cgi ; then emake cgi fi } src_install() { make DESTDIR=${D} install || die dosbin parsembox spamtest train exeinto /usr/share/${PN}/util doexe util/* if use rrdtool ; then exeinto /usr/share/${PN}/stat doexe stat/* else exeinto /usr/share/${PN}/stat doexe stat/process_syslog.pl fi if use mysql ; then dodir /usr/share/${PN}/blackhole /usr/share/${PN}/sql exeinto /usr/share/${PN}/blackhole doexe blackhole/black.pl blackhole/black.crtab.sh insinto /usr/share/${PN}/sql doins blackhole/blackhole.sql doins TRAINING/tokens.sql fi if use cgi ; then dodir /usr/share/${PN}/web/cgi-bin exeinto /usr/share/${PN}/web/cgi-bin doexe spamcgi cgi insinto /usr/share/${PN}/web doins TRAINING/index.html doins TRAINING/.htaccess doins TRAINING/.htpasswd fi dodir /usr/share/${PN}/util/perl exeinto /usr/share/${PN}/util/perl doexe perl/*.pl insinto /usr/share/${PN}/util/perl doins perl/spam.inc dodir /var/lib/clapf /var/run/clapf keepdir /var/lib/clapf /var/run/clapf fowners clapf:clapf -R /var/lib/clapf /var/run/clapf dodoc README Changelog doc/LICENSE docinto html dohtml doc/html/* doconfd ${FILESDIR}/${PV}/conf.d/clapf doinitd ${FILESDIR}/${PV}/init.d/clapf } pkg_postinst(){ einfo "Now you need create initial database and train antispam filter" einfo "More information you can get here: http://clapf.acts.hu/" }