clamav/clamav.spec

337 lines
10 KiB
RPMSpec
Raw Normal View History

%define clamav_usr %{name}
%define clamav_grp %{name}
%define clamav_uid 65035
%define clamav_gid 65035
%define libname lib%{name}
Name: clamav
Version: 0.98.4
Release: 1mamba
Summary: Clam AntiVirus is a GPL anti-virus toolkit for UNIX
Group: Applications/Security
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://www.clamav.net
Source0: http://downloads.sourceforge.net/project/clamav/clamav/%{version}/clamav-%{version}.tar.gz
#Source0: http://downloads.sourceforge.net/sourceforge/clamav/clamav-%{version}.tar.gz
Source1: %{name}-clamd.initscript
Source2: %{name}-clamd.logrotate
Source3: %{name}-freshclam.initscript
Source4: %{name}-freshclam.logrotate
Source5: http://db.local.clamav.net/daily.cvd
Patch: %{name}-0.98-config.patch
Patch1: %{name}-0.98-freshclam_config.patch
License: GPL
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: libbzip2-devel
BuildRequires: libgcc
BuildRequires: libltdl-devel
BuildRequires: libncurses-devel
BuildRequires: libstdc++6-devel
BuildRequires: libz-devel
## AUTOBUILDREQ-END
BuildRequires: bash
BuildRequires: ldconfig
BuildRequires: pwdutils
Requires: bzip2
Requires: gzip
Requires: tar
Requires: unzip
Requires(pre): %{libname} = %{?epoch:%epoch:}%{version}-%{release}
Requires(pre): /usr/sbin/groupadd, /usr/sbin/useradd
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
Clam AntiVirus is a GPL anti-virus toolkit for UNIX.
The main purpose of this software is the integration with mail servers (attachment scanning).
This package provides a command line scanner, and a tool for automatic updating via Internet.
%package -n clamd
Summary: The Clam AntiVirus Daemon
Group: System/Servers
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
%description -n clamd
Clam AntiVirus is a GPL anti-virus toolkit for UNIX.
The main purpose of this software is the integration with mail servers (attachment scanning).
This package provides the multi-threaded Clam AntiVirus Daemon.
%package -n %{libname}
Summary: Shared libraries for %{name}
Group: System/Libraries
%description -n %{libname}
Clam AntiVirus is a GPL anti-virus toolkit for UNIX.
The main purpose of this software is the integration with mail servers (attachment scanning).
This package contains the shared libraries for %{name}.
%package -n %{libname}-devel
Summary: Development library and header files for the %{name} library
Group: Development/Libraries
Requires: %{libname} = %{?epoch:%epoch:}%{version}-%{release}
%description -n %{libname}-devel
Clam AntiVirus is a GPL anti-virus toolkit for UNIX.
The main purpose of this software is the integration with mail servers (attachment scanning).
This package contains the static %{libname} library and its header files.
%prep
%setup -q
%patch -p1
%patch1 -p1
cp %{SOURCE5} database/daily.cvd
%build
export SENDMAIL="%{_libdir}/sendmail"
%configure --disable-clamav
%make
%install
[ "%{buildroot}" != / ] && rm -rf %{buildroot}
%makeinstall
# log files stuff
install -d %{buildroot}%{_var}/log/%{name}
touch %{buildroot}%{_var}/log/%{name}/clamd.log
touch %{buildroot}%{_var}/log/%{name}/freshclam.log
# pid file stuff
install -d %{buildroot}%{_var}/run/%{name}
# install needed initscripts and logrotate files
install -D -m755 %{S:1} %{buildroot}%{_initrddir}/clamd
install -D -m644 %{S:2} %{buildroot}%{_sysconfdir}/logrotate.d/clamd
install -D -m755 %{S:3} %{buildroot}%{_initrddir}/freshclam
install -D -m644 %{S:4} %{buildroot}%{_sysconfdir}/logrotate.d/freshclam
install -d %{buildroot}%{_var}/lib/%{name}
mv %{buildroot}%{_sysconfdir}/clamd.conf.sample %{buildroot}%{_sysconfdir}/clamd.conf
mv %{buildroot}%{_sysconfdir}/freshclam.conf.sample %{buildroot}%{_sysconfdir}/freshclam.conf
%clean
[ "%{buildroot}" != / ] && rm -rf %{buildroot}
%pre
/usr/sbin/groupadd %{clamav_grp} -g %{clamav_gid} &>/dev/null
/usr/sbin/useradd %{clamav_usr} -c "Clam AntiVirus" -s /bin/false \
-u %{clamav_uid} -g %{clamav_grp} &>/dev/null
exit 0
%post
if [ $1 -eq 1 ]; then
# new install
/sbin/chkconfig --add freshclam
/sbin/service freshclam start
fi
if [ $1 -ge 1 ]; then
# remove /0 file created by error in initscript
[ -e /0 ] && rm -f /0
fi
exit 0
%postun
if [ $1 -eq 1 ]; then
# update
/sbin/service freshclam condrestart
fi
exit 0
%preun
if [ $1 -eq 0 ]; then
# erase
service freshclam stop
/sbin/chkconfig --del freshclam
/usr/sbin/userdel %{clamav_usr} 2>/dev/null
fi
exit 0
%post -n clamd
if [ $1 -eq 1 ]; then
# new install
/sbin/chkconfig --add clamd
/sbin/service freshclam start
#[ -x %{_bindir}/freshclam ] && %{_bindir}/freshclam
sleep 5
/sbin/service clamd start
fi
exit 0
%postun -n clamd
if [ $1 -eq 1 ]; then
# update
/sbin/service clamd condrestart
fi
exit 0
%preun -n clamd
if [ $1 -eq 0 ]; then
# erase
/sbin/service clamd stop
/sbin/chkconfig --del clamd
fi
exit 0
%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig
%files
%defattr(-,root,root)
%{_bindir}/clambc
%{_bindir}/clamconf
%{_bindir}/clamdscan
%{_bindir}/clamscan
%{_bindir}/clamsubmit
%{_bindir}/freshclam
%{_bindir}/sigtool
#%{_datadir}/clamav/*.cvd
%{_initrddir}/freshclam
%config(noreplace) %{_sysconfdir}/clamd.conf
%config(noreplace) %{_sysconfdir}/freshclam.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/freshclam
%dir %attr(0750,%{clamav_usr},%{clamav_grp}) %{_var}/lib/%{name}
#%ghost %{_var}/lib/%{name}/daily.cvd
#%ghost %{_var}/lib/%{name}/mani.cvd
%dir %attr(0755,%{clamav_usr},%{clamav_grp}) %{_var}/log/%{name}
%dir %attr(0755,%{clamav_usr},%{clamav_grp}) %{_var}/run/%{name}
%ghost %attr(0644,%{clamav_usr},%{clamav_grp}) %{_var}/log/%{name}/freshclam.log
%{_mandir}/man1/clamconf.*
%{_mandir}/man1/clamdscan.*
%{_mandir}/man1/clamscan.*
%{_mandir}/man1/clamsubmit.1*
%{_mandir}/man1/clambc.1.gz
%{_mandir}/man1/freshclam.*
%{_mandir}/man1/sigtool.*
%{_mandir}/man5/clamav-milter.conf.*
%{_mandir}/man5/clamd.conf.*
%{_mandir}/man5/freshclam.conf.*
%{_mandir}/man8/clamav-milter.*
%doc AUTHORS COPYING
%files -n clamd
%defattr(-,root,root)
%{_sbindir}/clamd
%{_bindir}/clamdtop
%{_initrddir}/clamd
%config(noreplace) %{_sysconfdir}/logrotate.d/clamd
%ghost %attr(0644,%{clamav_usr},%{clamav_grp}) %{_var}/log/%{name}/clamd.log
%{_mandir}/man1/clamdtop.*
%{_mandir}/man8/clamd.*
%files -n %{libname}
%defattr(-,root,root)
%{_libdir}/*.so.*
%files -n %{libname}-devel
%defattr(-,root,root)
%{_bindir}/clamav-config
%{_includedir}/*.h
#%{_libdir}/*.a
%{_libdir}/*.la
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc
%doc BUGS ChangeLog NEWS README
%changelog
* Tue Jun 17 2014 Automatic Build System <autodist@mambasoft.it> 0.98.4-1mamba
- automatic version update by autodist
* Sun May 11 2014 Automatic Build System <autodist@mambasoft.it> 0.98.3-1mamba
- automatic version update by autodist
* Wed Jan 15 2014 Automatic Build System <autodist@mambasoft.it> 0.98.1-1mamba
- automatic version update by autodist
* Wed Oct 30 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 0.98-2mamba
- initscript: fix to avoid creating a /0 file in root directory
* Fri Sep 27 2013 Automatic Build System <autodist@mambasoft.it> 0.98-1mamba
- automatic version update by autodist
* Wed Apr 24 2013 Automatic Build System <autodist@mambasoft.it> 0.97.8-1mamba
- automatic version update by autodist
* Sat Apr 13 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 0.97.7-2mamba
- freshclam initscript: fix pidfile argument for systemd to correctly detect it is running
* Thu Mar 14 2013 Automatic Build System <autodist@mambasoft.it> 0.97.7-1mamba
- automatic version update by autodist
* Fri Oct 12 2012 Automatic Build System <autodist@mambasoft.it> 0.97.6-1mamba
- automatic version update by autodist
* Mon Aug 13 2012 Automatic Build System <autodist@mambasoft.it> 0.97.5-1mamba
- automatic version update by autodist
* Mon May 14 2012 Ercole 'ercolinux' Carpanetto <ercole69@gmail.com> 0.97.4-1mamba
- update to 0.97.4
* Thu Apr 28 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 0.97-1mamba
- update to 0.97
* Tue Dec 07 2010 Silvan Calarco <silvan.calarco@mambasoft.it> 0.96.5-1mamba
- update to 0.96.5
* Wed Jun 02 2010 Automatic Build System <autodist@mambasoft.it> 0.96.1-1mamba
- automatic update by autodist
* Mon Jul 06 2009 Silvan Calarco <silvan.calarco@mambasoft.it> 0.95.2-1mamba
- update to 0.95.2
* Thu Jan 29 2009 Silvan Calarco <silvan.calarco@mambasoft.it> 0.94.2-2mamba
- added patch for freshclam.conf to fix initscript startup
* Mon Dec 22 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 0.94.2-1mamba
- automatic update by autodist
* Sat Jul 12 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 0.93.3-2mamba
- clamav: added PreReq for libclamav to fix freshclam restart on upgrade
* Sat Jul 12 2008 gil <puntogil@libero.it> 0.93.3-1mamba
- update to 0.93.3
* Mon Feb 11 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 0.92-1mamba
- update to 0.92
* Tue May 08 2007 Aleph0 <aleph0@openmamba.org> 0.90.2-1mamba
- update to 0.90.2
- fixes the security issues: CVE-2007-0897, CVE-2007-0898, and CVE-2007-1997
- update configuration file patch
- update initscripts
* Wed Oct 18 2006 Davide Madrisan <davide.madrisan@qilinux.it> 0.88.5-2qilnx
- fixed static requirements for clamd and libclamv-devel packages
* Wed Oct 18 2006 Davide Madrisan <davide.madrisan@qilinux.it> 0.88.5-1qilnx
- update to version 0.88.5 by autospec
* Wed Aug 30 2006 Davide Madrisan <davide.madrisan@qilinux.it> 0.88.4-1qilnx
- update to version 0.88.4 by autospec
- also fixes a security flaw (bugtraq#221)
* Tue May 09 2006 Davide Madrisan <davide.madrisan@qilinux.it> 0.88.2-1qilnx
- update to version 0.88.2 by autospec
* Mon Apr 10 2006 Davide Madrisan <davide.madrisan@qilinux.it> 0.88.1-1qilnx
- update to version 0.88.1 by autospec
- this version fixes the vulnerabilities CVE-2006-16[14,15,30] and other bugs
* Mon Jan 16 2006 Davide Madrisan <davide.madrisan@qilinux.it> 0.88-1qilnx
- update to version 0.88 by autospec
- also fixes CVE-2006-0162 (qibug#110)
* Mon Nov 07 2005 Davide Madrisan <davide.madrisan@qilinux.it> 0.87.1-1qilnx
- update to version 0.87.1 by autospec
- this release fixes two security issues discovered by iDEFENSE (see bug#64)
* Tue Sep 27 2005 Davide Madrisan <davide.madrisan@qilinux.it> 0.87-2qilnx
- fixed %%preun scriptlet for clamd
- %%post scriptlet: run freshclam
- initscripts updated
* Fri Sep 23 2005 Davide Madrisan <davide.madrisan@qilinux.it> 0.87-1qilnx
- package created by autospec