clamav/clamav.spec

362 lines
12 KiB
RPMSpec

%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.6
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
Source6: clamav-clamd.service
Source7: clamav-freshclamd.service
Patch0: %{name}-0.98.4-config.patch
Patch1: %{name}-0.98-freshclam_config.patch
License: GPL
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: libbzip2-devel
BuildRequires: libcurl-devel
BuildRequires: libgcc
BuildRequires: libltdl-devel
BuildRequires: libncurses-devel
BuildRequires: libopenssl-devel
BuildRequires: libstdc++6-devel
BuildRequires: libxml2-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
%patch0 -p1
%patch1 -p1
#cp %{SOURCE5} database/daily.cvd
%build
export SENDMAIL="%{_libdir}/sendmail"
%configure \
--with-dbdir=%{_localstatedir}/lib/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
# 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
install -d %{buildroot}%{_unitdir}
install -m 0644 %{SOURCE6} %{buildroot}%{_unitdir}/clamd.service
install -m 0644 %{SOURCE7} %{buildroot}%{_unitdir}/freshclamd.service
install -d %{buildroot}%{_prefix}/lib/tmpfiles.d
cat > %{buildroot}%{_prefix}/lib/tmpfiles.d/clamav.conf << _EOF
d /run/clamav 711 %{clamav_usr} %{clamav_grp}
_EOF
%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
:
%post
if [ $1 -eq 1 ]; then
# new install
systemctl -q daemon-reload
systemd-tmpfiles --create clamav.conf
systemctl -q enable freshclamd
systemctl -q start freshclamd
elif [ $1 -ge 1 ]; then
systemctl -q daemon-reload
systemd-tmpfiles --create clamav.conf
systemctl -q try-restart freshclamd
# remove /0 file created by error in initscript
[ -e /0 ] && rm -f /0
fi
:
%preun
if [ $1 -eq 0 ]; then
# erase
systemctl -q stop freshclamd
systemctl -q disable freshclamd
/usr/sbin/userdel %{clamav_usr} 2>/dev/null
fi
:
%post -n clamd
if [ $1 -eq 1 ]; then
# new install
systemctl -q daemon-reload
systemd-tmpfiles --create clamav.conf
systemctl -q enable clamd
systemctl -q start freshclamd
sleep 5
systemctl -q start clamd
elif [ $1 -gt 1 ]; then
systemctl -q daemon-reload
systemd-tmpfiles --create clamav.conf
systemctl -q try-restart clamd
fi
:
%preun -n clamd
if [ $1 -eq 0 ]; then
# erase
systemctl -q stop clamd
systemctl -q disable clamd
fi
:
%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
%config(noreplace) %{_sysconfdir}/freshclam.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/freshclam
%{_prefix}/lib/tmpfiles.d/clamav.conf
%{_unitdir}/freshclamd.service
%dir %attr(0755,%{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}
%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)
%config(noreplace) %{_sysconfdir}/clamd.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/clamd
%{_sbindir}/clamd
%{_bindir}/clamdtop
%{_unitdir}/clamd.service
%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
* Thu Jan 29 2015 Automatic Build System <autodist@mambasoft.it> 0.98.6-1mamba
- automatic version update by autodist
* Wed Nov 19 2014 Automatic Build System <autodist@mambasoft.it> 0.98.5-1mamba
- automatic version update by autodist
* Thu Jul 24 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 0.98.4-4mamba
- move socket file and pid from /var/run/clamav to /run/clamav
- systemd switch
* Thu Jul 24 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 0.98.4-3mamba
- rebuilt with correct dbdir (--with-dbdir=%{_localstatedir}/lib/clamav/)
- make /var/lib/clamav world readable to work with amavis
* Thu Jul 24 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 0.98.4-2mamba
- rebuilt with correct dbdir (--with-dbdir=/var/lib/clamav)
* 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