Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37422869
en ru br
Репозитории ALT
S:0.103.8-alt1
5.1: 0.98.1-alt0.M51.1
4.1: 0.97.8-alt0.M41.1
+updates:0.94.1-alt0.M41.1
4.0: 0.97.8-alt0.M40.1
+updates:0.91.2-alt1
3.0: 0.86.2-alt1
+updates:0.91.1-alt0.M30.1
+backports:0.93.3-alt0.M30.1
www.altlinux.org/Changes

Другие репозитории
Upstream:0.93rc1

Группа :: Работа с файлами
Пакет: clamav

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

%def_without static
%def_with milter

%def_with ownconfdir

%if_with ownconfdir
%define clamconfdir /etc/clamav
%else
%define clamconfdir /etc
%endif

Name: clamav
Version: 0.91.2
Release: alt1

Summary: Clam Antivirus scanner
License: GPL
Group: File tools

URL: http://www.clamav.net/
%ifdef snap
Source0: http://www.clamav.net/snapshot/clamav-devel-%snap.tar.gz
%else
Source0: http://download.sourceforge.net/clamav/clamav-%{version}.tar.gz
%endif

Source1: clamav.init
Source2: clamav.sysconfig

Source4: freshclam.cron
Source5: freshclam.logrotate
Source6: clamav.logrotate

Source10: clamav-milter.init
Source11: clamav-milter.sysconfig
Source12: clamav-milter.msg
Source13: clamav-milter.whitelist
Source14: clamav-milter.conf

Source20: virusstat-perIP
Source21: virusstat-perIP-PrevHour
Source22: virusstat-total
Source23: virusstat.cron.example

Patch1: clamav-0.91-config.patch
Patch2: freshclam-0.90RC1-config.patch

Patch10: clamav-milter-20070313-template.patch
Patch11: clamav-milter-20041206-ip-to-log.patch

Patch12: clamav-milter-0.87.3-2-log.patch
Patch13: clamav.cfgparser.0.88.3.c.SysLogVerbose.parch

Patch20: clamav-0.90-libs.private.patch

# Package with clamd should require libclamav, not vice versa.

# Corresponding libclamav version need to be updated before, or clamd restart may fail!
Requires: lib%{name} = %version-%release

# Database updater moved to separated package.

Requires: clamav-freshclam = %version-%release

# postinstall uses subst utility

Requires(post): sed >= 1:3.02-alt1

# bc and sed used by configure script

BuildRequires: sed

# Automatically added by buildreq on Wed Feb 14 2007

# ...and edited manually to separate conditional buildreqs (and remove exim-common :-)
BuildRequires: bc bzlib-devel libgmp-devel zlib-devel

# for snapshots

%ifdef snap
BuildRequires: automake_1.8
%endif

%{?_with_milter:BuildRequires: sendmail-devel sendmail-libs}

%description
Clam AntiVirus is an anti-virus toolkit for Unix. The main purpose
of this software is the integration with mail servers (attachment
scanning). The package provides a flexible and scalable
multi-threaded daemon, a commandline scanner, and a tool for
automatic updating via Internet. The programs are based on a
shared library distributed with the Clam AntiVirus package, which
you can use in your own software.

%package -n lib%{name}
Summary: Shared libraries for clamav
Group: Development/C

%description -n lib%{name}
Shared libraries for clamav.

%package -n lib%{name}-devel
Summary: Development header files and libraries for clamav
Group: Development/C
Requires: %name = %version

%description -n lib%{name}-devel
This package contains the development header files and libraries
necessary to develop clamav client applications.

%package -n lib%{name}-devel-static
Summary: clamav static libraries
Group: Development/C
Requires: lib%{name}-devel = %version

%description -n lib%{name}-devel-static
clamav static libraries.

%package milter
Summary: clamav-milter for sendmail
Group: File tools
Requires: clamav = %version, sendmail

%description milter
This package contains the filter for Sendmail necessary to
integrate clamav with Sendmail MTA.

%package manual
Summary: ClamAV User Manual
Group: Books/Howtos

%description manual
This package contains user manual for clamav in HTML format.

%package freshclam
Summary: Auto-updater for the Clam Antivirus scanner virus signature files
Group: File tools

%description freshclam
This package contains programs which can be used to update the clamav
anti-virus database automatically. It uses the freshclam(1) utility for
this task.

%prep
%setup -q %{?snap: -n clamav-devel-%snap} %{?beta: -n clamav-%{version}%{beta}}
%patch1 -p1
%patch2 -p1

%patch10 -p0
#%patch11 -p0
#%patch12 -p0
#%patch13 -p0
%patch20 -p1

%build
%ifdef snap
aclocal
%endif

# --disable-clamav: Disable test for clamav user/group

%configure \
--enable-experimental \
--sysconfdir=%clamconfdir \
--disable-clamav \
--with-user=mail \
--with-group=mail \
--without-tcpwrappers \
--with-dbdir=/var/lib/%name %{?_with_milter: --enable-milter --with-sendmail=/usr/sbin/sendmail}

# configure trying to get sendmail version (used in milter code) from installed sendmail!

# I'd like to simplify build on host systems with alternative MTA installed so I prefer
# to just add needed strings:
cat <<EOF >>clamav-config.h
#define SENDMAIL_VERSION_A 8
#define SENDMAIL_VERSION_B 14
#define SENDMAIL_VERSION_C 1
EOF
# NB: yes, hardcoded. If you want to build clamav-milter for older sendmail
# change numbers accordingly!

%make_build

install -m644 %_sourcedir/virusstat* .

tar zxf contrib/clamdmon/clamdmon-*
cd clamdmon*
make CFLAGS="%optflags"

%install
%make_install install DESTDIR=%buildroot

# fix config

