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
|
|
|
#
|
2017-05-29 20:25:35 +02:00
|
|
|
# Copyright (c) 2017 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
|
|
|
|
2007-01-16 00:07:16 +01:00
|
|
|
Name: clamav
|
2012-03-17 21:40:58 +01:00
|
|
|
BuildRequires: ncurses-devel
|
|
|
|
BuildRequires: sed
|
|
|
|
BuildRequires: sendmail-devel
|
2010-04-16 00:00:32 +02:00
|
|
|
%define llvm --disable-llvm
|
2012-03-17 21:40:58 +01:00
|
|
|
BuildRequires: bc
|
|
|
|
BuildRequires: pkgconfig
|
|
|
|
BuildRequires: zlib-devel
|
2010-04-16 00:00:32 +02:00
|
|
|
%ifarch %ix86 x86_64
|
|
|
|
%define llvm --enable-llvm
|
2010-09-15 16:35:23 +02:00
|
|
|
# Needed for compiling LLVM.
|
|
|
|
BuildRequires: gcc-c++
|
2010-04-16 00:00:32 +02:00
|
|
|
%endif
|
2012-03-17 21:40:58 +01:00
|
|
|
BuildRequires: check-devel
|
|
|
|
BuildRequires: libbz2-devel
|
2014-05-08 17:21:16 +02:00
|
|
|
BuildRequires: libopenssl-devel
|
|
|
|
BuildRequires: libxml2-devel
|
2016-01-13 19:12:46 +01:00
|
|
|
BuildRequires: pcre-devel
|
2012-03-17 21:40:58 +01:00
|
|
|
BuildRequires: pwdutils
|
|
|
|
BuildRequires: python-devel
|
2008-09-05 22:14:53 +02:00
|
|
|
%define clamav_check --enable-check
|
2007-01-16 00:07:16 +01:00
|
|
|
Summary: Antivirus Toolkit
|
2011-12-06 18:03:07 +01:00
|
|
|
License: GPL-2.0
|
2007-01-16 00:07:16 +01:00
|
|
|
Group: Productivity/Security
|
2016-06-23 09:56:59 +02:00
|
|
|
Version: 0.99.2
|
2012-03-17 21:40:58 +01:00
|
|
|
Release: 0
|
2008-01-17 22:13:55 +01:00
|
|
|
Url: http://www.clamav.net
|
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
|
2015-12-02 17:24:31 +01:00
|
|
|
Requires(pre): %_sbindir/groupadd %_sbindir/useradd %_sbindir/usermod
|
|
|
|
Requires(pre): /usr/bin/awk /bin/sed /bin/tar
|
2016-06-23 10:08:28 +02:00
|
|
|
Source0: http://www.clamav.net/downloads/production/%{name}-%{version}.tar.gz
|
2014-02-21 15:43:48 +01:00
|
|
|
Source11: clamav.keyring
|
2007-07-16 07:48:13 +02:00
|
|
|
Source4: clamav-rpmlintrc
|
2013-01-14 16:06:55 +01:00
|
|
|
Source6: clamav-tmpfiles.conf
|
2014-03-28 17:04:21 +01:00
|
|
|
Source7: service.clamd
|
|
|
|
Source8: service.freshclam
|
|
|
|
Source9: service.clamav-milter
|
2008-02-25 17:07:24 +01:00
|
|
|
Patch1: clamav-conf.patch
|
2012-03-20 11:39:33 +01:00
|
|
|
Patch3: clamav-gcc47.patch
|
2016-11-10 23:34:49 +01:00
|
|
|
Patch4: clamav-disable-timestamps.patch
|
2017-09-05 16:59:05 +02:00
|
|
|
Patch5: clamav-fix_newer_zlib.patch
|
2014-03-28 17:04:21 +01:00
|
|
|
BuildRequires: systemd
|
2016-07-21 16:03:06 +02:00
|
|
|
BuildRequires: systemd-rpm-macros
|
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.
|
|
|
|
|
|
|
|
%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.
|
|
|
|
|
2007-01-16 00:07:16 +01:00
|
|
|
%prep
|
|
|
|
%setup -q
|
2013-09-28 09:38:07 +02:00
|
|
|
%patch1 -p1
|
2012-03-20 11:39:33 +01:00
|
|
|
%patch3 -p1
|
2016-11-10 23:34:49 +01:00
|
|
|
%patch4 -p1
|
2017-09-05 16:59:05 +02:00
|
|
|
%patch5 -p1
|
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"
|
2015-12-02 17:24:31 +01:00
|
|
|
export CFLAGS="%optflags $CFLAGS -fPIE -fno-strict-aliasing"
|
2016-06-17 15:53:52 +02:00
|
|
|
export CXXFLAGS="%optflags $CXXFLAGS -fPIE -fno-strict-aliasing -std=gnu++98"
|
2015-01-02 09:49:36 +01:00
|
|
|
export LDFLAGS="-pie"
|
2014-04-23 13:33:39 +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 \
|
|
|
|
--with-dbdir=/var/lib/clamav \
|
|
|
|
--with-user=vscan \
|
|
|
|
--with-group=vscan \
|
2008-04-21 18:37:35 +02:00
|
|
|
--enable-milter \
|
2008-09-05 22:14:53 +02:00
|
|
|
%clamav_check \
|
2010-04-16 00:00:32 +02:00
|
|
|
%llvm \
|
2012-06-19 22:15:38 +02:00
|
|
|
--enable-clamdtop \
|
2017-08-01 18:41:00 +02:00
|
|
|
--disable-zlib-vcheck \
|
2012-06-19 22:15:38 +02:00
|
|
|
--disable-timestamps
|
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
|
2014-06-12 15:36:29 +02:00
|
|
|
install -d -m755 %buildroot/var/lib/clamav
|
2014-02-04 15:37:44 +01:00
|
|
|
install -d -m755 %buildroot/%_tmpfilesdir
|
2016-07-21 16:03:06 +02:00
|
|
|
install -m644 %{S:6} %buildroot%_tmpfilesdir/clamav.conf
|
2007-01-16 00:07:16 +01:00
|
|
|
mkdir -p %buildroot/var/spool/amavis
|
2016-07-21 16:03:06 +02:00
|
|
|
mkdir -p -m 0755 %buildroot/run/clamav
|
2007-02-25 12:09:43 +01:00
|
|
|
rm %buildroot/%_libdir/*.la
|
2008-04-21 18:37:35 +02:00
|
|
|
# Remove bogus dependencies from libclamav.pc
|
|
|
|
sed -i 's/^Libs: .*/Libs: -lclamav/' %buildroot%_libdir/pkgconfig/libclamav.pc
|
2007-01-16 00:07:16 +01:00
|
|
|
|
2013-09-28 09:38:07 +02:00
|
|
|
# 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
|
|
|
|
|
2014-03-28 17:04:21 +01:00
|
|
|
# Systemd...
|
|
|
|
install -d -m 0755 %buildroot/%{_unitdir}
|
2016-07-21 16:03:06 +02:00
|
|
|
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
|
2014-03-28 17:04:21 +01:00
|
|
|
# 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
|
2014-06-12 15:36:29 +02:00
|
|
|
(export PATH=/usr/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
|
|
|
|
|
2007-01-16 00:07:16 +01:00
|
|
|
%files
|
|
|
|
%defattr(-,root,root,-)
|
|
|
|
%config(noreplace) %_sysconfdir/*.conf
|
2014-03-28 17:04:21 +01:00
|
|
|
#systemd...
|
|
|
|
%{_unitdir}/clamd.service
|
|
|
|
%{_unitdir}/freshclam.service
|
|
|
|
%{_unitdir}/clamav-milter.service
|
2014-02-04 15:37:44 +01:00
|
|
|
%_tmpfilesdir
|
2007-07-16 07:48:13 +02:00
|
|
|
%doc AUTHORS BUGS ChangeLog COPYING FAQ NEWS README UPGRADE
|
2007-01-16 00:07:16 +01:00
|
|
|
%doc docs/*.pdf docs/html
|
|
|
|
%doc %_mandir/*/*
|
|
|
|
%_bindir/*
|
|
|
|
%_sbindir/*
|
|
|
|
%_libdir/pkgconfig/libclamav.pc
|
|
|
|
%defattr(-,vscan,vscan)
|
2013-04-29 16:32:27 +02:00
|
|
|
%dir %attr(750,vscan,vscan) /var/spool/amavis
|
2007-01-16 00:07:16 +01:00
|
|
|
%dir /var/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
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%_libdir/libclam*.so.7*
|
|
|
|
|
|
|
|
%files devel
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%_libdir/libclam*.so
|
|
|
|
%_includedir/*
|
|
|
|
|
2007-01-16 00:07:16 +01:00
|
|
|
%pre
|
2016-07-29 13:05:50 +02:00
|
|
|
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 || :
|
2007-02-25 12:09:43 +01:00
|
|
|
%_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
|
|
|
|
systemd-tmpfiles --create %_tmpfilesdir/clamav.conf
|
|
|
|
%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
|