clamav/clamav.spec

212 lines
6.5 KiB
RPMSpec
Raw Normal View History

#
# spec file for package clamav
#
Accepting request 569976 from home:vitezslav_cizek:branches:security - Update to security release 0.99.3 (bsc#1077732) * CVE-2017-12376 (ClamAV Buffer Overflow in handle_pdfname Vulnerability) * CVE-2017-12377 (ClamAV Mew Packet Heap Overflow Vulnerability) * CVE-2017-12379 (ClamAV Buffer Overflow in messageAddArgument Vulnerability) - these vulnerabilities could have allowed an unauthenticated, remote attacker to cause a denial of service (DoS) condition or potentially execute arbitrary code on an affected device. * CVE-2017-12374 (ClamAV use-after-free Vulnerabilities) * CVE-2017-12375 (ClamAV Buffer Overflow Vulnerability) * CVE-2017-12378 (ClamAV Buffer Over Read Vulnerability) * CVE-2017-12380 (ClamAV Null Dereference Vulnerability) - these vulnerabilities could have allowed an unauthenticated, remote attacker to cause a denial of service (DoS) condition on an affected device. * CVE-2017-6420 (bsc#1052448) - this vulnerability allowed remote attackers to cause a denial of service (use-after-free) via a crafted PE file with WWPack compression. * CVE-2017-6419 (bsc#1052449) - ClamAV allowed remote attackers to cause a denial of service (heap-based buffer overflow and application crash) or possibly have unspecified other impact via a crafted CHM file. * CVE-2017-11423 (bsc#1049423) - The cabd_read_string function in mspack/cabd.c in libmspack 0.5alpha allowed remote attackers to cause a denial of service (stack-based buffer over-read and application crash) via a crafted CAB file. * CVE-2017-6418 (bsc#1052466) - ClamAV 0.99.2 allowed remote attackers to cause a denial of service (out-of-bounds read) via a crafted e-mail message. - drop clamav-0.99.2-openssl-1.1.patch (upstream) OBS-URL: https://build.opensuse.org/request/show/569976 OBS-URL: https://build.opensuse.org/package/show/security/clamav?expand=0&rev=151
2018-01-26 17:21:11 +01:00
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: clamav
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: bc
BuildRequires: check-devel
BuildRequires: libbz2-devel
BuildRequires: libcurl-devel
BuildRequires: libopenssl-devel
BuildRequires: libtool
BuildRequires: libxml2-devel
BuildRequires: llvm-devel
BuildRequires: ncurses-devel
BuildRequires: pcre-devel
BuildRequires: pkgconfig
BuildRequires: pwdutils
BuildRequires: python-devel
BuildRequires: sed
BuildRequires: sendmail-devel
BuildRequires: zlib-devel
%define clamav_check --enable-check
Summary: Antivirus Toolkit
License: GPL-2.0-only
Group: Productivity/Security
Version: 0.100.0
Release: 0
Url: http://www.clamav.net
Obsoletes: clamav-db < 0.88.3
Provides: clamav-nodb = %{version}
Obsoletes: clamav-nodb <= 0.98.4
Requires(pre): %_sbindir/groupadd %_sbindir/useradd %_sbindir/usermod
Requires(pre): /usr/bin/awk /bin/sed /bin/tar
Source0: http://www.clamav.net/downloads/production/%{name}-%{version}.tar.gz
Source1: http://www.clamav.net/downloads/production/%{name}-%{version}.tar.gz.sig
Source11: clamav.keyring
Source4: clamav-rpmlintrc
Source6: clamav-tmpfiles.conf
Source7: service.clamd
Source8: service.freshclam
Source9: service.clamav-milter
Patch1: clamav-conf.patch
Patch4: clamav-disable-timestamps.patch
Patch5: clamav-obsolete-config.patch
BuildRequires: systemd
BuildRequires: systemd-rpm-macros
%systemd_requires
%description
ClamAV is an antivirus engine designed for detecting trojans,
viruses, malware and other malicious threats. It is the de-facto
standard for mail gateway scanning. It provides a multi-threaded
scanning daemon, command line utilities for on-demand file scanning,
and a tool for automatic signature updates. The core ClamAV library
provides numerous file format detection mechanisms, file unpacking
support, archive support, and multiple signature languages for
detecting threats.
%package -n libclamav7
Summary: ClamAV antivirus engine runtime
Group: System/Libraries
%description -n libclamav7
ClamAV is an antivirus engine designed for detecting trojans,
viruses, malware and other malicious threats.
%package devel
Summary: Development files for libclamav, an antivirus engine
Group: Development/Libraries/C and C++
Requires: libclamav7 = %version
%description devel
ClamAV is an antivirus engine designed for detecting trojans,
viruses, malware and other malicious threats.
This subpackage contains header files for developing applications
that want to make use of libclamav.
%prep
%setup -q
%patch1
%patch4
%patch5
%build
CFLAGS="-fstack-protector"
CXXFLAGS="-fstack-protector"
export CFLAGS="%optflags $CFLAGS -fPIE -fno-strict-aliasing"
export CXXFLAGS="%optflags $CXXFLAGS -fPIE -fno-strict-aliasing -std=gnu++98"
export LDFLAGS="-pie"
%if "%_lib" == "lib64"
# tomsfastmath needs this for correct operation on 64-bit platforms
CFLAGS="$CFLAGS -DFP_64BIT"
%endif
%configure \
--disable-clamav \
--disable-static \
--with-dbdir=/var/lib/clamav \
--with-user=vscan \
--with-group=vscan \
--enable-milter \
%clamav_check \
--enable-clamdtop \
--disable-zlib-vcheck \
--disable-timestamps
make V=1 %{?_smp_mflags}
%install
%make_install
install -d -m755 %buildroot/var/lib/clamav
install -d -m755 %buildroot/%_tmpfilesdir
install -m644 %{S:6} %buildroot%_tmpfilesdir/clamav.conf
mkdir -p %buildroot/var/spool/amavis
mkdir -p -m 0755 %buildroot/run/clamav
rm %buildroot/%_libdir/*.la
# Remove bogus dependencies from libclamav.pc
sed -i 's/^Libs: .*/Libs: -lclamav/' %buildroot%_libdir/pkgconfig/libclamav.pc
# fix the new config file names
pushd %buildroot/etc
mv clamd.conf.sample clamd.conf
mv clamav-milter.conf.sample clamav-milter.conf
mv freshclam.conf.sample freshclam.conf
popd
# Systemd...
install -d -m 0755 %buildroot/%{_unitdir}
install -m 0644 %{S:7} %buildroot/%{_unitdir}/clamd.service
install -m 0644 %{S:8} %buildroot/%{_unitdir}/freshclam.service
install -m 0644 %{S:9} %buildroot/%{_unitdir}/clamav-milter.service
rm -f %buildroot/%{_unitdir}/clamav-daemon.service
rm -f %buildroot/%{_unitdir}/clamav-daemon.socket
rm -f %buildroot/%{_unitdir}/clamav-freshclam.service
# this is broken if system does not have systemd so don't
# use it at all on systems without mandatory systemd
for srvname in clamd freshclam clamav-milter;do
(export PATH=/usr/sbin:/sbin:$PATH ;ln -sf $(which service) %{buildroot}/%{_sbindir}/rc${srvname})
done
%check
# regression tests
%if !0%{?qemu_user_space_build:1}
VALGRIND_GENSUP=1 make check
%endif
%post -n libclamav7 -p /sbin/ldconfig
%postun -n libclamav7 -p /sbin/ldconfig
%files
%config(noreplace) %_sysconfdir/*.conf
#systemd...
%{_unitdir}/clamd.service
%{_unitdir}/freshclam.service
%{_unitdir}/clamav-milter.service
%_tmpfilesdir
%doc COPYING*
%doc docs/*.pdf docs/html
%doc %_mandir/*/*
%_bindir/*
%_sbindir/*
%defattr(-,vscan,vscan)
%dir %attr(750,vscan,vscan) /var/spool/amavis
%dir /var/lib/clamav
%ghost %attr(755,vscan,vscan) /run/clamav
%files -n libclamav7
%_libdir/libclam*.so.7*
%_libdir/libclammspack.so.0*
%files devel
%_libdir/pkgconfig/*
%_libdir/libclam*.so
%_includedir/*
%pre
getent group vscan >/dev/null || %_sbindir/groupadd -r vscan || :
getent passwd vscan >/dev/null || \
%_sbindir/useradd -r -o -g vscan -u 65 -s /bin/false \
-c "Vscan account" -d /var/spool/amavis vscan || :
%_sbindir/usermod vscan -g vscan 2> /dev/null || :
%service_add_pre clamd.service freshclam.service clamav-milter.service
%post
systemd-tmpfiles --create %_tmpfilesdir/clamav.conf
%service_add_post clamd.service freshclam.service clamav-milter.service
%preun
%service_del_preun clamd.service freshclam.service clamav-milter.service
%postun
%service_del_postun clamd.service freshclam.service clamav-milter.service
%changelog