%if 0%{?fedora} > 0 # i dont know when fedora changed this but older versions are out of support %define clamupdate_user clamupdate %define clamupdate_user clamupdate %define have_systemd 1 %define distro centos7 %else %if 0%{?rhel} >= 7 %define clamupdate_user clamupdate %define clamupdate_group clamupdate %define have_systemd 1 %define distro centos7 %else %define clamupdate_user clamav %define clamupdate_group clamav %define have_systemd 0 %define distro centos6 %endif %endif Name: clamav-unofficial-sigs Version: 5.6.2 Release: 1%{?dist} Summary: Scripts to download unoffical clamav signatures Group: Applications/System License: BSD URL: https://github.com/extremeshok/clamav-unofficial-sigs Source0: https://codeload.github.com/extremeshok/%{name}/tar.gz/%{version}#/%{name}-%{version}.tar.gz BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: bind-utils Requires: clamav rsync gnupg diffutils curl bind-utils %if %distro == centos7 Requires: clamav-server %endif %if %{have_systemd} == 0 Requires: crontabs %else Requires: util-linux %{?systemd_requires} BuildRequires: systemd-units %endif %description This package contains scripts and configuration files that provide the capability to download, test, and update the 3rd-party signature databases provide by Sanesecurity, SecuriteInfo, MalwarePatrol, OITC, INetMsg and ScamNailer. %prep %setup -q # change clam user/group to match our setup (varies with OS version and clam source repo) #sed -i "s:clam_user=\"clam\":clam_user=\"%{clamupdate_user}\":g" config/os.%{distro}.conf #sed -i "s:clam_group=\"clam\":clam_group=\"%{clamupdate_group}\":g" config/os.%{distro}.conf #sed -i "s:clam_dbs=\"/var/lib/clamav\":clam_dbs=\"%{clam_db_dir}\":g" config/os.%{distro}.conf # fix log path sed -i -e '$ilog_file_path="%{_localstatedir}/log"\n' config/os.%{distro}.conf # lock out install/upgrade/remove features in script sed -i -e '$ipkg_mgr="yum"' config/os.%{distro}.conf sed -i -e '$ipkg_rm="yum autoremove %{name}"\n' config/os.%{distro}.conf # fix path and run as clamupdate_user sed -i -e 's@^ExecStart=.*$@ExecStart=/sbin/runuser -u %{clamupdate_user} %{_sbindir}/%{name}@' systemd/%{name}.service # use clamav-notify-servers to reload sed -i -e 's@^clamd_reload_opt=.*$@clamd_reload_opt="/usr/sbin/clamav-notify-servers"@' config/os.centos7.conf sed -i -e '/^clamd_pid/ {s/^/#/}' config/os.centos7.conf sed -i -e '/^clamd_restart_opt/ {s/^/#/}' config/os.centos7.conf # use condrestart on centos6 sed -i -e 's/service clamd restart/service clamd condrestart/' config/os.centos6.conf # config version is hardcoded here so if upstream changes build will fail cat > install.conf </dev/null 2>&1 || : systemctl start %{name}.timer >/dev/null 2>&1 || : %else sed -i -e s/@RANDOM@/$(( ( RANDOM % 59 ) + 1 ))/ %{_sysconfdir}/cron.d/%{name} %endif %postun %if %{have_systemd} == 1 %systemd_postun_with_restart %{name}.service %systemd_postun_with_restart %{name}.timer %endif %files %defattr(-,root,root,-) %doc README.md INSTALL LICENSE %dir %{_sysconfdir}/%{name} %config %{_sysconfdir}/%{name}/master.conf %config %{_sysconfdir}/%{name}/os.conf %config(noreplace) %{_sysconfdir}/%{name}/user.conf %if %{have_systemd} == 0 %config(noreplace) %{_sysconfdir}/cron.d/* %else %{_unitdir}/%{name}.service %{_unitdir}/%{name}.timer %endif %config(noreplace) %{_sysconfdir}/logrotate.d/* %{_sbindir}/* %{_mandir}/man8/* %ghost %attr(0640,%{clamupdate_user},%{clamupdate_group}) %{_localstatedir}/log/%{name}.log %attr(0755,%{clamupdate_user},%{clamupdate_group}) %dir %{_localstatedir}/lib/%{name} %changelog * Thu Mar 23 2017 Luca Berra 5.6.2-1 - Update to 5.6.2 - rework specfile * Thu Jul 28 2016 Kenneth Porter - 5.4.1-1 - Update to 5.4.1. * Wed Feb 03 2016 Fedora Release Engineering - 3.7.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Mon Jul 20 2015 Ján ONDREJ (SAL) - 3.7.2-1 - Update to upstream - EPEL7 branch - New source URL and URL at sourceforge (see also debian bug#734593) * Wed Jun 17 2015 Fedora Release Engineering - 3.7.1-13 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Sat Jun 07 2014 Fedora Release Engineering - 3.7.1-12 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild * Wed Aug 07 2013 Pierre-Yves Chibon - 3.7.1-11 - Add a missing requirement on crontabs to spec file - Fixes RHBZ#988602 * Sat Aug 03 2013 Fedora Release Engineering - 3.7.1-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild * Wed Feb 13 2013 Fedora Release Engineering - 3.7.1-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild * Sat Aug 04 2012 Andrew Colin Kissa - 3.7.1-8 - FIX: bugzilla #842180 * Wed Jul 18 2012 Fedora Release Engineering - 3.7.1-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild * Thu Jan 12 2012 Fedora Release Engineering - 3.7.1-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild * Sat Apr 23 2011 Andrew Colin Kissa - 3.7.1-5 - FIX: bugzilla #683139 * Tue Feb 08 2011 Fedora Release Engineering - 3.7.1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild * Sun Jan 02 2011 Andrew Colin Kissa - 3.7.1-3 - Fixes requested by reviewer * Thu Dec 23 2010 Andrew Colin Kissa - 3.7.1-2 - Fixes requested by reviewer * Tue Jul 20 2010 Andrew Colin Kissa - 3.7.1-1 - upgraded to latest upstream * Thu Apr 22 2010 Andrew Colin Kissa - 3.7-3 - Fix sed error * Mon Mar 15 2010 Andrew Colin Kissa - 3.7-2 - Fix the cron entry * Tue Mar 09 2010 Andrew Colin Kissa - 3.7-1 - Initial packaging