|
@@ -1,20 +1,32 @@
|
|
|
|
+%define dbdir %{_localstatedir}/lib/clamav
|
|
|
|
+
|
|
|
|
+%if %{?_dist_release}!="vl5"
|
|
|
|
+%define milter 1
|
|
|
|
+%endif
|
|
|
|
+
|
|
Summary: Clam AntiVirus
|
|
Summary: Clam AntiVirus
|
|
Summary(ja): Clamアンチウィルススキャナ
|
|
Summary(ja): Clamアンチウィルススキャナ
|
|
Name: clamav
|
|
Name: clamav
|
|
-Version: 0.96
|
|
+Version: 0.96.5
|
|
-Release: 2%{?_dist_release}
|
|
+Release: 1%{?_dist_release}
|
|
License: GPL
|
|
License: GPL
|
|
Group: Applications/System
|
|
Group: Applications/System
|
|
URL: http://www.clamav.net/
|
|
URL: http://www.clamav.net/
|
|
Source0: http://clamav.elektrapro.com/stable/%{name}-%{version}.tar.gz
|
|
Source0: http://clamav.elektrapro.com/stable/%{name}-%{version}.tar.gz
|
|
Source1: clamd.init
|
|
Source1: clamd.init
|
|
Source2: freshclam.init
|
|
Source2: freshclam.init
|
|
-Source3: README.clamd-vine
|
|
+Source3: clamav-milter.init
|
|
|
|
+Source4: clamav.logrotate
|
|
|
|
+Source5: clamav-milter.logrotate
|
|
|
|
+Source100: README.clamd-vine
|
|
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
|
BuildRequires: bzip2-devel, curl-devel > 7.10.0, gmp-devel, ncurses-devel
|
|
BuildRequires: bzip2-devel, curl-devel > 7.10.0, gmp-devel, ncurses-devel
|
|
BuildRequires: openssl-devel, zlib-devel
|
|
BuildRequires: openssl-devel, zlib-devel
|
|
-Requires: bzip2, curl > 7.10.0, gmp, ncurses, openssl, zlib
|
|
+%if %{?milter}
|
|
|
|
+BuildRequires: sendmail-devel
|
|
|
|
+%endif
|
|
|
|
+Requires: bzip2, curl > 7.10.0, gmp, ncurses, openssl, zlib, logrotate
|
|
Requires(pre): shadow-utils, grep
|
|
Requires(pre): shadow-utils, grep
|
|
|
|
|
|
Vendor: Project Vine
|
|
Vendor: Project Vine
|
|
@@ -34,6 +46,16 @@ AMaViS、圧縮ファイルをサポートし、OpenAntivirus.orgのウィルス
|
|
プログラムを含んでいます。 このCで書かれたスキャナはマルチスレッド化
|
|
プログラムを含んでいます。 このCで書かれたスキャナはマルチスレッド化
|
|
されており、 POSIXに準拠しています。
|
|
されており、 POSIXに準拠しています。
|
|
|
|
|
|
|
|
+%if %{?milter}
|
|
|
|
+%package milter
|
|
|
|
+Summary: Virus scanner for sendmail/postfix
|
|
|
|
+Group: Applications/System
|
|
|
|
+
|
|
|
|
+%description milter
|
|
|
|
+clamav-milter is a milter module to scan mails using Clam AntiVirus.
|
|
|
|
+
|
|
|
|
+%endif
|
|
|
|
+
|
|
%package devel
|
|
%package devel
|
|
Group: Development/Libraries
|
|
Group: Development/Libraries
|
|
Summary: headers and libraries for development using Clam AntiVirus
|
|
Summary: headers and libraries for development using Clam AntiVirus
|
|
@@ -51,18 +73,38 @@ Clam AntiVirus.
|
|
|
|
|
|
%prep
|
|
%prep
|
|
%setup -q
|
|
%setup -q
|
|
|
|
+cp %{SOURCE100} .
|
|
|
|
+
|
|
|
|
+perl -pi -e 's|^#PidFile .+$|PidFile /var/run/clamav/clamd.pid|' etc/clamd.conf
|
|
|
|
+perl -pi -e 's|^#LogFile .+$|LogFile /var/log/clamav/clamd.log|' etc/clamd.conf
|
|
|
|
+perl -pi -e 's|^#PidFile .+$|PidFile /var/run/clamav/freshclam.pid|' etc/freshclam.conf
|
|
|
|
+perl -pi -e 's|^#UpdateLogFile .+$|UpdateLogFile /var/log/clamav/freshclam.log|' etc/freshclam.conf
|
|
|
|
+perl -pi -e 's|^#PidFile .+$|PidFile /var/run/clamav/clamav-milter.pid|' etc/clamav-milter.conf
|
|
|
|
+perl -pi -e 's|^#LogFile .+$|LogFile /var/log/clamav/clamav-milter.log|' etc/clamav-milter.conf
|
|
|
|
|
|
%build
|
|
%build
|
|
-%configure --disable-clamav
|
|
+%if %{?milter}
|
|
|
|
+%configure --disable-clamav --enable-milter --with-dbdir=%{dbdir}
|
|
|
|
+%else
|
|
|
|
+%configure --disable-clamav --with-dbdir=%{dbdir}
|
|
|
|
+%endif
|
|
|
|
+
|
|
make %{?_smp_mflags}
|
|
make %{?_smp_mflags}
|
|
|
|
|
|
%install
|
|
%install
|
|
rm -rf %{buildroot}
|
|
rm -rf %{buildroot}
|
|
-mkdir -p %{buildroot}%{_sysconfdir}
|
|
+mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
|
|
mkdir -p %{buildroot}%{_initdir}
|
|
mkdir -p %{buildroot}%{_initdir}
|
|
|
|
+mkdir -p %{buildroot}%{_localstatedir}/run/clamav
|
|
|
|
+mkdir -p %{buildroot}%{_localstatedir}/log/clamav
|
|
make install DESTDIR=%{buildroot} transform='s,x,x,'
|
|
make install DESTDIR=%{buildroot} transform='s,x,x,'
|
|
install -m755 %{SOURCE1} %{buildroot}%{_initdir}/clamd
|
|
install -m755 %{SOURCE1} %{buildroot}%{_initdir}/clamd
|
|
install -m755 %{SOURCE2} %{buildroot}%{_initdir}/freshclam
|
|
install -m755 %{SOURCE2} %{buildroot}%{_initdir}/freshclam
|
|
|
|
+%if %{?milter}
|
|
|
|
+install -m755 %{SOURCE3} %{buildroot}%{_initdir}/clamav-milter
|
|
|
|
+install -m644 %{SOURCE5} %{buildroot}%{_sysconfdir}/logrotate.d/clamav-milter
|
|
|
|
+%endif
|
|
|
|
+install -m644 %{SOURCE4} %{buildroot}%{_sysconfdir}/logrotate.d/clamav
|
|
install etc/clamd.conf %{buildroot}%{_sysconfdir}
|
|
install etc/clamd.conf %{buildroot}%{_sysconfdir}
|
|
install etc/freshclam.conf %{buildroot}%{_sysconfdir}
|
|
install etc/freshclam.conf %{buildroot}%{_sysconfdir}
|
|
|
|
|
|
@@ -85,35 +127,77 @@ fi
|
|
/sbin/chkconfig --add freshclam
|
|
/sbin/chkconfig --add freshclam
|
|
|
|
|
|
%preun
|
|
%preun
|
|
-/sbin/chkconfig --del clamd
|
|
+if [ "$1" = 0 ]; then
|
|
-/sbin/chkconfig --del freshclam
|
|
+ [ ! -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
|
|
|
|
|
|
%postun
|
|
%postun
|
|
/sbin/ldconfig
|
|
/sbin/ldconfig
|
|
-if [ $1 = 0 ]; then
|
|
+if [ "$1" = 0 ]; then
|
|
if [ `grep clamav /etc/passwd | wc -l` = 1 ]; then
|
|
if [ `grep clamav /etc/passwd | wc -l` = 1 ]; then
|
|
/usr/sbin/userdel clamav
|
|
/usr/sbin/userdel clamav
|
|
fi
|
|
fi
|
|
if [ `grep clamav /etc/group | wc -l` = 1 ]; then
|
|
if [ `grep clamav /etc/group | wc -l` = 1 ]; then
|
|
/usr/sbin/groupdel clamav
|
|
/usr/sbin/groupdel clamav
|
|
fi
|
|
fi
|
|
|
|
+else
|
|
|
|
+ [ ! -f /var/run/clamav/clamd.pid ] || /etc/init.d/clamd restart
|
|
|
|
+ [ ! -f /var/run/clamav/freshclam.pid ] || /etc/init.d/freshclam restart
|
|
|
|
+fi
|
|
|
|
+
|
|
|
|
+%if %{?milter}
|
|
|
|
+%post milter
|
|
|
|
+/sbin/chkconfig --add clamav-milter
|
|
|
|
+
|
|
|
|
+%preun milter
|
|
|
|
+if [ "$1" = 0 ]; then
|
|
|
|
+ [ ! -f /var/run/clamav/clamd.pid ] || /etc/init.d/clamav-milter stop
|
|
|
|
+ /sbin/chkconfig --del clamav-milter
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
+%postun milter
|
|
|
|
+if [ "$1" -ge 1 ]; then
|
|
|
|
+ [ ! -f /var/run/clamav/clamav-milter.pid ] || /etc/init.d/clamav-milter restart
|
|
|
|
+fi
|
|
|
|
+%endif
|
|
|
|
+
|
|
%files
|
|
%files
|
|
%defattr(-,root,root)
|
|
%defattr(-,root,root)
|
|
%doc AUTHORS BUGS COPYING* ChangeLog FAQ INSTALL NEWS README examples test
|
|
%doc AUTHORS BUGS COPYING* ChangeLog FAQ INSTALL NEWS README examples test
|
|
|
|
+%doc README
|
|
%doc docs/*
|
|
%doc docs/*
|
|
-%{_initdir}/*
|
|
+%{_initdir}/clamd
|
|
|
|
+%{_initdir}/freshclam
|
|
%config(noreplace) %{_sysconfdir}/clamd.conf
|
|
%config(noreplace) %{_sysconfdir}/clamd.conf
|
|
%config(noreplace) %{_sysconfdir}/freshclam.conf
|
|
%config(noreplace) %{_sysconfdir}/freshclam.conf
|
|
|
|
+%config(noreplace) %{_sysconfdir}/logrotate.d/clamav
|
|
%{_bindir}/*
|
|
%{_bindir}/*
|
|
%exclude %{_bindir}/clamav-config
|
|
%exclude %{_bindir}/clamav-config
|
|
%{_sbindir}/*
|
|
%{_sbindir}/*
|
|
%{_libdir}/lib*.so.*
|
|
%{_libdir}/lib*.so.*
|
|
-%attr(-,clamav,clamav) %dir %{_datadir}/clamav
|
|
+%attr(-,clamav,clamav) %dir %{_localstatedir}/run/clamav
|
|
-%attr(-,clamav,clamav) %config(noreplace) %{_datadir}/clamav/*
|
|
+%attr(-,clamav,clamav) %dir %{_localstatedir}/log/clamav
|
|
|
|
+%attr(-,clamav,clamav) %dir %{dbdir}
|
|
|
|
+%attr(-,clamav,clamav) %config(noreplace) %{dbdir}/*
|
|
|
|
+%exclude %{_mandir}/man8/clamav-milter.8*
|
|
%{_mandir}/man*/*
|
|
%{_mandir}/man*/*
|
|
|
|
|
|
|
|
+%if %{?milter}
|
|
|
|
+
|
|
|
|
+%files milter
|
|
|
|
+%defattr(-,root,root)
|
|
|
|
+%doc AUTHORS BUGS COPYING ChangeLog FAQ NEWS README
|
|
|
|
+%{_initdir}/clamav-milter
|
|
|
|
+%config(noreplace) %{_sysconfdir}/clamav-milter.conf
|
|
|
|
+%config(noreplace) %{_sysconfdir}/logrotate.d/clamav-milter
|
|
|
|
+%{_sbindir}/clamav-milter
|
|
|
|
+%{_mandir}/man8/clamav-milter.8*
|
|
|
|
+
|
|
|
|
+%endif
|
|
|
|
+
|
|
%files devel
|
|
%files devel
|
|
%defattr(-,root,root)
|
|
%defattr(-,root,root)
|
|
%doc AUTHORS BUGS COPYING ChangeLog FAQ NEWS README
|
|
%doc AUTHORS BUGS COPYING ChangeLog FAQ NEWS README
|
|
@@ -123,6 +207,20 @@ fi
|
|
%{_includedir}/*
|
|
%{_includedir}/*
|
|
|
|
|
|
%changelog
|
|
%changelog
|
|
|
|
+* Fri Dec 03 2010 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.96.5-1
|
|
|
|
+- new upstream release.
|
|
|
|
+
|
|
|
|
+* Sat Nov 27 2010 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.96.4-3
|
|
|
|
+- moved virus databases to /var/lib/clamav.
|
|
|
|
+
|
|
|
|
+* Wed Nov 17 2010 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.96.4-2
|
|
|
|
+- added milter support.
|
|
|
|
+
|
|
|
|
+* Fri Nov 05 2010 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.96.4-1
|
|
|
|
+- new upstream release.
|
|
|
|
+- added logrotate support.
|
|
|
|
+- fixed pre/post scripts for daemons.
|
|
|
|
+
|
|
* Thu Sep 30 2010 Shu KONNO <owa@bg.wakwak.com> 0.96-2
|
|
* Thu Sep 30 2010 Shu KONNO <owa@bg.wakwak.com> 0.96-2
|
|
- rebuilt with rpm-4.8.1 for pkg-config
|
|
- rebuilt with rpm-4.8.1 for pkg-config
|
|
|
|
|