mirror of
https://github.com/coolsnowwolf/packages.git
synced 2025-05-01 13:13:04 +08:00

1、 clamav: avoid host pickup of libxml2 If libxml2 is installed in the host, then the host library is used and compilation fails. Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com> 2、 clamav: Update to version 0.101.4 Change deprecated options to a new one: DetectBrokenExecutables to AlertBrokenExecutables ArchiveBlockEncrypted to AlertEncrypted Fixes: CVE-2019-12900 and CVE-2019-12625 Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com> 3、 clamav: Update init scripts This replaces the use of uci_validate_section() with uci_load_validate(), which removes the need to declare local variables for every config option. This also removes some unnecessary curly brackets. Signed-off-by: Jeffery To <jeffery.to@gmail.com> 4、 clamav: don't install dev files into package This avoids copying /usr/include, unversioned *.so files, pkgconfig, /usr/lib/*.la, and the build-time libs/cflags configuration utility clamav-config. Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com> (cherry-picked from 815e05e) 5、 clamav: Change depends from uclibcxx to CXX_DEPENDS The build system allows changing uclibc++ to libstdcpp globally. This avoids an unnecessary depends in the case of libstdcpp usage. Signed-off-by: Rosen Penev <rosenp@gmail.com> 6、 clamav: enable clamav-milter Signed-off-by: Lucian Cristian <lucian.cristian@gmail.com> 7、 clamav: fix invalid zlib version error ClamAV's configure script uses grep to check for bugy zlib version 1.2.1. Since current OpenWrt zlib version is 1.2.11 this check passes and build fails. This patch will disable this unneeded check and make sure we are looking for zlib on the right location. clamdtop was beeing built without it's ncurses dependency. Build system would link it to the host's ncurses making the program fail at run time. This patch will disable building of optional clamdtop, otherwise we need to add ncurses as a dependency and fix the search path. Increase PKG_RELEASE to reflect changes. Signed-off-by: Marko Ratkaj <marko.ratkaj@sartura.hr>
69 lines
1.7 KiB
Bash
69 lines
1.7 KiB
Bash
#!/bin/sh /etc/rc.common
|
|
# Copyright (C) 2015 OpenWrt.org
|
|
|
|
START=90
|
|
STOP=10
|
|
|
|
USE_PROCD=1
|
|
PROG=/usr/sbin/freshclam
|
|
FRESHCLAM_CONFIGFILE="/tmp/clamav/freshclam.conf"
|
|
|
|
validate_freshclam_section() {
|
|
uci_load_validate freshclam freshclam "$1" "$2" \
|
|
'freshclam_config_file:string' \
|
|
'UpdateLogFile:string' \
|
|
'DatabaseMirror:string' \
|
|
'NotifyClamd:string' \
|
|
'DatabaseOwner:string' \
|
|
'CompressLocalDatabase:string' \
|
|
'DatabaseDirectory:string:'
|
|
}
|
|
|
|
start_freshclam_instance() {
|
|
[ "$2" = 0 ] || {
|
|
echo "validation failed"
|
|
return 1
|
|
}
|
|
|
|
[ -f /tmp/freshclam.pid ] && echo "already running" && return 0
|
|
|
|
mkdir -p $DatabaseDirectory
|
|
mkdir -p /etc/clamav
|
|
touch /tmp/freshclam.log
|
|
touch /tmp/freshclam.pid
|
|
|
|
mkdir -p $(dirname $FRESHCLAM_CONFIGFILE)
|
|
ln -sf $freshclam_config_file $FRESHCLAM_CONFIGFILE
|
|
|
|
echo "UpdateLogFile " $UpdateLogFile > $FRESHCLAM_CONFIGFILE
|
|
echo "DatabaseMirror " $DatabaseMirror >> $FRESHCLAM_CONFIGFILE
|
|
echo "NotifyClamd " $NotifyClamd >> $FRESHCLAM_CONFIGFILE
|
|
echo "DatabaseOwner " $DatabaseOwner >> $FRESHCLAM_CONFIGFILE
|
|
echo "CompressLocalDatabase " $CompressLocalDatabase >> $FRESHCLAM_CONFIGFILE
|
|
echo "DatabaseDirectory " $DatabaseDirectory >> $FRESHCLAM_CONFIGFILE
|
|
|
|
procd_open_instance
|
|
procd_set_param command $PROG -d --config-file=$FRESHCLAM_CONFIGFILE -p /tmp/freshclam.pid --no-warnings
|
|
procd_set_param file $FRESHCLAM_CONFIGFILE
|
|
procd_close_instance
|
|
}
|
|
|
|
start_service()
|
|
{
|
|
validate_freshclam_section freshclam start_freshclam_instance
|
|
}
|
|
|
|
stop_service()
|
|
{
|
|
[ ! -f /tmp/freshclam.pid ] && echo "not running" && return 0
|
|
PID=`cat /tmp/freshclam.pid`
|
|
kill $PID
|
|
rm -f /tmp/freshclam.pid
|
|
}
|
|
|
|
service_triggers()
|
|
{
|
|
procd_add_reload_trigger "freshclam"
|
|
procd_add_validation validate_freshclam_section
|
|
}
|