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
|
|
|
#
|
2018-01-26 17:21:11 +01:00
|
|
|
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
|
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.
|
|
|
|
|
2007-01-16 00:07:16 +01:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2011-02-21 13:23:22 +01:00
|
|
|
|
2018-07-26 11:55:19 +02:00
|
|
|
%define clamav_check --enable-check
|
2007-01-16 00:07:16 +01:00
|
|
|
Name: clamav
|
2018-07-26 11:55:19 +02:00
|
|
|
Version: 0.100.1
|
|
|
|
Release: 0
|
|
|
|
Summary: Antivirus Toolkit
|
|
|
|
License: GPL-2.0-only
|
|
|
|
Group: Productivity/Security
|
|
|
|
URL: http://www.clamav.net
|
|
|
|
Source0: http://www.clamav.net/downloads/production/%{name}-%{version}.tar.gz
|
|
|
|
Source1: http://www.clamav.net/downloads/production/%{name}-%{version}.tar.gz.sig
|
|
|
|
Source4: clamav-rpmlintrc
|
|
|
|
Source6: clamav-tmpfiles.conf
|
|
|
|
Source7: service.clamd
|
|
|
|
Source8: service.freshclam
|
|
|
|
Source9: service.clamav-milter
|
|
|
|
Source11: clamav.keyring
|
|
|
|
Patch1: clamav-conf.patch
|
|
|
|
Patch4: clamav-disable-timestamps.patch
|
|
|
|
Patch5: clamav-obsolete-config.patch
|
2017-11-28 10:00:11 +01:00
|
|
|
BuildRequires: autoconf
|
|
|
|
BuildRequires: automake
|
2018-04-13 17:16:49 +02:00
|
|
|
BuildRequires: bc
|
2012-03-17 21:40:58 +01:00
|
|
|
BuildRequires: check-devel
|
|
|
|
BuildRequires: libbz2-devel
|
2018-02-14 13:23:33 +01:00
|
|
|
BuildRequires: libcurl-devel
|
2018-07-26 11:55:19 +02:00
|
|
|
BuildRequires: libjson-c-devel
|
2014-05-08 17:21:16 +02:00
|
|
|
BuildRequires: libopenssl-devel
|
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: ncurses-devel
|
2018-07-26 11:55:19 +02:00
|
|
|
BuildRequires: pcre2-devel
|
2018-04-13 17:16:49 +02:00
|
|
|
BuildRequires: pkgconfig
|
2012-03-17 21:40:58 +01:00
|
|
|
BuildRequires: pwdutils
|
|
|
|
BuildRequires: python-devel
|
2018-04-13 17:16:49 +02:00
|
|
|
BuildRequires: sed
|
|
|
|
BuildRequires: sendmail-devel
|
2018-07-26 11:55:19 +02:00
|
|
|
BuildRequires: systemd-devel
|
|
|
|
BuildRequires: systemd-rpm-macros
|
2018-04-13 17:16:49 +02:00
|
|
|
BuildRequires: zlib-devel
|
2018-07-26 11:55:19 +02:00
|
|
|
Requires(pre): %{_bindir}/awk
|
|
|
|
Requires(pre): %{_sbindir}/groupadd
|
|
|
|
Requires(pre): %{_sbindir}/useradd
|
|
|
|
Requires(pre): %{_sbindir}/usermod
|
|
|
|
Requires(pre): /bin/sed
|
|
|
|
Requires(pre): /bin/tar
|
2007-01-16 00:07:16 +01:00
|
|
|
Obsoletes: clamav-db < 0.88.3
|
2017-05-29 20:25:35 +02:00
|
|
|
Provides: clamav-nodb = %{version}
|
|
|
|
Obsoletes: clamav-nodb <= 0.98.4
|
2014-06-12 15:36:29 +02:00
|
|
|
%systemd_requires
|
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
|
|
|
|
2017-10-07 12:09:49 +02:00
|
|
|
%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.
|
|
|
|
|
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++
|
2018-07-26 11:55:19 +02:00
|
|
|
Requires: libclamav7 = %{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-03-07 14:46:42 +01:00
|
|
|
%patch4
|
2018-04-18 16:49:27 +02:00
|
|
|
%patch5
|
2007-01-16 00:07:16 +01:00
|
|
|
|
|
|
|
%build
|
2008-04-21 18:37:35 +02:00
|
|
|
CFLAGS="-fstack-protector"
|
2010-04-08 22:11:51 +02:00
|
|
|
CXXFLAGS="-fstack-protector"
|
2018-07-26 11:55:19 +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"
|
2018-07-26 11:55:19 +02: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 \
|
2018-07-26 11:55:19 +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 \
|
2018-07-26 11:55:19 +02:00
|
|
|
%{clamav_check} \
|
2012-06-19 22:15:38 +02:00
|
|
|
--enable-clamdtop \
|
2017-08-01 18:41:00 +02:00
|
|
|
--disable-zlib-vcheck \
|
2018-07-30 13:28:31 +02:00
|
|
|
--disable-timestamps \
|
|
|
|
--disable-yara
|
2010-04-08 22:11:51 +02:00
|
|
|
|
2016-07-29 13:05:50 +02:00
|
|
|
make V=1 %{?_smp_mflags}
|
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
|
2018-07-26 11:55:19 +02:00
|
|
|
install -d -m755 %{buildroot}%{_localstatedir}/lib/clamav
|
|
|
|
install -d -m755 %{buildroot}/%{_tmpfilesdir}
|
|
|
|
install -m644 %{SOURCE6} %{buildroot}%{_tmpfilesdir}/clamav.conf
|
|
|
|
mkdir -p %{buildroot}%{_localstatedir}/spool/amavis
|
|
|
|
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
|
2018-07-26 11:55:19 +02:00
|
|
|
rm %{buildroot}%{_libdir}/pkgconfig/libclammspack.pc
|
|
|
|
rm %{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
|
2018-07-26 11:55:19 +02:00
|
|
|
pushd %{buildroot}%{_sysconfdir}
|
2013-09-28 09:38:07 +02:00
|
|
|
mv clamd.conf.sample clamd.conf
|
|
|
|
mv clamav-milter.conf.sample clamav-milter.conf
|
|
|
|
mv freshclam.conf.sample freshclam.conf
|
|
|
|
popd
|
|
|
|
|
2014-03-28 17:04:21 +01:00
|
|
|
# Systemd...
|
2018-07-26 11:55:19 +02:00
|
|
|
install -d -m 0755 %{buildroot}/%{_unitdir}
|
|
|
|
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
|
|
|
|
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
|
2014-03-28 17:04:21 +01:00
|
|
|
# use it at all on systems without mandatory systemd
|
|
|
|
for srvname in clamd freshclam clamav-milter;do
|
2018-07-26 11:55:19 +02:00
|
|
|
(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}
|
|
|
|
VALGRIND_GENSUP=1 make check
|
|
|
|
%endif
|
|
|
|
|
2017-10-07 12:09:49 +02:00
|
|
|
%post -n libclamav7 -p /sbin/ldconfig
|
|
|
|
%postun -n libclamav7 -p /sbin/ldconfig
|
2018-07-17 23:41:52 +02:00
|
|
|
%post -n libclammspack0 -p /sbin/ldconfig
|
|
|
|
%postun -n libclammspack0 -p /sbin/ldconfig
|
|
|
|
|
2007-01-16 00:07:16 +01:00
|
|
|
%files
|
2018-07-26 11:55:19 +02:00
|
|
|
%config(noreplace) %{_sysconfdir}/*.conf
|
2014-03-28 17:04:21 +01:00
|
|
|
#systemd...
|
|
|
|
%{_unitdir}/clamd.service
|
|
|
|
%{_unitdir}/freshclam.service
|
|
|
|
%{_unitdir}/clamav-milter.service
|
2018-07-26 11:55:19 +02:00
|
|
|
%{_tmpfilesdir}
|
|
|
|
%license COPYING*
|
2007-01-16 00:07:16 +01:00
|
|
|
%doc docs/*.pdf docs/html
|
2018-07-26 11:55:19 +02:00
|
|
|
%{_mandir}/*/*
|
|
|
|
%{_bindir}/*
|
|
|
|
%{_sbindir}/*
|
2007-01-16 00:07:16 +01:00
|
|
|
%defattr(-,vscan,vscan)
|
2018-07-26 11:55:19 +02:00
|
|
|
%dir %attr(750,vscan,vscan) %{_localstatedir}/spool/amavis
|
|
|
|
%dir %{_localstatedir}/lib/clamav
|
2016-07-21 16:03:06 +02:00
|
|
|
%ghost %attr(755,vscan,vscan) /run/clamav
|
2007-01-16 00:07:16 +01:00
|
|
|
|
2017-10-07 12:09:49 +02:00
|
|
|
%files -n libclamav7
|
2018-07-26 11:55:19 +02:00
|
|
|
%{_libdir}/libclam*.so.7*
|
2018-04-26 17:39:59 +02:00
|
|
|
|
|
|
|
%files -n libclammspack0
|
2018-07-26 11:55:19 +02:00
|
|
|
%{_libdir}/libclammspack.so.0*
|
2017-10-07 12:09:49 +02:00
|
|
|
|
|
|
|
%files devel
|
2018-07-26 11:55:19 +02:00
|
|
|
%{_libdir}/pkgconfig/*
|
|
|
|
%{_libdir}/libclam*.so
|
|
|
|
%{_includedir}/*
|
2017-10-07 12:09:49 +02:00
|
|
|
|
2007-01-16 00:07:16 +01:00
|
|
|
%pre
|
2018-07-26 11:55:19 +02:00
|
|
|
getent group vscan >/dev/null || %{_sbindir}/groupadd -r vscan || :
|
2016-07-29 13:05:50 +02:00
|
|
|
getent passwd vscan >/dev/null || \
|
2018-07-26 11:55:19 +02:00
|
|
|
%{_sbindir}/useradd -r -o -g vscan -u 65 -s /bin/false \
|
|
|
|
-c "Vscan account" -d %{_localstatedir}/spool/amavis vscan || :
|
|
|
|
%{_sbindir}/usermod vscan -g vscan 2> /dev/null || :
|
2015-01-23 15:07:57 +01:00
|
|
|
%service_add_pre clamd.service freshclam.service clamav-milter.service
|
2007-02-25 12:09:43 +01:00
|
|
|
|
2015-01-23 15:07:57 +01:00
|
|
|
%post
|
2018-07-26 11:55:19 +02:00
|
|
|
systemd-tmpfiles --create %{_tmpfilesdir}/clamav.conf
|
2015-01-23 15:07:57 +01:00
|
|
|
%service_add_post clamd.service freshclam.service clamav-milter.service
|
|
|
|
|
2007-01-16 00:07:16 +01:00
|
|
|
%preun
|
2014-06-12 15:36:29 +02:00
|
|
|
%service_del_preun clamd.service freshclam.service clamav-milter.service
|
2007-01-16 00:07:16 +01:00
|
|
|
|
|
|
|
%postun
|
2014-06-12 15:36:29 +02:00
|
|
|
%service_del_postun clamd.service freshclam.service clamav-milter.service
|
2007-01-16 00:07:16 +01:00
|
|
|
|
2007-02-25 12:09:43 +01:00
|
|
|
%changelog
|