# Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # 2009/04/22 by Daniel Mettler (numlock.ch) inherit perl-module DESCRIPTION="The Heise iX SpamAssassin plugin that computes MD5 checksums of e-mail messages and compares them to those of known spam using DNS queries to a RBL-like name server." HOMEPAGE="http://sourceforge.net/projects/ixhash/" SRC_URI="http://switch.dl.sourceforge.net/sourceforge/ixhash/${P}.tgz" LICENSE="Apache Software License" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="" DEPEND="dev-lang/perl >=mail-filter/spamassassin-3.1.0" RDEPEND="${DEPEND}" S="${WORKDIR}" src_compile() { perlinfo # tell spamassassin where to look for the .pm file # first prepare the plugin_dir variable.. local plugin_dir=${VENDOR_LIB}/Mail/SpamAssassin/Plugin # ..mask all slashes using backslashes as sed doesn't like them plugin_dir=${plugin_dir//\//\\/} # now let's adjust the loadplugin directive accordingly sed -rie "s/^(loadplugin.*)\/etc\/mail\/spamassassin/\1 ${plugin_dir}/" ${P}/iXhash/iXhash.cf } src_install() { perlinfo local plugin_dir=${VENDOR_LIB}/Mail/SpamAssassin/Plugin cd ${P} insinto ${plugin_dir} doins iXhash/iXhash.pm insinto /etc/mail/spamassassin/ doins iXhash/iXhash.cf rm LICENSE WHERE_ARE_THE_OTHER_FILES dodoc CHANGELOG INSTALL README iXhash.eml } pkg_postinst() { echo elog "1. (optional) Adjust the scores given in" elog " /etc/mail/spamassassin/iXhash.cf" elog " if there are too many false positives/negatives" elog "2. (optional) Test the plugin by executing" elog elog " 'spamassassin -D IXHASH < iXhash.eml'" elog elog " where 'iXhash.eml' can be found (as .bz2) in" elog " /usr/share/doc/${P}" elog " The output should show that the plugin is being used and that" elog " generic.ixhash.net is triggered" elog "3. Restart spamassassin to make the plugin work" elog " /etc/init.d/spamd restart" echo }