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
|
2005-07-04 19:38:52 +02:00
|
|
|
PORTVERSION= 20050704
|
2003-01-20 04:41:52 +01:00
|
|
|
CATEGORIES= security
|
2005-05-06 10:05:02 +02:00
|
|
|
MASTER_SITES= http://www.clamav.net/snapshot/ \
|
|
|
|
http://www.galle.com.br/~renato/clamav-devel/
|
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-11-04 23:49:52 +01:00
|
|
|
OPTIONS= MILTER "Compile the milter interface" Off \
|
|
|
|
CURL "Support URL downloading" Off
|
2005-05-06 10:05:02 +02:00
|
|
|
|
2003-09-26 14:19:55 +02:00
|
|
|
USE_REINPLACE= yes
|
2003-06-11 18:58:37 +02:00
|
|
|
GNU_CONFIGURE= yes
|
2005-04-12 05:26:56 +02:00
|
|
|
CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
|
2004-06-09 20:04:11 +02:00
|
|
|
USE_AUTOCONF_VER=259
|
2004-10-15 19:32:46 +02:00
|
|
|
USE_AUTOMAKE_VER=19
|
2004-09-02 17:24:16 +02:00
|
|
|
USE_LIBTOOL_VER=15
|
|
|
|
LIBTOOLFILES= acinclude.m4
|
2003-06-08 18:16:49 +02:00
|
|
|
INSTALLS_SHLIB= yes
|
2004-05-03 22:22:55 +02:00
|
|
|
USE_RC_SUBR= yes
|
2003-01-20 04:41:52 +01:00
|
|
|
|
2004-11-04 23:49:52 +01:00
|
|
|
PKGINSTALL= ${WRKDIR}/pkg-install
|
|
|
|
PKGDEINSTALL= ${WRKDIR}/pkg-deinstall
|
|
|
|
|
|
|
|
PORTDOCS= NEWS ChangeLog html
|
|
|
|
|
2004-12-22 03:10:12 +01:00
|
|
|
DBDIR= /var/db/clamav
|
2005-01-27 13:15:27 +01:00
|
|
|
LOGDIR= /var/log/clamav
|
2005-01-12 16:09:51 +01:00
|
|
|
RUNDIR= /var/run/clamav
|
2005-01-27 13:15:27 +01:00
|
|
|
PLIST_SUB+= DBDIR=${DBDIR} LOGDIR=${LOGDIR} RUNDIR=${RUNDIR}
|
2005-01-12 16:09:51 +01:00
|
|
|
|
2004-12-22 03:10:12 +01:00
|
|
|
CONFIGURE_ARGS= --with-dbdir=${DBDIR} \
|
2004-12-03 10:52:20 +01:00
|
|
|
--with-zlib=/usr \
|
2004-12-15 10:57:27 +01:00
|
|
|
--disable-zlib-vcheck \
|
2004-05-03 22:22:55 +02:00
|
|
|
--disable-clamuko \
|
|
|
|
--disable-clamav \
|
|
|
|
--enable-bigstack \
|
2004-11-04 23:49:52 +01:00
|
|
|
--disable-gethostbyname_r \
|
|
|
|
--enable-readdir_r \
|
2004-05-03 22:22:55 +02:00
|
|
|
--disable-dependency-tracking
|
|
|
|
CPPFLAGS+= -I${LOCALBASE}/include
|
2004-09-02 17:24:16 +02:00
|
|
|
CFLAGS+= ${PTHREAD_CFLAGS} -I${LOCALBASE}/include
|
|
|
|
LDFLAGS+= ${PTHREAD_LIBS} -L${LOCALBASE}/lib
|
|
|
|
CONFIGURE_ENV+= CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CPPFLAGS="${CPPFLAGS}"
|
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
|
2004-11-04 23:49:52 +01:00
|
|
|
MAN5= clamd.conf.5 freshclam.conf.5
|
2003-11-12 22:14:57 +01:00
|
|
|
MAN8= clamd.8 clamav-milter.8
|
2003-02-05 14:09:19 +01:00
|
|
|
|
2004-11-04 23:49:52 +01:00
|
|
|
CONFLICTS= clamav-0.[0-9]*
|
2003-10-15 04:32:54 +02:00
|
|
|
|
2003-09-30 20:21:48 +02:00
|
|
|
CLAMAVUSER?= clamav
|
|
|
|
CLAMAVGROUP?= clamav
|
2005-01-12 16:09:51 +01:00
|
|
|
CLAMAV_CLAMD_SOCKET?= ${RUNDIR}/clamd
|
|
|
|
CLAMAV_MILTER_SOCKET?= ${RUNDIR}/clmilter.sock
|
2003-09-30 05:39:11 +02:00
|
|
|
|
|
|
|
SED_SCRIPT= -e 's|%%PREFIX%%|${PREFIX}|g' \
|
2004-12-22 03:10:12 +01:00
|
|
|
-e 's|%%DBDIR%%|${DBDIR}|g' \
|
2005-01-27 13:15:27 +01:00
|
|
|
-e 's|%%LOGDIR%%|${LOGDIR}|g' \
|
2005-01-12 16:09:51 +01:00
|
|
|
-e 's|%%RUNDIR%%|${RUNDIR}|g' \
|
2003-10-03 15:31:26 +02:00
|
|
|
-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|' \
|
2005-01-27 13:15:27 +01:00
|
|
|
-e 's|^\#?((Update)?LogFile) .*/([a-z]+\.log)$$|\1 ${LOGDIR}/\3|' \
|
2005-01-12 16:09:51 +01:00
|
|
|
-e 's|^\#?(PidFile) .*/([a-z]+\.pid)$$|\1 ${RUNDIR}/\2|' \
|
2004-04-20 12:27:53 +02:00
|
|
|
-e 's|^\#?(LocalSocket) .*$$|\1 ${CLAMAV_CLAMD_SOCKET}|' \
|
2003-09-30 05:39:11 +02:00
|
|
|
-e 's|^\#?(User) .*$$|\1 ${CLAMAVUSER}|' \
|
2004-05-03 22:22:55 +02:00
|
|
|
-e 's|^\#?(AllowSupplementaryGroups)$$|\1|' \
|
2004-01-13 17:22:04 +01:00
|
|
|
-e 's|^\#?(ScanMail)$$|\1|' \
|
2004-11-04 23:49:52 +01:00
|
|
|
-e 's|^\#?(NotifyClamd)$$|\1|' \
|
2004-01-13 17:22:04 +01:00
|
|
|
-e 's|^\#?(Checks)$$|\#\1|' \
|
2004-12-22 03:10:12 +01:00
|
|
|
-e 's|^\#?(DatabaseDirectory) .*$$|\1 ${DBDIR}|' \
|
2004-01-13 17:22:04 +01:00
|
|
|
-e 's|^\#?(DatabaseOwner) .*$$|\1 ${CLAMAVUSER}|' \
|
2004-02-18 21:24:40 +01:00
|
|
|
-e 's|^\#?(FixStaleSocket)$$|\1|'
|
2004-01-13 17:22:04 +01:00
|
|
|
|
2004-05-25 01:02:23 +02:00
|
|
|
PLIST_SUB+= CLAMAVUSER=${CLAMAVUSER} \
|
|
|
|
CLAMAVGROUP=${CLAMAVGROUP}
|
|
|
|
|
2003-10-03 15:31:26 +02:00
|
|
|
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}
|
|
|
|
|
2004-05-03 22:22:55 +02:00
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
|
2003-07-22 15:54:09 +02:00
|
|
|
.if defined(WITH_MILTER)
|
2004-05-23 18:50:21 +02:00
|
|
|
.if !exists(/usr/lib/libmilter.a)
|
|
|
|
BUILD_DEPENDS+= ${LOCALBASE}/lib/libmilter.a:${PORTSDIR}/mail/sendmail
|
2004-11-04 23:49:52 +01:00
|
|
|
CONFIGURE_ENV+= SENDMAIL="${LOCALBASE}/sbin/sendmail"
|
|
|
|
.else
|
|
|
|
CONFIGURE_ENV+= SENDMAIL="/usr/sbin/sendmail"
|
2004-05-23 18:50:21 +02:00
|
|
|
.endif
|
2003-06-25 14:33:31 +02:00
|
|
|
CONFIGURE_ARGS+= --enable-milter
|
2004-05-03 22:22:55 +02:00
|
|
|
PLIST_SUB+= CLAMAV-MILTER=""
|
|
|
|
.else
|
|
|
|
PLIST_SUB+= CLAMAV-MILTER="@comment "
|
2003-06-25 14:33:31 +02:00
|
|
|
.endif
|
|
|
|
|
2004-11-04 23:49:52 +01:00
|
|
|
.if defined(WITH_CURL)
|
|
|
|
LIB_DEPENDS+= curl.3:${PORTSDIR}/ftp/curl
|
|
|
|
CONFIGURE_ARGS+= --with-libcurl
|
|
|
|
.else
|
|
|
|
CONFIGURE_ARGS+= --without-libcurl
|
|
|
|
.endif
|
|
|
|
|
|
|
|
pre-configure:
|
2004-10-15 19:32:46 +02:00
|
|
|
@cd ${WRKSRC} && ${ACLOCAL}
|
2003-09-26 14:19:55 +02:00
|
|
|
|
2004-11-04 23:49:52 +01:00
|
|
|
pre-build:
|
|
|
|
@if ${LDCONFIG} -r | ${GREP} -qw -e -lclamav; then \
|
|
|
|
${ECHO_MSG} "===> *** WARNING ***"; \
|
|
|
|
${ECHO_MSG} " Installed version of libclamav found."; \
|
|
|
|
${ECHO_MSG} " This might cause build problems."; \
|
|
|
|
fi
|
|
|
|
|
2003-09-30 05:39:11 +02:00
|
|
|
post-build:
|
2004-11-04 23:49:52 +01:00
|
|
|
@${REINPLACE_CMD} ${SED_CONF} ${BUILD_WRKSRC}/etc/clamd.conf
|
|
|
|
@${REINPLACE_CMD} ${SED_CONF} ${BUILD_WRKSRC}/etc/freshclam.conf
|
|
|
|
@${SED} ${SED_SCRIPT} ${PKGDIR}/pkg-install >${PKGINSTALL}
|
|
|
|
@${SED} ${SED_SCRIPT} ${PKGDIR}/pkg-deinstall >${PKGDEINSTALL}
|
2003-10-03 15:31:26 +02:00
|
|
|
@${SED} ${SED_SCRIPT} ${FILESDIR}/clamav-clamd.sh \
|
2004-11-04 23:49:52 +01:00
|
|
|
>${WRKDIR}/clamav-clamd.sh
|
2004-05-25 01:02:23 +02:00
|
|
|
@${SED} ${SED_SCRIPT} ${FILESDIR}/clamav-freshclam.sh \
|
2004-11-04 23:49:52 +01:00
|
|
|
>${WRKDIR}/clamav-freshclam.sh
|
|
|
|
.if defined(WITH_MILTER)
|
|
|
|
@${SED} ${SED_SCRIPT} ${FILESDIR}/clamav-milter.sh \
|
|
|
|
>${WRKDIR}/clamav-milter.sh
|
|
|
|
.endif
|
2003-09-30 05:39:11 +02:00
|
|
|
|
|
|
|
pre-install:
|
2004-11-04 23:49:52 +01:00
|
|
|
@${SETENV} PKG_PREFIX=${PREFIX} PKG_DESTDIR=${DESTDIR} \
|
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-10-03 15:31:26 +02:00
|
|
|
@${INSTALL_SCRIPT} ${WRKDIR}/clamav-clamd.sh \
|
2004-11-04 23:49:52 +01:00
|
|
|
${DESTDIR}${RC_DIR}/clamav-clamd${RC_SUFX}
|
2004-05-25 01:02:23 +02:00
|
|
|
@${INSTALL_SCRIPT} ${WRKDIR}/clamav-freshclam.sh \
|
2004-11-04 23:49:52 +01:00
|
|
|
${DESTDIR}${RC_DIR}/clamav-freshclam${RC_SUFX}
|
2004-12-22 03:10:12 +01:00
|
|
|
@${CHOWN} -R ${CLAMAVUSER}:${CLAMAVGROUP} ${DESTDIR}${DBDIR}
|
2004-11-04 23:49:52 +01:00
|
|
|
.for c in clamd freshclam
|
|
|
|
@[ -f ${DESTDIR}${PREFIX}/etc/${c}.conf ] || \
|
|
|
|
${CP} ${DESTDIR}${PREFIX}/etc/${c}.conf.default ${DESTDIR}${PREFIX}/etc/${c}.conf
|
|
|
|
.endfor
|
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 \
|
2004-11-04 23:49:52 +01:00
|
|
|
${DESTDIR}${RC_DIR}/clamav-milter${RC_SUFX}
|
|
|
|
.endif
|
|
|
|
.if !defined(NOPORTDOCS)
|
|
|
|
@${MKDIR} ${DESTDIR}${DOCSDIR}
|
|
|
|
@${INSTALL_DATA} ${INSTALL_WRKSRC}/NEWS ${INSTALL_WRKSRC}/ChangeLog \
|
|
|
|
${DESTDIR}${DOCSDIR}
|
|
|
|
@${MKDIR} ${DESTDIR}${DOCSDIR}/html
|
|
|
|
@${INSTALL_DATA} ${INSTALL_WRKSRC}/docs/html/*.* \
|
|
|
|
${DESTDIR}${DOCSDIR}/html
|
2003-09-26 14:19:55 +02:00
|
|
|
.endif
|
2004-11-04 23:49:52 +01:00
|
|
|
@${SETENV} PKG_PREFIX=${PREFIX} PKG_DESTDIR=${DESTDIR} \
|
|
|
|
${SH} ${PKGINSTALL} ${PREFIX} POST-INSTALL
|
2003-01-20 04:41:52 +01:00
|
|
|
|
2003-02-05 14:09:19 +01:00
|
|
|
.include <bsd.port.post.mk>
|