Changeset View
Changeset View
Standalone View
Standalone View
security/clamav/Makefile
PORTNAME= clamav | PORTNAME= clamav | ||||
PORTVERSION= 0.103.3 | DISTVERSION= 0.104.0 | ||||
PORTEPOCH= 1 | PORTEPOCH= 1 | ||||
CATEGORIES= security | CATEGORIES= security | ||||
MASTER_SITES= https://www.clamav.net/downloads/production/ | MASTER_SITES= https://www.clamav.net/downloads/production/ | ||||
MAINTAINER= yasu@FreeBSD.org | MAINTAINER= yasu@FreeBSD.org | ||||
COMMENT= Command line virus scanner written entirely in C | COMMENT= Command line virus scanner written entirely in C | ||||
LICENSE= GPLv2 | LICENSE= GPLv2 | ||||
LICENSE_FILE= ${WRKSRC}/COPYING | LICENSE_FILE= ${WRKSRC}/COPYING.txt | ||||
LIB_DEPENDS= libcurl.so:ftp/curl \ | LIB_DEPENDS= libcurl.so:ftp/curl \ | ||||
libltdl.so:devel/libltdl \ | libjson-c.so:devel/json-c \ | ||||
libmspack.so:archivers/libmspack | libmspack.so:archivers/libmspack \ | ||||
libpcre2-8.so:devel/pcre2 | |||||
USES= compiler cpe gmake gnome libtool ncurses pathfix pkgconfig ssl | USES= cmake cpe gnome iconv ncurses pkgconfig ssl | ||||
USE_RC_SUBR= clamav-clamd clamav-freshclam | USE_GNOME= libxml2 | ||||
USE_LDCONFIG= yes | USE_LDCONFIG= yes | ||||
USE_RC_SUBR= clamav-clamd clamav-freshclam | |||||
GNU_CONFIGURE= yes | CMAKE_ARGS= -DDATABASE_DIRECTORY:STRING=${_DBDIR} | ||||
INSTALL_TARGET= install-strip | CMAKE_ON= ENABLE_EXTERNAL_MSPACK | ||||
PLIST_SUB+= CLAMAVGROUP=${CLAMAVGROUP} \ | TEST_TARGET= check | ||||
CLAMAVUSER=${CLAMAVUSER} \ | |||||
DBDIR=${DBDIR} \ | |||||
LOGDIR=${LOGDIR} \ | |||||
RUNDIR=${RUNDIR} | |||||
CONFIGURE_ARGS= --disable-dependency-tracking \ | |||||
--enable-bigstack \ | |||||
--enable-clamdtop \ | |||||
--libdir=${PREFIX}/lib \ | |||||
--with-dbdir=${DBDIR} \ | |||||
--with-libcurl=${LOCALBASE} \ | |||||
--with-openssl=${OPENSSLBASE} \ | |||||
--with-system-libmspack=${LOCALBASE}/lib/libmspack.so | |||||
CFLAGS_i386= -march=i486 | |||||
# This port has a problem with -pthread, | |||||
# force to use -lthr until it's not fixed. | |||||
LDFLAGS+= -lthr | |||||
CONFLICTS_INSTALL= clamav-[0-9]* | CONFLICTS_INSTALL= clamav-[0-9]* | ||||
SUB_FILES= pkg-deinstall | SUB_FILES= pkg-message | ||||
SUB_LIST+= CHMOD=${CHMOD} \ | SUB_LIST+= CHMOD=${CHMOD} \ | ||||
CHOWN=${CHOWN} \ | CHOWN=${CHOWN} \ | ||||
CLAMAV_CLAMD_PIDFILE=${CLAMAV_CLAMD_PIDFILE} \ | CLAMAV_CLAMD_PIDFILE=${_CLAMAV_CLAMD_PIDFILE} \ | ||||
CLAMAV_CLAMD_SOCKET=${CLAMAV_CLAMD_SOCKET} \ | CLAMAV_CLAMD_SOCKET=${_CLAMAV_CLAMD_SOCKET} \ | ||||
CLAMAV_MILTER_SOCKET=${CLAMAV_MILTER_SOCKET} \ | CLAMAV_MILTER_SOCKET=${_CLAMAV_MILTER_SOCKET} \ | ||||
CLAMAVGROUP=${CLAMAVGROUP} \ | CLAMAVGROUP=${_CLAMAVGROUP} \ | ||||
CLAMAVUSER=${CLAMAVUSER} \ | CLAMAVUSER=${_CLAMAVUSER} \ | ||||
DBDIR=${DBDIR} \ | DBDIR=${_DBDIR} \ | ||||
LOGDIR=${LOGDIR} \ | LOGDIR=${_LOGDIR} \ | ||||
RUNDIR=${RUNDIR} | RUNDIR=${_RUNDIR} | ||||
PLIST_SUB+= CLAMAVGROUP=${CLAMAVGROUP} \ | USERS= ${_CLAMAVUSER} | ||||
CLAMAVUSER=${CLAMAVUSER} | GROUPS= ${_CLAMAVGROUP} mail | ||||
OPTIONS_DEFINE= ARC ARJ DMG_XAR DOCS EXPERIMENTAL ICONV IPV6 JSON LDAP LHA \ | PLIST_SUB+= CLAMAVGROUP=${_CLAMAVGROUP} \ | ||||
MILTER PCRE STDERR TESTS UNRAR UNZOO | CLAMAVUSER=${_CLAMAVUSER} \ | ||||
DBDIR=${_DBDIR} \ | |||||
LOGDIR=${_LOGDIR} \ | |||||
RUNDIR=${_RUNDIR} | |||||
OPTIONS_DEFAULT= ARC ARJ DMG_XAR JSON MILTER PCRE UNRAR UNZOO | OPTIONS_DEFINE= ARC ARJ DOCS EXPERIMENTAL LHA MILTER STDERR TESTS UNRAR UNZOO | ||||
OPTIONS_DEFAULT= ARC ARJ MILTER UNRAR UNZOO | |||||
OPTIONS_SUB= yes | OPTIONS_SUB= yes | ||||
ARC_DESC= Enable arch archives support | ARC_DESC= Enable arch archives support | ||||
ARJ_DESC= Enable arj archives support | ARJ_DESC= Enable arj archives support | ||||
DMG_XAR_DESC= Enable DMG and XAR archives support | |||||
EXPERIMENTAL_DESC= Build experimental code | EXPERIMENTAL_DESC= Build experimental code | ||||
LHA_DESC= Enable lha archives support | LHA_DESC= Enable lha archives support | ||||
MILTER_DESC= Compile the milter interface | MILTER_DESC= Compile the milter interface | ||||
STDERR_DESC= Print logs to stderr instead of stdout | STDERR_DESC= Print logs to stderr instead of stdout | ||||
TESTS_DESC= Run compile-time tests (req. python) | TESTS_DESC= Build with test enabled (`make test` requires it) | ||||
diizzy: Consider using TEST instead for consistency within the ports tree
https://github. | |||||
UNZOO_DESC= Enable zoo archives support | UNZOO_DESC= Enable zoo archives support | ||||
ARC_RUN_DEPENDS= arc:archivers/arc | ARC_RUN_DEPENDS= arc:archivers/arc | ||||
ARJ_RUN_DEPENDS= arj:archivers/arj | ARJ_RUN_DEPENDS= arj:archivers/arj | ||||
DMG_XAR_CONFIGURE_WITH= xml=${LOCALBASE} | EXPERIMENTAL_CMAKE_BOOL= ENABLE_EXPERIMENTAL | ||||
DMG_XAR_USE= GNOME=libxml2 | |||||
EXPERIMENTAL_CONFIGURE_ENABLE= experimental | |||||
ICONV_CONFIGURE_WITH= iconv | |||||
ICONV_USES= iconv | |||||
IPV6_CONFIGURE_ENABLE= ipv6 | |||||
JSON_CONFIGURE_WITH= libjson=${LOCALBASE} | |||||
JSON_LIB_DEPENDS= libjson-c.so:devel/json-c | |||||
LDAP_LDFLAGS= -lldap -L${LOCALBASE}/lib | |||||
LDAP_USE= OPENLDAP=yes | |||||
LHA_RUN_DEPENDS= lha:archivers/lha | LHA_RUN_DEPENDS= lha:archivers/lha | ||||
MILTER_CONFIGURE_WITH= sendmail=/usr/sbin/sendmail | |||||
MILTER_CONFIGURE_ENABLE= milter | |||||
.if !exists(/usr/lib/libmilter.so) | .if !exists(/usr/lib/libmilter.so) | ||||
MILTER_CFLAGS= -I${LOCALBASE}/include | MILTER_LIB_DEPENDS= libmilter.so:mail/libmilter | ||||
MILTER_LDFLAGS= -L${LOCALBASE}/lib | |||||
MILTER_LIB_DEPENDS+= libmilter.so:mail/libmilter | |||||
.endif | .endif | ||||
MILTER_USE= RC_SUBR=clamav-milter | MILTER_USE= RC_SUBR=clamav-milter | ||||
PCRE_CONFIGURE_WITH= pcre | .if !exists(/usr/lib/libmilter.so) | ||||
PCRE_LIB_DEPENDS= libpcre2-8.so:devel/pcre2 | MILTER_USE+= localbase | ||||
STDERR_EXTRA_PATCHES= ${FILESDIR}/extra-patch-shared_output.c | .endif | ||||
TESTS_CONFIGURE_ENABLE= check | MILTER_CMAKE_BOOL= ENABLE_MILTER | ||||
STDERR_EXTRA_PATCHES= ${FILESDIR}/extra-patch-common_output.c | |||||
TESTS_BUILD_DEPENDS= ${LOCALBASE}/include/check.h:devel/check | TESTS_BUILD_DEPENDS= ${LOCALBASE}/include/check.h:devel/check | ||||
TESTS_USES= python:build | TESTS_USES= python:build | ||||
UNRAR_CONFIGURE_ENABLE= unrar | TESTS_CMAKE_BOOL= ENABLE_TESTS | ||||
UNRAR_CMAKE_BOOL= ENABLE_UNRAR | |||||
UNZOO_RUN_DEPENDS= unzoo:archivers/unzoo | UNZOO_RUN_DEPENDS= unzoo:archivers/unzoo | ||||
CLAMAVUSER?= clamav | _CLAMAVUSER= clamav | ||||
CLAMAVGROUP?= clamav | _CLAMAVGROUP= clamav | ||||
CLAMAV_CLAMD_SOCKET?= ${RUNDIR}/clamd.sock | _CLAMAV_CLAMD_SOCKET?= ${_RUNDIR}/clamd.sock | ||||
CLAMAV_CLAMD_PIDFILE?= ${RUNDIR}/clamd.pid | _CLAMAV_CLAMD_PIDFILE?= ${_RUNDIR}/clamd.pid | ||||
CLAMAV_MILTER_SOCKET?= ${RUNDIR}/clmilter.sock | _CLAMAV_MILTER_SOCKET?= ${_RUNDIR}/clmilter.sock | ||||
.if ${CLAMAVUSER} == "clamav" | _DBDIR= /var/db/clamav | ||||
USERS= clamav | _LOGDIR= /var/log/clamav | ||||
.endif | _RUNDIR= /var/run/clamav | ||||
.if ${CLAMAVGROUP} == "clamav" | _SED_CONF= -E -e 's|^\#?(Example)$$|\#\1|' -e \ | ||||
GROUPS= clamav mail | 's|^\#?((Update)?LogFile) .*/([a-z]+\.log)$$|\1 ${_LOGDIR}/\3|' \ | ||||
.endif | -e 's|^\#?(PidFile) .*/([a-z\-]+\.pid)$$|\1 ${_RUNDIR}/\2|' -e \ | ||||
's|^\#?(LocalSocket) .*$$|\1 ${_CLAMAV_CLAMD_SOCKET}|' -e \ | |||||
DBDIR= /var/db/clamav | 's|^\#?(User) .*$$|\1 ${_CLAMAVUSER}|' -e \ | ||||
LOGDIR= /var/log/clamav | |||||
RUNDIR= /var/run/clamav | |||||
PY_NO_THREAD= ${WRKDIR}/.python-has-no-threads | |||||
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|^\#?(AllowSupplementaryGroups).*$$|\1 yes|' -e \ | ||||
's|^\#?(ScanMail).*$$|\1 yes|' -e \ | 's|^\#?(ScanMail).*$$|\1 yes|' -e \ | ||||
's|^\#?(DatabaseDirectory) .*$$|\1 ${DBDIR}|' -e \ | 's|^\#?(DatabaseDirectory) .*$$|\1 ${_DBDIR}|' -e \ | ||||
's|^\#?(DatabaseOwner) .*$$|\1 ${CLAMAVUSER}|' -e \ | 's|^\#?(DatabaseOwner) .*$$|\1 ${_CLAMAVUSER}|' -e \ | ||||
's|^\#?(FixStaleSocket).*$$|\1 yes|' -e \ | 's|^\#?(FixStaleSocket).*$$|\1 yes|' -e \ | ||||
's|^\#?(NotifyClamd) .*$$|\1 ${PREFIX}/etc/clamd.conf|' -e \ | 's|^\#?(NotifyClamd) .*$$|\1 ${PREFIX}/etc/clamd.conf|' -e \ | ||||
's|^\#?(MilterSocket) */tmp.*$$|\1 ${CLAMAV_MILTER_SOCKET}|' -e \ | 's|^\#?(MilterSocket) */tmp.*$$|\1 ${_CLAMAV_MILTER_SOCKET}|' \ | ||||
's|^\#?(ClamdSocket).*$$|\1 unix:${CLAMAV_CLAMD_SOCKET}|' | -e 's|^\#?(ClamdSocket).*$$|\1 unix:${_CLAMAV_CLAMD_SOCKET}|' | ||||
.include <bsd.port.pre.mk> | |||||
post-patch: | post-patch: | ||||
@${REINPLACE_CMD} ${SED_CONF} \ | @${REINPLACE_CMD} ${_SED_CONF} \ | ||||
${WRKSRC}/etc/clamd.conf.sample \ | ${WRKSRC}/etc/clamd.conf.sample \ | ||||
${WRKSRC}/etc/freshclam.conf.sample \ | ${WRKSRC}/etc/freshclam.conf.sample \ | ||||
${WRKSRC}/etc/clamav-milter.conf.sample | ${WRKSRC}/etc/clamav-milter.conf.sample | ||||
.if ${CHOSEN_COMPILER_TYPE} == gcc | |||||
@${REINPLACE_CMD} -e 's|-Wno-logical-op-parentheses||' \ | |||||
-e 's|-Wno-dangling-else||' \ | |||||
${WRKSRC}/libclamav/Makefile.am \ | |||||
${WRKSRC}/libclamav/Makefile.in \ | |||||
${WRKSRC}/libclamunrar/makefile | |||||
.endif | |||||
pre-configure-TESTS-on: | post-install: | ||||
@if ! ${PYTHON_CMD} -c "import thread" >/dev/null 2>&1; then \ | ${INSTALL_DATA} ${INSTALL_WRKSRC}/clamav-config.h ${STAGEDIR}${PREFIX}/include | ||||
${ECHO_MSG} ""; \ | @${MKDIR} ${STAGEDIR}${_DBDIR} \ | ||||
${ECHO_MSG} "==========================================================================="; \ | ${STAGEDIR}${_LOGDIR} \ | ||||
${ECHO_MSG} "= Unit tests REQUIRES python built with thread support, and yours is not. ="; \ | ${STAGEDIR}${_RUNDIR} | ||||
${ECHO_MSG} "= It will not be called during this build ="; \ | |||||
${ECHO_MSG} "==========================================================================="; \ | |||||
${ECHO_MSG} ""; \ | |||||
${TOUCH} ${PY_NO_THREAD}; \ | |||||
fi | |||||
post-build-TESTS-on: | post-install-DOCS-on: | ||||
@if [ ! -f "${PY_NO_THREAD}" ]; then \ | ${MV} ${STAGEDIR}${PREFIX}/share/doc/ClamAV ${STAGEDIR}${DOCSDIR} | ||||
${MAKE_CMD} -C ${WRKSRC} check; \ | |||||
fi | |||||
post-install: | post-install-DOCS-off: | ||||
${INSTALL_DATA} ${WRKSRC}/clamav-config.h ${STAGEDIR}${PREFIX}/include | ${RM} -r ${STAGEDIR}${PREFIX}/share/doc/ClamAV | ||||
@${MKDIR} ${STAGEDIR}${DOCSDIR}/html \ | |||||
${STAGEDIR}${DBDIR} \ | |||||
${STAGEDIR}${LOGDIR} \ | |||||
${STAGEDIR}${RUNDIR} | |||||
(cd ${WRKSRC}/docs/html; ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR}/html) | |||||
.include <bsd.port.post.mk> | pre-test-TESTS-off: | ||||
Not Done Inline ActionsI guess it boils down to preference but as far as I know we don't do this for any other port. If there's a test option it's implied that you need to have it enabled diizzy: I guess it boils down to preference but as far as I know we don't do this for any other port. | |||||
@${ECHO_MSG} '******************************************************************' && \ | |||||
${ECHO_MSG} '***** You need to enable TESTS option to execute `make test` *****' && \ | |||||
${ECHO_MSG} '******************************************************************' && \ | |||||
${FALSE} | |||||
.include <bsd.port.mk> |
Consider using TEST instead for consistency within the ports tree
https://github.com/freebsd/freebsd-ports/blob/main/Mk/bsd.options.desc.mk#L481