summaryrefslogtreecommitdiff
path: root/mail/spamass-milter/Makefile
blob: cd302a64ebb145eee12d13008c7c626eb24eb75d (plain) (blame)
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
PORTNAME=	spamass-milter
PORTVERSION=	0.4.0
PORTREVISION=	4
CATEGORIES=	mail
MASTER_SITES=	SAVANNAH/spamass-milt

MAINTAINER=	bmah@FreeBSD.org
COMMENT=	Sendmail Milter (mail filter) plugin for SpamAssassin
WWW=		https://savannah.nongnu.org/projects/spamass-milt/

BUILD_DEPENDS=	spamc:mail/spamassassin
RUN_DEPENDS:=	${BUILD_DEPENDS}

LICENSE=	GPLv2

OPTIONS_DEFINE=	LDAP MILTER_PORT DOCS
MILTER_PORT_DESC=	Build against libmilter port

.include <bsd.port.pre.mk>

.if exists(${LOCALBASE}/lib/libldap.so)
WITH_LDAP=yes
.undef WITHOUT_LDAP
.endif

.if ${PORT_OPTIONS:MLDAP}
USE_OPENLDAP=yes
CPPFLAGS+=	-I${LOCALBASE}/include
LDFLAGS+=	-L${LOCALBASE}/lib
.endif

.if ${PORT_OPTIONS:MDOCS}
PORTDOCS=	AUTHORS ChangeLog NEWS README TODO
.endif

USE_RC_SUBR=	spamass-milter
GNU_CONFIGURE=	yes

SUB_FILES=	pkg-message

post-patch:
	@${SED} -e's,%%PREFIX%%,${PREFIX},g' \
		${FILESDIR}/activation.txt > ${WRKDIR}/activation.txt
.if ${PORT_OPTIONS:MLDAP} && ${PORT_OPTIONS:MLDAP}
	@${REINPLACE_CMD} -e 's|-lmilter|-lmilter -lldap|g' ${WRKSRC}/configure
.endif

post-install:
.if ${PORT_OPTIONS:MDOCS}
	${MKDIR} ${STAGEDIR}${DOCSDIR}
	${INSTALL_DATA} ${WRKDIR}/activation.txt ${STAGEDIR}${DOCSDIR}/activation.txt
.for f in ${PORTDOCS}
	${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}${DOCSDIR}
.endfor
.endif

.include "${PORTSDIR}/mail/sendmail/bsd.milter.mk"
.include <bsd.port.post.mk>