2003-01-20 03:41:52 +00:00
|
|
|
# New ports collection makefile for: clamav
|
|
|
|
# Date created: 15 July 2002
|
|
|
|
# Whom: markun@onohara.to
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
|
|
|
PORTNAME= clamav
|
2007-03-13 20:11:19 +00:00
|
|
|
PORTVERSION= 0.90.1
|
2007-03-16 19:16:32 +00:00
|
|
|
PORTREVISION= 1
|
2003-01-20 03:41:52 +00:00
|
|
|
CATEGORIES= security
|
2006-08-08 11:23:51 +00:00
|
|
|
MASTER_SITES= SF
|
2003-06-18 09:43:05 +00:00
|
|
|
|
2006-04-07 10:07:49 +00:00
|
|
|
MAINTAINER= garga@FreeBSD.org
|
2003-05-18 02:40:47 +00:00
|
|
|
COMMENT= Command line virus scanner written entirely in C
|
2003-01-20 03:41:52 +00:00
|
|
|
|
2006-05-10 14:46:47 +00:00
|
|
|
LIB_DEPENDS= gmp.7:${PORTSDIR}/math/libgmp4
|
2003-01-20 03:41:52 +00:00
|
|
|
RUN_DEPENDS= lha:${PORTSDIR}/archivers/lha \
|
2006-05-24 12:34:22 +00:00
|
|
|
arj:${PORTSDIR}/archivers/arj \
|
2006-05-23 19:21:41 +00:00
|
|
|
unzoo:${PORTSDIR}/archivers/unzoo \
|
2007-02-16 00:19:32 +00:00
|
|
|
arc:${PORTSDIR}/archivers/arc
|
2003-01-20 03:41:52 +00:00
|
|
|
|
2004-10-14 09:30:47 +00:00
|
|
|
OPTIONS= MILTER "Compile the milter interface" Off \
|
2007-02-16 11:20:24 +00:00
|
|
|
LDAP "libmilter was built with LDAP" Off \
|
2005-10-11 23:07:39 +00:00
|
|
|
CURL "Support URL downloading" Off \
|
2007-02-18 16:12:37 +00:00
|
|
|
STDERR "Print logs to stderr instead of stdout" Off \
|
|
|
|
EXPERIMENTAL "Build experimental code" Off
|
2005-10-14 13:40:26 +00:00
|
|
|
|
2005-11-15 06:52:12 +00:00
|
|
|
USE_AUTOTOOLS= libtool:15
|
2005-04-12 03:26:56 +00:00
|
|
|
CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
|
2006-08-08 11:23:51 +00:00
|
|
|
USE_LDCONFIG= yes
|
2006-04-06 15:20:18 +00:00
|
|
|
USE_RC_SUBR= clamav-clamd clamav-freshclam
|
2003-01-20 03:41:52 +00:00
|
|
|
|
2007-02-16 00:19:32 +00:00
|
|
|
PORTDOCS= *
|
2003-09-28 13:29:28 +00:00
|
|
|
|
2004-12-22 02:10:12 +00:00
|
|
|
DBDIR= /var/db/clamav
|
2005-01-27 12:28:08 +00:00
|
|
|
LOGDIR= /var/log/clamav
|
2005-01-12 17:57:58 +00:00
|
|
|
RUNDIR= /var/run/clamav
|
2005-01-27 12:28:08 +00:00
|
|
|
PLIST_SUB+= DBDIR=${DBDIR} LOGDIR=${LOGDIR} RUNDIR=${RUNDIR}
|
2004-12-22 02:10:12 +00:00
|
|
|
|
2007-02-18 16:12:37 +00:00
|
|
|
CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS}" \
|
|
|
|
LDFLAGS="${LDFLAGS}"
|
2004-12-22 02:10:12 +00:00
|
|
|
CONFIGURE_ARGS= --with-dbdir=${DBDIR} \
|
2005-01-30 17:44:03 +00:00
|
|
|
--with-zlib=/usr \
|
2007-02-18 16:12:37 +00:00
|
|
|
--mandir=${MANPREFIX}/man \
|
2005-01-30 17:44:03 +00:00
|
|
|
--disable-zlib-vcheck \
|
2004-04-01 16:36:29 +00:00
|
|
|
--disable-clamuko \
|
|
|
|
--disable-clamav \
|
|
|
|
--enable-bigstack \
|
2004-10-14 09:30:47 +00:00
|
|
|
--disable-gethostbyname_r \
|
|
|
|
--enable-readdir_r \
|
2004-05-26 10:15:19 +00:00
|
|
|
--disable-dependency-tracking
|
2004-04-01 16:36:29 +00:00
|
|
|
CPPFLAGS+= -I${LOCALBASE}/include \
|
|
|
|
${PTHREAD_CFLAGS}
|
|
|
|
LDFLAGS+= -L${LOCALBASE}/lib \
|
|
|
|
${PTHREAD_LIBS}
|
2005-02-09 09:19:54 +00:00
|
|
|
|
2007-02-16 00:19:32 +00:00
|
|
|
MAN1= clamconf.1 \
|
|
|
|
clamscan.1 \
|
|
|
|
freshclam.1 \
|
|
|
|
sigtool.1 \
|
|
|
|
clamdscan.1
|
|
|
|
MAN5= clamd.conf.5 \
|
|
|
|
freshclam.conf.5
|
|
|
|
MAN8= clamd.8 \
|
|
|
|
clamav-milter.8
|
2003-02-05 13:09:19 +00:00
|
|
|
|
2004-07-28 18:15:54 +00:00
|
|
|
CONFLICTS= clamav-devel-[0-9]*
|
2004-05-26 10:15:19 +00:00
|
|
|
|
2004-05-22 06:45:18 +00:00
|
|
|
CLAMAVUSER?= clamav
|
|
|
|
CLAMAVGROUP?= clamav
|
2007-02-16 00:19:32 +00:00
|
|
|
|
2005-01-12 17:57:58 +00:00
|
|
|
CLAMAV_CLAMD_SOCKET?= ${RUNDIR}/clamd
|
|
|
|
CLAMAV_MILTER_SOCKET?= ${RUNDIR}/clmilter.sock
|
2003-10-25 20:52:32 +00:00
|
|
|
|
2006-04-06 15:20:18 +00:00
|
|
|
SUB_FILES= pkg-install pkg-deinstall
|
2007-02-18 16:12:37 +00:00
|
|
|
SUB_LIST+= DBDIR=${DBDIR} \
|
2005-05-13 08:16:40 +00:00
|
|
|
LOGDIR=${LOGDIR} \
|
|
|
|
RUNDIR=${RUNDIR} \
|
|
|
|
CLAMAVUSER=${CLAMAVUSER} \
|
|
|
|
CLAMAVGROUP=${CLAMAVGROUP} \
|
|
|
|
CLAMAV_CLAMD_SOCKET=${CLAMAV_CLAMD_SOCKET} \
|
|
|
|
CLAMAV_MILTER_SOCKET=${CLAMAV_MILTER_SOCKET}
|
2003-09-28 13:29:28 +00:00
|
|
|
|
|
|
|
SED_CONF= -E -e 's|^\#?(Example)$$|\#\1|' \
|
2005-01-27 12:28:08 +00:00
|
|
|
-e 's|^\#?((Update)?LogFile) .*/([a-z]+\.log)$$|\1 ${LOGDIR}/\3|' \
|
2005-01-12 17:57:58 +00:00
|
|
|
-e 's|^\#?(PidFile) .*/([a-z]+\.pid)$$|\1 ${RUNDIR}/\2|' \
|
2004-02-10 14:06:49 +00:00
|
|
|
-e 's|^\#?(LocalSocket) .*$$|\1 ${CLAMAV_CLAMD_SOCKET}|' \
|
2004-05-22 06:45:18 +00:00
|
|
|
-e 's|^\#?(User) .*$$|\1 ${CLAMAVUSER}|' \
|
2007-02-16 11:20:24 +00:00
|
|
|
-e 's|^\#?(AllowSupplementaryGroups).*$$|\1 yes|' \
|
|
|
|
-e 's|^\#?(ScanMail).*$$|\1 yes|' \
|
2004-12-22 02:10:12 +00:00
|
|
|
-e 's|^\#?(DatabaseDirectory) .*$$|\1 ${DBDIR}|' \
|
2004-04-01 16:36:29 +00:00
|
|
|
-e 's|^\#?(DatabaseOwner) .*$$|\1 ${CLAMAVUSER}|' \
|
2007-02-16 11:20:24 +00:00
|
|
|
-e 's|^\#?(FixStaleSocket).*$$|\1 yes|' \
|
2007-02-16 00:19:32 +00:00
|
|
|
-e 's|^\#?(NotifyClamd) .*$$|\1 ${PREFIX}/etc/clamd.conf|'
|
2003-09-28 13:29:28 +00:00
|
|
|
|
2004-04-01 16:36:29 +00:00
|
|
|
PLIST_SUB+= CLAMAVUSER=${CLAMAVUSER} \
|
|
|
|
CLAMAVGROUP=${CLAMAVGROUP}
|
2003-02-05 13:09:19 +00:00
|
|
|
|
2005-02-17 22:57:32 +00:00
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
|
2007-03-16 12:20:45 +00:00
|
|
|
# This port has a problem with -pthread,
|
|
|
|
# force to use -lthr until it's not fixed.
|
|
|
|
.if ${OSVERSION} >= 601000
|
|
|
|
PTHREAD_LIBS= -lthr
|
|
|
|
.endif
|
|
|
|
# Maybe the port is broken for
|
|
|
|
# FreeBSD 5.2.1 since -lc_r
|
|
|
|
# and -pthread have both issues there.
|
|
|
|
.if ${OSVERSION} == 502010
|
2005-08-30 21:47:46 +00:00
|
|
|
PTHREAD_LIBS= -pthread
|
|
|
|
.endif
|
|
|
|
|
2004-03-27 18:30:18 +00:00
|
|
|
.if defined(WITH_MILTER)
|
2006-04-06 15:20:18 +00:00
|
|
|
USE_RC_SUBR+= clamav-milter
|
2007-02-16 11:20:24 +00:00
|
|
|
.if defined(WITH_LDAP) && exists(${LOCALBASE}/lib/libldap.so)
|
2005-02-17 22:57:32 +00:00
|
|
|
USE_OPENLDAP= yes
|
|
|
|
LDFLAGS+= -lldap
|
|
|
|
.endif
|
2007-02-18 16:12:37 +00:00
|
|
|
.if !exists(/usr/lib/libmilter.a) || exists(${LOCALBASE}/lib/libmilter.a)
|
2004-05-20 09:02:07 +00:00
|
|
|
BUILD_DEPENDS+= ${LOCALBASE}/lib/libmilter.a:${PORTSDIR}/mail/sendmail
|
2007-02-18 16:12:37 +00:00
|
|
|
CONFIGURE_ARGS+= --with-sendmail=${LOCALBASE}/sbin/sendmail
|
2004-10-14 09:30:47 +00:00
|
|
|
.else
|
2007-02-18 16:12:37 +00:00
|
|
|
CONFIGURE_ARGS+= --with-sendmail=/usr/sbin/sendmail
|
2004-05-20 09:02:07 +00:00
|
|
|
.endif
|
2003-09-25 02:51:45 +00:00
|
|
|
CONFIGURE_ARGS+= --enable-milter
|
2003-09-28 13:29:28 +00:00
|
|
|
PLIST_SUB+= CLAMAV-MILTER=""
|
2003-07-07 07:37:08 +00:00
|
|
|
.else
|
2003-09-28 13:29:28 +00:00
|
|
|
PLIST_SUB+= CLAMAV-MILTER="@comment "
|
2003-07-07 07:37:08 +00:00
|
|
|
.endif
|
|
|
|
|
2004-10-14 09:30:47 +00:00
|
|
|
.if defined(WITH_CURL)
|
2006-12-13 12:41:35 +00:00
|
|
|
LIB_DEPENDS+= curl.4:${PORTSDIR}/ftp/curl
|
2004-10-14 09:30:47 +00:00
|
|
|
CONFIGURE_ARGS+= --with-libcurl
|
|
|
|
.else
|
|
|
|
CONFIGURE_ARGS+= --without-libcurl
|
|
|
|
.endif
|
|
|
|
|
2006-05-26 16:49:53 +00:00
|
|
|
.if defined(WITH_STDERR)
|
|
|
|
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-shared_output.c
|
|
|
|
.endif
|
|
|
|
|
2007-02-18 16:12:37 +00:00
|
|
|
.if defined(WITH_EXPERIMENTAL)
|
|
|
|
CONFIGURE_ARGS+= --enable-experimental
|
|
|
|
.endif
|
|
|
|
|
2003-09-25 02:51:45 +00:00
|
|
|
post-patch:
|
2007-03-01 16:02:14 +00:00
|
|
|
@${REINPLACE_CMD} -e 's|%%PTHREAD_LIBS%%|${PTHREAD_LIBS}|g' \
|
2007-02-18 16:12:37 +00:00
|
|
|
${WRKSRC}/${CONFIGURE_SCRIPT}
|
|
|
|
@${REINPLACE_CMD} -E 's,^(pkgconfigdir = ).*$$,\1$$(prefix)/libdata/pkgconfig,g' \
|
|
|
|
${WRKSRC}/Makefile.in
|
|
|
|
@${REINPLACE_CMD} -e 's|0x100000000|0x100000000ULL|g' \
|
|
|
|
${WRKSRC}/libclamav/unrar/unrar.c
|
|
|
|
@${REINPLACE_CMD} ${SED_CONF} \
|
|
|
|
${WRKSRC}/etc/clamd.conf \
|
|
|
|
${WRKSRC}/etc/freshclam.conf
|
2003-09-25 02:51:45 +00:00
|
|
|
|
2003-01-20 03:41:52 +00:00
|
|
|
pre-install:
|
2007-02-18 16:12:37 +00:00
|
|
|
@${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
|
2003-06-18 09:43:05 +00:00
|
|
|
|
|
|
|
post-install:
|
2004-10-14 09:30:47 +00:00
|
|
|
.for c in clamd freshclam
|
2007-02-18 16:12:37 +00:00
|
|
|
@[ -f ${PREFIX}/etc/${c}.conf ] || \
|
|
|
|
${CP} ${PREFIX}/etc/${c}.conf.default ${PREFIX}/etc/${c}.conf
|
2004-03-06 20:45:47 +00:00
|
|
|
.endfor
|
|
|
|
.if !defined(NOPORTDOCS)
|
2006-08-08 19:33:04 +00:00
|
|
|
@${MKDIR} ${DOCSDIR}/html
|
2007-02-18 16:12:37 +00:00
|
|
|
@${INSTALL_DATA} ${WRKSRC}/NEWS ${WRKSRC}/ChangeLog ${DOCSDIR}
|
|
|
|
@${INSTALL_DATA} ${WRKSRC}/docs/html/* ${DOCSDIR}/html
|
2003-12-08 14:06:49 +00:00
|
|
|
.endif
|
2007-02-16 00:19:32 +00:00
|
|
|
@${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
|
2003-01-20 03:41:52 +00:00
|
|
|
|
2003-02-05 13:09:19 +00:00
|
|
|
.include <bsd.port.post.mk>
|