aboutsummaryrefslogtreecommitdiffstats
path: root/mail/antivirus-milter/Makefile
blob: 5a7d428331663769ec0e82837a042298fcb24143 (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
# $FreeBSD$

PORTNAME=   antivirus
PORTVERSION=    3.30
PORTREVISION=   6
CATEGORIES= mail
MASTER_SITES=   ${MASTER_SITE_LOCAL}
MASTER_SITE_SUBDIR= dinoex

MAINTAINER= dinoex@FreeBSD.org
COMMENT=    Sendmail milter wich uses McAfee Virus Scan or clamav

LICENSE=    BSD

NO_STAGE=   yes

CFLAGS+=    -Wall ${PTHREAD_CFLAGS:S=""==}
LIBS+=      -lmilter ${PTHREAD_LIBS}
PLIST_SUB+= ANTIVIRUS=${ANTIVIRUS_DIR}
SUB_LIST+=  ANTIVIRUS=${ANTIVIRUS_DIR}
SED_SCRIPT= -e 's|%%ANTIVIRUS%%|${ANTIVIRUS_DIR}|g' \
        -e 's|%%PREFIX%%|${PREFIX}|g'
USE_RC_SUBR=    antivirus-milter

ANTIVIRUS_DIR?= /var/spool/antivirus

.include <bsd.port.pre.mk>

.include "${PORTSDIR}/mail/sendmail/bsd.milter.mk"

.if defined(WITH_SENDMAIL_PORT)
LIBS+=      ${LDFLAGS}
.endif
MAKE_ENV+=  SENDMAILBASE="${MILTERBASE}" \
        SENDMAILOBJ="${MILTERBASE}" \
        LIBS="${LIBS}"

do-configure:
    @${REINPLACE_CMD} -e 's|/etc/mail/antivirus.conf|${LOCALBASE}/etc/antivirus.conf|' \
        ${CONFIGURE_WRKSRC}/antivirus.c
    @${SED} ${SED_SCRIPT} ${FILESDIR}/antivirus.conf \
        > ${WRKSRC}/antivirus.conf
    @${SED} ${SED_SCRIPT} ${FILESDIR}/clamav.conf \
        > ${WRKSRC}/clamav.conf

do-install:
    ${INSTALL_PROGRAM} ${WRKSRC}/antivirus \
        ${PREFIX}/libexec/antivirus
    ${INSTALL_DATA} ${WRKSRC}/antivirus.conf ${PREFIX}/etc/antivirus.conf-dist
    ${INSTALL_DATA} ${WRKSRC}/clamav.conf ${PREFIX}/etc/antivirus.conf-clamav
    ${MKDIR} ${ANTIVIRUS_DIR}/spool ${ANTIVIRUS_DIR}/run ${ANTIVIRUS_DIR}/quarantine
    ${CHOWN} -R nobody:nobody ${ANTIVIRUS_DIR}/
    @${ECHO_MSG} "Add to your *.mc configfile:"
    @${ECHO_MSG} "INPUT_MAIL_FILTER(\`antivirus', \`S=local:${ANTIVIRUS_DIR}/antivirus.sock, F=')"

.include <bsd.port.post.mk>