78df14
Name:           clamav-unofficial-sigs
7cc4b3
Version:        5.6.2
36c45c
Release:        4%{?dist}
78df14
Summary:        Scripts to download unoffical clamav signatures 
78df14
License:        BSD
7cc4b3
URL:            https://github.com/extremeshok/%{name}
7cc4b3
Source0:        https://github.com/extremeshok/%{name}/archive/%{version}.tar.gz
78df14
BuildArch:      noarch
7cc4b3
BuildRequires:  bind-utils
7cc4b3
BuildRequires:  rsync
7cc4b3
BuildRequires:  systemd
78df14
Requires:       clamav clamav-update rsync gnupg diffutils curl bind-utils
7cc4b3
Requires(post): systemd-sysv
78df14
78df14
%description
78df14
This package contains scripts and configuration files
78df14
that provide the capability to download, test, and 
78df14
update the 3rd-party signature databases provide by 
78df14
Sanesecurity, SecuriteInfo, MalwarePatrol, OITC, 
78df14
INetMsg and ScamNailer.
78df14
78df14
%prep
7cc4b3
%setup -qn %{name}-%{version}
7cc4b3
sed -i -e '/user_configuration_complete/ s/^#//' config/user.conf
7cc4b3
sed -i -e '/ExecStart/ s^/usr/local/sbin^/usr/sbin^' systemd/clamav-unofficial-sigs.service
7cc4b3
# Just for generating cron, logrotate and man files
7cc4b3
grep version config/master.conf > build.conf
7cc4b3
cat << EOF >> build.conf
7cc4b3
clamscan_bin="/usr/bin/clamscan"
7cc4b3
rsync_bin="/usr/bin/rsync"
7cc4b3
clam_user=root
7cc4b3
clam_group=root
7cc4b3
work_dir="."
7cc4b3
clam_dbs="."
7cc4b3
man_dir="."
7cc4b3
cron_filename="%{name}.cron"
7cc4b3
cron_dir="."
7cc4b3
logrotate_filename="%{name}.logrotate"
7cc4b3
logrotate_dir="."
7cc4b3
log_file_path="."
7cc4b3
user_configuration_complete="yes"
7cc4b3
EOF
78df14
78df14
%build
7cc4b3
bash clamav-unofficial-sigs.sh -c ./build.conf --install-all
7cc4b3
%if 0%{?rhel} == 7
7cc4b3
sed -i -e '/^#pkg_mgr/ s/^#//;s/""/"yum"/' config/master.conf
7cc4b3
%else
7cc4b3
sed -i -e '/^#pkg_mgr/ s/^#//;s/""/"dnf"/' config/master.conf
7cc4b3
%endif
624eb5
# Disable yara rules
624eb5
sed -i -e '/^enable_yararules/ s/yes/no/' config/master.conf
624eb5
sed -i -e '/^clamd_restart_opt/ s/systemctl restart/systemctl try-restart/' config/os.centos7.conf
7cc4b3
sed -i -e 's^%{_builddir}/%{name}-%{version}^%{_sbindir}^g' clamav-unofficial-sigs.cron
624eb5
sed -i -e 's^\./^%{_localstatedir}/log/clamav-unofficial-sigs/*.log^' clamav-unofficial-sigs.logrotate
78df14
78df14
%install
7cc4b3
rm -rf %{buildroot}
7cc4b3
install -d -p %{buildroot}%{_unitdir}
7cc4b3
install -d -p %{buildroot}%{_sysconfdir}/%{name}
7cc4b3
install -d -p %{buildroot}%{_sbindir}
7cc4b3
install -d -p %{buildroot}%{_localstatedir}/log/%{name}
7cc4b3
install -d -p %{buildroot}%{_localstatedir}/lib/%{name}
7cc4b3
install -d -p %{buildroot}%{_sysconfdir}/cron.d
7cc4b3
install -d -p %{buildroot}%{_sysconfdir}/logrotate.d
7cc4b3
install -d -p %{buildroot}%{_mandir}/man8
7cc4b3
install -p -m0755 clamav-unofficial-sigs.sh %{buildroot}%{_sbindir}/clamav-unofficial-sigs.sh
7cc4b3
# config/os.centos7.conf file is for epel and fedora
7cc4b3
install -p -m0644 config/os.centos7.conf %{buildroot}%{_sysconfdir}/%{name}/os.conf
7cc4b3
install -p -m0644 config/user.conf %{buildroot}%{_sysconfdir}/%{name}/user.conf
7cc4b3
install -p -m0644 config/master.conf %{buildroot}%{_sysconfdir}/%{name}/master.conf
7cc4b3
install -Dp -m 0644 systemd/clamav-unofficial-sigs.service %{buildroot}%{_unitdir}/clamav-unofficial-sigs.service
7cc4b3
install -Dp -m 0644 systemd/clamav-unofficial-sigs.timer %{buildroot}%{_unitdir}/clamav-unofficial-sigs.timer
7cc4b3
install -p -m0644 clamav-unofficial-sigs.cron %{buildroot}%{_sysconfdir}/cron.d/clamav-unofficial-sigs
7cc4b3
install -p -m0644 clamav-unofficial-sigs.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/clamav-unofficial-sigs
7cc4b3
install -p -m0644 clamav-unofficial-sigs.8 %{buildroot}%{_mandir}/man8/clamav-unofficial-sigs.8
7cc4b3
78df14
%files
7cc4b3
%doc README.md INSTALL 
7cc4b3
%license LICENSE
78df14
%dir %{_sysconfdir}/%{name}
7cc4b3
%config %{_sysconfdir}/%{name}/os.conf
7cc4b3
%config %{_sysconfdir}/%{name}/master.conf
7cc4b3
%config(noreplace) %{_sysconfdir}/%{name}/user.conf
7cc4b3
%{_sbindir}/clamav-unofficial-sigs.sh
78df14
%attr(0755,clamupdate,clamupdate) %dir %{_localstatedir}/lib/%{name}
7cc4b3
%attr(0755,clamupdate,clamupdate) %dir %{_localstatedir}/log/%{name}
7cc4b3
%{_unitdir}/%{name}.service
7cc4b3
%{_unitdir}/%{name}.timer
7cc4b3
%{_sysconfdir}/cron.d/%{name}
7cc4b3
%{_sysconfdir}/logrotate.d/%{name}
7cc4b3
%{_mandir}/man*/%{name}*
78df14
78df14
%changelog
36c45c
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 5.6.2-4
36c45c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
36c45c
624eb5
* Fri Dec 21 2018 Didier Fabert <didier.fabert@gmail.com> 5.6.2-3
624eb5
- Fix logrotate (files are rotated more than one time)
624eb5
- Fix clamd_restart_opt with try-restart
624eb5
- Disable yara rules by default (can be enabled in user.conf to overrride master.conf setting)
624eb5
7cc4b3
* Wed Sep 12 2018 Didier Fabert <didier.fabert@gmail.com> 5.6.2-2
7cc4b3
- Generate cron, logrotate and man files
7cc4b3
7cc4b3
* Wed Sep 12 2018 Didier Fabert <didier.fabert@gmail.com> 5.6.2-1
7cc4b3
- Switch to new upstream: extremeshok on github
3a6f76
290830
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.2-5
290830
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
290830
5c2ff8
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.2-4
5c2ff8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
5c2ff8
1b847f
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.2-3
1b847f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
1b847f
fa3235
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.2-2
fa3235
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
fa3235
Jan ONDREJ (SAL) 882154
* Mon Jul 20 2015 Jรกn ONDREJ (SAL) <ondrejj(at)salstar.sk> - 3.7.2-1
Jan ONDREJ (SAL) 882154
- Update to upstream
Jan ONDREJ (SAL) 882154
- EPEL7 branch
Jan ONDREJ (SAL) 882154
- New source URL and URL at sourceforge (see also debian bug#734593)
Jan ONDREJ (SAL) 882154
e96aaf
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.7.1-13
e96aaf
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
e96aaf
1f60b6
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.7.1-12
1f60b6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
1f60b6
0d506a
* Wed Aug 07 2013 Pierre-Yves Chibon <pingou@pingoured.fr> - 3.7.1-11
0d506a
- Add a missing requirement on crontabs to spec file
0d506a
- Fixes RHBZ#988602
0d506a
6ffe5a
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.7.1-10
6ffe5a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
6ffe5a
ef8e4f
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.7.1-9
ef8e4f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
ef8e4f
3e778c
* Sat Aug 04 2012 Andrew Colin Kissa <andrew@topdog.za.net> - 3.7.1-8
3e778c
- FIX: bugzilla #842180
3e778c
6bf6d5
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.7.1-7
6bf6d5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
6bf6d5
621b37
* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.7.1-6
621b37
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
621b37
cd0d6b
* Sat Apr 23 2011 Andrew Colin Kissa <andrew@topdog.za.net> - 3.7.1-5
cd0d6b
- FIX: bugzilla #683139
cd0d6b
0e7e66
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.7.1-4
0e7e66
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
0e7e66
78df14
* Sun Jan 02 2011 Andrew Colin Kissa <andrew@topdog.za.net> - 3.7.1-3
78df14
- Fixes requested by reviewer
78df14
78df14
* Thu Dec 23 2010 Andrew Colin Kissa <andrew@topdog.za.net> - 3.7.1-2
78df14
- Fixes requested by reviewer
78df14
78df14
* Tue Jul 20 2010 Andrew Colin Kissa <andrew@topdog.za.net> - 3.7.1-1
78df14
- upgraded to latest upstream
78df14
Jan ONDREJ (SAL) 882154
* Thu Apr 22 2010 Andrew Colin Kissa <andrew@topdog.za.net> - 3.7-3
78df14
- Fix sed error
78df14
78df14
* Mon Mar 15 2010 Andrew Colin Kissa <andrew@topdog.za.net> - 3.7-2
78df14
- Fix the cron entry
78df14
78df14
* Tue Mar 09 2010 Andrew Colin Kissa <andrew@topdog.za.net> - 3.7-1
78df14
- Initial packaging