diff --git a/security/clamav/Makefile b/security/clamav/Makefile index ad1beb45d440..037c7ca58488 100644 --- a/security/clamav/Makefile +++ b/security/clamav/Makefile @@ -1,181 +1,133 @@ PORTNAME= clamav -PORTVERSION= 0.103.3 +DISTVERSION= 0.104.0 PORTEPOCH= 1 CATEGORIES= security MASTER_SITES= https://www.clamav.net/downloads/production/ MAINTAINER= yasu@FreeBSD.org COMMENT= Command line virus scanner written entirely in C LICENSE= GPLv2 -LICENSE_FILE= ${WRKSRC}/COPYING +LICENSE_FILE= ${WRKSRC}/COPYING.txt LIB_DEPENDS= libcurl.so:ftp/curl \ - libltdl.so:devel/libltdl \ - libmspack.so:archivers/libmspack + libjson-c.so:devel/json-c \ + libmspack.so:archivers/libmspack \ + libpcre2-8.so:devel/pcre2 -USES= compiler cpe gmake gnome libtool ncurses pathfix pkgconfig ssl -USE_RC_SUBR= clamav-clamd clamav-freshclam +USES= cmake cpe gnome iconv ncurses pkgconfig ssl +USE_GNOME= libxml2 USE_LDCONFIG= yes +USE_RC_SUBR= clamav-clamd clamav-freshclam -GNU_CONFIGURE= yes -INSTALL_TARGET= install-strip - -PLIST_SUB+= CLAMAVGROUP=${CLAMAVGROUP} \ - 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 +CMAKE_ARGS= -DDATABASE_DIRECTORY:STRING=${_DBDIR} +CMAKE_ON= ENABLE_EXTERNAL_MSPACK -# This port has a problem with -pthread, -# force to use -lthr until it's not fixed. -LDFLAGS+= -lthr +TEST_TARGET= check CONFLICTS_INSTALL= clamav-[0-9]* -SUB_FILES= pkg-deinstall +SUB_FILES= pkg-message SUB_LIST+= CHMOD=${CHMOD} \ CHOWN=${CHOWN} \ - CLAMAV_CLAMD_PIDFILE=${CLAMAV_CLAMD_PIDFILE} \ - CLAMAV_CLAMD_SOCKET=${CLAMAV_CLAMD_SOCKET} \ - CLAMAV_MILTER_SOCKET=${CLAMAV_MILTER_SOCKET} \ - CLAMAVGROUP=${CLAMAVGROUP} \ - CLAMAVUSER=${CLAMAVUSER} \ - DBDIR=${DBDIR} \ - LOGDIR=${LOGDIR} \ - RUNDIR=${RUNDIR} - -PLIST_SUB+= CLAMAVGROUP=${CLAMAVGROUP} \ - CLAMAVUSER=${CLAMAVUSER} - -OPTIONS_DEFINE= ARC ARJ DMG_XAR DOCS EXPERIMENTAL ICONV IPV6 JSON LDAP LHA \ - MILTER PCRE STDERR TESTS UNRAR UNZOO - -OPTIONS_DEFAULT= ARC ARJ DMG_XAR JSON MILTER PCRE UNRAR UNZOO + CLAMAV_CLAMD_PIDFILE=${_CLAMAV_CLAMD_PIDFILE} \ + CLAMAV_CLAMD_SOCKET=${_CLAMAV_CLAMD_SOCKET} \ + CLAMAV_MILTER_SOCKET=${_CLAMAV_MILTER_SOCKET} \ + CLAMAVGROUP=${_CLAMAVGROUP} \ + CLAMAVUSER=${_CLAMAVUSER} \ + DBDIR=${_DBDIR} \ + LOGDIR=${_LOGDIR} \ + RUNDIR=${_RUNDIR} + +USERS= ${_CLAMAVUSER} +GROUPS= ${_CLAMAVGROUP} mail + +PLIST_SUB+= CLAMAVGROUP=${_CLAMAVGROUP} \ + CLAMAVUSER=${_CLAMAVUSER} \ + DBDIR=${_DBDIR} \ + LOGDIR=${_LOGDIR} \ + RUNDIR=${_RUNDIR} + +OPTIONS_DEFINE= ARC ARJ DOCS EXPERIMENTAL LHA MILTER STDERR TESTS UNRAR UNZOO + +OPTIONS_DEFAULT= ARC ARJ MILTER UNRAR UNZOO OPTIONS_SUB= yes ARC_DESC= Enable arch archives support ARJ_DESC= Enable arj archives support -DMG_XAR_DESC= Enable DMG and XAR archives support EXPERIMENTAL_DESC= Build experimental code LHA_DESC= Enable lha archives support MILTER_DESC= Compile the milter interface 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) UNZOO_DESC= Enable zoo archives support ARC_RUN_DEPENDS= arc:archivers/arc ARJ_RUN_DEPENDS= arj:archivers/arj -DMG_XAR_CONFIGURE_WITH= xml=${LOCALBASE} -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 +EXPERIMENTAL_CMAKE_BOOL= ENABLE_EXPERIMENTAL LHA_RUN_DEPENDS= lha:archivers/lha -MILTER_CONFIGURE_WITH= sendmail=/usr/sbin/sendmail -MILTER_CONFIGURE_ENABLE= milter .if !exists(/usr/lib/libmilter.so) -MILTER_CFLAGS= -I${LOCALBASE}/include -MILTER_LDFLAGS= -L${LOCALBASE}/lib -MILTER_LIB_DEPENDS+= libmilter.so:mail/libmilter +MILTER_LIB_DEPENDS= libmilter.so:mail/libmilter .endif MILTER_USE= RC_SUBR=clamav-milter -PCRE_CONFIGURE_WITH= pcre -PCRE_LIB_DEPENDS= libpcre2-8.so:devel/pcre2 -STDERR_EXTRA_PATCHES= ${FILESDIR}/extra-patch-shared_output.c -TESTS_CONFIGURE_ENABLE= check +.if !exists(/usr/lib/libmilter.so) +MILTER_USE+= localbase +.endif +MILTER_CMAKE_BOOL= ENABLE_MILTER +STDERR_EXTRA_PATCHES= ${FILESDIR}/extra-patch-common_output.c TESTS_BUILD_DEPENDS= ${LOCALBASE}/include/check.h:devel/check TESTS_USES= python:build -UNRAR_CONFIGURE_ENABLE= unrar +TESTS_CMAKE_BOOL= ENABLE_TESTS +UNRAR_CMAKE_BOOL= ENABLE_UNRAR UNZOO_RUN_DEPENDS= unzoo:archivers/unzoo -CLAMAVUSER?= clamav -CLAMAVGROUP?= clamav - -CLAMAV_CLAMD_SOCKET?= ${RUNDIR}/clamd.sock -CLAMAV_CLAMD_PIDFILE?= ${RUNDIR}/clamd.pid -CLAMAV_MILTER_SOCKET?= ${RUNDIR}/clmilter.sock - -.if ${CLAMAVUSER} == "clamav" -USERS= clamav -.endif +_CLAMAVUSER= clamav +_CLAMAVGROUP= clamav -.if ${CLAMAVGROUP} == "clamav" -GROUPS= clamav mail -.endif +_CLAMAV_CLAMD_SOCKET?= ${_RUNDIR}/clamd.sock +_CLAMAV_CLAMD_PIDFILE?= ${_RUNDIR}/clamd.pid +_CLAMAV_MILTER_SOCKET?= ${_RUNDIR}/clmilter.sock -DBDIR= /var/db/clamav -LOGDIR= /var/log/clamav -RUNDIR= /var/run/clamav -PY_NO_THREAD= ${WRKDIR}/.python-has-no-threads +_DBDIR= /var/db/clamav +_LOGDIR= /var/log/clamav +_RUNDIR= /var/run/clamav -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 \ +_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|^\#?(DatabaseDirectory) .*$$|\1 ${_DBDIR}|' -e \ + 's|^\#?(DatabaseOwner) .*$$|\1 ${_CLAMAVUSER}|' -e \ 's|^\#?(FixStaleSocket).*$$|\1 yes|' -e \ 's|^\#?(NotifyClamd) .*$$|\1 ${PREFIX}/etc/clamd.conf|' -e \ - 's|^\#?(MilterSocket) */tmp.*$$|\1 ${CLAMAV_MILTER_SOCKET}|' -e \ - 's|^\#?(ClamdSocket).*$$|\1 unix:${CLAMAV_CLAMD_SOCKET}|' - -.include + 's|^\#?(MilterSocket) */tmp.*$$|\1 ${_CLAMAV_MILTER_SOCKET}|' \ + -e 's|^\#?(ClamdSocket).*$$|\1 unix:${_CLAMAV_CLAMD_SOCKET}|' post-patch: - @${REINPLACE_CMD} ${SED_CONF} \ + @${REINPLACE_CMD} ${_SED_CONF} \ ${WRKSRC}/etc/clamd.conf.sample \ ${WRKSRC}/etc/freshclam.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: - @if ! ${PYTHON_CMD} -c "import thread" >/dev/null 2>&1; then \ - ${ECHO_MSG} ""; \ - ${ECHO_MSG} "==========================================================================="; \ - ${ECHO_MSG} "= Unit tests REQUIRES python built with thread support, and yours is not. ="; \ - ${ECHO_MSG} "= It will not be called during this build ="; \ - ${ECHO_MSG} "==========================================================================="; \ - ${ECHO_MSG} ""; \ - ${TOUCH} ${PY_NO_THREAD}; \ - fi - -post-build-TESTS-on: - @if [ ! -f "${PY_NO_THREAD}" ]; then \ - ${MAKE_CMD} -C ${WRKSRC} check; \ - fi post-install: - ${INSTALL_DATA} ${WRKSRC}/clamav-config.h ${STAGEDIR}${PREFIX}/include - @${MKDIR} ${STAGEDIR}${DOCSDIR}/html \ - ${STAGEDIR}${DBDIR} \ - ${STAGEDIR}${LOGDIR} \ - ${STAGEDIR}${RUNDIR} - (cd ${WRKSRC}/docs/html; ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR}/html) - -.include + ${INSTALL_DATA} ${INSTALL_WRKSRC}/clamav-config.h ${STAGEDIR}${PREFIX}/include + @${MKDIR} ${STAGEDIR}${_DBDIR} \ + ${STAGEDIR}${_LOGDIR} \ + ${STAGEDIR}${_RUNDIR} + +post-install-DOCS-on: + ${MV} ${STAGEDIR}${PREFIX}/share/doc/ClamAV ${STAGEDIR}${DOCSDIR} + +post-install-DOCS-off: + ${RM} -r ${STAGEDIR}${PREFIX}/share/doc/ClamAV + +pre-test-TESTS-off: + @${ECHO_MSG} '******************************************************************' && \ + ${ECHO_MSG} '***** You need to enable TESTS option to execute `make test` *****' && \ + ${ECHO_MSG} '******************************************************************' && \ + ${FALSE} + +.include diff --git a/security/clamav/distinfo b/security/clamav/distinfo index 808efe68f12a..e578511dfc6c 100644 --- a/security/clamav/distinfo +++ b/security/clamav/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1624295813 -SHA256 (clamav-0.103.3.tar.gz) = 9f6e3d18449f3d1a3992771d696685249dfa12736fe2b2929858f2c7d8276ae9 -SIZE (clamav-0.103.3.tar.gz) = 13389239 +TIMESTAMP = 1631019092 +SHA256 (clamav-0.104.0.tar.gz) = a079d64cd55d6184510adfe0f341b2f278f7fb1bcc080d28d374298160f19cb2 +SIZE (clamav-0.104.0.tar.gz) = 11896747 diff --git a/security/clamav/files/clamav-clamd.in b/security/clamav/files/clamav-clamd.in index b9c562f47987..c6de79538080 100644 --- a/security/clamav/files/clamav-clamd.in +++ b/security/clamav/files/clamav-clamd.in @@ -1,51 +1,46 @@ #!/bin/sh # PROVIDE: clamav_clamd # REQUIRE: LOGIN # BEFORE: mail # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf to enable clamd: # # clamav_clamd_enable="YES" # clamav_clamd_flags="" # # See clamd(8) for flags # . /etc/rc.subr name=clamav_clamd rcvar=clamav_clamd_enable # read settings, set default values load_rc_config "$name" : ${clamav_clamd_enable:=NO} -: ${clamav_clamd_socket="%%CLAMAV_CLAMD_SOCKET%%"} : ${clamav_clamd_pidfile="%%CLAMAV_CLAMD_PIDFILE%%"} -: ${clamav_clamd_user="%%CLAMAVUSER%%"} command=%%PREFIX%%/sbin/clamd +pidfile=${clamav_clamd_pidfile} required_dirs=%%DBDIR%% required_files=%%PREFIX%%/etc/clamd.conf start_precmd=clamav_clamd_precmd extra_commands=reload reload_cmd="%%PREFIX%%/bin/clamdscan --reload" #clamav .93 won't start without a valid main.c[vl]d file clamav_clamd_precmd() { - local rundir=${clamav_clamd_pidfile%/*} - if [ ! -d $rundir ] ; then - install -d -m 0755 -o ${clamav_clamd_user} -g ${clamav_clamd_user} $rundir - fi if [ ! -f %%DBDIR%%/main.cvd -a ! -f %%DBDIR%%/main.cld ];then echo "Missing %%DBDIR%%/*.cvd or *.cld files. You must run freshclam first" exit 1 fi } run_rc_command "$1" diff --git a/security/clamav/files/clamav-freshclam.in b/security/clamav/files/clamav-freshclam.in index affd41e1c6a3..a32de395b2c8 100644 --- a/security/clamav/files/clamav-freshclam.in +++ b/security/clamav/files/clamav-freshclam.in @@ -1,45 +1,34 @@ #!/bin/sh # PROVIDE: clamav_freshclam # REQUIRE: LOGIN clamav_clamd # BEFORE: mail # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf to enable the freshclam daemon: # # clamav_freshclam_enable="YES" # clamav_freshclam_flags="" # # See freshclam(1) for flags # . /etc/rc.subr name=clamav_freshclam rcvar=clamav_freshclam_enable # read settings, set default values load_rc_config ${name} : ${clamav_freshclam_enable:=NO} : ${clamav_freshclam_pidfile=%%RUNDIR%%/freshclam.pid} -: ${clamav_freshclam_user=%%CLAMAVUSER%%} command=%%PREFIX%%/bin/freshclam pidfile=${clamav_freshclam_pidfile} command_args="--daemon -p ${pidfile}" required_dirs=%%DBDIR%% required_files=%%PREFIX%%/etc/freshclam.conf -start_precmd=clamav_freshclam_precmd - -clamav_freshclam_precmd() -{ - local rundir=${clamav_freshclam_pidfile%/*} - if [ ! -d $rundir ] ; then - install -d -m 0755 -o ${clamav_freshclam_user} -g ${clamav_freshclam_user} $rundir - fi -} - run_rc_command "$1" diff --git a/security/clamav/files/extra-patch-shared_output.c b/security/clamav/files/extra-patch-common_output.c similarity index 71% rename from security/clamav/files/extra-patch-shared_output.c rename to security/clamav/files/extra-patch-common_output.c index ddb4ab029f38..c87b4daaff95 100644 --- a/security/clamav/files/extra-patch-shared_output.c +++ b/security/clamav/files/extra-patch-common_output.c @@ -1,17 +1,17 @@ ---- shared/output.c.orig Thu May 18 22:10:40 2006 -+++ shared/output.c Thu May 18 22:12:43 2006 +--- common/output.c.orig Thu May 18 22:10:40 2006 ++++ common/output.c Thu May 18 22:12:43 2006 @@ -236,7 +236,13 @@ return; } - fd = stdout; +/* fd = stdout; (missing flag 'mprintf_stdout') --eh. */ + + if(mprintf_stdout) + fd = stdout; + else + fd = stderr; + /* legend: * ! - error diff --git a/security/clamav/files/patch-libclamav_c++_llvm_include_llvm_Support_CFG.h b/security/clamav/files/patch-libclamav_c++_llvm_include_llvm_Support_CFG.h deleted file mode 100644 index dd70c2ca4d20..000000000000 --- a/security/clamav/files/patch-libclamav_c++_llvm_include_llvm_Support_CFG.h +++ /dev/null @@ -1,62 +0,0 @@ ---- libclamav/c++/llvm/include/llvm/Support/CFG.h.orig 2016-04-22 15:02:19 UTC -+++ libclamav/c++/llvm/include/llvm/Support/CFG.h -@@ -27,8 +27,9 @@ namespace llvm { - - template // Predecessor Iterator - class PredIterator : public std::iterator { -- typedef std::iterator super; -+ Ptr, ptrdiff_t, Ptr*, Ptr*> { -+ typedef std::iterator super; - typedef PredIterator Self; - USE_iterator It; - -@@ -40,6 +41,7 @@ class PredIterator : public std::iteratoruse_begin()) { - advancePastNonTerminators(); -@@ -49,7 +51,7 @@ class PredIterator : public std::iterator(*It)->getParent(); - } -@@ -87,10 +89,11 @@ inline const_pred_iterator pred_end(const BasicBlock * - - template // Successor Iterator - class SuccIterator : public std::iterator { -+ BB_, ptrdiff_t, BB_*, BB_*> { - const Term_ Term; - unsigned idx; -- typedef std::iterator super; -+ typedef std::iterator super; - typedef SuccIterator Self; - - inline bool index_is_valid(int idx) { -@@ -99,6 +102,7 @@ class SuccIterator : public std::iteratorgetSuccessor(idx); } -+ inline reference operator*() const { return Term->getSuccessor(idx); } - inline pointer operator->() const { return operator*(); } - - inline Self& operator++() { ++idx; return *this; } // Preincrement diff --git a/security/clamav/files/pkg-deinstall.in b/security/clamav/files/pkg-deinstall.in deleted file mode 100644 index 47b5c7f8abf3..000000000000 --- a/security/clamav/files/pkg-deinstall.in +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -if [ "$2" != "POST-DEINSTALL" ]; then - exit 0 -fi - -CLAMAVUSER=%%CLAMAVUSER%% - -echo -echo "====================================================" -echo -echo "If you want remove clamav permanently from you system" -echo "execute following commands:" -echo -echo " # rm -rf %%LOGDIR%%" -echo " # rm -rf %%RUNDIR%%" -echo " # rm -rf %%DBDIR%%" -if pw usershow "${CLAMAVUSER}" 2>/dev/null 1>&2; then - echo " # pw userdel ${CLAMAVUSER}" -fi -echo -echo "====================================================" -echo - -exit 0 diff --git a/security/clamav/files/pkg-message.in b/security/clamav/files/pkg-message.in new file mode 100644 index 000000000000..91cd8d4e1ada --- /dev/null +++ b/security/clamav/files/pkg-message.in @@ -0,0 +1,13 @@ +[ +{ type: remove + message: <