1 |
# $Id: smeserver-clamav.spec,v 1.4 2019/11/27 03:52:30 jpp Exp $ |
# $Id: smeserver-clamav.spec,v 1.11 2021/04/18 20:18:15 jpp Exp $ |
2 |
|
|
3 |
Summary: SME Server module to configure clamav |
Summary: SME Server module to configure clamav |
4 |
%define name smeserver-clamav |
%define name smeserver-clamav |
5 |
Name: %{name} |
Name: %{name} |
6 |
%define version 2.7.0 |
%define version 2.7.0 |
7 |
%define release 1 |
%define release 8 |
8 |
Version: %{version} |
Version: %{version} |
9 |
Release: %{release}%{?dist} |
Release: %{release}%{?dist} |
10 |
License: GPL |
License: GPL |
11 |
Group: System Environment/Base |
Group: System Environment/Base |
12 |
Source: %{name}-%{version}.tar.xz |
Source: %{name}-%{version}.tar.xz |
13 |
#Patch0: smeserver-clamav-2.7.0-bz123454-som-fix.patch |
Patch0: smeserver-clamav-2.7.0-bz11103-improvements.patch |
14 |
|
Patch1: smeserver-clamav-2.7.0-bz11313-clamdtop.patch |
15 |
|
Patch2: smeserver-clamav-2.7.0-bz11520-clamd2scan.conf.patch |
16 |
|
|
17 |
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot |
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot |
18 |
BuildArchitectures: noarch |
BuildArchitectures: noarch |
19 |
Requires: e-smith-lib |
Requires: e-smith-lib |
35 |
SME Server enhancement to configure and run clamd and freshclam |
SME Server enhancement to configure and run clamd and freshclam |
36 |
|
|
37 |
%changelog |
%changelog |
38 |
|
* Sun Apr 18 2021 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-8.sme |
39 |
|
- fix typo and missing +x [SME: 11520] |
40 |
|
|
41 |
|
* Wed Apr 07 2021 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-6.sme |
42 |
|
- fix issues with non epel standard scan.conf [SME: 11520] |
43 |
|
move clamd.conf to scan.conf |
44 |
|
remove alias for clamtop |
45 |
|
add a wrapper for clamdscan to force --fdpass |
46 |
|
|
47 |
|
* Fri Jan 08 2021 Jean-Philipe Pialasse <tests@pialasse.com> 2.7.0-5.sme |
48 |
|
- ease use of clamdtop [SME: 11313] |
49 |
|
|
50 |
|
* Wed Jan 06 2021 Jean-Philipe Pialasse <tests@pialasse.com> 2.7.0-4.sme |
51 |
|
- fix Transaction check error [SME: 11311] |
52 |
|
|
53 |
|
* Sat Jan 02 2021 Jean-Philipe Pialasse <tests@pialasse.com> 2.7.0-2.sme |
54 |
|
- add pid folder /run/clamd/ [SME: 11103] |
55 |
|
few improvements |
56 |
|
- create update event [SME: 11162] |
57 |
|
|
58 |
* Wed Dec 16 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 2.7.0-1 |
* Wed Dec 16 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 2.7.0-1 |
59 |
- Updated to use 0.103+ from EPEL [SME: 11194] |
- Updated to use 0.103+ from EPEL [SME: 11194] |
60 |
- Updated to use systemd |
- Updated to use systemd for clamd [SME: 11103] |
61 |
|
- Updated to use systemd for freshclam [SME: 11104] |
62 |
|
|
63 |
* Tue Nov 26 2019 Jean-Philipe Pialasse <tests@pialasse.com> 2.6.0-4.sme |
* Tue Nov 26 2019 Jean-Philipe Pialasse <tests@pialasse.com> 2.6.0-4.sme |
64 |
- increase lower memory limit to 1GB [SME: 10833] |
- increase lower memory limit to 1GB [SME: 10833] |
389 |
|
|
390 |
%prep |
%prep |
391 |
%setup |
%setup |
392 |
#%patch0 -p1 |
%patch0 -p1 |
393 |
|
mkdir -p root/run/clamd |
394 |
|
rm -rf root/etc/e-smith/templates/usr/lib/systemd/system/freshclam.service.d |
395 |
|
rm -rf root/usr/lib/systemd/system/freshclam.service.d |
396 |
|
%patch1 -p1 |
397 |
|
%patch2 -p1 |
398 |
|
|
399 |
%build |
%build |
400 |
perl createlinks |
perl createlinks |
401 |
|
|
402 |
%pre |
%pre |
403 |
|
if [ $1 -gt 1 ] ; then |
404 |
|
if [ -e /var/service/clamd/run ] ; then |
405 |
|
/usr/bin/sv d clamd |
406 |
|
/usr/bin/sv d clamd/log |
407 |
|
fi |
408 |
|
fi |
409 |
|
if [ $1 -gt 1 ] ; then |
410 |
|
if [ -e /var/service/freshclam/run ] ; then |
411 |
|
/usr/bin/sv d freshclam |
412 |
|
/usr/bin/sv d freshclam/log |
413 |
|
fi |
414 |
|
fi |
415 |
%post |
%post |
416 |
|
# removing old conf file |
417 |
|
if [[ -f /etc/clamd.d/clamd.conf ]]; then |
418 |
|
rm -f /etc/clamd.d/clamd.conf |
419 |
|
fi |
420 |
|
|
421 |
# All a bit ugly clearing up due to migrating freshclam here and A5 updates |
#echo "Changing freshclam log owners" |
|
# Most of this can go in due course |
|
|
|
|
|
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 |
|
|
|
|
|
echo "Changing freshclam log owners" |
|
422 |
if [[ -d /var/log/freshclam ]]; then |
if [[ -d /var/log/freshclam ]]; then |
423 |
chown -R clamupdate:clamupdate /var/log/freshclam; |
chown -R clamupdate:clamupdate /var/log/freshclam; |
424 |
chown -R clamupdate:clamupdate /var/log/freshclam/*; |
chown -R clamupdate:clamupdate /var/log/freshclam/*; |
425 |
fi |
fi |
426 |
|
|
427 |
echo "Changing clamd log owners" |
#echo "Changing clamd log owners" |
428 |
if [[ -d /var/log/clamd ]]; then |
if [[ -d /var/log/clamd ]]; then |
429 |
chown -R clamscan:clamscan /var/log/clamd; |
chown -R clamscan:clamscan /var/log/clamd; |
430 |
chown -R clamscan:clamscan /var/log/clamd/*; |
chown -R clamscan:clamscan /var/log/clamd/*; |
434 |
rm -rf $RPM_BUILD_ROOT |
rm -rf $RPM_BUILD_ROOT |
435 |
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) |
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) |
436 |
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ |
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ |
437 |
|
--dir /run/clamd 'attr(2775,clamscan,virusgroup)' \ |
438 |
--dir /var/log/freshclam 'attr(2755,clamupdate,clamupdate)' \ |
--dir /var/log/freshclam 'attr(2755,clamupdate,clamupdate)' \ |
439 |
--dir /var/log/clamd 'attr(2755,clamscan,clamscan)' \ |
--dir /var/log/clamd 'attr(2755,clamscan,clamscan)' \ |
440 |
--dir /var/spool/clamav/quarantine 'attr(2750,clamscan,clamscan)' \ |
--dir /var/spool/clamav/quarantine 'attr(2750,clamscan,clamscan)' \ |
441 |
|
--file /sbin/clamdscan 'attr(0755,root,root)' \ |
442 |
--file /sbin/e-smith/freshclam-update-failed 'attr(0755,root,root)' \ |
--file /sbin/e-smith/freshclam-update-failed 'attr(0755,root,root)' \ |
443 |
--file /sbin/e-smith/freshclam-update-ok 'attr(0755,root,root)' \ |
--file /sbin/e-smith/freshclam-update-ok 'attr(0755,root,root)' \ |
444 |
--file /sbin/e-smith/smeserver-clamscan 'attr(0755,root,root)' \ |
--file /sbin/e-smith/smeserver-clamscan 'attr(0755,root,root)' \ |