Accepting request 226920 from home:bmanojlovic:branches:security
- initial systemd support unit files OBS-URL: https://build.opensuse.org/request/show/226920 OBS-URL: https://build.opensuse.org/package/show/security/clamav?expand=0&rev=95
This commit is contained in:
parent
a8582c8355
commit
e543ab3c80
@ -1,3 +1,8 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Mar 13 15:41:18 UTC 2014 - boris@steki.net
|
||||||
|
|
||||||
|
- initial systemd support unit files
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed Feb 19 07:02:06 UTC 2014 - meissner@suse.com
|
Wed Feb 19 07:02:06 UTC 2014 - meissner@suse.com
|
||||||
|
|
||||||
|
36
clamav.spec
36
clamav.spec
@ -64,11 +64,17 @@ Source3: clamav-updateclamconf
|
|||||||
Source4: clamav-rpmlintrc
|
Source4: clamav-rpmlintrc
|
||||||
Source5: clamav-rcmilter
|
Source5: clamav-rcmilter
|
||||||
Source6: clamav-tmpfiles.conf
|
Source6: clamav-tmpfiles.conf
|
||||||
|
Source7: service.clamd
|
||||||
|
Source8: service.freshclam
|
||||||
|
Source9: service.clamav-milter
|
||||||
Patch1: clamav-conf.patch
|
Patch1: clamav-conf.patch
|
||||||
Patch2: clamav-sles9.patch
|
Patch2: clamav-sles9.patch
|
||||||
Patch3: clamav-gcc47.patch
|
Patch3: clamav-gcc47.patch
|
||||||
Patch4: clamav-fan-syscalls.patch
|
Patch4: clamav-fan-syscalls.patch
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
|
%if 0%{?suse_version} >= 1210
|
||||||
|
BuildRequires: systemd
|
||||||
|
%endif
|
||||||
|
|
||||||
%description
|
%description
|
||||||
ClamAV is an open source (GPL) antivirus engine designed for detecting
|
ClamAV is an open source (GPL) antivirus engine designed for detecting
|
||||||
@ -152,6 +158,21 @@ mv clamav-milter.conf.sample clamav-milter.conf
|
|||||||
mv freshclam.conf.sample freshclam.conf
|
mv freshclam.conf.sample freshclam.conf
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
# Systemd...
|
||||||
|
%if 0%{?suse_version} >= 1210
|
||||||
|
install -d -m 0755 %buildroot/%{_unitdir}
|
||||||
|
install -m 0644 %{SOURCE7} %buildroot/%{_unitdir}/clamd.service
|
||||||
|
install -m 0644 %{SOURCE8} %buildroot/%{_unitdir}/freshclam.service
|
||||||
|
install -m 0644 %{SOURCE9} %buildroot/%{_unitdir}/clamav-milter.service
|
||||||
|
# this is broken if system does not have systemd so don't
|
||||||
|
# use it at all on systems without mandatory systemd
|
||||||
|
%if 0%{?suse_version} >= 1230
|
||||||
|
for srvname in clamd freshclam clamav-milter;do
|
||||||
|
(export PATH=/sbin:/usr/sbin:$PATH ;ln -sf $(which service) %{buildroot}/%{_sbindir}/rc${srvname})
|
||||||
|
done
|
||||||
|
%endif
|
||||||
|
%endif
|
||||||
|
|
||||||
%check
|
%check
|
||||||
|
|
||||||
# regression tests
|
# regression tests
|
||||||
@ -163,6 +184,12 @@ VALGRIND_GENSUP=1 make check
|
|||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
%config(noreplace) %_sysconfdir/*.conf
|
%config(noreplace) %_sysconfdir/*.conf
|
||||||
%config %attr(744,root,root)/etc/init.d/*
|
%config %attr(744,root,root)/etc/init.d/*
|
||||||
|
#systemd...
|
||||||
|
%if 0%{?suse_version} >= 1210
|
||||||
|
%{_unitdir}/clamd.service
|
||||||
|
%{_unitdir}/freshclam.service
|
||||||
|
%{_unitdir}/clamav-milter.service
|
||||||
|
%endif
|
||||||
%_tmpfilesdir
|
%_tmpfilesdir
|
||||||
%doc AUTHORS BUGS ChangeLog COPYING FAQ NEWS README UPGRADE
|
%doc AUTHORS BUGS ChangeLog COPYING FAQ NEWS README UPGRADE
|
||||||
%doc docs/*.pdf docs/html
|
%doc docs/*.pdf docs/html
|
||||||
@ -183,6 +210,9 @@ VALGRIND_GENSUP=1 make check
|
|||||||
%_sbindir/usermod vscan -g vscan 2> /dev/null || :
|
%_sbindir/usermod vscan -g vscan 2> /dev/null || :
|
||||||
|
|
||||||
%post
|
%post
|
||||||
|
%{fillup_and_insserv clamd}
|
||||||
|
%{fillup_and_insserv freshclam}
|
||||||
|
#%%{fillup_and_insserv clamav-filter}
|
||||||
/sbin/ldconfig
|
/sbin/ldconfig
|
||||||
# merge config files on update
|
# merge config files on update
|
||||||
test "0$1" -lt 2 && exit 0
|
test "0$1" -lt 2 && exit 0
|
||||||
@ -199,14 +229,16 @@ for f in /etc/clamd.conf /etc/freshclam.conf /etc/clamav-milter.conf; do
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
%if 0%{?suse_version} >= 1210
|
||||||
systemd-tmpfiles --create %_tmpfilesdir/clamav.conf
|
systemd-tmpfiles --create %_tmpfilesdir/clamav.conf
|
||||||
|
%endif
|
||||||
|
|
||||||
%preun
|
%preun
|
||||||
%stop_on_removal clamd freshclam
|
%stop_on_removal clamd freshclam clamav-milter
|
||||||
|
|
||||||
%postun
|
%postun
|
||||||
/sbin/ldconfig
|
/sbin/ldconfig
|
||||||
%restart_on_update clamd freshclam
|
%restart_on_update clamd freshclam clamav-milter
|
||||||
%insserv_cleanup
|
%insserv_cleanup
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
14
service.clamav-milter
Normal file
14
service.clamav-milter
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Clamav antivirus milter daemon
|
||||||
|
After=syslog.target network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=forking
|
||||||
|
ExecStart=/usr/sbin/clamav-milter
|
||||||
|
; it will switch to vscan user
|
||||||
|
;User=vscan
|
||||||
|
;Group=vscan
|
||||||
|
;PrivateTmp=yes
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
13
service.clamd
Normal file
13
service.clamd
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Clamav antivirus Deamon
|
||||||
|
After=syslog.target network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=forking
|
||||||
|
ExecStart=/usr/sbin/clamd
|
||||||
|
;User=vscan
|
||||||
|
;Group=vscan
|
||||||
|
;PrivateTmp=yes
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
13
service.freshclam
Normal file
13
service.freshclam
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Freshclam virus definitions downloader
|
||||||
|
After=syslog.target network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=forking
|
||||||
|
ExecStart=/usr/bin/freshclam -d
|
||||||
|
;User=vscan
|
||||||
|
;Group=vscan
|
||||||
|
;PrivateTmp=yes
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
Loading…
Reference in New Issue
Block a user