Andrew Geissler | f1e4406 | 2021-04-15 15:52:46 -0500 | [diff] [blame] | 1 | SUMMARY = "ClamAV anti-virus utility for Unix - command-line interface" |
| 2 | DESCRIPTION = "ClamAV is an open source antivirus engine for detecting trojans, viruses, malware & other malicious threats." |
| 3 | HOMEPAGE = "http://www.clamav.net/index.html" |
| 4 | SECTION = "security" |
Patrick Williams | de0582f | 2022-04-08 10:23:27 -0500 | [diff] [blame] | 5 | LICENSE = "LGPL-2.1-only" |
Andrew Geissler | f1e4406 | 2021-04-15 15:52:46 -0500 | [diff] [blame] | 6 | |
| 7 | DEPENDS = "glibc llvm libtool db openssl zlib curl libxml2 bison pcre2 json-c libcheck" |
| 8 | |
Patrick Williams | de0582f | 2022-04-08 10:23:27 -0500 | [diff] [blame] | 9 | COMPATIBLE_HOST:libc-musl:class-target = "null" |
| 10 | |
Andrew Geissler | f1e4406 | 2021-04-15 15:52:46 -0500 | [diff] [blame] | 11 | LIC_FILES_CHKSUM = "file://COPYING.txt;beginline=2;endline=3;md5=f7029fbbc5898b273d5902896f7bbe17" |
| 12 | |
Patrick Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame] | 13 | # July 30th, 2022 |
| 14 | SRCREV = "563ba93052f3b7b46fb8725a65ee6299a9c332cf" |
Andrew Geissler | f1e4406 | 2021-04-15 15:52:46 -0500 | [diff] [blame] | 15 | |
Patrick Williams | 2a25492 | 2023-08-11 09:48:11 -0500 | [diff] [blame] | 16 | SRC_URI = "git://github.com/Cisco-Talos/clamav;branch=rel/0.104;protocol=https \ |
Andrew Geissler | f1e4406 | 2021-04-15 15:52:46 -0500 | [diff] [blame] | 17 | file://clamd.conf \ |
| 18 | file://freshclam.conf \ |
| 19 | file://volatiles.03_clamav \ |
| 20 | file://tmpfiles.clamav \ |
Andrew Geissler | f1e4406 | 2021-04-15 15:52:46 -0500 | [diff] [blame] | 21 | file://headers_fixup.patch \ |
| 22 | file://oe_cmake_fixup.patch \ |
| 23 | " |
| 24 | S = "${WORKDIR}/git" |
| 25 | |
| 26 | LEAD_SONAME = "libclamav.so" |
| 27 | SO_VER = "9.6.0" |
| 28 | |
| 29 | BINCONFIG = "${bindir}/clamav-config" |
| 30 | |
| 31 | inherit cmake chrpath pkgconfig useradd systemd multilib_header multilib_script |
| 32 | |
William A. Kennington III | ee32beb | 2021-06-02 12:48:35 -0700 | [diff] [blame] | 33 | UPSTREAM_CHECK_COMMITS = "1" |
| 34 | |
Andrew Geissler | f1e4406 | 2021-04-15 15:52:46 -0500 | [diff] [blame] | 35 | CLAMAV_UID ?= "clamav" |
| 36 | CLAMAV_GID ?= "clamav" |
| 37 | |
| 38 | MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/clamav-config" |
| 39 | |
| 40 | EXTRA_OECMAKE = " -DCMAKE_BUILD_TYPE=Release -DOPTIMIZE=ON -DENABLE_JSON_SHARED=OFF \ |
| 41 | -DCLAMAV_GROUP=${CLAMAV_GID} -DCLAMAV_USER=${CLAMAV_UID} \ |
| 42 | -DENABLE_TESTS=OFF -DBUILD_SHARED_LIBS=ON \ |
| 43 | -DDISABLE_MPOOL=ON -DENABLE_FRESHCLAM_DNS_FIX=ON \ |
| 44 | " |
| 45 | |
| 46 | PACKAGECONFIG ?= " clamonacc \ |
| 47 | ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "systemd", "", d)}" |
| 48 | |
| 49 | PACKAGECONFIG[milter] = "-DENABLE_MILTER=ON ,-DENABLE_MILTER=OFF, curl, curl" |
| 50 | PACKAGECONFIG[clamonacc] = "-DENABLE_CLAMONACC=ON ,-DENABLE_CLAMONACC=OFF," |
| 51 | PACKAGECONFIG[unrar] = "-DENABLE_UNRAR=ON ,-DENABLE_UNRAR=OFF," |
| 52 | PACKAGECONFIG[systemd] = "-DENABLE_SYSTEMD=ON -DSYSTEMD_UNIT_DIR=${systemd_system_unitdir}, -DENABLE_SYSTEMD=OFF, systemd" |
| 53 | |
| 54 | export OECMAKE_C_FLAGS += " -I${STAGING_INCDIR} -L ${RECIPE_SYSROOT}${nonarch_libdir} -L${STAGING_LIBDIR} -lpthread" |
| 55 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 56 | do_install:append () { |
Andrew Geissler | f1e4406 | 2021-04-15 15:52:46 -0500 | [diff] [blame] | 57 | install -d ${D}/${sysconfdir} |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame] | 58 | install -d -o ${PN} -g ${CLAMAV_GID} ${D}/${localstatedir}/lib/clamav |
Andrew Geissler | f1e4406 | 2021-04-15 15:52:46 -0500 | [diff] [blame] | 59 | install -d ${D}${sysconfdir}/clamav ${D}${sysconfdir}/default/volatiles |
| 60 | |
| 61 | install -m 644 ${WORKDIR}/clamd.conf ${D}/${prefix}/${sysconfdir} |
| 62 | install -m 644 ${WORKDIR}/freshclam.conf ${D}/${prefix}/${sysconfdir} |
| 63 | install -m 0644 ${WORKDIR}/volatiles.03_clamav ${D}${sysconfdir}/default/volatiles/03_clamav |
| 64 | sed -i -e 's#${STAGING_DIR_HOST}##g' ${D}${libdir}/pkgconfig/libclamav.pc |
| 65 | rm ${D}/${libdir}/libclamav.so |
| 66 | if [ "${INSTALL_CLAMAV_CVD}" = "1" ]; then |
| 67 | install -m 666 ${S}/clamav_db/* ${D}/${localstatedir}/lib/clamav/. |
| 68 | fi |
| 69 | |
| 70 | rm ${D}/${libdir}/libfreshclam.so |
Andrew Geissler | f1e4406 | 2021-04-15 15:52:46 -0500 | [diff] [blame] | 71 | |
| 72 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)};then |
Andrew Geissler | f1e4406 | 2021-04-15 15:52:46 -0500 | [diff] [blame] | 73 | install -d ${D}${sysconfdir}/tmpfiles.d |
| 74 | install -m 0644 ${WORKDIR}/tmpfiles.clamav ${D}${sysconfdir}/tmpfiles.d/clamav.conf |
| 75 | fi |
| 76 | oe_multilib_header clamav-types.h |
| 77 | } |
| 78 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 79 | pkg_postinst:${PN} () { |
William A. Kennington III | ee32beb | 2021-06-02 12:48:35 -0700 | [diff] [blame] | 80 | if [ -z "$D" ]; then |
| 81 | if command -v systemd-tmpfiles >/dev/null; then |
| 82 | systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/clamav.conf |
| 83 | elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then |
| 84 | ${sysconfdir}/init.d/populate-volatile.sh update |
| 85 | fi |
Andrew Geissler | f1e4406 | 2021-04-15 15:52:46 -0500 | [diff] [blame] | 86 | fi |
Andrew Geissler | f1e4406 | 2021-04-15 15:52:46 -0500 | [diff] [blame] | 87 | } |
| 88 | |
William A. Kennington III | ee32beb | 2021-06-02 12:48:35 -0700 | [diff] [blame] | 89 | PACKAGES += "${PN}-daemon ${PN}-clamdscan ${PN}-freshclam ${PN}-libclamav" |
Andrew Geissler | f1e4406 | 2021-04-15 15:52:46 -0500 | [diff] [blame] | 90 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 91 | FILES:${PN} = "${bindir}/clambc ${bindir}/clamscan ${bindir}/clamsubmit ${sbindir}/clamonacc \ |
Andrew Geissler | f1e4406 | 2021-04-15 15:52:46 -0500 | [diff] [blame] | 92 | ${bindir}/*sigtool ${mandir}/man1/clambc* ${mandir}/man1/clamscan* \ |
| 93 | ${mandir}/man1/sigtool* ${mandir}/man1/clambsubmit* \ |
William A. Kennington III | ee32beb | 2021-06-02 12:48:35 -0700 | [diff] [blame] | 94 | ${docdir}/clamav/*" |
Andrew Geissler | f1e4406 | 2021-04-15 15:52:46 -0500 | [diff] [blame] | 95 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 96 | FILES:${PN}-clamdscan = " ${bindir}/clamdscan \ |
Andrew Geissler | f1e4406 | 2021-04-15 15:52:46 -0500 | [diff] [blame] | 97 | ${docdir}/clamdscan/* \ |
| 98 | ${mandir}/man1/clamdscan* \ |
| 99 | " |
| 100 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 101 | FILES:${PN}-daemon = "${bindir}/clamconf ${bindir}/clamdtop ${sbindir}/clamd \ |
Andrew Geissler | f1e4406 | 2021-04-15 15:52:46 -0500 | [diff] [blame] | 102 | ${mandir}/man1/clamconf* ${mandir}/man1/clamdtop* \ |
| 103 | ${mandir}/man5/clamd* ${mandir}/man8/clamd* \ |
| 104 | ${sysconfdir}/clamd.conf* \ |
| 105 | /usr/etc/clamd.conf* \ |
William A. Kennington III | ee32beb | 2021-06-02 12:48:35 -0700 | [diff] [blame] | 106 | ${systemd_system_unitdir}/clamav-daemon/* \ |
Andrew Geissler | f1e4406 | 2021-04-15 15:52:46 -0500 | [diff] [blame] | 107 | ${docdir}/clamav-daemon/* ${sysconfdir}/clamav-daemon \ |
| 108 | ${sysconfdir}/logcheck/ignore.d.server/clamav-daemon \ |
William A. Kennington III | ee32beb | 2021-06-02 12:48:35 -0700 | [diff] [blame] | 109 | ${systemd_system_unitdir}/clamav-daemon.service \ |
| 110 | ${systemd_system_unitdir}/clamav-clamonacc.service \ |
Andrew Geissler | f1e4406 | 2021-04-15 15:52:46 -0500 | [diff] [blame] | 111 | " |
| 112 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 113 | FILES:${PN}-freshclam = "${bindir}/freshclam \ |
Andrew Geissler | f1e4406 | 2021-04-15 15:52:46 -0500 | [diff] [blame] | 114 | ${sysconfdir}/freshclam.conf* \ |
| 115 | /usr/etc/freshclam.conf* \ |
| 116 | ${sysconfdir}/clamav ${sysconfdir}/default/volatiles \ |
| 117 | ${sysconfdir}/tmpfiles.d/*.conf \ |
| 118 | ${localstatedir}/lib/clamav \ |
| 119 | ${docdir}/${PN}-freshclam ${mandir}/man1/freshclam.* \ |
| 120 | ${mandir}/man5/freshclam.conf.* \ |
William A. Kennington III | ee32beb | 2021-06-02 12:48:35 -0700 | [diff] [blame] | 121 | ${systemd_system_unitdir}/clamav-freshclam.service" |
Andrew Geissler | f1e4406 | 2021-04-15 15:52:46 -0500 | [diff] [blame] | 122 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 123 | FILES:${PN}-dev = " ${bindir}/clamav-config ${libdir}/*.la \ |
Andrew Geissler | f1e4406 | 2021-04-15 15:52:46 -0500 | [diff] [blame] | 124 | ${libdir}/pkgconfig/*.pc \ |
| 125 | ${mandir}/man1/clamav-config.* \ |
Patrick Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame] | 126 | ${includedir}/*.h ${docdir}/libclamav* \ |
| 127 | ${libdir}/libmspack.so" |
Andrew Geissler | f1e4406 | 2021-04-15 15:52:46 -0500 | [diff] [blame] | 128 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 129 | FILES:${PN}-staticdev = "${libdir}/*.a" |
Andrew Geissler | f1e4406 | 2021-04-15 15:52:46 -0500 | [diff] [blame] | 130 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 131 | FILES:${PN}-libclamav = "${libdir}/libclamav.so* ${libdir}/libclammspack.so* \ |
William A. Kennington III | ee32beb | 2021-06-02 12:48:35 -0700 | [diff] [blame] | 132 | ${libdir}/libfreshclam.so* ${docdir}/libclamav/* \ |
| 133 | ${libdir}/libmspack* " |
Andrew Geissler | f1e4406 | 2021-04-15 15:52:46 -0500 | [diff] [blame] | 134 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 135 | FILES:${PN}-doc = "${mandir}/man/* \ |
Andrew Geissler | f1e4406 | 2021-04-15 15:52:46 -0500 | [diff] [blame] | 136 | ${datadir}/man/* \ |
| 137 | ${docdir}/* " |
| 138 | |
Patrick Williams | 53961c2 | 2022-01-20 11:06:23 -0600 | [diff] [blame] | 139 | USERADD_PACKAGES = "${PN}-freshclam " |
| 140 | GROUPADD_PARAM:${PN}-freshclam = "--system ${CLAMAV_UID}" |
| 141 | USERADD_PARAM:${PN}-freshclam = "--system -g ${CLAMAV_GID} --home-dir \ |
William A. Kennington III | ee32beb | 2021-06-02 12:48:35 -0700 | [diff] [blame] | 142 | ${localstatedir}/lib/${BPN} \ |
Patrick Williams | 53961c2 | 2022-01-20 11:06:23 -0600 | [diff] [blame] | 143 | --no-create-home --shell /sbin/nologin ${PN}" |
Andrew Geissler | f1e4406 | 2021-04-15 15:52:46 -0500 | [diff] [blame] | 144 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 145 | RPROVIDES:${PN} += "${PN}-systemd" |
| 146 | RREPLACES:${PN} += "${PN}-systemd" |
| 147 | RCONFLICTS:${PN} += "${PN}-systemd" |
William A. Kennington III | ee32beb | 2021-06-02 12:48:35 -0700 | [diff] [blame] | 148 | SYSTEMD_PACKAGES = "${PN}-daemon ${PN}-freshclam" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 149 | SYSTEMD_SERVICE:${PN}-daemon = "clamav-daemon.service" |
| 150 | SYSTEMD_SERVICE:${PN}-freshclam = "clamav-freshclam.service" |
Andrew Geissler | f1e4406 | 2021-04-15 15:52:46 -0500 | [diff] [blame] | 151 | |
Patrick Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame] | 152 | INSANE_SKIP:${PN}-libclamav += "dev-so" |
| 153 | |
Patrick Williams | 93c203f | 2021-10-06 16:15:23 -0500 | [diff] [blame] | 154 | RDEPENDS:${PN} = "openssl ncurses-libncurses libxml2 libbz2 ncurses-libtinfo curl libpcre2 clamav-libclamav" |
| 155 | RRECOMMENDS:${PN} = "clamav-freshclam" |
| 156 | RDEPENDS:${PN}-freshclam = "clamav" |
| 157 | RDEPENDS:${PN}-daemon = "clamav clamav-freshclam" |