freebsd-ports/security/clamav/Makefile
Renato Botelho 3de94d87f8 - Update to 0.93
This version fixes lock problem reported at ports/122534

Most important changes:
 *libclamav:
   - New logic in scan limits: provides much more efficient protection against
     DoS attacks but also results in different command line and config options
     to clamscan and clamd (see below)
   - New/improved modules: unzip, SIS, cabinet, CHM, SZDD, text normalisator,
     entity converter
   - Improved filetype detection; filetype definitions can be remotely updated
   - Support for .cld containers (which replace .inc directories)
   - Improved pattern matcher and signature formats
   - More efficient scanning of HTML files
   - Many other improvements

 * clamd:
   - NEW CONFIG FILE OPTIONS: MaxScanSize, MaxFileSize, MaxRecursion, MaxFiles
   - ** THE FOLLOWING OPTIONS ARE NO LONGER SUPPORTED **: MailMaxRecursion,
     ArchiveMaxFileSize, ArchiveMaxRecursion, ArchiveMaxFiles,
     ArchiveMaxCompressionRatio, ArchiveBlockMax

 * clamscan:
   - NEW CMDLINE OPTIONS: --max-filesize, --max-scansize
   - REMOVED OPTIONS: --block-max, --max-space, --max-ratio

 * freshclam:
   - NEW CONFIG OPTION CompressLocalDatabase
   - NEW CMDLINE SWITCH --no-warnings
   - main.inc and daily.inc directories are no longer used by ClamAV; please
     remove them manually from your database directory

PR:		ports/122770 [1] (based on)
		ports/122534 [2]
Submitted by:	Michael Scheidell <scheidell@secnap.net> [1]
		Sebastian Inacker <inacker@fmsweb.de> [2]
Security:	http://secunia.com/advisories/29000
2008-04-16 16:05:54 +00:00

192 lines
5.1 KiB
Makefile

