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
|
|
|
#
|
2012-03-17 21:40:58 +01:00
|
|
|
# Copyright (c) 2012 SUSE LINUX Products 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
|
|
|
|
BuildRequires: sendmail-devel
|
2010-04-16 00:00:32 +02:00
|
|
|
%define llvm --disable-llvm
|
2008-09-05 22:14:53 +02:00
|
|
|
%if 0%{?suse_version} >= 1010
|
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
|
2007-01-16 00:07:16 +01:00
|
|
|
%endif
|
2008-09-05 22:14:53 +02:00
|
|
|
%if 0%{?suse_version} >= 1030
|
2012-03-17 21:40:58 +01:00
|
|
|
BuildRequires: check-devel
|
|
|
|
BuildRequires: libbz2-devel
|
|
|
|
BuildRequires: pwdutils
|
|
|
|
BuildRequires: python-devel
|
2008-09-05 22:14:53 +02:00
|
|
|
%define clamav_check --enable-check
|
|
|
|
%else
|
2010-10-25 22:42:57 +02:00
|
|
|
BuildRequires: bzip2
|
2008-09-05 22:14:53 +02:00
|
|
|
%define clamav_check --disable-check
|
2008-02-25 17:07:24 +01:00
|
|
|
%endif
|
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
|
2012-09-19 13:40:29 +02:00
|
|
|
Version: 0.97.6
|
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
|
|
|
Requires: latex2html-pngicons
|
|
|
|
Obsoletes: clamav-db < 0.88.3
|
2008-07-11 22:41:26 +02:00
|
|
|
PreReq: %_sbindir/groupadd %_sbindir/useradd %_sbindir/usermod
|
|
|
|
PreReq: /usr/bin/awk /bin/sed /bin/tar
|
2009-04-07 12:45:24 +02:00
|
|
|
PreReq: %insserv_prereq
|
2011-10-18 11:21:19 +02:00
|
|
|
Source0: %{name}-%{version}.tar.gz
|
2007-01-16 00:07:16 +01:00
|
|
|
Source1: clamav-rcclamd
|
|
|
|
Source2: clamav-rcfreshclam
|
2007-02-25 12:09:43 +01:00
|
|
|
Source3: clamav-updateclamconf
|
2007-07-16 07:48:13 +02:00
|
|
|
Source4: clamav-rpmlintrc
|
2008-02-25 17:07:24 +01:00
|
|
|
Source5: clamav-rcmilter
|
2012-06-19 22:15:38 +02:00
|
|
|
# http://db.local.clamav.net/main.cvd
|
|
|
|
Source6: main-54.cvd
|
|
|
|
# http://db.local.clamav.net/daily.cvd
|
|
|
|
Source7: daily-15055.cvd
|
2008-02-25 17:07:24 +01:00
|
|
|
Patch1: clamav-conf.patch
|
2009-06-17 15:41:46 +02:00
|
|
|
Patch2: clamav-sles9.patch
|
2012-03-20 11:39:33 +01:00
|
|
|
Patch3: clamav-gcc47.patch
|
2007-01-16 00:07:16 +01:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
|
|
|
|
%description
|
2012-09-28 11:31:10 +02:00
|
|
|
ClamAV is an open source (GPL) 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 high
|
|
|
|
performance mutli-threaded scanning daemon, command line utilities for
|
|
|
|
on demand file scanning, and an intelligent 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
|
|
|
|
|
|
|
%package db
|
2012-03-17 21:40:58 +01:00
|
|
|
Summary: Virus Database for ClamAV
|
2012-09-19 13:40:29 +02:00
|
|
|
License: BSD-3-Clause and GPL-2.0+ and LGPL-2.1+ and SUSE-Public-Domain and MIT
|
2007-01-16 00:07:16 +01:00
|
|
|
Group: Productivity/Security
|
2008-04-21 18:37:35 +02:00
|
|
|
PreReq: clamav sed /bin/cp /usr/bin/awk /bin/rm
|
2010-04-08 22:11:51 +02:00
|
|
|
%if 0%{?suse_version} > 1120
|
2010-02-09 22:07:58 +01:00
|
|
|
BuildArch: noarch
|
|
|
|
%endif
|
2007-01-16 00:07:16 +01:00
|
|
|
|
|
|
|
%description db
|
|
|
|
This package contains a snapshot of the virus description database for
|
|
|
|
ClamAV. It is not needed if you use freshclam to keep your virus
|
|
|
|
database up to date.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Authors:
|
|
|
|
--------
|
|
|
|
Tomasz Kojm
|
|
|
|
Nigel Horne
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q
|
|
|
|
%patch1
|
2009-06-17 15:41:46 +02:00
|
|
|
%if 0%{?suse_version} == 0910
|
|
|
|
# SLES9's libmilter doesn't have smfi_insheader()
|
|
|
|
%patch2
|
|
|
|
%endif
|
2012-03-20 11:39:33 +01:00
|
|
|
%patch3 -p1
|
2007-01-16 00:07:16 +01:00
|
|
|
|
|
|
|
%build
|
2008-04-21 18:37:35 +02:00
|
|
|
%if 0%{?suse_version} >= 1010
|
|
|
|
CFLAGS="-fstack-protector"
|
2010-04-08 22:11:51 +02:00
|
|
|
CXXFLAGS="-fstack-protector"
|
2007-01-16 00:07:16 +01:00
|
|
|
%endif
|
2011-10-19 15:24:30 +02:00
|
|
|
export CFLAGS="%optflags $CFLAGS"
|
|
|
|
export CXXFLAGS="%optflags $CXXFLAGS"
|
2009-04-07 12:45:24 +02:00
|
|
|
%if 0%{?suse_version} == 0910
|
|
|
|
# SLES9 needs this macro to enable the quarantine feature in libmilter
|
2009-06-17 15:41:46 +02:00
|
|
|
CFLAGS="$CFLAGS -D_FFR_QUARANTINE -D_FFR_SMFI_OPENSOCKET"
|
2009-04-07 12:45:24 +02:00
|
|
|
%endif
|
2007-01-16 00:07:16 +01:00
|
|
|
./configure \
|
|
|
|
--prefix=%_prefix \
|
|
|
|
--libdir=%_libdir \
|
|
|
|
--mandir=%_mandir \
|
|
|
|
--sysconfdir=%_sysconfdir \
|
|
|
|
--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 \
|
2010-04-08 22:11:51 +02:00
|
|
|
--disable-zlib-vcheck \
|
2012-06-19 22:15:38 +02:00
|
|
|
--enable-clamdtop \
|
|
|
|
--disable-timestamps
|
2010-04-08 22:11:51 +02:00
|
|
|
|
2007-01-16 00:07:16 +01:00
|
|
|
make %{?jobs:-j%jobs}
|
2007-07-16 07:48:13 +02:00
|
|
|
|
|
|
|
%check
|
2012-08-15 08:41:23 +02:00
|
|
|
%if !0%{?qemu_user_space_build:1}
|
2008-11-08 00:46:45 +01:00
|
|
|
VALGRIND_GENSUP=1 make check
|
2012-08-15 08:41:23 +02:00
|
|
|
%endif
|
2007-01-16 00:07:16 +01:00
|
|
|
|
|
|
|
%install
|
|
|
|
%makeinstall
|
2008-02-25 17:07:24 +01:00
|
|
|
ln -sf docs/html/{clamdoc,index}.html
|
2007-01-16 00:07:16 +01:00
|
|
|
mkdir -p %buildroot/etc/init.d
|
2007-02-25 12:09:43 +01:00
|
|
|
install -m755 %SOURCE1 %buildroot/etc/init.d/clamd
|
|
|
|
ln -s /etc/init.d/clamd %buildroot%_sbindir/rcclamd
|
|
|
|
install -m755 %SOURCE2 %buildroot/etc/init.d/freshclam
|
|
|
|
ln -s /etc/init.d/freshclam %buildroot%_sbindir/rcfreshclam
|
2008-02-25 17:07:24 +01:00
|
|
|
install -m755 %SOURCE5 %buildroot/etc/init.d/clamav-milter
|
|
|
|
ln -s /etc/init.d/clamav-milter %buildroot%_sbindir/rcclamav-milter
|
2007-02-25 12:09:43 +01:00
|
|
|
install -m755 %SOURCE3 %buildroot%_sbindir/updateclamconf
|
2012-06-19 22:15:38 +02:00
|
|
|
install -d -m755 %buildroot/var/lib/clamav
|
2007-01-16 00:07:16 +01:00
|
|
|
touch %buildroot/var/lib/clamav/{clamd,freshclam}.pid
|
2012-06-19 22:15:38 +02:00
|
|
|
install -m755 %SOURCE6 %buildroot/var/lib/clamav/main.cvd
|
|
|
|
install -m755 %SOURCE7 %buildroot/var/lib/clamav/daily.cvd
|
2007-01-16 00:07:16 +01:00
|
|
|
for f in %buildroot/var/lib/clamav/*.cvd; do
|
|
|
|
mv $f $f.dist
|
|
|
|
touch $f
|
|
|
|
done
|
2008-04-21 18:37:35 +02:00
|
|
|
touch %buildroot/var/lib/clamav/{main,daily}.cld
|
2007-01-16 00:07:16 +01:00
|
|
|
mkdir -p %buildroot/var/spool/amavis
|
2008-04-21 18:37:35 +02:00
|
|
|
%if 0%{?suse_version} > 1020
|
2007-02-25 12:09:43 +01:00
|
|
|
rm %buildroot/%_libdir/*.la
|
|
|
|
%endif
|
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
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root,-)
|
|
|
|
%config(noreplace) %_sysconfdir/*.conf
|
|
|
|
%config %attr(744,root,root)/etc/init.d/*
|
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/*
|
|
|
|
%_includedir/*
|
|
|
|
%_libdir/lib*
|
|
|
|
%_libdir/pkgconfig/libclamav.pc
|
|
|
|
%defattr(-,vscan,vscan)
|
|
|
|
%dir %attr(700,vscan,root) /var/spool/amavis
|
|
|
|
%dir /var/lib/clamav
|
|
|
|
%ghost /var/lib/clamav/*.pid
|
2008-04-21 18:37:35 +02:00
|
|
|
%ghost /var/lib/clamav/*.cld
|
2007-01-16 00:07:16 +01:00
|
|
|
%ghost /var/lib/clamav/*.cvd
|
|
|
|
|
|
|
|
%files db
|
|
|
|
%defattr(-,vscan,vscan)
|
|
|
|
%dir /var/lib/clamav
|
|
|
|
/var/lib/clamav/*.cvd.dist
|
|
|
|
|
|
|
|
%pre
|
2007-02-25 12:09:43 +01:00
|
|
|
%_sbindir/groupadd -r vscan 2> /dev/null || :
|
|
|
|
%_sbindir/useradd -r -o -g vscan -u 65 -s /bin/false -c "Vscan account" -d /var/spool/amavis vscan 2> /dev/null || :
|
|
|
|
%_sbindir/usermod vscan -g vscan 2> /dev/null || :
|
|
|
|
|
|
|
|
%post
|
2008-04-21 18:37:35 +02:00
|
|
|
/sbin/ldconfig
|
2007-02-25 12:09:43 +01:00
|
|
|
# merge config files on update
|
|
|
|
test "0$1" -lt 2 && exit 0
|
2008-04-21 18:37:35 +02:00
|
|
|
umask 022
|
2009-04-07 12:45:24 +02:00
|
|
|
for f in /etc/clamd.conf /etc/freshclam.conf /etc/clamav-milter.conf; do
|
2007-02-25 12:09:43 +01:00
|
|
|
if test -e $f.rpmnew; then
|
2008-02-25 17:07:24 +01:00
|
|
|
echo "Merging $f and $f.rpmnew"
|
2007-02-25 12:09:43 +01:00
|
|
|
%_sbindir/updateclamconf -v override="$OVERRIDE" $f $f.rpmnew > $f.tmp
|
|
|
|
if test $? == 0; then
|
|
|
|
mv $f $f.old
|
|
|
|
mv $f.tmp $f
|
|
|
|
else
|
|
|
|
echo "Merging $f with $f.rpmnew failed"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
2008-04-21 18:37:35 +02:00
|
|
|
# convert virus database file format when updating from < 0.93
|
|
|
|
DBDIR=$(awk '/^[[:space:]]*DatabaseDirectory/{print $NF}' /etc/clamd.conf)
|
|
|
|
cd ${DBDIR:=/var/lib/clamav}
|
|
|
|
umask 022
|
|
|
|
TMPFILE=$PWD/tmp.$$
|
|
|
|
for type in main daily; do
|
|
|
|
rm -f $TMPFILE
|
|
|
|
if test ! -f $type.cvd -a ! -f $type.cld -a -d $type.inc; then
|
|
|
|
cd $type.inc
|
|
|
|
test -f COPYING -a -f $type.info -a -f $type.db \
|
|
|
|
-a -f $type.hdb -a -f $type.mdb -a -f $type.ndb \
|
|
|
|
-a -f $type.zmd -a -f $type.fp || continue
|
|
|
|
awk 'NR==1{printf $0; for (i=length($0); i<512; i++) printf " "}' \
|
|
|
|
$type.info > $TMPFILE || continue
|
|
|
|
tar -c -f- COPYING $type.info $type.db $type.hdb $type.mdb \
|
|
|
|
$type.ndb $type.zmd $type.fp >> $TMPFILE || continue
|
|
|
|
cd ..
|
|
|
|
if test -f $TMPFILE; then
|
|
|
|
chown --reference $type.inc $TMPFILE 2>/dev/null
|
|
|
|
mv $TMPFILE $type.cld
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
rm -f $TMPFILE
|
2007-01-16 00:07:16 +01:00
|
|
|
|
|
|
|
%triggerpostun -- %name < 0.88.3
|
|
|
|
# Move clamav.conf to clamd.conf when updating from an old version
|
|
|
|
# and inform the admin about the rename.
|
|
|
|
cd /etc
|
|
|
|
if test -e clamav.conf.rpmsave -a ! -e clamd.conf.rpmnew; then
|
|
|
|
mv clamd.conf clamd.conf.rpmnew
|
|
|
|
mv clamav.conf.rpmsave clamd.conf
|
|
|
|
cat > clamav.conf <<-EOF
|
|
|
|
# clamd.conf has been renamed to clamav.conf.
|
|
|
|
# This file can be removed.
|
|
|
|
EOF
|
|
|
|
%restart_on_update clamd
|
|
|
|
fi
|
|
|
|
|
|
|
|
%preun
|
|
|
|
%stop_on_removal clamd freshclam
|
|
|
|
|
|
|
|
%postun
|
2008-04-21 18:37:35 +02:00
|
|
|
/sbin/ldconfig
|
2007-01-16 00:07:16 +01:00
|
|
|
%restart_on_update clamd freshclam
|
|
|
|
%insserv_cleanup
|
|
|
|
|
|
|
|
%post db
|
|
|
|
# determine the version number of a given database file
|
|
|
|
getversion() {
|
|
|
|
if test -f "$1"; then
|
|
|
|
/usr/bin/sigtool -i "$1" | sed -n '/^Version: /s///gp'
|
|
|
|
else
|
|
|
|
# a non-existing file is assumed to have version 0
|
|
|
|
echo 0
|
|
|
|
fi
|
|
|
|
}
|
2008-04-21 18:37:35 +02:00
|
|
|
DBDIR=$(awk '/^[[:space:]]*DatabaseDirectory/{print $NF}' /etc/clamd.conf)
|
|
|
|
cd ${DBDIR:=/var/lib/clamav}
|
|
|
|
for f in main daily; do
|
|
|
|
vdist=$(getversion $f.cvd.dist)
|
|
|
|
vcvd=$(getversion $f.cvd)
|
|
|
|
vcld=$(getversion $f.cld)
|
|
|
|
v=$((vcld > vcvd ? vcld : vcvd))
|
|
|
|
if test $vdist -gt $v; then
|
|
|
|
cp -a $f.cvd.dist $f.cvd
|
|
|
|
rm -f $f.cld
|
2007-01-16 00:07:16 +01:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2007-02-25 12:09:43 +01:00
|
|
|
%changelog
|