0533f35c930cb0d64b798ffe439ab1fc1db4617b
[gentoo.git] /
1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 MODULE_AUTHOR=DANBORN
7 MODULE_VERSION=1.03
8 inherit perl-module
9
10 DESCRIPTION="SpamAssassin plugin to score mail based on Google blocklists"
11
12 LICENSE="Apache-2.0"
13 SLOT="0"
14 KEYWORDS="~amd64 ~x86 ~ppc"
15 IUSE="test"
16
17 RDEPEND="dev-perl/Net-Google-SafeBrowsing-Blocklist
18                  dev-perl/Net-Google-SafeBrowsing-UpdateRequest
19                  mail-filter/spamassassin"
20 DEPEND="${RDEPEND}
21                 test? ( dev-perl/Test-Pod )"
22
23 SRC_TEST="do"
24
25 src_install() {
26         perl-module_src_install
27         insinto /etc/mail/spamassassin
28         doins "${FILESDIR}"/init_google_safebrowsing.pre
29         doins "${FILESDIR}"/24_google_safebrowsing.cf
30         insinto /etc/cron.d/
31         newins "${FILESDIR}"/update_google_safebrowsing.cron update_google_safebrowsing
32         dosbin "${FILESDIR}"/update_google_safebrowsing.sh
33         keepdir /var/lib/spamassassin/google_safebrowsing/
34 }
35
36 pkg_postinst() {
37         if [[ -f ${ROOT}/etc/cron.d/update_google_safebrowsing.sh ]]; then
38                 ewarn "You MUST remove ${ROOT}/etc/cron.d/update_google_safebrowsing.sh"
39         fi
40         elog "To use this package:"
41         elog "1. You MUST apply for a free apikey at:"
42         elog "   https://code.google.com/apis/safebrowsing/key_signup.html"
43         elog "2. Place the key into /etc/mail/spamassassin/24_google_safebrowsing.cf"
44         elog "3. Manually run the script /usr/sbin/update_google_safebrowsing.sh"
45         elog "4. Enable the plugin by uncommenting the loadplugin entry in"
46         elog "   /etc/mail/spamassassin/init_google_safebrowsing.pre"
47         elog "5. Restart spamd"
48 }