2003-06-25 14:33:31 +02:00
|
|
|
# New ports collection makefile for: clamav-devel
|
|
|
|
# Date created: 13 June 2003
|
|
|
|
# Whom: Rob Evers <rob@debank.tv>
|
2003-01-20 04:41:52 +01:00
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
|
|
|
PORTNAME= clamav
|
2004-02-11 11:39:34 +01:00
|
|
|
PORTVERSION= 20040210
|
2003-01-20 04:41:52 +01:00
|
|
|
CATEGORIES= security
|
2003-09-04 04:53:26 +02:00
|
|
|
MASTER_SITES= http://clamav.sourceforge.net/snapshot/
|
2003-06-25 14:33:31 +02:00
|
|
|
PKGNAMESUFFIX= -devel
|
2004-01-13 17:22:04 +01:00
|
|
|
DISTNAME= ${PORTNAME}${PKGNAMESUFFIX}-${PORTVERSION}
|
2003-06-18 11:43:05 +02:00
|
|
|
|
2003-06-25 14:33:31 +02:00
|
|
|
MAINTAINER= rob@debank.tv
|
2003-05-18 04:40:47 +02:00
|
|
|
COMMENT= Command line virus scanner written entirely in C
|
2003-01-20 04:41:52 +01:00
|
|
|
|
2003-10-21 13:10:15 +02:00
|
|
|
LIB_DEPENDS= gmp.6:${PORTSDIR}/math/libgmp4
|
2003-01-20 04:41:52 +01:00
|
|
|
RUN_DEPENDS= lha:${PORTSDIR}/archivers/lha \
|
|
|
|
unarj:${PORTSDIR}/archivers/unarj \
|
|
|
|
unrar:${PORTSDIR}/archivers/unrar \
|
|
|
|
zoo:${PORTSDIR}/archivers/zoo \
|
|
|
|
arc:${PORTSDIR}/archivers/arc \
|
|
|
|
unzip:${PORTSDIR}/archivers/unzip
|
|
|
|
|
2004-02-11 11:39:34 +01:00
|
|
|
OPTIONS= MILTER "Compile the milter interface" off
|
2003-09-26 14:19:55 +02:00
|
|
|
USE_REINPLACE= yes
|
2003-01-20 04:41:52 +01:00
|
|
|
USE_GMAKE= yes
|
2003-06-11 18:58:37 +02:00
|
|
|
GNU_CONFIGURE= yes
|
2003-06-25 14:33:31 +02:00
|
|
|
CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
|
2003-06-08 18:16:49 +02:00
|
|
|
USE_LIBTOOL= yes
|
|
|
|
INSTALLS_SHLIB= yes
|
2003-01-20 04:41:52 +01:00
|
|
|
|
2003-09-30 20:21:48 +02:00
|
|
|
CONFIGURE_ARGS= --with-dbdir=${DATADIR} \
|
2003-06-26 12:55:19 +02:00
|
|
|
--disable-clamav --enable-bigstack
|
2003-09-04 04:53:26 +02:00
|
|
|
CFLAGS+= -I${LOCALBASE}/include
|
2003-10-21 13:10:15 +02:00
|
|
|
LDFLAGS+= ${PTHREAD_LIBS} -L${LOCALBASE}/lib
|
2003-09-04 04:53:26 +02:00
|
|
|
CONFIGURE_ENV+= LDFLAGS="${LDFLAGS}"
|
2003-01-20 04:41:52 +01:00
|
|
|
|
2003-11-12 22:14:57 +01:00
|
|
|
MAN1= clamscan.1 freshclam.1 sigtool.1 clamdscan.1
|
2003-02-05 14:09:19 +01:00
|
|
|
MAN5= clamav.conf.5
|
2003-11-12 22:14:57 +01:00
|
|
|
MAN8= clamd.8 clamav-milter.8
|
2003-02-05 14:09:19 +01:00
|
|
|
|
2003-10-15 04:32:54 +02:00
|
|
|
CONFLICTS= clamav-0.*
|
|
|
|
|
2003-09-30 20:21:48 +02:00
|
|
|
CLAMAVUSER?= clamav
|
|
|
|
CLAMAVGROUP?= clamav
|
2003-10-03 15:31:26 +02:00
|
|
|
CLAMAV_CLAMD_SOCKET?= /var/run/clamav/clamd
|
2004-01-13 17:22:04 +01:00
|
|
|
CLAMAV_MILTER_SOCKET?= /var/run/clamav/clmilter.sock
|
2003-09-30 05:39:11 +02:00
|
|
|
|
2003-09-30 20:21:48 +02:00
|
|
|
PLIST_SUB+= CLAMAVUSER="${CLAMAVUSER}"
|
|
|
|
PLIST_SUB+= CLAMAVGROUP="${CLAMAVGROUP}"
|
2003-09-30 05:39:11 +02:00
|
|
|
|
|
|
|
SED_SCRIPT= -e 's|%%PREFIX%%|${PREFIX}|g' \
|
2003-10-03 15:31:26 +02:00
|
|
|
-e 's|%%DATADIR%%|${DATADIR}|g' \
|
|
|
|
-e 's|%%CLAMAVUSER%%|${CLAMAVUSER}|g' \
|
|
|
|
-e 's|%%CLAMAVGROUP%%|${CLAMAVGROUP}|g' \
|
|
|
|
-e 's|%%CLAMAV_CLAMD_SOCKET%%|${CLAMAV_CLAMD_SOCKET}|g' \
|
|
|
|
-e 's|%%CLAMAV_MILTER_SOCKET%%|${CLAMAV_MILTER_SOCKET}|g'
|
2003-09-30 05:39:11 +02:00
|
|
|
|
|
|
|
SED_CONF= -E -e 's|^\#?(Example)$$|\#\1|' \
|
|
|
|
-e 's|^\#?(LogFile) .*$$|\1 /var/log/clamav/clamd.log|' \
|
|
|
|
-e 's|^\#?(PidFile) .*$$|\1 /var/run/clamav/clamd.pid|' \
|
|
|
|
-e 's|^\#?(LocalSocket) .*$$|\1 /var/run/clamav/clamd|' \
|
|
|
|
-e 's|^\#?(User) .*$$|\1 ${CLAMAVUSER}|' \
|
2004-01-13 17:22:04 +01:00
|
|
|
-e 's|^\#?(ScanMail)$$|\1|' \
|
|
|
|
-e 's|^\#?(Checks)$$|\#\1|' \
|
|
|
|
-e 's|^\#?(DatabaseDirectory) .*$$|\1 ${DATADIR}|' \
|
|
|
|
-e 's|^\#?(DatabaseOwner) .*$$|\1 ${CLAMAVUSER}|' \
|
|
|
|
-e 's|^\#?(UpdateLogFile) .*$$|\1 /var/log/clamav/freshclam.log|'
|
|
|
|
|
2003-02-05 14:09:19 +01:00
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
|
2004-02-17 01:16:33 +01:00
|
|
|
.if ${OSVERSION} >= 502102
|
|
|
|
FORBIDDEN= "Links against conflicting thread libraries"
|
|
|
|
.endif
|
|
|
|
|
2003-10-03 15:31:26 +02:00
|
|
|
USE_RC_SUBR= yes
|
|
|
|
RC_DIR= ${PREFIX}/etc/rc.d
|
|
|
|
RC_SUFX= .sh
|
|
|
|
SED_SCRIPT+= -e 's|%%RC_SUBR%%|${RC_SUBR}|g' \
|
|
|
|
-e 's|%%RC_DIR%%|${RC_DIR}|g' \
|
|
|
|
-e 's|%%RC_SUFX%%|${RC_SUFX}|g'
|
|
|
|
PLIST_SUB+= RC_DIR=${RC_DIR} \
|
|
|
|
RC_SUFX=${RC_SUFX}
|
|
|
|
|
2003-09-30 05:39:11 +02:00
|
|
|
.if ${OSVERSION} < 501001
|
2003-09-04 04:53:26 +02:00
|
|
|
# compiles only with optimizer
|
|
|
|
CFLAGS+= -O
|
|
|
|
LDFLAGS+= -lcipher
|
|
|
|
.endif
|
|
|
|
|
2003-07-22 15:54:09 +02:00
|
|
|
.if defined(WITH_MILTER)
|
2003-06-25 14:33:31 +02:00
|
|
|
CONFIGURE_ARGS+= --enable-milter
|
|
|
|
PLIST_SUB+= CLAMAV-MILTER:=""
|
|
|
|
.else
|
|
|
|
PLIST_SUB+= CLAMAV-MILTER:="@comment "
|
|
|
|
.endif
|
|
|
|
|
2003-09-26 14:19:55 +02:00
|
|
|
post-patch:
|
|
|
|
@${REINPLACE_CMD} -e 's|-pthread|${PTHREAD_LIBS}|g' ${WRKSRC}/configure
|
|
|
|
@${REINPLACE_CMD} -e 's|/usr/lib/sendmail|/usr/sbin/sendmail|g' \
|
2003-12-22 20:57:25 +01:00
|
|
|
-e 's|<malloc.h>|<stdlib.h>|' \
|
2003-09-26 14:19:55 +02:00
|
|
|
${WRKSRC}/clamav-milter/clamav-milter.c
|
|
|
|
|
2003-09-30 05:39:11 +02:00
|
|
|
post-build:
|
|
|
|
@${SED} ${SED_CONF} ${BUILD_WRKSRC}/etc/clamav.conf \
|
2003-10-03 15:31:26 +02:00
|
|
|
> ${BUILD_WRKSRC}/etc/clamav.conf.default
|
2003-12-30 16:42:38 +01:00
|
|
|
@${SED} ${SED_CONF} ${BUILD_WRKSRC}/etc/freshclam.conf \
|
|
|
|
> ${BUILD_WRKSRC}/etc/freshclam.conf.default
|
2003-10-03 15:31:26 +02:00
|
|
|
@${SED} ${SED_SCRIPT} ${FILESDIR}/clamav-clamd.sh \
|
|
|
|
> ${WRKDIR}/clamav-clamd.sh
|
|
|
|
@${SED} ${SED_SCRIPT} ${FILESDIR}/clamav-milter.sh \
|
|
|
|
> ${WRKDIR}/clamav-milter.sh
|
2004-01-13 17:22:04 +01:00
|
|
|
@${SED} ${SED_SCRIPT} ${FILESDIR}/freshclam.sh > ${WRKDIR}/freshclam.sh
|
2003-09-30 05:39:11 +02:00
|
|
|
|
|
|
|
pre-install:
|
|
|
|
${SETENV} PKG_PREFIX=${PREFIX} \
|
2003-10-03 15:31:26 +02:00
|
|
|
${SH} ${PKGINSTALL} ${PREFIX} PRE-INSTALL
|
2004-01-21 15:41:02 +01:00
|
|
|
.if !defined(NOPORTDOCS)
|
|
|
|
@${MKDIR} ${DOCSDIR}${PKGNAMESUFFIX}
|
2004-01-30 19:45:04 +01:00
|
|
|
@${INSTALL_DATA} ${WRKSRC}/docs/*pdf ${DOCSDIR}${PKGNAMESUFFIX}
|
2004-01-21 15:41:02 +01:00
|
|
|
.endif
|
2003-09-30 05:39:11 +02:00
|
|
|
|
2003-06-18 11:43:05 +02:00
|
|
|
post-install:
|
2003-09-30 05:39:11 +02:00
|
|
|
@[ -f ${PREFIX}/etc/clamav.conf ] || \
|
2004-01-30 19:45:04 +01:00
|
|
|
${CP} ${BUILD_WRKSRC}/etc/clamav.conf.default \
|
2003-10-03 15:31:26 +02:00
|
|
|
${PREFIX}/etc/clamav.conf
|
2004-02-11 11:39:34 +01:00
|
|
|
@[ -f ${PREFIX}/etc/clamav.conf.default ] || \
|
|
|
|
${CP} ${BUILD_WRKSRC}/etc/clamav.conf.default \
|
|
|
|
${PREFIX}/etc/clamav.conf.default
|
2003-12-30 16:42:38 +01:00
|
|
|
@[ -f ${PREFIX}/etc/freshclam.conf ] || \
|
2004-01-30 19:45:04 +01:00
|
|
|
${CP} ${BUILD_WRKSRC}/etc/freshclam.conf.default \
|
2003-12-30 16:42:38 +01:00
|
|
|
${PREFIX}/etc/freshclam.conf
|
2004-02-11 11:39:34 +01:00
|
|
|
@[ -f ${PREFIX}/etc/freshclam.conf.default ] || \
|
|
|
|
${CP} ${BUILD_WRKSRC}/etc/freshclam.conf.default \
|
|
|
|
${PREFIX}/etc/freshclam.conf.default
|
2003-09-30 05:39:11 +02:00
|
|
|
@${CHOWN} -R ${CLAMAVUSER}:${CLAMAVGROUP} ${DATADIR}
|
2003-10-03 15:31:26 +02:00
|
|
|
@${INSTALL_SCRIPT} ${WRKDIR}/clamav-clamd.sh \
|
|
|
|
${RC_DIR}/clamav-clamd${RC_SUFX}
|
2004-01-13 17:22:04 +01:00
|
|
|
@${INSTALL_SCRIPT} ${WRKDIR}/freshclam.sh ${RC_DIR}/freshclam${RC_SUFX}
|
2003-09-26 14:19:55 +02:00
|
|
|
.if defined(WITH_MILTER)
|
2003-10-03 15:31:26 +02:00
|
|
|
@${INSTALL_SCRIPT} ${WRKDIR}/clamav-milter.sh \
|
|
|
|
${RC_DIR}/clamav-milter${RC_SUFX}
|
2003-09-26 14:19:55 +02:00
|
|
|
.endif
|
2003-01-20 04:41:52 +01:00
|
|
|
|
2003-02-05 14:09:19 +01:00
|
|
|
.include <bsd.port.post.mk>
|