Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [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" |
| 5 | LICENSE = "LGPL-2.1" |
| 6 | |
| 7 | DEPENDS = "libtool db libmspack chrpath-replacement-native" |
| 8 | |
| 9 | LIC_FILES_CHKSUM = "file://COPYING.LGPL;beginline=2;endline=3;md5=4b89c05acc71195e9a06edfa2fa7d092" |
| 10 | |
| 11 | SRCREV = "b66e5e27b48c0a07494f9df9b809ed933cede047" |
| 12 | |
| 13 | SRC_URI = "git://github.com/vrtadmin/clamav-devel;branch=rel/0.99 \ |
| 14 | file://clamd.conf \ |
| 15 | file://freshclam.conf \ |
| 16 | file://volatiles.03_clamav \ |
| 17 | file://${BPN}.service \ |
| 18 | " |
| 19 | |
| 20 | S = "${WORKDIR}/git" |
| 21 | |
| 22 | LEAD_SONAME = "libclamav.so" |
| 23 | SO_VER = "7.1.1" |
| 24 | |
| 25 | EXTRANATIVEPATH += "chrpath-native" |
| 26 | |
| 27 | inherit autotools-brokensep pkgconfig useradd systemd |
| 28 | |
| 29 | UID = "clamav" |
| 30 | GID = "clamav" |
| 31 | |
| 32 | # Clamav has a built llvm version 2 but does not build with gcc 6.x, |
| 33 | # disable the internal one. This is a known issue |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 34 | # If you want LLVM support, use the one in core |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 35 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 36 | PACKAGECONFIG ?= "ncurses openssl bz2 zlib llvm" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 37 | PACKAGECONFIG += " ${@bb.utils.contains("DISTRO_FEATURES", "ipv6", "ipv6", "", d)}" |
| 38 | PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}" |
| 39 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 40 | PACKAGECONFIG[llvm] = "--with-system-llvm --with-llvm-linking=dynamic --disable-llvm, ,llvm8.0" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 41 | |
| 42 | PACKAGECONFIG[pcre] = "--with-pcre=${STAGING_LIBDIR}, --without-pcre, libpcre" |
| 43 | PACKAGECONFIG[xml] = "--with-xml=${STAGING_LIBDIR}/.., --with-xml=no, libxml2," |
| 44 | PACKAGECONFIG[json] = "--with-libjson=${STAGING_LIBDIR}, --without-libjson, json," |
| 45 | PACKAGECONFIG[curl] = "--with-libcurl=${STAGING_LIBDIR}, --without-libcurl, curl," |
| 46 | PACKAGECONFIG[ipv6] = "--enable-ipv6, --disable-ipv6" |
| 47 | PACKAGECONFIG[openssl] = "--with-openssl=${STAGING_DIR_HOST}/usr, --without-openssl, openssl, openssl" |
| 48 | PACKAGECONFIG[zlib] = "--with-zlib=${STAGING_DIR_HOST}/usr --disable-zlib-vcheck , --without-zlib, zlib, " |
| 49 | PACKAGECONFIG[bz2] = "--with-libbz2-prefix=${STAGING_LIBDIR}/.., --without-libbz2-prefix, " |
| 50 | PACKAGECONFIG[ncurses] = "--with-libncurses-prefix=${STAGING_LIBDIR}/.., --without-libncurses-prefix, ncurses, " |
| 51 | PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/, --without-systemdsystemunitdir, " |
| 52 | |
| 53 | EXTRA_OECONF += " --with-user=${UID} --with-group=${GID} \ |
| 54 | --without-libcheck-prefix --disable-unrar \ |
| 55 | --disable-mempool \ |
| 56 | --program-prefix="" \ |
| 57 | --disable-yara \ |
| 58 | --disable-rpath \ |
| 59 | " |
| 60 | |
| 61 | do_configure () { |
| 62 | cd ${S} |
| 63 | ./configure ${CONFIGUREOPTS} ${EXTRA_OECONF} |
| 64 | } |
| 65 | |
| 66 | do_compile_append() { |
| 67 | # brute force removing RPATH |
| 68 | chrpath -d ${B}/libclamav/.libs/libclamav.so.${SO_VER} |
| 69 | chrpath -d ${B}/sigtool/.libs/sigtool |
| 70 | chrpath -d ${B}/clambc/.libs/clambc |
| 71 | chrpath -d ${B}/clamscan/.libs/clamscan |
| 72 | chrpath -d ${B}/clamconf/.libs/clamconf |
| 73 | chrpath -d ${B}/clamd/.libs/clamd |
| 74 | chrpath -d ${B}/freshclam/.libs/freshclam |
| 75 | } |
| 76 | |
| 77 | do_install_append() { |
| 78 | install -d ${D}/${sysconfdir} |
| 79 | install -d ${D}/${localstatedir}/lib/clamav |
| 80 | install -d ${D}${sysconfdir}/clamav ${D}${sysconfdir}/default/volatiles |
| 81 | |
| 82 | install -m 644 ${WORKDIR}/clamd.conf ${D}/${sysconfdir} |
| 83 | install -m 644 ${WORKDIR}/freshclam.conf ${D}/${sysconfdir} |
| 84 | install -m 0644 ${WORKDIR}/volatiles.03_clamav ${D}${sysconfdir}/default/volatiles/volatiles.03_clamav |
| 85 | sed -i -e 's#${STAGING_DIR_HOST}##g' ${D}${libdir}/pkgconfig/libclamav.pc |
| 86 | rm ${D}/${libdir}/libclamav.so |
| 87 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)};then |
| 88 | install -D -m 0644 ${WORKDIR}/clamav.service ${D}${systemd_unitdir}/system/clamav.service |
| 89 | fi |
| 90 | } |
| 91 | |
| 92 | pkg_postinst_ontarget_${PN} () { |
| 93 | if [ -e /etc/init.d/populate-volatile.sh ] ; then |
| 94 | ${sysconfdir}/init.d/populate-volatile.sh update |
| 95 | fi |
| 96 | chown ${UID}:${GID} ${localstatedir}/lib/clamav |
| 97 | } |
| 98 | |
| 99 | |
| 100 | PACKAGES = "${PN} ${PN}-dev ${PN}-dbg ${PN}-daemon ${PN}-doc \ |
| 101 | ${PN}-clamdscan ${PN}-freshclam ${PN}-libclamav ${PN}-staticdev" |
| 102 | |
| 103 | FILES_${PN} = "${bindir}/clambc ${bindir}/clamscan ${bindir}/clamsubmit \ |
| 104 | ${bindir}/*sigtool ${mandir}/man1/clambc* ${mandir}/man1/clamscan* \ |
| 105 | ${mandir}/man1/sigtool* ${mandir}/man1/clambsubmit* \ |
| 106 | ${docdir}/clamav/* " |
| 107 | |
| 108 | FILES_${PN}-clamdscan = " ${bindir}/clamdscan \ |
| 109 | ${docdir}/clamdscan/* \ |
| 110 | ${mandir}/man1/clamdscan* \ |
| 111 | " |
| 112 | |
| 113 | FILES_${PN}-daemon = "${bindir}/clamconf ${bindir}/clamdtop ${sbindir}/clamd \ |
| 114 | ${mandir}/man1/clamconf* ${mandir}/man1/clamdtop* \ |
| 115 | ${mandir}/man5/clamd* ${mandir}/man8/clamd* \ |
| 116 | ${sysconfdir}/clamd.conf* \ |
| 117 | ${systemd_unitdir}/system/clamav-daemon/* \ |
| 118 | ${docdir}/clamav-daemon/* ${sysconfdir}/clamav-daemon \ |
| 119 | ${sysconfdir}/logcheck/ignore.d.server/clamav-daemon " |
| 120 | |
| 121 | FILES_${PN}-freshclam = "${bindir}/freshclam \ |
| 122 | ${sysconfdir}/freshclam.conf* \ |
| 123 | ${sysconfdir}/clamav ${sysconfdir}/default/volatiles \ |
| 124 | ${localstatedir}/lib/clamav \ |
| 125 | ${docdir}/${PN}-freshclam ${mandir}/man1/freshclam.* \ |
| 126 | ${mandir}/man5/freshclam.conf.* \ |
| 127 | ${systemd_unitdir}/system/clamav-freshclam.service" |
| 128 | |
| 129 | FILES_${PN}-dev = " ${bindir}/clamav-config ${libdir}/*.la \ |
| 130 | ${libdir}/pkgconfig/*.pc \ |
| 131 | ${mandir}/man1/clamav-config.* \ |
| 132 | ${includedir}/*.h ${docdir}/libclamav* " |
| 133 | |
| 134 | FILES_${PN}-staticdev = "${libdir}/*.a" |
| 135 | |
| 136 | FILES_${PN}-libclamav = "${libdir}/libclamav.so* ${libdir}/libmspack.so*\ |
| 137 | ${docdir}/libclamav/* " |
| 138 | |
| 139 | FILES_${PN}-doc = "${mandir}/man/* \ |
| 140 | ${datadir}/man/* \ |
| 141 | ${docdir}/* " |
| 142 | |
| 143 | USERADD_PACKAGES = "${PN}" |
| 144 | GROUPADD_PARAM_${PN} = "--system ${UID}" |
| 145 | USERADD_PARAM_${PN} = "--system -g ${GID} --home-dir \ |
| 146 | ${localstatedir}/spool/${BPN} \ |
| 147 | --no-create-home --shell /bin/false ${BPN}" |
| 148 | |
| 149 | RPROVIDES_${PN} += "${PN}-systemd" |
| 150 | RREPLACES_${PN} += "${PN}-systemd" |
| 151 | RCONFLICTS_${PN} += "${PN}-systemd" |
| 152 | SYSTEMD_SERVICE_${PN} = "${BPN}.service" |
| 153 | |
| 154 | RDEPENDS_${PN} += "openssl ncurses-libncurses libbz2 ncurses-libtinfo clamav-freshclam clamav-libclamav" |