aboutsummaryrefslogtreecommitdiffstats
path: root/security/clamsmtp/Makefile
blob: 979959d5147086a366724e5c2e86cb4d7077870b (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
59
60
61
62
63
64
65
66
67
68
69
# New ports collection makefile for:    clamsmtp
# Date created:     2004-07-29
# Whom:         Cheng-Lung Sung <clsung@dragon2.net>
#
# $FreeBSD$
#

PORTNAME=   clamsmtp
PORTVERSION=    1.9
CATEGORIES= security
MASTER_SITES=   http://memberwebs.com/stef/software/clamsmtp/

MAINTAINER= clsung@FreeBSD.org
COMMENT=    An ClamAV anti-virus SMTP Filter

GNU_CONFIGURE=  yes
USE_GMAKE=  yes
USE_RC_SUBR=    clamsmtpd.sh
SUB_LIST=   CLAMAV_PID_DIR=${CLAMAV_PID_DIR}
SUB_FILES+= pkg-message

CONFIGURE_TARGET=   --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}

CLAMAV_PID_DIR?=    /var/run/clamav

MAN5=       clamsmtpd.conf.5
MAN8=       clamsmtpd.8

PORTDOCS=   README

OPTIONS=    LOCAL_CLAMAV "RUN_DEPEND on security/clamav" on
OPTIONS+=   LOCAL_CLAMAV_DEVEL "RUN_DEPEND on security/clamav-devel" off

.include <bsd.port.pre.mk>

.if defined(WITH_LOCAL_CLAMAV)
RUN_DEPENDS+=   clamav>=0:${PORTSDIR}/security/clamav
.endif

.if defined(WITH_LOCAL_CLAMAV_DEVEL)
RUN_DEPENDS+=   clamav-devel>=0:${PORTSDIR}/security/clamav-devel
.endif

.if defined(WITH_LOCAL_CLAMAV) || defined(WITH_LOCAL_CLAMAV_DEVEL)
SUB_LIST+=  CLAMD=clamd
.else
SUB_LIST+=  CLAMD=
.endif

pre-extract:
.if defined(WITH_LOCAL_CLAMAV) && defined(WITH_LOCAL_CLAMAV_DEVEL)
    @${ECHO_CMD} "Please select only one clamav port"
    exit 1
.endif

post-patch:
    @${REINPLACE_CMD} -e "s,%%PTHREAD_LIBS%%,${PTHREAD_LIBS}," ${WRKSRC}/configure

post-install:
    @${INSTALL_DATA} ${WRKSRC}/doc/clamsmtpd.conf ${PREFIX}/etc/clamsmtpd.conf-sample
.if !defined(NOPORTDOCS)
    @${MKDIR} ${DOCSDIR}
    ${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}
.endif
    @${MKDIR} ${EXAMPLESDIR}
    ${INSTALL_SCRIPT} ${WRKSRC}/scripts/virus_action.sh ${EXAMPLESDIR}
    @${CAT} ${PKGMESSAGE}

.include <bsd.port.post.mk>