# New ports collection makefile for: clamav
# Date created: 15 July 2002
# Whom: markun@onohara.to
#
# $FreeBSD$
#
PORTNAME= clamav
PORTVERSION= 0.93
CATEGORIES= security
MASTER_SITES= SF
MAINTAINER= garga@FreeBSD.org
COMMENT= Command line virus scanner written entirely in C
LIB_DEPENDS= gmp.7:${PORTSDIR}/math/libgmp4
OPTIONS= ARC "Enable arch archives support" On \
ARJ "Enable arj archives support" On \
LHA "Enable lha archives support" On \
UNZOO "Enable zoo archives support" On \
UNRAR "Enable rar archives support" On \
MILTER "Compile the milter interface" Off \
LDAP "libmilter was built with LDAP" Off \
ICONV "Enable ICONV support" Off \
STDERR "Print logs to stderr instead of stdout" Off \
EXPERIMENTAL "Build experimental code" Off
USE_AUTOTOOLS= libtool:15
CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
USE_LDCONFIG= yes
USE_RC_SUBR= clamav-clamd clamav-freshclam
PORTDOCS= *
DBDIR= /var/db/clamav
LOGDIR= /var/log/clamav
RUNDIR= /var/run/clamav
PLIST_SUB+= DBDIR=${DBDIR} LOGDIR=${LOGDIR} RUNDIR=${RUNDIR}
CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS}" \
LDFLAGS="${LDFLAGS}"
CONFIGURE_ARGS= --with-dbdir=${DBDIR} \
--with-zlib=/usr \
--disable-zlib-vcheck \
--disable-clamuko \
--disable-clamav \
--enable-bigstack \
--enable-readdir_r \
--disable-dependency-tracking
CPPFLAGS+= -I${LOCALBASE}/include \
${PTHREAD_CFLAGS}
LDFLAGS+= -L${LOCALBASE}/lib \
${PTHREAD_LIBS}
MAN1= clamconf.1 \
clamscan.1 \
freshclam.1 \
sigtool.1 \
clamdscan.1
MAN5= clamd.conf.5 \
freshclam.conf.5
MAN8= clamd.8 \
clamav-milter.8
CONFLICTS= clamav-devel-[0-9]*
CLAMAVUSER?= clamav
CLAMAVGROUP?= clamav
CLAMAV_CLAMD_SOCKET?= ${RUNDIR}/clamd
CLAMAV_MILTER_SOCKET?= ${RUNDIR}/clmilter.sock
SUB_FILES= pkg-install pkg-deinstall
SUB_LIST+= DBDIR=${DBDIR} \
LOGDIR=${LOGDIR} \
RUNDIR=${RUNDIR} \
CLAMAVUSER=${CLAMAVUSER} \
CLAMAVGROUP=${CLAMAVGROUP} \
CLAMAV_CLAMD_SOCKET=${CLAMAV_CLAMD_SOCKET} \
CLAMAV_MILTER_SOCKET=${CLAMAV_MILTER_SOCKET}
SED_CONF= -E -e 's|^\#?(Example)$$|\#\1|' \
-e 's|^\#?((Update)?LogFile) .*/([a-z]+\.log)$$|\1 ${LOGDIR}/\3|' \
-e 's|^\#?(PidFile) .*/([a-z]+\.pid)$$|\1 ${RUNDIR}/\2|' \
-e 's|^\#?(LocalSocket) .*$$|\1 ${CLAMAV_CLAMD_SOCKET}|' \
-e 's|^\#?(User) .*$$|\1 ${CLAMAVUSER}|' \
-e 's|^\#?(AllowSupplementaryGroups).*$$|\1 yes|' \
-e 's|^\#?(ScanMail).*$$|\1 yes|' \
-e 's|^\#?(DatabaseDirectory) .*$$|\1 ${DBDIR}|' \
-e 's|^\#?(DatabaseOwner) .*$$|\1 ${CLAMAVUSER}|' \
-e 's|^\#?(FixStaleSocket).*$$|\1 yes|' \
-e 's|^\#?(NotifyClamd) .*$$|\1 ${PREFIX}/etc/clamd.conf|'
PLIST_SUB+= CLAMAVUSER=${CLAMAVUSER} \
CLAMAVGROUP=${CLAMAVGROUP}
.include <bsd.port.pre.mk>
.if ${OSVERSION} < 601103
CONFIGURE_ARGS+= --disable-gethostbyname_r
.else
CONFIGURE_ARGS+= --enable-gethostbyname_r
.endif
# This port has a problem with -pthread,
# force to use -lthr until it's not fixed.
.if ${OSVERSION} >= 601000
PTHREAD_LIBS= -lthr
.else
PTHREAD_LIBS= -lpthread
.endif
.if defined(WITH_ARC)
RUN_DEPENDS+= arc:${PORTSDIR}/archivers/arc
.endif
.if defined(WITH_ARJ)
RUN_DEPENDS+= arj:${PORTSDIR}/archivers/arj
.endif
.if defined(WITH_LHA)
RUN_DEPENDS+= lha:${PORTSDIR}/archivers/lha
.endif
.if defined(WITH_UNZOO)
RUN_DEPENDS+= unzoo:${PORTSDIR}/archivers/unzoo
.endif
.if defined(WITH_UNRAR)
PLIST_SUB+= UNRAR=""
.else
PLIST_SUB+= UNRAR="@comment "
CONFIGURE_ARGS+= --disable-unrar
.endif
.if defined(WITH_ICONV)
CONFIGURE_ARGS+=--with-iconv
USE_ICONV= yes
.else
CONFIGURE_ARGS+=--without-iconv
.endif
.if defined(WITH_MILTER)
USE_RC_SUBR+= clamav-milter
.if defined(WITH_LDAP) && exists(${LOCALBASE}/lib/libldap.so)
USE_OPENLDAP= yes
LDFLAGS+= -lldap
.endif
.if !exists(/usr/lib/libmilter.a) || exists(${LOCALBASE}/lib/libmilter.a)
BUILD_DEPENDS+= ${LOCALBASE}/lib/libmilter.a:${PORTSDIR}/mail/sendmail
CONFIGURE_ARGS+= --with-sendmail=${LOCALBASE}/sbin/sendmail
.else
CONFIGURE_ARGS+= --with-sendmail=/usr/sbin/sendmail
.endif
CONFIGURE_ARGS+= --enable-milter
PLIST_SUB+= CLAMAV-MILTER=""
.else
PLIST_SUB+= CLAMAV-MILTER="@comment "
.endif
.if defined(WITH_STDERR)
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-shared_output.c
.endif
.if defined(WITH_EXPERIMENTAL)
CONFIGURE_ARGS+= --enable-experimental
.endif
post-patch:
@${REINPLACE_CMD} -e 's|%%PTHREAD_LIBS%%|${PTHREAD_LIBS}|g' \
${WRKSRC}/${CONFIGURE_SCRIPT}
@${REINPLACE_CMD} -E 's,^(pkgconfigdir = ).*$$,\1$$(prefix)/libdata/pkgconfig,g' \
${WRKSRC}/Makefile.in
@${REINPLACE_CMD} ${SED_CONF} \
${WRKSRC}/etc/clamd.conf \
${WRKSRC}/etc/freshclam.conf
@${REINPLACE_CMD} -e 's|0x100000000|0x100000000ULL|g' \
${WRKSRC}/libclamunrar/unrar.c
pre-install:
@${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
post-install:
@${INSTALL_DATA} ${WRKSRC}/clamav-config.h ${PREFIX}/include
.for c in clamd freshclam
@[ -f ${PREFIX}/etc/${c}.conf ] || \
${CP} ${PREFIX}/etc/${c}.conf.default ${PREFIX}/etc/${c}.conf
.endfor
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}/html
@${INSTALL_DATA} ${WRKSRC}/NEWS ${WRKSRC}/ChangeLog ${DOCSDIR}
@${INSTALL_DATA} ${WRKSRC}/docs/html/* ${DOCSDIR}/html
.endif
@${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
.include <bsd.port.post.mk>