# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 inherit eutils DESCRIPTION="milter-greylist is a stand-alone milter written in C that implements the greylist filtering method" ##SRC_URI="ftp://ftp.espci.fr/pub/milter-greylist/${P}.tgz" SRC_URI="ftp://ftp.espci.fr/pub/milter-greylist/milter-greylist-4.0b3.tgz" HOMEPAGE="http://hcpnet.free.fr/milter-greylist" DEPEND="virtual/libc mail-mta/sendmail spf? ( >=mail-filter/libspf2-1.2.5-r1 )" SLOT="0" LICENSE="BSD" KEYWORDS="~x86 ~amd64" IUSE="spf dnsrbl geoip curl" S="${WORKDIR}/milter-greylist-4.0b3" pkg_setup() { if [ ! -e /usr/lib/libmilter.a ] ; then ewarn "Sendmail must be compiled with milter support -" ewarn "recompile sendmail with milter USE flag enabled" die "need milter-enabled sendmail" fi } src_compile() { local myconf use spf && { myconf="${myconf} --with-libspf2=/usr/lib" } use dnsrbl && { myconf="${myconf} --enable-dnsrbl" } use geoip && { myconf="${myconf} --with-libGeoIP=/usr/lib" } use curl && { myconf="${myconf} --with-libcurl=/usr/lib" } sed "18s/^/DESC\=\"milter-greylist\"\n/; \ s|DAEMON=/usr/local/bin/$NAME|DAEMON=@BINDIR@/$NAME|; \ s|DOPTIONS=\"-p \$SOCKET -u \$USER -P \$PIDFILE\"|DOPTIONS=\"-p \$SOCKET -u \$USER -P \$PIDFILE \$GREYLIST_OPTS\"|;" rc-gentoo.sh.in > rc-gentoo.sh.in.tmp mv rc-gentoo.sh.in.tmp rc-gentoo.sh.in econf ${myconf} --with-user=smmsp || die emake || die "build error" } src_install () { newinitd rc-gentoo.sh milter-greylist cat > milter-greylist.conf.in <<-EOF # GREYLIST_OPTS: Extra options for milter-greylist daemon" # eg -L 24 GREYLIST_OPTS="" EOF newconfd milter-greylist.conf.in milter-greylist emake DESTDIR=${D} install || die "install error" dodoc ChangeLog README diropts "-o smmsp -m 755" into / keepdir /var/milter-greylist } pkg_postinst() { echo einfo "Read instructions at /usr/share/doc/${P}/README.gz" einfo "to configure milter-greylist." einfo "Insert the following into your sendmail.mc file:" einfo "INPUT_MAIL_FILTER(\`greylist',\`S=local:/var/milter-greylist/milter-greylist.sock,F=, T=S:4m;R:4m')" einfo "define(\`confMILTER_MACROS_CONNECT', \`j, {if_addr}')" einfo "define(\`confMILTER_MACROS_HELO', \`{verify}, {cert_subject}')" einfo "define(\`confMILTER_MACROS_ENVFROM', \`i, {auth_authen}')" einfo "define(\`confMILTER_MACROS_ENVRCPT', \`{greylist}')" }