%__subst 's| at  at CLAMAVCONFDIR at  at |%clamconfdir|' %buildroot%clamconfdir/freshclam.conf

%{!?_with_milter:rm -f %buildroot%_man1dir/clamav-milter*}

install -pD -m755 %_sourcedir/clamav.init %buildroot/etc/rc.d/init.d/clamd
install -m755 %_sourcedir/clamav-milter.init %buildroot/etc/rc.d/init.d/clamav-milter

install -pD %_sourcedir/clamav.sysconfig %buildroot/etc/sysconfig/clamd

%if_with milter
#install -m644 %_sourcedir/clamav-milter.sysconfig %buildroot/etc/sysconfig/clamav-milter
sed -e 's| at  at CLAMAVCONFDIR at  at |%clamconfdir|' < %_sourcedir/clamav-milter.sysconfig > %buildroot/etc/sysconfig/clamav-milter
install -m644 %_sourcedir/clamav-milter.whitelist %buildroot%clamconfdir/
install -m644 %_sourcedir/clamav-milter.msg %buildroot%clamconfdir/
install -m644 %_sourcedir/clamav-milter.conf %buildroot%clamconfdir/
%endif

install -d %buildroot%_logdir/clamav
touch %buildroot%_logdir/clamav/clamd.log
touch %buildroot%_logdir/clamav/freshclam.log

# install the logrotate stuff

install -pD -m644 %_sourcedir/freshclam.logrotate %buildroot%_sysconfdir/logrotate.d/freshclam
install -m644 %_sourcedir/clamav.logrotate %buildroot%_sysconfdir/logrotate.d/clamav

# pid file dir

install -d %buildroot/var/run/clamav

# install clamdmon

pushd clamdmon*
install -m755 clamdmon %buildroot%_bindir/
subst 's at /usr/local/sbin at /usr/bin at ' clamdmon.sh
popd

# install html docs

mkdir -p %buildroot%_defaultdocdir/clamav-manual
rm -rf docs/html/CVS
install -m644 docs/html/* %buildroot%_defaultdocdir/clamav-manual

# remove non-packaged files

rm -f %buildroot%_libdir/*.la
rm -f %buildroot/var/lib/clamav/*.cvd
%if_without static
rm -f %buildroot%_libdir/*.a
%endif

install -d %buildroot%_sysconfdir/cron.d
cat <<EOF >%buildroot%_sysconfdir/cron.d/freshclam
30 * * * *       root    %_bindir/freshclam --quiet --daemon-notify
EOF

%post
# virus db format changed with 0.65, so delete old databases
rm -f /var/lib/clamav/viruses.db*

# randomize time of database updating (in order to distribute load on servers evenly)

RNDM=$[$RANDOM/555]
/usr/bin/subst s/^[0-9]*/$RNDM/ %_sysconfdir/cron.d/freshclam

touch %_logdir/clamav/clamd.log
chown mail.root %_logdir/clamav/clamd.log
chmod 644 %_logdir/clamav/clamd.log

%post_service clamd

%preun
%preun_service clamd

%post -n lib%{name} -p %post_ldconfig
%postun -n lib%{name} -p %postun_ldconfig

%post milter
%post_service clamav-milter

%preun milter
%preun_service clamav-milter

%files
%doc AUTHORS BUGS ChangeLog README
%doc docs/signatures.* clamdmon*/clamdmon.sh
%doc virusstat*

%_bindir/clamdscan
%_bindir/clamscan
%_bindir/sigtool
%_bindir/clamdmon
%_sbindir/clamd
%config %_initdir/clamd
%{?_with_ownconfdir: %dir %clamconfdir}
%config(noreplace) %verify(not md5 size mtime) %clamconfdir/clamd.conf
%config(noreplace) %_sysconfdir/logrotate.d/clamav
%attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/clamd
%_man1dir/clamdscan*
%_man1dir/clamscan*
%_man1dir/sigtool*
%_man5dir/*
%_man8dir/clamd*
%attr(3775,root,mail) %dir /var/lib/clamav
%attr(3775,root,mail) %dir /var/run/clamav
%attr(3771,root,mail) %dir %_logdir/clamav
%attr(640,mail,root) %ghost %_logdir/clamav/clamd.log

%files -n lib%{name}
%_libdir/lib*.so.*

%files freshclam
%{?_with_ownconfdir: %dir %clamconfdir}
%attr(3775,root,mail) %dir /var/lib/clamav
%attr(3775,root,mail) %dir /var/run/clamav
%attr(3771,root,mail) %dir %_logdir/clamav
%_bindir/freshclam
%_man1dir/freshclam*
%_bindir/clamconf
%_man1dir/clamconf*
%config(noreplace) %verify(not md5 size mtime) %clamconfdir/freshclam.conf
%config(noreplace) %_sysconfdir/cron.d/freshclam
%config(noreplace) %_sysconfdir/logrotate.d/freshclam
%attr(644,mail,mail) %ghost %_logdir/clamav/freshclam.log

%files -n lib%{name}-devel
%_bindir/clamav-config
%_libdir/lib*.so
%_libdir/pkgconfig/*
%_includedir/*.h

%files manual
%_defaultdocdir/clamav-manual

%if_with static
%files -n lib%{name}-devel-static
%_libdir/lib*.a
%endif

%if_with milter
%files milter
%_sbindir/clamav-milter
%config %_initdir/clamav-milter
%config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/clamav-milter
%config(noreplace) %verify(not md5 size mtime) %clamconfdir/*.msg
%config(noreplace) %verify(not md5 size mtime) %clamconfdir/clamav-milter.conf
%config(noreplace) %verify(not md5 size mtime) %clamconfdir/clamav-milter.whitelist
%_man8dir/clamav-milter.*
%endif

%changelog

Полный changelog можно просмотреть здесь

 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin