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
|
2003-10-15 04:32:54 +02:00
|
|
|
PORTVERSION= 20031014
|
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
|
2003-09-26 19:34:19 +02: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
|
|
|
|
|
|
|
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
|
|
|
|
|
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-09-30 05:39:11 +02:00
|
|
|
LDFLAGS+= ${PTHREAD_LIBS}
|
2003-09-04 04:53:26 +02:00
|
|
|
CONFIGURE_ENV+= LDFLAGS="${LDFLAGS}"
|
2003-01-20 04:41:52 +01:00
|
|
|
|
2003-06-26 12:55:19 +02:00
|
|
|
MAN1= clamscan.1 freshclam.1 sigtool.1 clamdscan.1 clamav-milter.1
|
2003-02-05 14:09:19 +01:00
|
|
|
MAN5= clamav.conf.5
|
|
|
|
MAN8= clamd.8
|
|
|
|
|
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
|
|
|
|
CLAMAV_MILTER_SOCKET?= /var/run/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}|' \
|
|
|
|
-e 's|^\#?(ScanMail)$$|\1|'
|
2003-09-26 19:34:19 +02:00
|
|
|
|
2003-02-05 14:09:19 +01:00
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
|
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' \
|
|
|
|
${WRKSRC}/clamav-milter/clamav-milter.c
|
|
|
|
|
2003-09-30 05:39:11 +02:00
|
|
|
pre-configure:
|
|
|
|
@${REINPLACE_CMD} -e 's|clamav.conf|&.default|' \
|
|
|
|
${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT} \
|
|
|
|
${CONFIGURE_WRKSRC}/etc/Makefile.in
|
|
|
|
|
|
|
|
post-build:
|
|
|
|
@${SED} ${SED_CONF} ${BUILD_WRKSRC}/etc/clamav.conf \
|
2003-10-03 15:31:26 +02:00
|
|
|
> ${BUILD_WRKSRC}/etc/clamav.conf.default
|
|
|
|
@${SED} ${SED_SCRIPT} ${FILESDIR}/clamav-clamd.sh \
|
|
|
|
> ${WRKDIR}/clamav-clamd.sh
|
|
|
|
@${SED} ${SED_SCRIPT} ${FILESDIR}/clamav-milter.sh \
|
|
|
|
> ${WRKDIR}/clamav-milter.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
|
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 ] || \
|
2003-10-03 15:31:26 +02:00
|
|
|
${CP} ${PREFIX}/etc/clamav.conf.default \
|
|
|
|
${PREFIX}/etc/clamav.conf
|
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}
|
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>
|