2007-01-16 00:07:16 +01:00
|
|
|
#
|
2011-02-21 13:23:22 +01:00
|
|
|
# spec file for package clamav
|
2007-01-16 00:07:16 +01:00
|
|
|
#
|
2022-04-12 15:56:58 +02:00
|
|
|
# Copyright (c) 2022 SUSE LLC
|
2007-01-16 00:07:16 +01:00
|
|
|
#
|
2008-09-05 22:14:53 +02:00
|
|
|
# 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.
|
|
|
|
|
2019-03-29 13:01:14 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2007-01-16 00:07:16 +01:00
|
|
|
#
|
|
|
|
|
2011-02-21 13:23:22 +01:00
|
|
|
|
2021-02-22 19:54:31 +01:00
|
|
|
%bcond_with clammspack
|
|
|
|
%bcond_with valgrind
|
2007-01-16 00:07:16 +01:00
|
|
|
Name: clamav
|
2022-05-06 11:28:32 +02:00
|
|
|
Version: 0.103.6
|
2018-07-26 11:55:19 +02:00
|
|
|
Release: 0
|
|
|
|
Summary: Antivirus Toolkit
|
|
|
|
License: GPL-2.0-only
|
|
|
|
Group: Productivity/Security
|
2022-04-12 15:56:58 +02:00
|
|
|
URL: https://www.clamav.net
|
|
|
|
Source0: https://www.clamav.net/downloads/production/%{name}-%{version}.tar.gz
|
|
|
|
Source1: https://www.clamav.net/downloads/production/%{name}-%{version}.tar.gz.sig
|
2018-07-26 11:55:19 +02:00
|
|
|
Source4: clamav-rpmlintrc
|
|
|
|
Source6: clamav-tmpfiles.conf
|
|
|
|
Source7: service.clamd
|
|
|
|
Source8: service.freshclam
|
|
|
|
Source9: service.clamav-milter
|
2021-02-22 19:54:31 +01:00
|
|
|
Source10: timer.freshclam
|
2018-07-26 11:55:19 +02:00
|
|
|
Source11: clamav.keyring
|
2021-02-22 19:54:31 +01:00
|
|
|
Source65: system-user-vscan.conf
|
2018-07-26 11:55:19 +02:00
|
|
|
Patch1: clamav-conf.patch
|
|
|
|
Patch5: clamav-obsolete-config.patch
|
2018-07-31 10:58:20 +02:00
|
|
|
Patch6: clamav-disable-yara.patch
|
2020-11-10 17:48:44 +01:00
|
|
|
Patch12: clamav-fips.patch
|
2021-11-04 14:53:57 +01:00
|
|
|
Patch14: clamav-document-maxsize.patch
|
|
|
|
|
2017-11-28 10:00:11 +01:00
|
|
|
BuildRequires: autoconf
|
|
|
|
BuildRequires: automake
|
2019-01-21 18:35:52 +01:00
|
|
|
BuildRequires: gcc-c++
|
2012-03-17 21:40:58 +01:00
|
|
|
BuildRequires: libbz2-devel
|
2020-09-18 16:19:44 +02:00
|
|
|
BuildRequires: libcurl-devel >= 7.45
|
2018-07-26 11:55:19 +02:00
|
|
|
BuildRequires: libjson-c-devel
|
2021-02-22 19:54:31 +01:00
|
|
|
BuildRequires: libopenssl-devel >= 1.0.2
|
2017-11-28 10:00:11 +01:00
|
|
|
BuildRequires: libtool
|
2014-05-08 17:21:16 +02:00
|
|
|
BuildRequires: libxml2-devel
|
2018-04-13 17:16:49 +02:00
|
|
|
BuildRequires: sendmail-devel
|
2021-02-22 19:54:31 +01:00
|
|
|
BuildRequires: pkgconfig(check)
|
|
|
|
BuildRequires: pkgconfig(libpcre2-8) >= 10.30
|
|
|
|
BuildRequires: pkgconfig(ncurses)
|
|
|
|
BuildRequires: pkgconfig(zlib)
|
2020-11-10 17:48:44 +01:00
|
|
|
#
|
|
|
|
# Workaround to keep "make check" from using an existing libclamav
|
|
|
|
# instead of the just built one. This should rather be fixed
|
|
|
|
# by keeping libtool from adding libdir to rpath and LD_LIBRARY_PATH
|
|
|
|
# of the test binaries.
|
|
|
|
#
|
|
|
|
#!BuildIgnore: clamav
|
2007-01-16 00:07:16 +01:00
|
|
|
Obsoletes: clamav-db < 0.88.3
|
2021-02-22 19:54:31 +01:00
|
|
|
Provides: clamav-nodb = %{version}
|
|
|
|
Obsoletes: clamav-nodb < %{version}
|
2020-04-15 22:39:04 +02:00
|
|
|
%if %{without clammspack}
|
2021-02-22 19:54:31 +01:00
|
|
|
BuildRequires: pkgconfig(libmspack)
|
2020-04-15 22:39:04 +02:00
|
|
|
%endif
|
2021-02-22 19:54:31 +01:00
|
|
|
%if %{with valgrind}
|
|
|
|
BuildRequires: valgrind
|
|
|
|
%endif
|
|
|
|
%if 0%{?suse_version} > 1500
|
|
|
|
Requires(pre): group(vscan)
|
|
|
|
Requires(pre): user(vscan)
|
|
|
|
%else
|
|
|
|
BuildRequires: sysuser-tools
|
|
|
|
%sysusers_requires
|
|
|
|
%endif
|
|
|
|
%{?systemd_ordering}
|
2007-01-16 00:07:16 +01:00
|
|
|
|
|
|
|
%description
|
2016-07-29 13:05:50 +02:00
|
|
|
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.
|
2007-01-16 00:07:16 +01:00
|
|
|
|
2021-04-08 10:27:46 +02:00
|
|
|
%package milter
|
|
|
|
Summary: ClamAV Milter compatible mail scanner
|
|
|
|
Group: Productivity/Security
|
|
|
|
Requires: %{name} = %{version}
|
2021-04-09 12:35:14 +02:00
|
|
|
Provides: %{name}:/usr/sbin/clamav-milter
|
2021-04-08 10:27:46 +02:00
|
|
|
|
|
|
|
%description milter
|
|
|
|
ClamAV-milter is a filter for sendmail(1) mail server. It uses a
|
|
|
|
mail scanning engine built into clamd(8). ClamAV-milter can use
|
|
|
|
load balancing and fault tolerant techniques to connect to more
|
|
|
|
than one clamd(8) server and seamlessly hot-swap to even the load
|
|
|
|
between different machines and to keep scanning for viruses even
|
|
|
|
when a server goes down.
|
|
|
|
|
2019-01-21 18:35:52 +01:00
|
|
|
%package -n libclamav9
|
2017-10-07 12:09:49 +02:00
|
|
|
Summary: ClamAV antivirus engine runtime
|
|
|
|
Group: System/Libraries
|
|
|
|
|
2019-01-21 18:35:52 +01:00
|
|
|
%description -n libclamav9
|
2017-10-07 12:09:49 +02:00
|
|
|
ClamAV is an antivirus engine designed for detecting trojans,
|
|
|
|
viruses, malware and other malicious threats.
|
|
|
|
|
2019-11-26 00:01:55 +01:00
|
|
|
%package -n libfreshclam2
|
|
|
|
Summary: ClamAV updater library
|
|
|
|
Group: System/Libraries
|
|
|
|
|
|
|
|
%description -n libfreshclam2
|
|
|
|
ClamAV is an antivirus engine designed for detecting trojans,
|
|
|
|
viruses, malware and other malicious threats.
|
|
|
|
|
2018-04-26 17:39:59 +02:00
|
|
|
%package -n libclammspack0
|
|
|
|
Summary: ClamAV antivirus engine runtime
|
|
|
|
Group: System/Libraries
|
|
|
|
|
|
|
|
%description -n libclammspack0
|
|
|
|
ClamAV is an antivirus engine designed for detecting trojans,
|
|
|
|
viruses, malware and other malicious threats.
|
|
|
|
|
2017-10-07 12:09:49 +02:00
|
|
|
%package devel
|
|
|
|
Summary: Development files for libclamav, an antivirus engine
|
|
|
|
Group: Development/Libraries/C and C++
|
2021-02-22 19:54:31 +01:00
|
|
|
Requires: libclamav9 = %{version}
|
|
|
|
Requires: libfreshclam2 = %{version}
|
2017-10-07 12:09:49 +02:00
|
|
|
|
|
|
|
%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.
|
|
|
|
|
2007-01-16 00:07:16 +01:00
|
|
|
%prep
|
|
|
|
%setup -q
|
2018-04-13 17:16:49 +02:00
|
|
|
%patch1
|
2018-04-18 16:49:27 +02:00
|
|
|
%patch5
|
2018-07-31 10:58:20 +02:00
|
|
|
%patch6
|
2020-11-10 17:48:44 +01:00
|
|
|
%patch12
|
2021-11-04 14:53:57 +01:00
|
|
|
%patch14 -p1
|
2007-01-16 00:07:16 +01:00
|
|
|
|
|
|
|
%build
|
2021-02-22 19:54:31 +01:00
|
|
|
%if 0%{?suse_version} <= 1500
|
|
|
|
# Create vscan user
|
|
|
|
%sysusers_generate_pre %{SOURCE65} vscan
|
|
|
|
%endif
|
2008-04-21 18:37:35 +02:00
|
|
|
CFLAGS="-fstack-protector"
|
2010-04-08 22:11:51 +02:00
|
|
|
CXXFLAGS="-fstack-protector"
|
2018-07-31 11:13:16 +02:00
|
|
|
export CFLAGS="%optflags $CFLAGS -fPIE -fno-strict-aliasing"
|
|
|
|
export CXXFLAGS="%optflags $CXXFLAGS -fPIE -fno-strict-aliasing -std=gnu++98"
|
2015-01-02 09:49:36 +01:00
|
|
|
export LDFLAGS="-pie"
|
2021-02-22 19:54:31 +01:00
|
|
|
%if "%{_lib}" == "lib64"
|
2013-12-18 09:10:11 +01:00
|
|
|
# tomsfastmath needs this for correct operation on 64-bit platforms
|
|
|
|
CFLAGS="$CFLAGS -DFP_64BIT"
|
|
|
|
%endif
|
2015-12-02 17:24:31 +01:00
|
|
|
%configure \
|
2007-01-16 00:07:16 +01:00
|
|
|
--disable-clamav \
|
|
|
|
--disable-static \
|
2020-04-15 22:39:04 +02:00
|
|
|
--with-dbdir=%{_localstatedir}/lib/clamav \
|
2007-01-16 00:07:16 +01:00
|
|
|
--with-user=vscan \
|
|
|
|
--with-group=vscan \
|
2008-04-21 18:37:35 +02:00
|
|
|
--enable-milter \
|
2021-02-22 19:54:31 +01:00
|
|
|
--enable-check \
|
2012-06-19 22:15:38 +02:00
|
|
|
--enable-clamdtop \
|
2019-01-21 18:35:52 +01:00
|
|
|
--disable-yara \
|
|
|
|
%if %{without clammspack}
|
|
|
|
--with-system-libmspack
|
|
|
|
%endif
|
2010-04-08 22:11:51 +02:00
|
|
|
|
2020-07-17 16:24:02 +02:00
|
|
|
%make_build
|
2007-07-16 07:48:13 +02:00
|
|
|
|
2007-01-16 00:07:16 +01:00
|
|
|
%install
|
2017-10-07 12:09:49 +02:00
|
|
|
%make_install
|
2021-02-22 19:54:31 +01:00
|
|
|
install -d -m755 %{buildroot}%{_localstatedir}/lib/clamav
|
|
|
|
install -d -m755 %{buildroot}%{_tmpfilesdir}
|
|
|
|
install -m644 %SOURCE6 %{buildroot}%{_tmpfilesdir}/clamav.conf
|
|
|
|
%if 0%{?suse_version} <= 1500
|
|
|
|
mkdir -p %{buildroot}%{_localstatedir}/spool/amavis
|
|
|
|
%endif
|
|
|
|
mkdir -p -m 0755 %{buildroot}/run/clamav
|
|
|
|
find %{buildroot} -type f -name "*.la" -delete -print
|
2018-04-26 17:39:59 +02:00
|
|
|
|
|
|
|
# libclammspack is not meant to be linked against by anything but
|
|
|
|
# libclamav
|
2021-02-22 19:54:31 +01:00
|
|
|
rm -f %{buildroot}%{_libdir}/pkgconfig/libclammspack.pc
|
|
|
|
rm -f %{buildroot}%{_libdir}/libclammspack.so
|
2007-01-16 00:07:16 +01:00
|
|
|
|
2013-09-28 09:38:07 +02:00
|
|
|
# fix the new config file names
|
2021-02-22 19:54:31 +01:00
|
|
|
mv %{buildroot}%{_sysconfdir}/clamd.conf{.sample,}
|
|
|
|
mv %{buildroot}%{_sysconfdir}/clamav-milter.conf{.sample,}
|
|
|
|
mv %{buildroot}%{_sysconfdir}/freshclam.conf{.sample,}
|
2013-09-28 09:38:07 +02:00
|
|
|
|
2014-03-28 17:04:21 +01:00
|
|
|
# Systemd...
|
2021-02-22 19:54:31 +01:00
|
|
|
install -d -m 0755 %{buildroot}%{_unitdir}
|
|
|
|
rm -f %{buildroot}%{_unitdir}/clamav-*
|
|
|
|
install -m 0644 %SOURCE7 %{buildroot}%{_unitdir}/clamd.service
|
|
|
|
install -m 0644 %SOURCE8 %{buildroot}%{_unitdir}/freshclam.service
|
|
|
|
install -m 0644 %SOURCE9 %{buildroot}%{_unitdir}/clamav-milter.service
|
|
|
|
install -m 0644 %SOURCE10 %{buildroot}%{_unitdir}/freshclam.timer
|
2018-07-26 11:55:19 +02:00
|
|
|
# this is broken if system does not have systemd so don't
|
2014-03-28 17:04:21 +01:00
|
|
|
# use it at all on systems without mandatory systemd
|
2021-02-22 19:54:31 +01:00
|
|
|
for srvname in clamd freshclam clamav-milter; do
|
|
|
|
(export PATH=%_prefix/sbin:/sbin:$PATH ;ln -sf $(which service) %{buildroot}/%{_sbindir}/rc${srvname})
|
2014-03-28 17:04:21 +01:00
|
|
|
done
|
|
|
|
|
2013-01-05 15:28:49 +01:00
|
|
|
%check
|
2013-09-28 09:41:14 +02:00
|
|
|
# regression tests
|
2013-01-05 15:28:49 +01:00
|
|
|
%if !0%{?qemu_user_space_build:1}
|
2020-09-18 16:19:44 +02:00
|
|
|
make check VG=1
|
2013-01-05 15:28:49 +01:00
|
|
|
%endif
|
|
|
|
|
2021-02-22 19:54:31 +01:00
|
|
|
%if 0%{?suse_version} > 1500
|
|
|
|
%pre
|
|
|
|
%else
|
2021-04-08 10:27:46 +02:00
|
|
|
|
2021-02-22 19:54:31 +01:00
|
|
|
%pre -f vscan.pre
|
|
|
|
%endif
|
2021-04-08 10:27:46 +02:00
|
|
|
%service_add_pre clamd.service
|
2021-02-22 19:54:31 +01:00
|
|
|
|
|
|
|
%post
|
|
|
|
%tmpfiles_create %{_tmpfilesdir}/clamav.conf
|
2021-04-08 10:27:46 +02:00
|
|
|
%service_add_post clamd.service
|
2021-02-22 19:54:31 +01:00
|
|
|
|
|
|
|
%preun
|
2021-04-08 10:27:46 +02:00
|
|
|
if [ $1 -eq 0 ]; then
|
|
|
|
# package will be uninstalled
|
|
|
|
rm -f %{_localstatedir}/lib/clamav/*
|
|
|
|
fi
|
|
|
|
%service_del_preun clamd.service
|
2021-02-22 19:54:31 +01:00
|
|
|
|
|
|
|
%postun
|
2021-04-08 10:27:46 +02:00
|
|
|
%service_del_postun clamd.service
|
|
|
|
|
|
|
|
%pre milter
|
|
|
|
%service_add_pre clamav-milter.service
|
|
|
|
|
|
|
|
%post milter
|
|
|
|
%service_add_post clamav-milter.service
|
|
|
|
|
|
|
|
%preun milter
|
|
|
|
%service_del_preun clamav-milter.service
|
|
|
|
|
|
|
|
%postun milter
|
|
|
|
%service_del_postun clamav-milter.service
|
2021-02-22 19:54:31 +01:00
|
|
|
|
|
|
|
%if 0%{?suse_version} > 1500
|
|
|
|
%ldconfig_scriptlets -n libclamav9
|
|
|
|
%ldconfig_scriptlets -n libfreshclam2
|
|
|
|
%if %{with clammspack}
|
|
|
|
%ldconfig_scriptlets -n libclammspack0
|
|
|
|
%endif
|
|
|
|
%else
|
2019-01-21 18:35:52 +01:00
|
|
|
%post -n libclamav9 -p /sbin/ldconfig
|
|
|
|
%postun -n libclamav9 -p /sbin/ldconfig
|
2019-11-26 00:01:55 +01:00
|
|
|
%post -n libfreshclam2 -p /sbin/ldconfig
|
|
|
|
%postun -n libfreshclam2 -p /sbin/ldconfig
|
2021-02-22 19:54:31 +01:00
|
|
|
%if %{with clammspack}
|
2019-11-26 00:01:55 +01:00
|
|
|
%post -n libclammspack0 -p /sbin/ldconfig
|
2018-07-17 23:41:52 +02:00
|
|
|
%postun -n libclammspack0 -p /sbin/ldconfig
|
2021-02-22 19:54:31 +01:00
|
|
|
%endif
|
|
|
|
%endif
|
2018-07-17 23:41:52 +02:00
|
|
|
|
2007-01-16 00:07:16 +01:00
|
|
|
%files
|
2018-07-26 11:55:19 +02:00
|
|
|
%license COPYING*
|
2019-01-21 18:35:52 +01:00
|
|
|
%doc docs/html/*
|
2021-04-08 10:27:46 +02:00
|
|
|
%config(noreplace) %{_sysconfdir}/clamd.conf
|
|
|
|
%config(noreplace) %{_sysconfdir}/freshclam.conf
|
|
|
|
%{_bindir}/clamav-config
|
|
|
|
%{_bindir}/clambc
|
|
|
|
%{_bindir}/clamconf
|
|
|
|
%{_bindir}/clamdscan
|
|
|
|
%{_bindir}/clamdtop
|
|
|
|
%{_bindir}/clamscan
|
|
|
|
%{_bindir}/clamsubmit
|
|
|
|
%{_bindir}/freshclam
|
|
|
|
%{_bindir}/sigtool
|
|
|
|
%{_sbindir}/clamd
|
|
|
|
%{_sbindir}/clamonacc
|
|
|
|
%{_sbindir}/rcclamd
|
|
|
|
%{_sbindir}/rcfreshclam
|
|
|
|
%{_mandir}/man1/clambc.1%{?ext_man}
|
|
|
|
%{_mandir}/man1/clamconf.1%{?ext_man}
|
|
|
|
%{_mandir}/man1/clamdscan.1%{?ext_man}
|
|
|
|
%{_mandir}/man1/clamdtop.1%{?ext_man}
|
|
|
|
%{_mandir}/man1/clamscan.1%{?ext_man}
|
|
|
|
%{_mandir}/man1/clamsubmit.1%{?ext_man}
|
|
|
|
%{_mandir}/man1/freshclam.1%{?ext_man}
|
|
|
|
%{_mandir}/man1/sigtool.1%{?ext_man}
|
|
|
|
%{_mandir}/man5/clamd.conf.5%{?ext_man}
|
|
|
|
%{_mandir}/man5/freshclam.conf.5%{?ext_man}
|
|
|
|
%{_mandir}/man8/clamd.8%{?ext_man}
|
|
|
|
%{_mandir}/man8/clamonacc.8%{?ext_man}
|
2021-02-22 19:54:31 +01:00
|
|
|
%{_tmpfilesdir}/*
|
|
|
|
%{_unitdir}/clamd.service
|
|
|
|
%{_unitdir}/freshclam.service
|
|
|
|
%{_unitdir}/freshclam.timer
|
2007-01-16 00:07:16 +01:00
|
|
|
%defattr(-,vscan,vscan)
|
2020-04-15 22:39:04 +02:00
|
|
|
%dir %{_localstatedir}/lib/clamav
|
2021-02-22 19:54:31 +01:00
|
|
|
%if 0%{?suse_version} <= 1500
|
|
|
|
%dir %attr(750,vscan,vscan) %{_localstatedir}/spool/amavis
|
|
|
|
%endif
|
2016-07-21 16:03:06 +02:00
|
|
|
%ghost %attr(755,vscan,vscan) /run/clamav
|
2007-01-16 00:07:16 +01:00
|
|
|
|
2021-04-08 10:27:46 +02:00
|
|
|
%files milter
|
|
|
|
%config(noreplace) %{_sysconfdir}/clamav-milter.conf
|
|
|
|
%{_unitdir}/clamav-milter.service
|
|
|
|
%{_sbindir}/clamav-milter
|
|
|
|
%{_sbindir}/rcclamav-milter
|
|
|
|
%{_mandir}/man5/clamav-milter.conf.5%{?ext_man}
|
|
|
|
%{_mandir}/man8/clamav-milter.8%{?ext_man}
|
|
|
|
|
2019-01-21 18:35:52 +01:00
|
|
|
%files -n libclamav9
|
2021-02-22 19:54:31 +01:00
|
|
|
%{_libdir}/libclam*.so.9*
|
2018-04-26 17:39:59 +02:00
|
|
|
|
2019-11-26 00:01:55 +01:00
|
|
|
%files -n libfreshclam2
|
2021-02-22 19:54:31 +01:00
|
|
|
%{_libdir}/libfreshclam.so.2*
|
2019-11-26 00:01:55 +01:00
|
|
|
|
2019-01-21 18:35:52 +01:00
|
|
|
%if %{with clammspack}
|
2018-04-26 17:39:59 +02:00
|
|
|
%files -n libclammspack0
|
2021-02-22 19:54:31 +01:00
|
|
|
%{_libdir}/libclammspack.so.0*
|
2019-01-21 18:35:52 +01:00
|
|
|
%endif
|
2017-10-07 12:09:49 +02:00
|
|
|
|
|
|
|
%files devel
|
2021-02-22 19:54:31 +01:00
|
|
|
%{_includedir}/*
|
|
|
|
%{_libdir}/pkgconfig/*
|
|
|
|
%{_libdir}/libclam*.so
|
|
|
|
%{_libdir}/libfreshclam*.so
|
2007-01-16 00:07:16 +01:00
|
|
|
|
2007-02-25 12:09:43 +01:00
|
|
|
%changelog
|