73 lines
2.5 KiB
Bash
73 lines
2.5 KiB
Bash
# Template file for 'clamav'
|
|
pkgname=clamav
|
|
version=0.103.8
|
|
revision=2
|
|
build_style=gnu-configure
|
|
# XXX: system llvm is too new (< 3.7 required)
|
|
# Shipped llvm does not build with gcc>=6
|
|
configure_args="--sbindir=/usr/bin --libdir=/usr/lib
|
|
--with-openssl=${XBPS_CROSS_BASE}/usr --with-pcre=${XBPS_CROSS_BASE}/usr
|
|
--with-zlib=${XBPS_CROSS_BASE}/usr --with-libbz2-prefix=${XBPS_CROSS_BASE}/usr
|
|
--with-system-libmspack=${XBPS_CROSS_BASE}/usr --with-libcurl=${XBPS_CROSS_BASE}/usr
|
|
--enable-ipv6 --with-user=_clamav --with-group=_clamav"
|
|
conf_files="/etc/clamd.conf /etc/freshclam.conf"
|
|
hostmakedepends="flex pkg-config zip"
|
|
makedepends="json-c-devel libcurl-devel libmspack-devel libxml2-devel
|
|
ncurses-devel pcre-devel tcl-devel"
|
|
short_desc="Clam Anti-Virus scanner"
|
|
maintainer="Orphaned <orphan@voidlinux.org>"
|
|
license="GPL-2.0-only"
|
|
homepage="https://www.clamav.net/"
|
|
distfiles="https://www.clamav.net/downloads/production/clamav-${version}.tar.gz"
|
|
checksum=6f49da6ee927936de13d359e559d3944248e3a257d40b80b6c99ebe6fe8c8c3f
|
|
_clamav_homedir="/var/lib/_${pkgname}"
|
|
_clamav_descr="ClamAV user"
|
|
system_accounts="_clamav"
|
|
make_check=ci-skip
|
|
|
|
CPPFLAGS="-Wno-unused-local-typedefs"
|
|
if [ "$CROSS_BUILD" ]; then
|
|
configure_args+=" --disable-mempool"
|
|
fi
|
|
if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
|
|
makedepends+=" musl-fts-devel"
|
|
LDFLAGS="-lfts"
|
|
fi
|
|
|
|
do_configure() {
|
|
# Disable detection of sys/cdefs.h (it's obsolete)
|
|
sed -i configure -e 's; sys/cdefs\.h$;;'
|
|
sed -i configure -e 's;3\.7;3.9;'
|
|
# Enable IPv6 for cross builds
|
|
if [ "$CROSS_BUILD" ]; then
|
|
configure_args+=" have_cv_ipv6=yes"
|
|
fi
|
|
# Need to set PCRE_HOME to make --with-pcre=/usr work
|
|
PCRE_HOME=/usr ./configure ${configure_args}
|
|
}
|
|
post_install() {
|
|
# Enable and patch clamd configuration
|
|
mv -v ${PKGDESTDIR}/etc/clamd.conf.sample ${PKGDESTDIR}/etc/clamd.conf
|
|
vsconf etc/clamd.conf.sample
|
|
sed -i ${PKGDESTDIR}/etc/clamd.conf \
|
|
-e "s;^Example$;# Example;" \
|
|
-e "s;#DatabaseDirectory.*;DatabaseDirectory /var/lib/_${pkgname};"
|
|
|
|
# Enable and patch freshclam configuration
|
|
mv -v ${PKGDESTDIR}/etc/freshclam.conf.sample ${PKGDESTDIR}/etc/freshclam.conf
|
|
vsconf etc/freshclam.conf.sample
|
|
sed -i ${PKGDESTDIR}/etc/freshclam.conf \
|
|
-e "s;^Example$;# Example;" \
|
|
-e "s;#DatabaseDirectory.*;DatabaseDirectory /var/lib/_${pkgname};"
|
|
}
|
|
clamav-devel_package() {
|
|
depends="${sourcepkg}>=${version}_${revision}"
|
|
short_desc+=" - development files"
|
|
pkg_install() {
|
|
vmove usr/bin/clamav-config
|
|
vmove usr/lib/pkgconfig
|
|
vmove usr/include
|
|
vmove "usr/lib/*.so"
|
|
}
|
|
}
|