--- rpms/smeserver-clamav/sme10/smeserver-clamav.spec 2020/12/16 17:06:02 1.5 +++ rpms/smeserver-clamav/sme10/smeserver-clamav.spec 2021/01/03 04:31:10 1.6 @@ -1,16 +1,17 @@ -# $Id: smeserver-clamav.spec,v 1.4 2019/11/27 03:52:30 jpp Exp $ +# $Id: smeserver-clamav.spec,v 1.5 2020/12/16 17:06:02 jcrisp Exp $ Summary: SME Server module to configure clamav %define name smeserver-clamav Name: %{name} %define version 2.7.0 -%define release 1 +%define release 2 Version: %{version} Release: %{release}%{?dist} License: GPL Group: System Environment/Base Source: %{name}-%{version}.tar.xz -#Patch0: smeserver-clamav-2.7.0-bz123454-som-fix.patch +Patch0: smeserver-clamav-2.7.0-bz11103-improvements.patch + BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot BuildArchitectures: noarch Requires: e-smith-lib @@ -32,9 +33,15 @@ BuildRequires: e-smith-devtools SME Server enhancement to configure and run clamd and freshclam %changelog +* Sat Jan 02 2021 Jean-Philipe Pialasse 2.7.0-2.sme +- add pid folder /run/clamd/ [SME: 11103] + few improvements +- create update event [SME: 11162] + * Wed Dec 16 2020 John Crisp 2.7.0-1 - Updated to use 0.103+ from EPEL [SME: 11194] -- Updated to use systemd +- Updated to use systemd for clamd [SME: 11103] +- Updated to use systemd for freshclam [SME: 11104] * Tue Nov 26 2019 Jean-Philipe Pialasse 2.6.0-4.sme - increase lower memory limit to 1GB [SME: 10833] @@ -365,27 +372,45 @@ SME Server enhancement to configure and %prep %setup -#%patch0 -p1 +%patch0 -p1 +mkdir -p root/run/clamd +rm -rf root/etc/e-smith/templates/usr/lib/systemd/system/freshclam.service.d +rm -rf root/usr/lib/systemd/system/freshclam.service.d %build perl createlinks %pre - +if [ $1 -gt 1 ] ; then + if [ -e /var/service/clamd/run ] ; then + /usr/bin/sv d clamd + /usr/bin/sv d clamd/log + fi +fi +if [ $1 -gt 1 ] ; then + if [ -e /var/service/freshclam/run ] ; then + /usr/bin/sv d freshclam + /usr/bin/sv d freshclam/log + fi +fi %post # All a bit ugly clearing up due to migrating freshclam here and A5 updates # Most of this can go in due course -echo "File cleanup" +#echo "File cleanup" # cleanup old files -rm -f /etc/cron.d/clamav 2>/dev/null || true -rm -f /etc/logrotate.d/clamav 2>/dev/null || true -rm -f /etc/clamd.d/scan.conf 2>/dev/null || true -rm -rf /etc/e-smith/events/bootstrap-console-save/templates2expand/etc/cron.daily/freshclam 2>/dev/null || true -rm -f /etc/crond.daily/freshclam* 2>/dev/null || true -rm -rf /var/clamav 2>/dev/null || true +# no clue where it comes from not in sme9, not in new rpms, not templated +#rm -f /etc/cron.d/clamav 2>/dev/null || true +# this is clamd-0.100.2-2.el7.sme.x86_64 owned and not templated, removing the rpm will remove it ; useless +#rm -f /etc/logrotate.d/clamav 2>/dev/null || true +# this is clamav-filesystem-0.103.0-1.el7.noarch owned, should be done elsewhere, will be readded everytime the rpm is updated +#rm -f /etc/clamd.d/scan.conf 2>/dev/null || true +# should only be removed from prep as it is owned by this rpm +#rm -rf /etc/e-smith/events/bootstrap-console-save/templates2expand/etc/cron.daily/freshclam 2>/dev/null || true +# clamav-db and clamd rpm owned, might remains because of the content +#rm -rf /var/clamav 2>/dev/null || true echo "Changing freshclam log owners" if [[ -d /var/log/freshclam ]]; then @@ -403,6 +428,7 @@ fi rm -rf $RPM_BUILD_ROOT (cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) /sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ + --dir /run/clamd 'attr(2775,clamscan,virusgroup)' \ --dir /var/log/freshclam 'attr(2755,clamupdate,clamupdate)' \ --dir /var/log/clamd 'attr(2755,clamscan,clamscan)' \ --dir /var/spool/clamav/quarantine 'attr(2750,clamscan,clamscan)' \