From 65d88fced24ca64b94c79e71b0612c216e473d0c Mon Sep 17 00:00:00 2001 From: Armin Kuster Date: Sat, 30 Jul 2022 14:51:27 -0700 Subject: clamav: update to 0.104.4 drop accepted patch fix_systemd_socket.patch allow clamav-libclamav to have a symlink Signed-off-by: Armin Kuster --- recipes-scanners/clamav/clamav_0.104.0.bb | 156 -------------------- recipes-scanners/clamav/clamav_0.104.4.bb | 157 +++++++++++++++++++++ .../clamav/files/fix_systemd_socket.patch | 25 ---- 3 files changed, 157 insertions(+), 181 deletions(-) delete mode 100644 recipes-scanners/clamav/clamav_0.104.0.bb create mode 100644 recipes-scanners/clamav/clamav_0.104.4.bb delete mode 100644 recipes-scanners/clamav/files/fix_systemd_socket.patch diff --git a/recipes-scanners/clamav/clamav_0.104.0.bb b/recipes-scanners/clamav/clamav_0.104.0.bb deleted file mode 100644 index 18e8329..0000000 --- a/recipes-scanners/clamav/clamav_0.104.0.bb +++ /dev/null @@ -1,156 +0,0 @@ -SUMMARY = "ClamAV anti-virus utility for Unix - command-line interface" -DESCRIPTION = "ClamAV is an open source antivirus engine for detecting trojans, viruses, malware & other malicious threats." -HOMEPAGE = "http://www.clamav.net/index.html" -SECTION = "security" -LICENSE = "LGPL-2.1-only" - -DEPENDS = "glibc llvm libtool db openssl zlib curl libxml2 bison pcre2 json-c libcheck" - -COMPATIBLE_HOST:libc-musl:class-target = "null" - -LIC_FILES_CHKSUM = "file://COPYING.txt;beginline=2;endline=3;md5=f7029fbbc5898b273d5902896f7bbe17" - -# July 27th -SRCREV = "c389dfa4c3af92b006ada4f7595bbc3e6df3f356" - -SRC_URI = "git://github.com/vrtadmin/clamav-devel;branch=rel/0.104;protocol=https \ - file://clamd.conf \ - file://freshclam.conf \ - file://volatiles.03_clamav \ - file://tmpfiles.clamav \ - file://headers_fixup.patch \ - file://oe_cmake_fixup.patch \ - file://fix_systemd_socket.patch \ -" -S = "${WORKDIR}/git" - -LEAD_SONAME = "libclamav.so" -SO_VER = "9.6.0" - -BINCONFIG = "${bindir}/clamav-config" - -inherit cmake chrpath pkgconfig useradd systemd multilib_header multilib_script - -UPSTREAM_CHECK_COMMITS = "1" - -CLAMAV_UID ?= "clamav" -CLAMAV_GID ?= "clamav" - -MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/clamav-config" - -EXTRA_OECMAKE = " -DCMAKE_BUILD_TYPE=Release -DOPTIMIZE=ON -DENABLE_JSON_SHARED=OFF \ - -DCLAMAV_GROUP=${CLAMAV_GID} -DCLAMAV_USER=${CLAMAV_UID} \ - -DENABLE_TESTS=OFF -DBUILD_SHARED_LIBS=ON \ - -DDISABLE_MPOOL=ON -DENABLE_FRESHCLAM_DNS_FIX=ON \ - " - -PACKAGECONFIG ?= " clamonacc \ - ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "systemd", "", d)}" - -PACKAGECONFIG[milter] = "-DENABLE_MILTER=ON ,-DENABLE_MILTER=OFF, curl, curl" -PACKAGECONFIG[clamonacc] = "-DENABLE_CLAMONACC=ON ,-DENABLE_CLAMONACC=OFF," -PACKAGECONFIG[unrar] = "-DENABLE_UNRAR=ON ,-DENABLE_UNRAR=OFF," -PACKAGECONFIG[systemd] = "-DENABLE_SYSTEMD=ON -DSYSTEMD_UNIT_DIR=${systemd_system_unitdir}, -DENABLE_SYSTEMD=OFF, systemd" - -export OECMAKE_C_FLAGS += " -I${STAGING_INCDIR} -L ${RECIPE_SYSROOT}${nonarch_libdir} -L${STAGING_LIBDIR} -lpthread" - -do_install:append () { - install -d ${D}/${sysconfdir} - install -d -o ${PN} -g ${CLAMAV_GID} ${D}/${localstatedir}/lib/clamav - install -d ${D}${sysconfdir}/clamav ${D}${sysconfdir}/default/volatiles - - install -m 644 ${WORKDIR}/clamd.conf ${D}/${prefix}/${sysconfdir} - install -m 644 ${WORKDIR}/freshclam.conf ${D}/${prefix}/${sysconfdir} - install -m 0644 ${WORKDIR}/volatiles.03_clamav ${D}${sysconfdir}/default/volatiles/03_clamav - sed -i -e 's#${STAGING_DIR_HOST}##g' ${D}${libdir}/pkgconfig/libclamav.pc - rm ${D}/${libdir}/libclamav.so - if [ "${INSTALL_CLAMAV_CVD}" = "1" ]; then - install -m 666 ${S}/clamav_db/* ${D}/${localstatedir}/lib/clamav/. - fi - - rm ${D}/${libdir}/libfreshclam.so - rm ${D}/${libdir}/libmspack.so - - if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)};then - install -d ${D}${sysconfdir}/tmpfiles.d - install -m 0644 ${WORKDIR}/tmpfiles.clamav ${D}${sysconfdir}/tmpfiles.d/clamav.conf - fi - oe_multilib_header clamav-types.h -} - -pkg_postinst:${PN} () { - if [ -z "$D" ]; then - if command -v systemd-tmpfiles >/dev/null; then - systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/clamav.conf - elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then - ${sysconfdir}/init.d/populate-volatile.sh update - fi - fi -} - -PACKAGES += "${PN}-daemon ${PN}-clamdscan ${PN}-freshclam ${PN}-libclamav" - -FILES:${PN} = "${bindir}/clambc ${bindir}/clamscan ${bindir}/clamsubmit ${sbindir}/clamonacc \ - ${bindir}/*sigtool ${mandir}/man1/clambc* ${mandir}/man1/clamscan* \ - ${mandir}/man1/sigtool* ${mandir}/man1/clambsubmit* \ - ${docdir}/clamav/*" - -FILES:${PN}-clamdscan = " ${bindir}/clamdscan \ - ${docdir}/clamdscan/* \ - ${mandir}/man1/clamdscan* \ - " - -FILES:${PN}-daemon = "${bindir}/clamconf ${bindir}/clamdtop ${sbindir}/clamd \ - ${mandir}/man1/clamconf* ${mandir}/man1/clamdtop* \ - ${mandir}/man5/clamd* ${mandir}/man8/clamd* \ - ${sysconfdir}/clamd.conf* \ - /usr/etc/clamd.conf* \ - ${systemd_system_unitdir}/clamav-daemon/* \ - ${docdir}/clamav-daemon/* ${sysconfdir}/clamav-daemon \ - ${sysconfdir}/logcheck/ignore.d.server/clamav-daemon \ - ${systemd_system_unitdir}/clamav-daemon.service \ - ${systemd_system_unitdir}/clamav-clamonacc.service \ - " - -FILES:${PN}-freshclam = "${bindir}/freshclam \ - ${sysconfdir}/freshclam.conf* \ - /usr/etc/freshclam.conf* \ - ${sysconfdir}/clamav ${sysconfdir}/default/volatiles \ - ${sysconfdir}/tmpfiles.d/*.conf \ - ${localstatedir}/lib/clamav \ - ${docdir}/${PN}-freshclam ${mandir}/man1/freshclam.* \ - ${mandir}/man5/freshclam.conf.* \ - ${systemd_system_unitdir}/clamav-freshclam.service" - -FILES:${PN}-dev = " ${bindir}/clamav-config ${libdir}/*.la \ - ${libdir}/pkgconfig/*.pc \ - ${mandir}/man1/clamav-config.* \ - ${includedir}/*.h ${docdir}/libclamav* " - -FILES:${PN}-staticdev = "${libdir}/*.a" - -FILES:${PN}-libclamav = "${libdir}/libclamav.so* ${libdir}/libclammspack.so* \ - ${libdir}/libfreshclam.so* ${docdir}/libclamav/* \ - ${libdir}/libmspack* " - -FILES:${PN}-doc = "${mandir}/man/* \ - ${datadir}/man/* \ - ${docdir}/* " - -USERADD_PACKAGES = "${PN}-freshclam " -GROUPADD_PARAM:${PN}-freshclam = "--system ${CLAMAV_UID}" -USERADD_PARAM:${PN}-freshclam = "--system -g ${CLAMAV_GID} --home-dir \ - ${localstatedir}/lib/${BPN} \ - --no-create-home --shell /sbin/nologin ${PN}" - -RPROVIDES:${PN} += "${PN}-systemd" -RREPLACES:${PN} += "${PN}-systemd" -RCONFLICTS:${PN} += "${PN}-systemd" -SYSTEMD_PACKAGES = "${PN}-daemon ${PN}-freshclam" -SYSTEMD_SERVICE:${PN}-daemon = "clamav-daemon.service" -SYSTEMD_SERVICE:${PN}-freshclam = "clamav-freshclam.service" - -RDEPENDS:${PN} = "openssl ncurses-libncurses libxml2 libbz2 ncurses-libtinfo curl libpcre2 clamav-libclamav" -RRECOMMENDS:${PN} = "clamav-freshclam" -RDEPENDS:${PN}-freshclam = "clamav" -RDEPENDS:${PN}-daemon = "clamav clamav-freshclam" diff --git a/recipes-scanners/clamav/clamav_0.104.4.bb b/recipes-scanners/clamav/clamav_0.104.4.bb new file mode 100644 index 0000000..68a7d1f --- /dev/null +++ b/recipes-scanners/clamav/clamav_0.104.4.bb @@ -0,0 +1,157 @@ +SUMMARY = "ClamAV anti-virus utility for Unix - command-line interface" +DESCRIPTION = "ClamAV is an open source antivirus engine for detecting trojans, viruses, malware & other malicious threats." +HOMEPAGE = "http://www.clamav.net/index.html" +SECTION = "security" +LICENSE = "LGPL-2.1-only" + +DEPENDS = "glibc llvm libtool db openssl zlib curl libxml2 bison pcre2 json-c libcheck" + +COMPATIBLE_HOST:libc-musl:class-target = "null" + +LIC_FILES_CHKSUM = "file://COPYING.txt;beginline=2;endline=3;md5=f7029fbbc5898b273d5902896f7bbe17" + +# July 30th, 2022 +SRCREV = "563ba93052f3b7b46fb8725a65ee6299a9c332cf" + +SRC_URI = "git://github.com/vrtadmin/clamav-devel;branch=rel/0.104;protocol=https \ + file://clamd.conf \ + file://freshclam.conf \ + file://volatiles.03_clamav \ + file://tmpfiles.clamav \ + file://headers_fixup.patch \ + file://oe_cmake_fixup.patch \ +" +S = "${WORKDIR}/git" + +LEAD_SONAME = "libclamav.so" +SO_VER = "9.6.0" + +BINCONFIG = "${bindir}/clamav-config" + +inherit cmake chrpath pkgconfig useradd systemd multilib_header multilib_script + +UPSTREAM_CHECK_COMMITS = "1" + +CLAMAV_UID ?= "clamav" +CLAMAV_GID ?= "clamav" + +MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/clamav-config" + +EXTRA_OECMAKE = " -DCMAKE_BUILD_TYPE=Release -DOPTIMIZE=ON -DENABLE_JSON_SHARED=OFF \ + -DCLAMAV_GROUP=${CLAMAV_GID} -DCLAMAV_USER=${CLAMAV_UID} \ + -DENABLE_TESTS=OFF -DBUILD_SHARED_LIBS=ON \ + -DDISABLE_MPOOL=ON -DENABLE_FRESHCLAM_DNS_FIX=ON \ + " + +PACKAGECONFIG ?= " clamonacc \ + ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "systemd", "", d)}" + +PACKAGECONFIG[milter] = "-DENABLE_MILTER=ON ,-DENABLE_MILTER=OFF, curl, curl" +PACKAGECONFIG[clamonacc] = "-DENABLE_CLAMONACC=ON ,-DENABLE_CLAMONACC=OFF," +PACKAGECONFIG[unrar] = "-DENABLE_UNRAR=ON ,-DENABLE_UNRAR=OFF," +PACKAGECONFIG[systemd] = "-DENABLE_SYSTEMD=ON -DSYSTEMD_UNIT_DIR=${systemd_system_unitdir}, -DENABLE_SYSTEMD=OFF, systemd" + +export OECMAKE_C_FLAGS += " -I${STAGING_INCDIR} -L ${RECIPE_SYSROOT}${nonarch_libdir} -L${STAGING_LIBDIR} -lpthread" + +do_install:append () { + install -d ${D}/${sysconfdir} + install -d -o ${PN} -g ${CLAMAV_GID} ${D}/${localstatedir}/lib/clamav + install -d ${D}${sysconfdir}/clamav ${D}${sysconfdir}/default/volatiles + + install -m 644 ${WORKDIR}/clamd.conf ${D}/${prefix}/${sysconfdir} + install -m 644 ${WORKDIR}/freshclam.conf ${D}/${prefix}/${sysconfdir} + install -m 0644 ${WORKDIR}/volatiles.03_clamav ${D}${sysconfdir}/default/volatiles/03_clamav + sed -i -e 's#${STAGING_DIR_HOST}##g' ${D}${libdir}/pkgconfig/libclamav.pc + rm ${D}/${libdir}/libclamav.so + if [ "${INSTALL_CLAMAV_CVD}" = "1" ]; then + install -m 666 ${S}/clamav_db/* ${D}/${localstatedir}/lib/clamav/. + fi + + rm ${D}/${libdir}/libfreshclam.so + + if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)};then + install -d ${D}${sysconfdir}/tmpfiles.d + install -m 0644 ${WORKDIR}/tmpfiles.clamav ${D}${sysconfdir}/tmpfiles.d/clamav.conf + fi + oe_multilib_header clamav-types.h +} + +pkg_postinst:${PN} () { + if [ -z "$D" ]; then + if command -v systemd-tmpfiles >/dev/null; then + systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/clamav.conf + elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then + ${sysconfdir}/init.d/populate-volatile.sh update + fi + fi +} + +PACKAGES += "${PN}-daemon ${PN}-clamdscan ${PN}-freshclam ${PN}-libclamav" + +FILES:${PN} = "${bindir}/clambc ${bindir}/clamscan ${bindir}/clamsubmit ${sbindir}/clamonacc \ + ${bindir}/*sigtool ${mandir}/man1/clambc* ${mandir}/man1/clamscan* \ + ${mandir}/man1/sigtool* ${mandir}/man1/clambsubmit* \ + ${docdir}/clamav/*" + +FILES:${PN}-clamdscan = " ${bindir}/clamdscan \ + ${docdir}/clamdscan/* \ + ${mandir}/man1/clamdscan* \ + " + +FILES:${PN}-daemon = "${bindir}/clamconf ${bindir}/clamdtop ${sbindir}/clamd \ + ${mandir}/man1/clamconf* ${mandir}/man1/clamdtop* \ + ${mandir}/man5/clamd* ${mandir}/man8/clamd* \ + ${sysconfdir}/clamd.conf* \ + /usr/etc/clamd.conf* \ + ${systemd_system_unitdir}/clamav-daemon/* \ + ${docdir}/clamav-daemon/* ${sysconfdir}/clamav-daemon \ + ${sysconfdir}/logcheck/ignore.d.server/clamav-daemon \ + ${systemd_system_unitdir}/clamav-daemon.service \ + ${systemd_system_unitdir}/clamav-clamonacc.service \ + " + +FILES:${PN}-freshclam = "${bindir}/freshclam \ + ${sysconfdir}/freshclam.conf* \ + /usr/etc/freshclam.conf* \ + ${sysconfdir}/clamav ${sysconfdir}/default/volatiles \ + ${sysconfdir}/tmpfiles.d/*.conf \ + ${localstatedir}/lib/clamav \ + ${docdir}/${PN}-freshclam ${mandir}/man1/freshclam.* \ + ${mandir}/man5/freshclam.conf.* \ + ${systemd_system_unitdir}/clamav-freshclam.service" + +FILES:${PN}-dev = " ${bindir}/clamav-config ${libdir}/*.la \ + ${libdir}/pkgconfig/*.pc \ + ${mandir}/man1/clamav-config.* \ + ${includedir}/*.h ${docdir}/libclamav* \ + ${libdir}/libmspack.so" + +FILES:${PN}-staticdev = "${libdir}/*.a" + +FILES:${PN}-libclamav = "${libdir}/libclamav.so* ${libdir}/libclammspack.so* \ + ${libdir}/libfreshclam.so* ${docdir}/libclamav/* \ + ${libdir}/libmspack* " + +FILES:${PN}-doc = "${mandir}/man/* \ + ${datadir}/man/* \ + ${docdir}/* " + +USERADD_PACKAGES = "${PN}-freshclam " +GROUPADD_PARAM:${PN}-freshclam = "--system ${CLAMAV_UID}" +USERADD_PARAM:${PN}-freshclam = "--system -g ${CLAMAV_GID} --home-dir \ + ${localstatedir}/lib/${BPN} \ + --no-create-home --shell /sbin/nologin ${PN}" + +RPROVIDES:${PN} += "${PN}-systemd" +RREPLACES:${PN} += "${PN}-systemd" +RCONFLICTS:${PN} += "${PN}-systemd" +SYSTEMD_PACKAGES = "${PN}-daemon ${PN}-freshclam" +SYSTEMD_SERVICE:${PN}-daemon = "clamav-daemon.service" +SYSTEMD_SERVICE:${PN}-freshclam = "clamav-freshclam.service" + +INSANE_SKIP:${PN}-libclamav += "dev-so" + +RDEPENDS:${PN} = "openssl ncurses-libncurses libxml2 libbz2 ncurses-libtinfo curl libpcre2 clamav-libclamav" +RRECOMMENDS:${PN} = "clamav-freshclam" +RDEPENDS:${PN}-freshclam = "clamav" +RDEPENDS:${PN}-daemon = "clamav clamav-freshclam" diff --git a/recipes-scanners/clamav/files/fix_systemd_socket.patch b/recipes-scanners/clamav/files/fix_systemd_socket.patch deleted file mode 100644 index 3347770..0000000 --- a/recipes-scanners/clamav/files/fix_systemd_socket.patch +++ /dev/null @@ -1,25 +0,0 @@ -clamd not installing clamav-daemon.socket - -Fixes: -__main__.SystemdUnitNotFoundError: (PosixPath('../security-build-image/1.0-r0/rootfs'), 'clamav-daemon.socket') -%post(clamav-daemon-0.104.0-r0.core2_64): waitpid(3587571) rc 3587571 status 100 -warning: %post(clamav-daemon-0.104.0-r0.core2_64) scriptlet failed, exit status 1 - -Upstream-Status: Pending -Signed-off-by: Armin Kuster - -Index: git/clamd/CMakeLists.txt -=================================================================== ---- git.orig/clamd/CMakeLists.txt -+++ git/clamd/CMakeLists.txt -@@ -60,4 +60,10 @@ if(SYSTEMD_FOUND) - install( - FILES ${CMAKE_CURRENT_BINARY_DIR}/clamav-daemon.socket - DESTINATION ${SYSTEMD_UNIT_DIR}) -+ configure_file( -+ ${CMAKE_CURRENT_SOURCE_DIR}/clamav-daemon.socket.in -+ ${CMAKE_CURRENT_BINARY_DIR}/clamav-daemon.socket @ONLY) -+ install( -+ FILES ${CMAKE_CURRENT_BINARY_DIR}/clamav-daemon.socket -+ DESTINATION ${SYSTEMD_UNIT_DIR}) - endif() -- cgit v1.2.3-54-g00ecf