summaryrefslogtreecommitdiff
blob: a525333e507753941810055c7e78cb408a31f550 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/mail-filter/qmail-scanner/qmail-scanner-1.16-r2.ebuild,v 1.6 2006/02/13 14:42:56 mcummings Exp $

DESCRIPTION="E-Mail virus scanner for qmail."
HOMEPAGE="http://qmail-scanner.sourceforge.net/"
SRC_URI="mirror://sourceforge/qmail-scanner/${P}.tgz"

DEPEND=">=dev-lang/perl-5.6.1-r1
	>=virtual/perl-Time-HiRes-01.20-r2
	>=net-mail/tnef-1.1.1
	>=mail-filter/maildrop-1.3.9
	>=virtual/perl-DB_File-1.803-r2
	|| (
	>=mail-mta/qmail-1.03-r8
	>=mail-mta/qmail-ldap-1.03-r1
	  mail-mta/qmail-mysql
	)
	>=app-arch/unzip-5.42-r1
	virtual/antivirus"

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

inherit fixheadtails

src_unpack() {
	unpack ${A}
	cd ${S}
	ht_fix_file autoupdaters/update_macafee autoupdaters/update_trend autoupdaters/update_sophos configure
}

src_compile () {
	yes | PATH=${PATH}:/opt/f-prot:/opt/vlnx ./configure \
		--domain localhost \
			|| die "./configure failed!"
}

src_install () {
	# Create Directory Structure
	diropts -m 755 -o qmailq -g qmail
	dodir /var/spool/qmailscan
	keepdir /var/spool/qmailscan
	for i in quarantine working archive; do
		for j in tmp new cur; do
			dodir /var/spool/qmailscan/${i}/${j}
			keepdir /var/spool/qmailscan/${i}/${j}
		done
	done

	# Install standard quarantine attachments file
	insinto /var/spool/qmailscan
	insopts -m 644 -o qmailq -g qmail
	doins quarantine-attachments.txt

	# Install qmail-scanner script
	insinto /var/qmail/bin
	insopts -m 4755 -o qmailq -g qmail
	doins qmail-scanner-queue.pl

	# Install documentation
	dodoc README CHANGES COPYING
	dohtml README.html

	# Install the contribs
	docinto contrib
	cd ${S}/contrib
	dodoc spamc-nice.eml
	dodoc test-clamd.pl
	dodoc test-trophie.pl
	dodoc sub-avpdaemon.pl
	dodoc logging_first_80_chars.eml
	dodoc spamc-nasty.eml
	dodoc avpdeamon.init
	dodoc test_installation.sh
	dodoc sub-sender-cache.pl
	dodoc test-sophie.pl
	dodoc reformime-test.eml
}

pkg_postinst () {
	# Setup perlscanner + Version Info
	/var/qmail/bin/qmail-scanner-queue.pl -z
	/var/qmail/bin/qmail-scanner-queue.pl -g

	einfo "To activate qmail-scanner, please edit your"
	einfo "/var/qmail/control/conf-common file and set:"
	einfo "QMAILQUEUE=/var/qmail/bin/qmail-scanner-queue.pl"
}