# Set this to 1 if compiling on Red Hat 7.3 or earlier %define rh73 0 Summary: An anti-virus utility for Unix Name: clamav Version: 0.65 Release: 1 License: GPL Group: Applications Source0: http://prdownloads.sourceforge.net/clamav/clamav-0.65.tar.gz Source1: %{name}.init Source2: %{name}.logrotate Source3: %{name}-%{version}.conf URL: http://www.clamav.net/ BuildRoot: /var/tmp/%{name}-%{version}-root %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. %package libs Summary: Shared libraries for Clam Antivirus Group: Libraries %description libs Shared libraries for Clam Antivirus. %package devel Summary: Clam Antivirus - development header files and libraries Group: Development/Libraries Requires: %{name}-libs = %{version} %description devel This package contains the development header files and libraries necessary to develop Clam Antivirus client applications. %package static Summary: Static libraries for Clam Antivirus Group: Development/Libraries Requires: %{name}-devel = %{version} %description static Static libraries for Clam Antivirus. %prep %setup -q %build %configure \ --disable-clamuko \ --disable-clamav %{__make} %install rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d install -d $RPM_BUILD_ROOT{%{_sysconfdir}/cron.daily,%{_var}/log} install -d $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d %{__make} install DESTDIR=$RPM_BUILD_ROOT echo -e '#!/bin/sh\n%{_bindir}/freshclam --quiet -l %{_var}/log/%{name}.log --daemon-notify' \ > $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/%{name} touch $RPM_BUILD_ROOT%{_var}/log/%{name}.log touch $RPM_BUILD_ROOT%{_var}/log/clamd.log %if %{rh73} # For some reason, make install installs the binaries/mans with weird names mv $RPM_BUILD_ROOT%{_bindir}/i386-redhat-linux-clamdscan $RPM_BUILD_ROOT%{_bindir}/clamdscan mv $RPM_BUILD_ROOT%{_bindir}/i386-redhat-linux-clamscan $RPM_BUILD_ROOT%{_bindir}/clamscan mv $RPM_BUILD_ROOT%{_bindir}/i386-redhat-linux-freshclam $RPM_BUILD_ROOT%{_bindir}/freshclam mv $RPM_BUILD_ROOT%{_bindir}/i386-redhat-linux-sigtool $RPM_BUILD_ROOT%{_bindir}/sigtool mv $RPM_BUILD_ROOT%{_sbindir}/i386-redhat-linux-clamd $RPM_BUILD_ROOT%{_sbindir}/clamd mv $RPM_BUILD_ROOT%{_mandir}/man1/i386-redhat-linux-clamdscan.1 $RPM_BUILD_ROOT%{_mandir}/man1/clamdscan.1 mv $RPM_BUILD_ROOT%{_mandir}/man1/i386-redhat-linux-clamscan.1 $RPM_BUILD_ROOT%{_mandir}/man1/clamscan.1 mv $RPM_BUILD_ROOT%{_mandir}/man1/i386-redhat-linux-freshclam.1 $RPM_BUILD_ROOT%{_mandir}/man1/freshclam.1 mv $RPM_BUILD_ROOT%{_mandir}/man1/i386-redhat-linux-sigtool.1 $RPM_BUILD_ROOT%{_mandir}/man1/sigtool.1 mv $RPM_BUILD_ROOT%{_mandir}/man8/i386-redhat-linux-clamav-milter.8 $RPM_BUILD_ROOT%{_mandir}/man1/clamav-milter.8 mv $RPM_BUILD_ROOT%{_mandir}/man5/i386-redhat-linux-clamav.conf.5 $RPM_BUILD_ROOT%{_mandir}/man5/clamav.conf.5 mv $RPM_BUILD_ROOT%{_mandir}/man8/i386-redhat-linux-clamd.8 $RPM_BUILD_ROOT%{_mandir}/man8/clamd.8 %endif install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/clamd install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/clamd install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/clamav.conf %clean rm -rf $RPM_BUILD_ROOT %pre echo "Adding unprivileged user clamav" useradd -c "Clam Antivirus" -s "/bin/false" -d "/tmp" -M clamav %postun if [ "$1" = "0" ]; then echo "Removing user clamav" /usr/sbin/userdel clamav fi %post touch %{_var}/log/%{name}.log && \ chmod 640 %{_var}/log/%{name}.log && \ chown clamav %{_var}/log/%{name}.log touch %{_var}/log/clamd.log && \ chmod 640 %{_var}/log/clamd.log && \ chown clamav %{_var}/log/clamd.log %post libs -p /sbin/ldconfig %postun libs -p /sbin/ldconfig %files %defattr(644,root,root,755) %doc AUTHORS BUGS ChangeLog COPYING FAQ INSTALL NEWS README TODO docs/html/ %attr(755,root,root) %{_bindir}/* %attr(755,root,root) %{_sbindir}/* %attr(755,clamav,root) %dir %{_datadir}/%{name} %attr(644,clamav,root) %verify(not md5 size mtime) %{_datadir}/%{name}/*.cvd %attr(640,clamav,root) %ghost %{_var}/log/%{name}.log %attr(640,clamav,root) %ghost %{_var}/log/clamd.log %attr(750,root,root) %{_sysconfdir}/cron.daily/%{name} %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/*.conf %attr(754,root,root) %{_sysconfdir}/rc.d/init.d/clamd %attr(644,root,root) %{_datadir}/%{name}/mirrors.txt %attr(644,root,root) %{_sysconfdir}/logrotate.d/clamd %{_mandir}/man?/* %files libs %defattr(644,root,root,755) %attr(755,root,root) %{_libdir}/lib*.so.* %files devel %defattr(644,root,root,755) %attr(755,root,root) %{_libdir}/lib*.so %{_libdir}/lib*.la %{_includedir}/*.h %files static %defattr(644,root,root,755) %{_libdir}/*.a %changelog * Wed Dec 03 2003 Tim Jackson - Updated to 0.65 * Sun Jun 22 2003 Tim Jackson - Updated to 0.60 * Sat Nov 30 2002 Tim Jackson - Updated to 0.54 * Mon Oct 14 2002 Tim Jackson