# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils DESCRIPTION="milter-regex allows you to filter mail using regular expressions" HOMEPAGE="http://www.benzedrine.cx/milter-regex.html" SRC_URI="http://www.benzedrine.cx/${P}.tar.gz" LICENSE="BSD" SLOT="0" KEYWORDS="~x86" IUSE="milter" DEPEND=">=mail-mta/sendmail-8.13 >=dev-util/yacc-1.9.1" src_unpack() { unpack ${A} cd ${S} epatch ${FILESDIR}/rules.patch || die } src_compile() { cd ${S} || die "could not cd to ${S}" emake -f Makefile.linux milter-regex || die "milter-regex build puked" } src_install() { source ${FILESDIR}/milter-regex-conf cd ${S} || die "could not cd to ${S}" exeinto /usr/bin doexe milter-regex insinto ${CONFIG%/*} newins rules ${CONFIG##*/}.sample keepdir ${SOCKET%/*} newconfd ${FILESDIR}/milter-regex-conf milter-regex newinitd ${FILESDIR}/milter-regex-init milter-regex doman *.8 ewarn "Please look at the example file installed at ${CONFIG}.sample" ewarn "You'll also need to add something like this to your sendmail.mc:" ewarn "INPUT_MAIL_FILTER(\`milter-regex', \`S=unix:${SOCKET}, T=S:30s;R:2m')" } pkg_postinst() { source /etc/conf.d/milter-regex if [[ ! -e ${CONFIG} ]]; then ewarn "You don't have a ${CONFIG}. Copying sample to ${CONFIG}." cp -vp ${CONFIG}.sample ${CONFIG}; fi chown ${USER} ${SOCKET%/*} }