aboutsummaryrefslogtreecommitdiffstats
path: root/mail/milter-bogom/Makefile
blob: 0d97a755f68aac1709602e204c9ed21782670947 (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
# Created by: Victor Balada Diaz <victor@bsdes.net>
# $FreeBSD$

PORTNAME=   bogom
PORTVERSION=    1.9.2
PORTREVISION=   2
CATEGORIES= mail
MASTER_SITES=   http://www.usebox.net/jjm/bogom/ \
        http://blackshell.usebox.net/bogom/
PKGNAMEPREFIX=  milter-

MAINTAINER= victor@bsdes.net
COMMENT=    Simple sendmail milter to interface bogofilter

RUN_DEPENDS=    bogofilter:${PORTSDIR}/mail/bogofilter

.if !exists(/usr/lib/libmilter.so)
LIB_DEPENDS=    libmilter.so:${PORTSDIR}/mail/sendmail
LDFLAGS+=   -I${LOCALBASE}/include
.endif

MAKE_ARGS=  CPPFLAGS="-DDEF_CONF=\\\"${PREFIX}/etc/bogom.conf\\\"" \
        LIBS="-lmilter -lpthread" LDFLAGS="${LDFLAGS}"

USE_RC_SUBR=    milter-bogom
SUB_FILES=  pkg-message

PLIST_FILES=    sbin/bogom \
        man/man8/bogom.8.gz \
        etc/bogom.conf-example

PORTDOCS=   README CHANGELOG

OPTIONS_DEFINE= DOCS

.include <bsd.port.options.mk>

post-patch:
    ${REINPLACE_CMD} -e 's|/etc|${PREFIX}/etc|g' ${WRKSRC}/bogom.8
    ${REINPLACE_CMD} -e \
        's|/usr/local/bin/bogofilter|${LOCALBASE}/bin/bogofilter|g' \
        ${WRKSRC}/bogom.8 \
        ${WRKSRC}/bogom.conf-example \
        ${WRKSRC}/milter.c

do-install:
    ${INSTALL_PROGRAM} ${WRKSRC}/bogom ${STAGEDIR}${PREFIX}/sbin/
    ${INSTALL_MAN} ${WRKSRC}/bogom.8 ${STAGEDIR}${PREFIX}/man/man8/
    ${INSTALL_DATA} ${WRKSRC}/bogom.conf-example ${STAGEDIR}${PREFIX}/etc/
.if ${PORT_OPTIONS:MDOCS}
    ${MKDIR} ${STAGEDIR}${DOCSDIR}
.for f in ${PORTDOCS}
    ${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}${DOCSDIR}/
.endfor
.endif

.include <bsd.port.mk>