%bcond_with systemd %bcond_with external_llvm %define dbdir %{_localstatedir}/lib/clamav %define milter 1 Summary: Clam AntiVirus Summary(ja): Clamアンチウィルススキャナ Name: clamav Version: 0.104.0 Release: 1%{?_dist_release}%{?with_systemd:.systemd} Group: security Vendor: Project Vine Distribution: Vine Linux Packager: tomop, inagaki License: GPL URL: https://www.clamav.net/ Source0: https://www.clamav.net/downloads/production/%{name}-%{version}.tar.gz Source1: clamd.init Source2: freshclam.init Source3: clamav-milter.init Source4: clamav.logrotate Source5: clamav-milter.logrotate #for clamonacc Source100: clamonacc.service #for clamav-milter.systemd Source330: clamav-milter.systemd #for scanner-systemd/server-systemd Source530: clamd.service Source550: clamav-freshclam.service BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRequires: cmake BuildRequires: bzip2-devel, curl-devel > 7.10.0, gmp-devel, ncurses-devel BuildRequires: openssl-devel, pcre2-devel, libxml2-devel, zlib-devel BuildRequires: json-c-devel %if %{with external_llvm} BuildRequires: llvm-devel %endif %if %{?milter} #BuildRequires: sendmail-devel BuildRequires: libmilter-devel %endif Requires: logrotate Requires(pre): shadow-utils, grep %if %{with systemd} #BuildRequires: systemd-devel %{?systemd_requires} %else Requires(post): chkconfig Requires(preun): chkconfig %endif %description Clam Antivirus is a powerful anti-virus scanner for Unix. It supports AMaViS, compressed files, uses the virus database from OpenAntivirus.org, and includes a program for auto-updating. The scanner is multithreaded, written in C, and POSIX compliant. %description -l ja Clamアンチウィルスは強力なUNIX向けのアンチウィルススキャナです。 AMaViS、圧縮ファイルをサポートし、OpenAntivirus.orgのウィルスデータ ベースを利用しています。またウィルスデータベースの自動アップデート プログラムを含んでいます。 このCで書かれたスキャナはマルチスレッド化 されており、 POSIXに準拠しています。 %if %{?milter} %package milter Summary: Virus scanner for sendmail/postfix Group: security,servers %if %{with systemd} %{?systemd_requires} %else Requires(post): chkconfig Requires(preun): chkconfig %endif %description milter clamav-milter is a milter module to scan mails using Clam AntiVirus. %endif %package devel Summary: headers and libraries for development using Clam AntiVirus Summary(ja): Clam AntiVirus を用いた開発に必要なヘッダ・ライブラリ Group: programming Requires: %{name} = %{version}-%{release} Requires: zlib-devel bzip2-devel gmp-devel %description devel clamav-devel provides headers and libraries for development using Clam AntiVirus. %description -l ja devel  clamav-devel パッケージは、Clam AntiVirus を用いた開発を行うための ヘッダファイルやライブラリファイルを提供します。 %debug_package %prep %setup -q %build %if %{?milter} export CLAMAV_MILTER_LIBS="-lpthread -lmilter" export have_milter=yes %endif %cmake \ -DCMAKE_INSTALL_SYSCONFDIR:PATH=/etc \ -DAPP_CONFIG_DIRECTORY:STRING=/etc \ -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \ -DCMAKE_SKIP_RPATH:BOOL=ON \ -DENABLE_TESTS:BOOL=OFF \ %if %{?milter} -DENABLE_MILTER:BOOL=ON \ %else -DENABLE_MILTER:BOOL=OFF \ %endif -DDATABASE_DIRECTORY:STRING=%{dbdir} %cmake_build %install rm -rf %{buildroot} mkdir -p %{buildroot}%{_sysconfdir}/clamd.d mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d mkdir -p %{buildroot}%{_initdir} mkdir -p %{buildroot}%{_localstatedir}/run/clamav mkdir -p %{buildroot}%{_localstatedir}/log/clamav %cmake_install %if %{with systemd} rm -f %{buildroot}%{_unitdir}/clamav-daemon.s* rm -f %{buildroot}%{_unitdir}/clamav-clamonacc.s* install -Dpm 0644 %{SOURCE100} %{buildroot}%{_unitdir}/clamonacc.service install -Dpm 0644 %{SOURCE530} %{buildroot}%{_unitdir}/clamd.service install -Dpm 0644 %{SOURCE550} %{buildroot}%{_unitdir}/clamav-freshclam.service mkdir -p %{buildroot}%{_tmpfilesdir} cat << EOF > %{buildroot}%{_tmpfilesdir}/clamav.conf d %{_rundir}/clamav 0710 clamav clamav EOF %else install -m755 %{SOURCE1} %{buildroot}%{_initdir}/clamd install -m755 %{SOURCE2} %{buildroot}%{_initdir}/freshclam %endif install -m644 %{SOURCE4} %{buildroot}%{_sysconfdir}/logrotate.d/clamav sed -ri \ -e 's!^Example!#Example!' \ -e 's|^#UpdateLogFile .*$|UpdateLogFile /var/log/clamav/freshclam.log|' \ %{buildroot}%_sysconfdir/freshclam.conf.sample sed -ri \ -e 's!^Example!#Example!' \ -e 's!^#?(LogFile ).*!#\1/var/log/clamav/clamd.log!g' \ -e 's!^#?(LocalSocket ).*!#\1%{_rundir}/clamav/clamd.sock!g' \ -e 's! /usr/local/share/clamav,! %{_sharedstatedir}/clamav,!g' \ %{buildroot}%_sysconfdir/clamd.conf.sample %if %{with systemd} sed -i -e 's|^#PidFile /var/run/|PidFile %{_rundir}/clamav/|' \ %{buildroot}%{_sysconfdir}/clamd.conf.sample \ %{buildroot}%{_sysconfdir}/freshclam.conf.sample %else sed -i -e 's|^#PidFile /var/run/|PidFile %{_localstatedir}/run/clamav/|' \ %{buildroot}%{_sysconfdir}/clamd.conf.sample \ %{buildroot}%{_sysconfdir}/freshclam.conf.sample %endif mv %{buildroot}%{_sysconfdir}/clamd.conf.sample %{buildroot}%{_sysconfdir}/clamd.conf mv %{buildroot}%{_sysconfdir}/freshclam.conf.sample %{buildroot}%{_sysconfdir}/freshclam.conf %if %{?milter} sed -ri \ -e 's!^Example!#Example!' \ -e 's|^#LogFile .+$|LogFile /var/log/clamav/clamav-milter.log|' \ %{buildroot}%{_sysconfdir}/clamav-milter.conf.sample %if %{with systemd} install -Dpm 0644 %{SOURCE330} %{buildroot}%{_unitdir}/clamav-milter.service sed -ri \ -e 's|^#PidFile .+$|PidFile /run/clamav/clamav-milter.pid|' \ %{buildroot}%{_sysconfdir}/clamav-milter.conf.sample %else install -m755 %{SOURCE3} %{buildroot}%{_initdir}/clamav-milter sed -ri \ -e 's|^#PidFile .+$|PidFile /var/run/clamav/clamav-milter.pid|' \ %{buildroot}%{_sysconfdir}/clamav-milter.conf.sample %endif install -m644 %{SOURCE5} %{buildroot}%{_sysconfdir}/logrotate.d/clamav-milter mv %{buildroot}%{_sysconfdir}/clamav-milter.conf.sample %{buildroot}%{_sysconfdir}/clamav-milter.conf %endif rm -f %{buildroot}%{_libdir}/lib*a mkdir -p %{buildroot}%{dbdir} %clean rm -rf %{buildroot} %pre if ! grep -q '^clamav:' /etc/group; then /usr/sbin/groupadd -r clamav fi if ! grep -q '^clamav:' /etc/passwd; then /usr/sbin/useradd -M -r -s /bin/false -g clamav -c "Clam Antivirus" clamav || : fi %post %if %{with systemd} %systemd_post clamd.service %systemd_post clamav-freshclam.service %{?with_tmpfiles:/bin/systemd-tmpfiles --create %{_tmpfilesdir}/clamav.conf || :} %else /sbin/chkconfig --add clamd /sbin/chkconfig --add freshclam %endif %preun %if %{with systemd} %systemd_preun clamd.service %systemd_preun clamav-freshclam.service %else if [ "$1" = 0 -o -x /bin/systemctl ]; then [ ! -f /var/run/clamav/clamd.pid ] || /etc/init.d/clamd stop [ ! -f /var/run/clamav/freshclam.pid ] || /etc/init.d/freshclam stop /sbin/chkconfig --del clamd /sbin/chkconfig --del freshclam fi %endif %postun if [ "$1" = 0 ]; then if [ `grep clamav /etc/passwd | wc -l` = 1 ]; then /usr/sbin/userdel clamav fi if [ `grep clamav /etc/group | wc -l` = 1 ]; then /usr/sbin/groupdel clamav fi else %if %{with systemd} %systemd_postun_with_restart clamd.service %systemd_postun_with_restart clamav-freshclam.service %else [ ! -f /var/run/clamav/clamd.pid ] || /etc/init.d/clamd restart [ ! -f /var/run/clamav/freshclam.pid ] || /etc/init.d/freshclam restart %endif fi %if %{?milter} %post milter %if %{with systemd} %systemd_post clamav-milter.service %else /sbin/chkconfig --add clamav-milter %endif %preun milter %if %{with systemd} %systemd_preun clamav-milter.service %else if [ "$1" = 0 -o -x /bin/systemctl ]; then [ ! -f /var/run/clamav/clamd.pid ] || /etc/init.d/clamav-milter stop /sbin/chkconfig --del clamav-milter fi %endif %postun milter %if %{with systemd} %systemd_postun_with_restart clamav-milter.service %else if [ "$1" -ge 1 ]; then [ ! -f /var/run/clamav/clamav-milter.pid ] || /etc/init.d/clamav-milter restart fi %endif %endif %files %defattr(-,root,root) %license COPYING* %doc NEWS* README* examples %if %{with systemd} %{_unitdir}/clamav-freshclam.service %{_unitdir}/clamd.service %{_unitdir}/clamonacc.service %{_tmpfilesdir}/clamav.conf %else %{_initdir}/clamd %{_initdir}/freshclam %attr(-,clamav,clamav) %dir %{_localstatedir}/run/clamav %endif %config(noreplace) %{_sysconfdir}/clamd.conf %config(noreplace) %{_sysconfdir}/freshclam.conf %config(noreplace) %{_sysconfdir}/logrotate.d/clamav %{_bindir}/* %exclude %{_bindir}/clamav-config %{_sbindir}/* %if %{?milter} %exclude %{_sbindir}/clamav-milter %endif %{_libdir}/lib*.so.* %{_libdir}/libclamunrar_iface.so %attr(-,clamav,clamav) %dir %{_localstatedir}/log/clamav %attr(0755,clamav,clamav) %dir %{dbdir} #%attr(-,clamav,clamav) %config(noreplace) %{dbdir}/main.cvd %exclude %{_mandir}/man8/clamav-milter.8* %{_mandir}/man*/* %if %{?milter} %files milter %defattr(-,root,root) %if %{with systemd} %{_unitdir}/clamav-milter.service %else %{_initdir}/clamav-milter %endif %config(noreplace) %{_sysconfdir}/clamav-milter.conf %config(noreplace) %{_sysconfdir}/logrotate.d/clamav-milter %{_sbindir}/clamav-milter %{_mandir}/man8/clamav-milter.8* %endif %files devel %defattr(-,root,root) %{_bindir}/clamav-config %{_libdir}/lib*.so %exclude %{_libdir}/libclamunrar_iface.so %{_libdir}/pkgconfig/*.pc %{_includedir}/* %changelog * Fri Sep 03 2021 Tomohiro "Tomo-p" KATO 0.104.0-1 - new upstream release. * Tue Jun 22 2021 Tomohiro "Tomo-p" KATO 0.103.3-1 - new upstream release. * Thu Apr 08 2021 Tomohiro "Tomo-p" KATO 0.103.2-1 - new upstream release. * Thu Feb 04 2021 Tomohiro "Tomo-p" KATO 0.103.1-1 - new upstream release. * Tue Sep 15 2020 Tomohiro "Tomo-p" KATO 0.103.0-1 - new upstream release. * Fri Jul 17 2020 Tomohiro "Tomo-p" KATO 0.102.4-1 - new upstream release. * Thu May 14 2020 Tomohiro "Tomo-p" KATO 0.102.3-1 - new upstream release. - added systemd support (disabled as default). - added debuginfo. * Thu Feb 06 2020 Tomohiro "Tomo-p" KATO 0.102.2-1 - new upstream release. * Thu Nov 21 2019 Tomohiro "Tomo-p" KATO 0.102.1-1 - new upstream release. * Thu Oct 10 2019 Tomohiro "Tomo-p" KATO 0.102.0-2 - fixed freshclam.init. * Fri Oct 04 2019 Tomohiro "Tomo-p" KATO 0.102.0-1 - new upstream release. * Thu Aug 22 2019 Tomohiro "Tomo-p" KATO 0.101.4-1 - new upstream release. * Thu Aug 08 2019 Tomohiro "Tomo-p" KATO 0.101.3-1 - new upstream release. * Thu Mar 28 2019 Tomohiro "Tomo-p" KATO 0.101.2-1 - new upstream release. * Tue Jan 08 2019 Tomohiro "Tomo-p" KATO 0.101.1-1 - new upstream release. * Fri Dec 07 2018 Tomohiro "Tomo-p" KATO 0.101.0-1 - new upstream release. * Tue Nov 20 2018 Tomohiro "Tomo-p" KATO 0.100.2-1 - new upstream release. * Tue May 29 2018 IWAI, Masaharu 0.100.0-1 - update to 0.100.0 * Fri Mar 02 2018 Tomohiro "Tomo-p" KATO 0.99.4-1 - new upstream release. * Sat Jan 27 2018 Tomohiro "Tomo-p" KATO 0.99.3-2 - added "-ltinfo" flag for Vine Linux 6.x. * Sat Jan 27 2018 Tomohiro "Tomo-p" KATO 0.99.3-1 - new upstream release. * Wed Jun 29 2016 Tomohiro "Tomo-p" KATO 0.99.2-2 - rebuilt with new toolchain. * Fri May 6 2016 Tomohiro "Tomo-p" KATO 0.99.2-1 - new upstream release. * Fri Mar 4 2016 Tomohiro "Tomo-p" KATO 0.99.1-1 - new upstream release. * Thu Dec 3 2015 Tomohiro "Tomo-p" KATO 0.99-1 - new upstream release. * Sat May 2 2015 Tomohiro "Tomo-p" KATO 0.98.7-1 - new upstream release. * Fri Jan 30 2015 Tomohiro "Tomo-p" KATO 0.98.6-1 - new upstream release. * Thu Nov 20 2014 Tomohiro "Tomo-p" KATO 0.98.5-1 - new upstream release. * Thu Jun 19 2014 Tomohiro "Tomo-p" KATO 0.98.4-1 - new upstream release. * Fri May 9 2014 Tomohiro "Tomo-p" KATO 0.98.3-1 - new upstream release. * Fri Jan 17 2014 Tomohiro "Tomo-p" KATO 0.98.1-1 - new upstream release. * Sun Jan 12 2014 Tomohiro "Tomo-p" KATO 0.98-2 - rebuilt with current environment. * Thu Oct 03 2013 Tomohiro "Tomo-p" KATO 0.98-1 - new upstream release. * Fri May 10 2013 Tomohiro "Tomo-p" KATO 0.97.8-1 - new upstream release. * Thu Mar 21 2013 Tomohiro "Tomo-p" KATO 0.97.7-1 - new upstream release. - fixed date of %%changelog. * Tue Sep 18 2012 Tomohiro "Tomo-p" KATO 0.97.6-2 - tarball was replaced on upstream. * Mon Sep 17 2012 Tomohiro "Tomo-p" KATO 0.97.6-1 - new upstream release. * Fri Jun 15 2012 Tomohiro "Tomo-p" KATO 0.97.5-1 - new upstream release. - removed /var/lib/clamav/main.cvd (by upstream). * Mon Mar 19 2012 Tomohiro "Tomo-p" KATO 0.97.4-1 - new upstream release. - removed /var/lib/clamav/daily.cvd. * Wed Dec 14 2011 Tomohiro "Tomo-p" KATO 0.97.3-1 - new upstream release. * Thu Aug 04 2011 Tomohiro "Tomo-p" KATO 0.97.2-1 - new upstream release. * Thu Jun 09 2011 Tomohiro "Tomo-p" KATO 0.97.1-1 - new upstream release. * Sun Mar 27 2011 IWAI, Masaharu 0.97-2 - add else routine for milter: fix building on Vine Linux 5 * Tue Feb 08 2011 Tomohiro "Tomo-p" KATO 0.97-1 - new upstream release. * Fri Dec 03 2010 Tomohiro "Tomo-p" KATO 0.96.5-1 - new upstream release. * Sat Nov 27 2010 Tomohiro "Tomo-p" KATO 0.96.4-3 - moved virus databases to /var/lib/clamav. * Wed Nov 17 2010 Tomohiro "Tomo-p" KATO 0.96.4-2 - added milter support. * Fri Nov 05 2010 Tomohiro "Tomo-p" KATO 0.96.4-1 - new upstream release. - added logrotate support. - fixed pre/post scripts for daemons. * Thu Sep 30 2010 Shu KONNO 0.96-2 - rebuilt with rpm-4.8.1 for pkg-config * Sun Apr 11 2010 Ryoichi INAGAKI 0.96-1 - new upstream release. * Sat Jan 30 2010 Ryoichi INAGAKI 0.95.3-1 - new upstream release. * Thu Jun 11 2009 Tomohiro "Tomo-p" KATO 0.95.2-1 - new upstream release. * Tue Jun 2 2009 Tomohiro "Tomo-p" KATO 0.95.1-1 - new upstream release. * Tue Mar 24 2009 Tomohiro "Tomo-p" KATO 0.95-2 - dropped *.a files. * Tue Mar 24 2009 Tomohiro "Tomo-p" KATO 0.95-1 - new upstream release. * Tue Jun 10 2008 Tomohiro 'Tomo-p' KATO 0.93.1-1 - new upstream release. - wrote specfile in UTF-8. * Tue Apr 15 2008 Tomohiro 'Tomo-p' KATO 0.93-1 - new upstream release. - move clamd.init to /etc/rc.d/init.d/. - add /etc/rc.d/init.d/freshclam. * Thu Apr 10 2008 Tomohiro 'Tomo-p' KATO 0.92.1-1 - apply new versioning policy. * Sat Mar 1 2008 Tomohiro 'Tomo-p' KATO 0.92.1-0vl0.40.1 - add missing files. * Sat Mar 1 2008 Tomohiro 'Tomo-p' KATO 0.92.1-0vl0.40 - new upstream release. * Tue Aug 21 2007 Tomohiro 'Tomo-p' KATO 0.91.2-0vl0.40 - new upstream release. * Thu Aug 9 2007 Tomohiro 'Tomo-p' KATO 0.91.1-0vl0.40 - new upstream release. * Fri Mar 2 2007 Tomohiro 'Tomo-p' KATO 0.90.1-0vl0.40 - new upstream release. * Mon Feb 26 2007 Tomohiro 'Tomo-p' KATO 0.90-0vl0.40 - new upstream release. * Thu Feb 1 2007 Tomohiro 'Tomo-p' KATO 0.88.7-0vl0.40 - for Vine Linux 4.0. - new upstream release. * Tue Nov 7 2006 Tomohiro 'Tomo-p' KATO 0.88.6-0vl1 - built for VineSeed. * Mon Nov 6 2006 Tomohiro 'Tomo-p' KATO 0.88.6-0vl0.1 - new upstream release. * Thu Oct 19 2006 Tomohiro 'Tomo-p' KATO 0.88.5-0vl0.1 - new upstream release. * Wed Aug 16 2006 Tomohiro 'Tomo-p' KATO 0.88.4-0vl0.1 - rebuilt for Vine Linux 3.x. * Wed Aug 16 2006 Tomohiro 'Tomo-p' KATO 0.88.4-0vl1 - new upstream release. * Sat Aug 5 2006 IWAI, Masaharu 0.88.2-0vl3 - add clamd.init script in doc dir * Tue Aug 1 2006 Ryoichi INAGAKI 0.88.2-0vl2 - rebuilt for VineSeed (4.0) - added libclamav.pc to devel package - added Requires: gmp-devel to devel package * Mon May 1 2006 Tomohiro 'Tomo-p' KATO - 0.88.2-0vl1 - new upstream release. * Wed Apr 5 2006 Tomohiro 'Tomo-p' KATO - 0.88.1-0vl1 - new upstream release. * Tue Jan 10 2006 Tomohiro 'Tomo-p' KATO - 0.88-0vl1 - new upstream release. * Fri Nov 4 2005 Tomohiro 'Tomo-p' KATO - 0.87.1-0vl1 - new upstream release. * Sun Sep 18 2005 Tomohiro 'Tomo-p' KATO - 0.87-0vl1 - new upstream release. * Mon Jul 25 2005 Tomohiro 'Tomo-p' KATO - 0.86.2-0vl1 - new upstream release. * Sun Jun 26 2005 Tomohiro 'Tomo-p' KATO - 0.86.1-0vl1 - new upstream release. - fix "Requires:". * Fri May 27 2005 Tomohiro 'Tomo-p' KATO - 0.85.1-0vl1 - new upstream release. * Mon May 16 2005 Tomohiro 'Tomo-p' KATO - 0.85-0vl1 - new upstream release. * Sun May 1 2005 Tomohiro 'Tomo-p' KATO - 0.84-0vl2 - new upstream release. * Tue Feb 15 2005 Tomohiro 'Tomo-p' KATO - 0.83-0vl1 - new upstream release. * Mon Feb 14 2005 Tomohiro 'Tomo-p' KATO - 0.82-0vl1 - new upstream release. * Thu Jan 27 2005 Tomohiro 'Tomo-p' KATO - 0.81-0vl1 - new upstream release. * Tue Nov 2 2004 Tomohiro 'Tomo-p' KATO - 0.80-0vl1 - new upstream release. * Wed Aug 18 2004 Tomohiro 'Tomo-p' KATO - 0.75-0vl1 - new upstream release. * Wed May 5 2004 Tomohiro 'Tomo-p' KATO - 0.70-0vl1 - new upstream release. * Wed Apr 14 2004 Tomohiro 'Tomo-p' KATO - 0.68.1-0vl1 - new upstream release. * Fri Feb 20 2004 Tomohiro 'Tomo-p' KATO - 0.67-0vl1 - new upstream release. * Fri Nov 28 2003 Tomohiro 'Tomo-p' KATO - 0.65-0vl1 - new upstream release. * Sat Aug 23 2003 Tomohiro 'Tomo-p' KATO - 0.60-0vl3 - fix %%files. * Fri Aug 22 2003 Tomohiro 'Tomo-p' KATO - 0.60-0vl2 - fix 'Requires:' and %%files. * Thu Aug 21 2003 Tomohiro 'Tomo-p' KATO - 0.60-0vl1 - new upstream release. - add a sub-package 'devel'. * Mon Nov 4 2002 TORAYA Shin-ichi - 0.53-0vl1 * Wed Oct 30 2002 TORAYA Shin-ichi - 0.52-0vl1 * Tue Oct 22 2002 TORAYA Shin-ichi - 0.51-0vl1 - port to Vine Linux from (0.51-1m) * Fri Oct 11 2002 Kazuhiko - (0.51-1m) - major bugfixes * Sun Oct 6 2002 Kazuhiko - (0.50-1m) - major feature enhancements * Fri Sep 20 2002 Kazuhiko - (0.24-2m) - fix permission etc. * Fri Aug 23 2002 Kazuhiko - (0.24-1m) - minor bugfixes * Sat Aug 3 2002 Kazuhiko - (0.23-1m) - minor feature enhancements * Fri Jul 19 2002 Kazuhiko - (0.21-1m) - minor bugfixes * Mon Jul 15 2002 Kazuhiko - (0.20-1m) - revise URL - add a new program 'sigtool' * Thu Jun 13 2002 Kazuhiko - (0.15-2k) * Fri May 31 2002 Kazuhiko - (0.14-2k) * Thu May 23 2002 Kazuhiko - (0.12-2k) * Fri May 10 2002 Kazuhiko - (0.11-2k)