Browse Source

new upstream release.

git-svn-id: http://trac.vinelinux.org/repos/projects/specs@2272 ec354946-7b23-47d6-9f5a-488ba84defc7
tomop 13 years ago
parent
commit
6bab53a74c
1 changed files with 110 additions and 12 deletions
  1. 110 12
      c/clamav/clamav-vl.spec

+ 110 - 12
c/clamav/clamav-vl.spec

@@ -1,20 +1,32 @@
+%define dbdir %{_localstatedir}/lib/clamav
+
+%if %{?_dist_release}!="vl5"
+%define milter 1
+%endif
+
 Summary: Clam AntiVirus
 Summary(ja): Clamアンチウィルススキャナ
 Name: clamav
-Version: 0.96
-Release: 2%{?_dist_release}
+Version: 0.96.5
+Release: 1%{?_dist_release}
 License: GPL
 Group: Applications/System
 URL: http://www.clamav.net/
 Source0: http://clamav.elektrapro.com/stable/%{name}-%{version}.tar.gz
 Source1: clamd.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
 BuildRequires: bzip2-devel, curl-devel > 7.10.0, gmp-devel, ncurses-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
 
 Vendor: Project Vine
@@ -34,6 +46,16 @@ AMaViS、圧縮ファイルをサポートし、OpenAntivirus.orgのウィルス
 プログラムを含んでいます。 このCで書かれたスキャナはマルチスレッド化
 されており、 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
 Group: Development/Libraries
 Summary: headers and libraries for development using Clam AntiVirus
@@ -51,18 +73,38 @@ Clam AntiVirus.
 
 %prep
 %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
-%configure --disable-clamav
+%if %{?milter}
+%configure --disable-clamav --enable-milter --with-dbdir=%{dbdir}
+%else
+%configure --disable-clamav --with-dbdir=%{dbdir}
+%endif
+
 make %{?_smp_mflags}
 
 %install
 rm -rf %{buildroot}
-mkdir -p %{buildroot}%{_sysconfdir}
+mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
 mkdir -p %{buildroot}%{_initdir}
+mkdir -p %{buildroot}%{_localstatedir}/run/clamav
+mkdir -p %{buildroot}%{_localstatedir}/log/clamav
 make install DESTDIR=%{buildroot} transform='s,x,x,'
 install -m755 %{SOURCE1} %{buildroot}%{_initdir}/clamd
 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/freshclam.conf %{buildroot}%{_sysconfdir}
 
@@ -85,35 +127,77 @@ fi
 /sbin/chkconfig --add freshclam
 
 %preun
-/sbin/chkconfig --del clamd
-/sbin/chkconfig --del freshclam
+if [ "$1" = 0 ]; 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
 
 %postun
 /sbin/ldconfig
-if [ $1 = 0 ]; then
+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
+    [ ! -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
 
+%postun milter
+if [ "$1" -ge 1 ]; then
+    [ ! -f /var/run/clamav/clamav-milter.pid ] || /etc/init.d/clamav-milter restart
+fi
+%endif
+
 %files 
 %defattr(-,root,root)
 %doc AUTHORS BUGS COPYING* ChangeLog FAQ INSTALL NEWS README examples test
+%doc README
 %doc docs/*
-%{_initdir}/*
+%{_initdir}/clamd
+%{_initdir}/freshclam
 %config(noreplace) %{_sysconfdir}/clamd.conf
 %config(noreplace) %{_sysconfdir}/freshclam.conf
+%config(noreplace) %{_sysconfdir}/logrotate.d/clamav
 %{_bindir}/*
 %exclude %{_bindir}/clamav-config
 %{_sbindir}/*
 %{_libdir}/lib*.so.*
-%attr(-,clamav,clamav) %dir %{_datadir}/clamav
-%attr(-,clamav,clamav) %config(noreplace) %{_datadir}/clamav/*
+%attr(-,clamav,clamav) %dir %{_localstatedir}/run/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*/*
 
+%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
 %defattr(-,root,root)
 %doc AUTHORS BUGS COPYING ChangeLog FAQ NEWS README
@@ -123,6 +207,20 @@ fi
 %{_includedir}/*
 
 %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
 - rebuilt with rpm-4.8.1 for pkg-config