# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: $

DESCRIPTION="Bayesian spam filter designed with fast algorithms, and tuned for speed."
HOMEPAGE="http://bogofilter.sourceforge.net/"
SRC_URI="mirror://sourceforge/bogofilter/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86"
IUSE=""

DEPEND="virtual/glibc
	app-text/xmlto 
	>=sys-libs/db-3.2"

RDEPEND="virtual/glibc
	>=sys-libs/db-3.2"

src_install() {
	make DESTDIR=${D} install || die

	exeinto /usr/lib/${PN}/contrib
	doexe contrib/{bogofilter-qfe,bogogrep,mime.get.rfc822,parmtest.sh}
	doexe contrib/{randomtrain,scramble,*.pl}

	insinto /usr/lib/${PN}/contrib
	doins contrib/{README.*,bogo.R,bogogrep.c,dot-qmail-bogofilter-default}
	doins contrib/{trainbogo.sh,*.example}

	dodoc AUTHORS CHANGES* COPYING INSTALL METHODS NEWS README
	dodoc RELEASE.NOTES* TODO doc/{integrating-with-*,*.HOWTO}

	dodir /usr/share/doc/${PF}/samples
	mv ${D}/etc/* ${D}/usr/share/doc/${PF}/samples/
	rmdir ${D}/etc

	dohtml doc/*.html
}
pkg_postinst() {
	einfo "The goal of the bogofilter 0.16 series is to clean out this excess code."
	ewarn "Please read the RELEASE.NOTES-0.16 carefully!"
	einfo ""
	einfo "Contributed tools and documentation is in ${ROOT}usr/lib/${PN}/contrib."
}