summaryrefslogtreecommitdiff
path: root/mail/spamassassin/Makefile
blob: 90cd5bd2ff265eddd44dc9e1ab4e074845f669ab (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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# $NetBSD: Makefile,v 1.10 2002/10/08 16:41:32 heinz Exp $

DISTNAME=	Mail-SpamAssassin-2.42
PKGNAME=	spamassassin-2.42
PKGREVISION=	1
SVR4_PKGNAME=	sa
CATEGORIES=	mail
MASTER_SITES=	${MASTER_SITE_PERL_CPAN:=Mail/}			\
		http://www.spamassassin.org/released/

MAINTAINER=	heinz-sa@netbsd.org
HOMEPAGE=	http://www.spamassassin.org/
COMMENT=	mail filter to identify spam

DEPENDS+=	procmail>=3.22:../../mail/procmail
DEPENDS+=	p5-Net-DNS-[0-9]*:../../net/p5-Net-DNS
DEPENDS+=	p5-HTML-Parser>=3.0:../../www/p5-HTML-Parser
DEPENDS+=	p5-Digest-SHA1-[0-9]*:../../security/p5-Digest-SHA1
DEPENDS+=	p5-MIME-Base64>=2.11:../../converters/p5-MIME-Base64

BUILDLINK_DEPENDS.perl=	perl>=5.6.0
USE_BUILDLINK2=		YES

CONFLICTS=		p5-Mail-SpamAssassin-[1-9]*

GNU_CONFIGURE=		YES
PKG_SYSCONFSUBDIR=	spamassassin

PERL5_CONFIGURE=	NO
MAKE_PARAMS=		SYSCONFDIR="${PKG_SYSCONFDIR}"
PERL5_PACKLIST=		${PERL5_SITEARCH}/auto/Mail/SpamAssassin/.packlist

RCD_SCRIPTS=		spamd
RCD_SCRIPT_SRC.spamd=	${WRKSRC}/spamd/netbsd-rc-script.sh

EGDIR=			${PREFIX}/share/examples/spamassassin
DOCDIR=			${PREFIX}/share/doc/spamassassin
RULESDIR=		${PREFIX}/share/spamassassin

CONF_FILES+=		${EGDIR}/local.cf  ${PKG_SYSCONFDIR}/local.cf
CONF_FILES+=		${PREFIX}/share/spamassassin/user_prefs.template\
			  ${PKG_SYSCONFDIR}/user_prefs.template
SUPPORT_FILES_PERMS+=	${EGDIR}/netbsd_lists.cf			\
			  ${PKG_SYSCONFDIR}/netbsd_lists.cf ${SHAREOWN}	\
			  ${SHAREGRP} ${SHAREMODE}

.include "../../mk/bsd.prefs.mk"
# the 'spamd' RCD_SCRIPT behaves differently if we run NetBSD 1.6 or later
.if ${OS_VERSION:M1.[0-5]*}
INTERPRETER_SUPPORT=NO
.else
INTERPRETER_SUPPORT=YES
.endif
FILES_SUBST+=		INTERPRETER_SUPPORT=${INTERPRETER_SUPPORT}

test:	build
	@cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKEFLAGS} test

pre-configure: perl5-configure

post-configure:
.for f in README lib/Mail/SpamAssassin/Conf.pm spamd/README.spamd-vpopmail
	@${SED} -e "s,/usr/share,${PREFIX}/share,"			\
		-e "s,/etc/mail,${PKG_SYSCONFBASE},g"			\
		${WRKSRC}/${f} > ${WRKSRC}/${f}.fixed &&		\
	  ${MV} ${WRKSRC}/${f}.fixed ${WRKSRC}/${f}
.endfor

pre-install:
	${INSTALL_DATA_DIR} ${EGDIR}
.for d in html masses/lib/Mail spamd sql tools
	${INSTALL_DATA_DIR}  ${DOCDIR}/$d
.endfor
.for f in INSTALL License README TRADEMARK sample-nonspam.txt		\
	  sample-spam.txt sql/README sql/spamassassin.sql		\
	  spamd/README.spamd spamd/README.spamd-vpopmail
	${INSTALL_DATA} ${WRKSRC}/$f ${DOCDIR}/$f
.endfor
	${INSTALL_DATA} ${WRKSRC}/rules/STATISTICS.txt ${DOCDIR}/
	${INSTALL_DATA} ${WRKSRC}/ninjabutton.png ${DOCDIR}/html/
	${INSTALL_DATA} ${WRKSRC}/masses/lib/Mail/ArchiveIterator.pm	\
	  ${DOCDIR}/masses/lib/Mail/ArchiveIterator.pm
	@(cd ${WRKSRC}/masses/;						\
	  for f in *; do						\
	    if ${TEST} -f $$f; then					\
	      if ${TEST} -x $$f ; then					\
		${SED} -e "1s,/usr/bin/perl,${PERL5}," < $$f		\
		  > $${f}.fixed && ${MV} $${f}.fixed $$f &&		\
		  ${CHMOD} +x $$f &&					\
		  ${INSTALL_SCRIPT} $$f ${DOCDIR}/masses/$$f;		\
	      else							\
		${INSTALL_DATA} $$f ${DOCDIR}/masses/$$f;		\
	      fi;							\
	    fi;								\
	  done)
	${INSTALL_DATA} ${WRKSRC}/procmailrc.example ${EGDIR}/procmailrc.example
	${INSTALL_DATA} ${WRKSRC}/rules/local.cf ${EGDIR}/local.cf
	${INSTALL_DATA} ${FILESDIR}/netbsd_lists.cf ${EGDIR}/
.for f in check_whitelist speedtest translation_prep.pl
	@(cd ${WRKSRC}/tools/;						\
	  ${SED} -e "1s,/usr/bin/perl,${PERL5},"			\
		 -e "1s,/usr/local/bin/perl,${PERL5}," < $f		\
	    > ${f}.fixed && ${MV} ${f}.fixed $f;			\
	  ${INSTALL_SCRIPT} $f ${DOCDIR}/tools/$f )
.endfor
	${INSTALL_DATA} ${WRKSRC}/tools/README.speedtest		\
	  ${DOCDIR}/tools/README.speedtest

post-install:
	${CHOWN} ${SHAREOWN} ${RULESDIR}/*
	${CHGRP} ${SHAREGRP} ${RULESDIR}/*

.include "../../lang/perl5/module.mk"
.include "../../mk/bsd.pkg.install.mk"
.include "../../mk/bsd.pkg.mk"