2007-01-16 00:07:16 +01:00
|
|
|
#
|
2011-01-10 12:06:17 +01:00
|
|
|
# spec file for package clamav (Version 0.96.5)
|
2007-01-16 00:07:16 +01:00
|
|
|
#
|
2011-01-10 12:06:17 +01:00
|
|
|
# Copyright (c) 2011 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/
|
|
|
|
#
|
|
|
|
|
|
|
|
Name: clamav
|
2010-10-25 22:42:57 +02:00
|
|
|
BuildRequires: ncurses-devel sed sendmail 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
|
2009-04-07 12:45:24 +02:00
|
|
|
BuildRequires: bc pkgconfig 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
|
2010-11-05 16:01:01 +01:00
|
|
|
BuildRequires: check-devel libbz2-devel pwdutils 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-02-09 10:24:32 +01:00
|
|
|
Version: 0.97
|
2010-06-28 14:52:15 +02:00
|
|
|
Release: 1
|
2010-02-09 22:07:58 +01:00
|
|
|
License: GPLv2
|
2007-01-16 00:07:16 +01:00
|
|
|
Group: Productivity/Security
|
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
|
2007-01-16 00:07:16 +01:00
|
|
|
Source0: %{name}-%{version}.tar.bz2
|
|
|
|
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
|
|
|
|
Patch1: clamav-conf.patch
|
2009-06-17 15:41:46 +02:00
|
|
|
Patch2: clamav-sles9.patch
|
2007-01-16 00:07:16 +01:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
|
|
|
|
%description
|
2009-06-17 15:41:46 +02:00
|
|
|
Clam AntiVirus is an open source (GPL) anti-virus toolkit for UNIX,
|
|
|
|
designed especially for e-mail scanning on mail gateways. It provides a
|
|
|
|
number of utilities including a flexible and scalable multi-threaded
|
|
|
|
daemon, a command line scanner and advanced tool for automatic database
|
|
|
|
updates. The core of the package is an anti-virus engine available in a
|
|
|
|
form of shared library.
|
|
|
|
|
|
|
|
Here is a list of the main features:
|
|
|
|
|
|
|
|
* command-line scanner
|
|
|
|
|
|
|
|
* fast, multi-threaded daemon with support for on-access scanning
|
|
|
|
|
|
|
|
* milter interface for sendmail
|
|
|
|
|
|
|
|
* advanced database updater with support for scripted updates and
|
|
|
|
digital signatures
|
|
|
|
|
|
|
|
* virus scanner C library
|
|
|
|
|
2010-02-09 22:07:58 +01:00
|
|
|
* on-access scanning (Linux and FreeBSD)
|
2009-06-17 15:41:46 +02:00
|
|
|
|
|
|
|
* virus database updated multiple times per day (see home page for
|
|
|
|
total number of signatures)
|
|
|
|
|
|
|
|
* built-in support for various archive formats, including Zip, RAR,
|
|
|
|
Tar, Gzip, Bzip2, OLE2, Cabinet, CHM, BinHex, SIS and others
|
|
|
|
|
|
|
|
* built-in support for almost all mail file formats
|
|
|
|
|
|
|
|
* built-in support for ELF executables and Portable Executable files
|
|
|
|
compressed with UPX, FSG, Petite, NsPack, wwpack32, MEW, Upack
|
|
|
|
and obfuscated with SUE, Y0da Cryptor and others
|
|
|
|
|
|
|
|
* built-in support for popular document formats including MS Office and
|
|
|
|
MacOffice files, HTML, RTF and PDF
|
2007-01-16 00:07:16 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Authors:
|
|
|
|
--------
|
|
|
|
Tomasz Kojm
|
|
|
|
Nigel Horne
|
|
|
|
|
|
|
|
%package db
|
2010-02-09 22:07:58 +01:00
|
|
|
License: BSD3c(or similar) ; GPLv2+ ; LGPLv2.1+ ; Public Domain, Freeware ; MIT License (or similar)
|
2007-01-16 00:07:16 +01:00
|
|
|
Group: Productivity/Security
|
|
|
|
Summary: Virus Database for ClamAV
|
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
|
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
|
2010-04-08 22:11:51 +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 \
|
|
|
|
--enable-clamdtop
|
|
|
|
|
2007-01-16 00:07:16 +01:00
|
|
|
make %{?jobs:-j%jobs}
|
2007-07-16 07:48:13 +02:00
|
|
|
|
|
|
|
%check
|
2008-11-08 00:46:45 +01:00
|
|
|
VALGRIND_GENSUP=1 make check
|
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
|
2007-01-16 00:07:16 +01:00
|
|
|
touch %buildroot/var/lib/clamav/{clamd,freshclam}.pid
|
|
|
|
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
|
|
|
|
|
|
|
%clean
|
|
|
|
rm -rf %buildroot
|
|
|
|
|
|
|
|
%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
|