summaryrefslogtreecommitdiff
path: root/mail/clamav/Makefile
blob: 402b18ca1cb7e15787a70c79ac29443724b3d987 (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
# $NetBSD: Makefile,v 1.23 2004/08/03 11:28:37 tv Exp $

DISTNAME=	clamav-${CLAMAV_VERSION}
PKGNAME=	clamav-${CLAMAV_VERSION:S/-/./}
PKGREVISION=	1
CATEGORIES=	mail
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE:=clamav/}

MAINTAINER=	david@netbsd-fr.org
HOMEPAGE=	http://www.clamav.net/
COMMENT=	Anti-virus toolkit

PKG_INSTALLATION_TYPES=	overwrite pkgviews

CLAMAV_VERSION=		0.75.1

USE_BUILDLINK3=		yes
USE_LIBTOOL=		yes

GNU_CONFIGURE=		yes
CONFIGURE_ARGS+=	--disable-clamav
CONFIGURE_ARGS+=	--sysconfdir=${PKG_SYSCONFDIR}
CONFIGURE_ARGS+=	--with-dbdir=${VIRUSDBDIR}
CONFIGURE_ARGS+=	--with-uid=${CLAMAV_USER}
CONFIGURE_ARGS+=	--with-group=${CLAMAV_GROUP}
CONFIGURE_ARGS+=	--with-tcpwrappers

.include "../../mk/bsd.prefs.mk"

BUILD_DEFS+=	CLAMAV_USER CLAMAV_GROUP
FILES_SUBST+=	CLAMAV_USER=${CLAMAV_USER}
MESSAGE_SUBST+=	CLAMAV_USER=${CLAMAV_USER}

USE_PKGINSTALL=		yes
DEINSTALL_EXTRA_TMPL=	${.CURDIR}/DEINSTALL

RCD_SCRIPTS=	clamd
PKG_GROUPS+=    ${CLAMAV_GROUP}
PKG_USERS+=     ${CLAMAV_USER}:${CLAMAV_GROUP}::Clamav\\ User

VIRUSDBDIR=	${VARBASE}/clamav
EGDIR=		${PREFIX}/share/examples/clamav
FILES_SUBST+=	VIRUSDBDIR=${VIRUSDBDIR}

OWN_DIRS_PERMS=		${VIRUSDBDIR} ${CLAMAV_USER} ${CLAMAV_GROUP} 0775
CONF_FILES=		# empty
CONF_FILES_PERMS=	# empty
.for _file_ in clamav.conf freshclam.conf
CONF_FILES+=		${EGDIR}/${_file_} ${PKG_SYSCONFDIR}/${_file_}
.endfor
.for _file_ in daily.cvd main.cvd
CONF_FILES_PERMS+=	${EGDIR}/${_file_} ${VIRUSDBDIR}/${_file_}	\
			${CLAMAV_USER} ${CLAMAV_GROUP} 0664
.endfor
.undef _file_

INSTALL_MAKE_FLAGS=	${MAKE_FLAGS} CFGINST=${EGDIR} DBINST=${EGDIR}

# Global and legacy options
.if defined(USE_MILTER)
.  if !defined(PKG_OPTIONS.clamav)
.    if defined(USE_MILTER) && !empty(USE_MILTER:M[yY][eE][sS])
PKG_OPTIONS.clamav+=	milter
.    endif
.  endif
.endif

PKG_OPTIONS_VAR=	PKG_OPTIONS.clamav
PKG_SUPPORTED_OPTIONS=	milter
.include "../../mk/bsd.options.mk"

.if !empty(PKG_OPTIONS:Mmilter)
.  include "../../mail/libmilter/buildlink3.mk"
CONFIGURE_ARGS+=	--enable-milter
PLIST_SUBST+=		MILTER=
.else
CONFIGURE_ARGS+=	--disable-milter
# XXX --disable-milter doesn't work as expected, so we need this
CONFIGURE_ENV+=		ac_cv_header_libmilter_mfapi_h=no
PLIST_SUBST+=		MILTER="@comment "
.endif

.include "../../archivers/bzip2/buildlink3.mk"
.include "../../devel/zlib/buildlink3.mk"
.include "../../devel/gmp/buildlink3.mk"
.include "../../security/tcp_wrappers/buildlink3.mk"
.include "../../mk/pthread.buildlink3.mk"

.include "../../mk/bsd.pkg.mk"