b3e4d97bc08a1dbdc279c40ed45a69cee1d433a4
[gentoo.git] / mail-filter / clamassassin / clamassassin-1.2.4.ebuild
1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 DESCRIPTION="Simple spamassassin-like script for virus scanning and filtering e-mail messages"
5 HOMEPAGE="http://jameslick.com/clamassassin/"
6 SRC_URI="http://jameslick.com/clamassassin/${P}.tar.gz"
7 LICENSE="BSD"
8 SLOT="0"
9 KEYWORDS="amd64 ~ppc ~sparc x86"
10 IUSE="subject-rewrite clamd"
11 DEPEND=">=app-antivirus/clamav-0.90
12                 sys-apps/debianutils
13                 sys-apps/which
14                 mail-filter/procmail"
15
16 src_compile() {
17         # Try to get location of clamd's DatabaseDirectory
18         local clamav_dbdir=`awk '$1 == "DatabaseDirectory" { print $2 }' \
19                 /etc/clamd.conf`
20         # If not defined in clamd.conf, go with default
21         if [ -z "$clamav_dbdir" ] ; then
22                 clamav_dbdir="/var/lib/clamav"
23         fi
24         # Add an entry to sandbox write prediction list, so sandbox doesn't complain
25         addpredict ${clamav_dbdir}/
26
27         econf \
28                 $(use_enable subject-rewrite) \
29                 $(use_enable clamd clamdscan) \
30                 || die
31         # Fix problems with Portage exporting TMP and breaking clamassassin. #61806
32         sed -i -e "s:${TMP}:/tmp:" clamassassin
33 }
34
35 src_install() {
36         dobin clamassassin
37         dodoc CHANGELOG README
38 }