--- /dev/null
+diff -ur clamav-0.97.5/clamav-milter/Makefile.am clamav-0.97.5-am/clamav-milter/Makefile.am
+--- clamav-0.97.5/clamav-milter/Makefile.am 2012-06-12 15:36:05.000000000 +0200
++++ clamav-0.97.5-am/clamav-milter/Makefile.am 2012-06-28 11:10:21.205378306 +0200
+@@ -45,7 +45,7 @@
+ endif
+
+ DEFS = @DEFS@ -DCL_NOLIBCLAMAV
+-CFLAGS=`echo "@CFLAGS@" | sed -e 's/-Wwrite-strings//' -e 's/-Werror /-Werror -Wno-error=format-nonliteral /'`
++AM_CFLAGS=`echo "@CFLAGS@" | sed -e 's/-Wwrite-strings//' -e 's/-Werror /-Werror -Wno-error=format-nonliteral /'`
+ LIBS = $(top_builddir)/libclamav/libclamav_internal_utils.la @CLAMAV_MILTER_LIBS@ @THREAD_LIBS@
+ AM_CPPFLAGS = -I$(top_srcdir)/clamd -I$(top_srcdir)/libclamav -I$(top_srcdir)/shared -I$(top_srcdir)
+ CLEANFILES=*.gcda *.gcno
+diff -ur clamav-0.97.5/configure.in clamav-0.97.5-am/configure.in
+--- clamav-0.97.5/configure.in 2012-06-28 11:10:46.795377403 +0200
++++ clamav-0.97.5-am/configure.in 2012-06-28 11:01:44.658245193 +0200
+@@ -54,6 +54,8 @@
+ AC_PROG_INSTALL
+ AC_PROG_LN_S
+ AC_PROG_MAKE_SET
++AM_PROG_AR
++AM_PROG_CC_C_O
+
+ LT_CONFIG_LTDL_DIR([libltdl])
+ LT_INIT([dlopen disable-static])
+@@ -469,7 +471,7 @@
+
+ if test "$enable_check_ut" != "no" ; then
+ AC_LIB_FIND([check],[check.h],
+- AC_LANG_PROGRAM([#include <check.h>],[srunner_create(0)]),
++ [AC_LANG_PROGRAM([#include <check.h>],[srunner_create(0)])],
+ [CHECK_CPPFLAGS="$INCCHECK"; CHECK_LIBS="$LTLIBCHECK"],
+ [])
+ fi
+@@ -1549,8 +1551,8 @@
+ if test "$enable_clamdtop" != "no"; then
+
+ AC_LIB_FIND([ncurses], [ncurses/ncurses.h],
+- AC_LANG_PROGRAM([#include <ncurses/ncurses.h>],
+- [initscr(); KEY_RESIZE;]),
++ [AC_LANG_PROGRAM([#include <ncurses/ncurses.h>],
++ [initscr(); KEY_RESIZE;])],
+ [CURSES_CPPFLAGS="$INCNCURSES"; CURSES_LIBS="$LTLIBNCURSES";
+ CURSES_INCLUDE="<ncurses/ncurses.h>"],
+ [])
+@@ -1558,8 +1560,8 @@
+ if test "X$HAVE_LIBNCURSES" != "Xyes"; then
+ HAVE_LIBNCURSES=
+ AC_LIB_FIND([ncurses], [ncurses.h],
+- AC_LANG_PROGRAM([#include <ncurses.h>],
+- [initscr(); KEY_RESIZE;]),
++ [AC_LANG_PROGRAM([#include <ncurses.h>],
++ [initscr(); KEY_RESIZE;])],
+ [CURSES_CPPFLAGS="$INCNCURSES"; CURSES_LIBS="$LTLIBNCURSES";
+ CURSES_INCLUDE="<ncurses.h>"],
+ [])
+@@ -1567,8 +1569,8 @@
+
+ if test "X$HAVE_LIBNCURSES" != "Xyes"; then
+ AC_LIB_FIND([pdcurses],[curses.h],
+- AC_LANG_PROGRAM([#include <curses.h>],
+- [initscr(); KEY_RESIZE;]),
++ [AC_LANG_PROGRAM([#include <curses.h>],
++ [initscr(); KEY_RESIZE;])],
+ [CURSES_CPPFLAGS="$INCPDCURSES";
+ CURSES_LIBS="$LTLIBPDCURSES";
+ CURSES_INCLUDE="<curses.h>"],
+diff -ur clamav-0.97.5/m4/resolv.m4 clamav-0.97.5-am/m4/resolv.m4
+--- clamav-0.97.5/m4/resolv.m4 2012-06-12 15:36:05.000000000 +0200
++++ clamav-0.97.5-am/m4/resolv.m4 2012-06-28 11:09:01.312047789 +0200
+@@ -18,7 +18,7 @@
+ [
+ AC_CACHE_CHECK([for dn_expand in std libs], [ac_cv_have_lresolv_std], [
+ ac_cv_have_lresolv_std='no'
+- AC_LINK_IFELSE([
++ AC_LINK_IFELSE([AC_LANG_SOURCE([
+ #include <sys/types.h>
+ #include <netinet/in.h>
+ #include <arpa/nameser.h>
+@@ -28,14 +28,14 @@
+ [
+ ac_cv_have_lresolv_std='yes'
+ ac_cv_have_lresolv=''
+- ])
++ ])])
+ ])
+ if test "x$ac_cv_have_lresolv" = "xno"; then
+ bklibs=$LIBS
+ LIBS=-lresolv
+ AC_CACHE_CHECK([for dn_expand in -lresolv], [ac_cv_have_lresolv_lresolv], [
+ ac_cv_have_lresolv_lresolv='yes'
+- AC_LINK_IFELSE([
++ AC_LINK_IFELSE([AC_LANG_SOURCE([
+ #include <sys/types.h>
+ #include <netinet/in.h>
+ #include <arpa/nameser.h>
+@@ -45,7 +45,7 @@
+ [
+ ac_cv_have_lresolv_lresolv='yes'
+ ac_cv_have_lresolv=' -lresolv'
+- ])
++ ])])
+ ])
+ LIBS=$bklibs;
+ fi
--- /dev/null
+--- clamav-0.96/configure.in~ 2010-04-15 13:38:54.000000000 +0300
++++ clamav-0.96/configure.in 2010-04-15 13:38:55.799688151 +0300
+@@ -34,8 +34,7 @@
+
+ dnl -Wall and -Werror here are NOT CFLAGS, they refer to automake warnings
+ dnl enable stealth builds and psychedelic tests
+-AM_INIT_AUTOMAKE([1.11 -Wall -Wportability -Wno-override -Werror std-options foreign dist-bzip2 no-define color-tests parallel-tests tar-ustar])
+-AM_SILENT_RULES([yes])
++AM_INIT_AUTOMAKE([1.10 -Wall -Wportability -Wno-override -Werror std-options foreign dist-bzip2 no-define tar-ustar])
+
+ dnl we told automake to not define these, since we want to include
+ dnl the date in the version
+--- clamav-0.96/m4/acinclude.m4~ 2010-04-15 14:58:22.000000000 +0300
++++ clamav-0.96/m4/acinclude.m4 2010-04-15 14:59:20.072733581 +0300
+@@ -789,9 +789,9 @@
+ AC_DEFUN([CL_MSG_STATUS],
+ [
+ m4_if($#,3,,[m4_fatal([$0: invalid number of arguments: $#])])
+- AS_ECHO_N([" $1: "])
+- AS_IF([test "x$3" = "xno"], [AS_ECHO(["$2 (disabled)"])],
+- [test "x$3" = "xyes"], [AS_ECHO(["$2"])],
+- [test "x$3" = "x"], [AS_ECHO(["$2"])],
+- [AS_ECHO(["$2 ($3)"])])
++ echo [" $1: "]
++ AS_IF([test "x$3" = "xno"], [echo ["$2 (disabled)"]],
++ [test "x$3" = "xyes"], [echo ["$2"]],
++ [test "x$3" = "x"], [echo ["$2"]],
++ [echo ["$2 ($3)"]])
+ ])
--- /dev/null
+#!/bin/sh
+
+[ -f /etc/sysconfig/clamd ] && . /etc/sysconfig/clamd
+[ -n "$UPDATE_HOUR" -a "$UPDATE_HOUR" -gt 0 ] || UPDATE_HOUR=2
+
+[ $((`date '+%k'` % $UPDATE_HOUR)) -eq 0 ] || exit 0
+
+# sleep random period to avoid all servers hitting clamav servers at the same time,
+# but 1800 seconds (half an hour) at most
+sleep $((RANDOM % 1800))
+
+[ "$UPDATE_MAIL_MESSAGES" ] || UPDATE_MAIL_MESSAGES="errors"
+[ "$UPDATE_MAIL_MESSAGES" = "errors" ] && freshclamopt="--quiet"
+
+[ -f /var/lock/subsys/clamd ] && notify="--daemon-notify" || notify=
+
+umask 022
+log=$(/usr/bin/freshclam $freshclamopt $notify 2>&1)
+[ "$UPDATE_MAIL_MESSAGES" != "none" -a -n "$log" ] && echo "$log"
--- /dev/null
+#!/bin/sh
+#
+# clamav-milter Script to start and stop the clamav-milter daemon
+#
+# chkconfig: 2345 77 23
+# description: clamav-milter is a daemon which hooks into sendmail and routes\
+# email messages to clamav
+#
+# processname: clamav-milter
+# config: /etc/sysconfig/clamav-milter
+# pidfile: /var/run/clamav/clamav-milter.pid
+#
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Check that networking is up
+if is_yes "${NETWORKING}"; then
+ if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status -a "$1" != init ]; then
+ msg_network_down clamav-milter
+ exit 1
+ fi
+else
+ exit 0
+fi
+
+# Local clamav-milter config
+test -f /etc/sysconfig/clamav-milter || exit 6
+. /etc/sysconfig/clamav-milter
+
+RETVAL=0
+case "$1" in
+ start)
+ # Check if the service is already running?
+ if [ ! -f /var/lock/subsys/clamav-milter ]; then
+ msg_starting clamav-milter
+ daemon /usr/sbin/clamav-milter $CLAMAV_FLAGS
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/clamav-milter
+ else
+ msg_already_running clamav-milter
+ fi
+ ;;
+ stop)
+ if [ -f /var/lock/subsys/clamav-milter ]; then
+ msg_stopping clamav-milter
+ killproc clamav-milter
+ rm -f /var/lock/subsys/clamav-milter >/dev/null 2>&1
+ else
+ msg_not_running clamav-milter
+ fi
+ ;;
+ status)
+ status clamav-milter
+ exit $?
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ exit $?
+ ;;
+ reload|force-reload)
+ if [ -f /var/lock/subsys/clamav-milter ]; then
+ msg_reloading clamav-milter
+ killproc clamav-milter -SIGHUP
+ RETVAL=$?
+ else
+ msg_not_running clamav-milter
+ exit 7
+ fi
+ ;;
+ *)
+ msg_usage "$0 {start|stop|restart|force-reload|status}"
+ exit 3
+esac
+
+exit $RETVAL
--- /dev/null
+CLAMAV_FLAGS=""
--- /dev/null
+--- clamav-0.96.1/configure.in~ 2010-05-19 14:23:09.000000000 +0200
++++ clamav-0.96.1/configure.in 2010-05-20 09:28:22.297294559 +0200
+@@ -430,8 +430,12 @@
+ AC_SUBST([BUILD_CONFIGURE_FLAGS], [$build_configure_args])
+
+ AX_CHECK_UNAME_SYSCALL
++AC_CHECK_FUNC(socket,, [
+ AC_CHECK_LIB([socket], [bind], [LIBS="$LIBS -lsocket"; CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lsocket"; FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lsocket"; CLAMD_LIBS="$CLAMD_LIBS -lsocket"])
++])
++AC_CHECK_FUNC(gethostent,, [
+ AC_SEARCH_LIBS([gethostent],[nsl], [(LIBS="$LIBS -lnsl"; CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lnsl"; FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lnsl"; CLAMD_LIBS="$CLAMD_LIBS -lnsl")])
++])
+
+ AC_CHECK_FUNCS([poll setsid memcpy snprintf vsnprintf strerror_r strlcpy strlcat strcasestr inet_ntop setgroups initgroups ctime_r mkstemp mallinfo madvise])
+ AC_FUNC_FSEEKO
--- /dev/null
+diff -ur clamav-0.97.1/etc//clamav-milter.conf clamav-0.97.1.new/etc//clamav-milter.conf
+--- clamav-0.97.1/etc//clamav-milter.conf 2011-01-10 18:48:28.000000000 +0100
++++ clamav-0.97.1.new/etc//clamav-milter.conf 2011-07-14 18:24:02.801795736 +0200
+@@ -3,7 +3,7 @@
+ ##
+
+ # Comment or remove the line below.
+-Example
++#Example
+
+
+ ##
+@@ -17,12 +17,12 @@
+ # inet6:port@[hostname|ip-address] - to specify an ipv6 socket
+ #
+ # Default: no default
+-#MilterSocket /tmp/clamav-milter.socket
++MilterSocket /var/lib/clamav/clamav-milter.socket
+ #MilterSocket inet:7357
+
+ # Define the group ownership for the (unix) milter socket.
+ # Default: disabled (the primary group of the user running clamd)
+-#MilterSocketGroup virusgroup
++#MilterSocketGroup clamav
+
+ # Sets the permissions on the (unix) milter socket to the specified mode.
+ # Default: disabled (obey umask)
+@@ -41,7 +41,7 @@
+ # Initialize supplementary group access (clamav-milter must be started by root).
+ #
+ # Default: no
+-#AllowSupplementaryGroups no
++AllowSupplementaryGroups yes
+
+ # Waiting for data from clamd will timeout after this time (seconds).
+ # Value of 0 disables the timeout.
+@@ -64,7 +64,7 @@
+ # daemon (main thread).
+ #
+ # Default: disabled
+-#PidFile /var/run/clamav-milter.pid
++PidFile /var/run/clamav/clamav-milter.pid
+
+ # Optional path to the global temporary directory.
+ # Default: system specific (usually /tmp or /var/tmp).
+@@ -90,7 +90,7 @@
+ # with the same socket: clamd servers will be selected in a round-robin fashion.
+ #
+ # Default: no default
+-#ClamdSocket tcp:scanner.mydomain:7357
++ClamdSocket /var/lib/clamav/clamd.socket
+
+
+ ##
+@@ -238,13 +238,13 @@
+ # Use system logger (can work together with LogFile).
+ #
+ # Default: no
+-#LogSyslog yes
++LogSyslog yes
+
+ # Specify the type of syslog messages - please refer to 'man syslog'
+ # for facility names.
+ #
+ # Default: LOG_LOCAL6
+-#LogFacility LOG_MAIL
++LogFacility LOG_MAIL
+
+ # Enable verbose logging.
+ #
+diff -ur clamav-0.97.1/etc//clamd.conf clamav-0.97.1.new/etc//clamd.conf
+--- clamav-0.97.1/etc//clamd.conf 2011-05-13 13:25:31.000000000 +0200
++++ clamav-0.97.1.new/etc//clamd.conf 2011-07-14 18:19:05.824861957 +0200
+@@ -5,13 +5,13 @@
+
+
+ # Comment or remove the line below.
+-Example
++#Example
+
+ # Uncomment this option to enable logging.
+ # LogFile must be writable for the user running daemon.
+ # A full path is required.
+ # Default: disabled
+-#LogFile /tmp/clamd.log
++#LogFile /var/log/clamd.log
+
+ # By default the log file is locked for writing - the lock protects against
+ # running clamd multiple times (if want to run another clamd, please
+@@ -40,12 +40,12 @@
+
+ # Use system logger (can work together with LogFile).
+ # Default: no
+-#LogSyslog yes
++LogSyslog yes
+
+ # Specify the type of syslog messages - please refer to 'man syslog'
+ # for facility names.
+ # Default: LOG_LOCAL6
+-#LogFacility LOG_MAIL
++LogFacility LOG_MAIL
+
+ # Enable verbose logging.
+ # Default: no
+@@ -58,7 +58,7 @@
+ # This option allows you to save a process identifier of the listening
+ # daemon (main thread).
+ # Default: disabled
+-#PidFile /var/run/clamd.pid
++PidFile /var/run/clamav/clamd.pid
+
+ # Optional path to the global temporary directory.
+ # Default: system specific (usually /tmp or /var/tmp).
+@@ -77,11 +77,11 @@
+
+ # Path to a local socket file the daemon will listen on.
+ # Default: disabled (must be specified by a user)
+-#LocalSocket /tmp/clamd.socket
++LocalSocket /var/lib/clamav/clamd.socket
+
+ # Sets the group ownership on the unix socket.
+ # Default: disabled (the primary group of the user running clamd)
+-#LocalSocketGroup virusgroup
++#LocalSocketGroup clamav
+
+ # Sets the permissions on the unix socket to the specified mode.
+ # Default: disabled (socket is world accessible)
+@@ -186,11 +186,11 @@
+
+ # Run as another user (clamd must be started by root for this option to work)
+ # Default: don't drop privileges
+-#User clamav
++User clamav
+
+ # Initialize supplementary group access (clamd must be started by root).
+ # Default: no
+-#AllowSupplementaryGroups no
++AllowSupplementaryGroups yes
+
+ # Stop daemon when libclamav reports out of memory condition.
+ #ExitOnOOM yes
+@@ -443,15 +443,15 @@
+
+ # Set access mask for Clamuko (Dazuko only).
+ # Default: no
+-#ClamukoScanOnOpen yes
+-#ClamukoScanOnClose yes
+-#ClamukoScanOnExec yes
++ClamukoScanOnOpen yes
++ClamukoScanOnClose yes
++ClamukoScanOnExec yes
+
+ # Set the include paths (all files inside them will be scanned). You can have
+ # multiple ClamukoIncludePath directives but each directory must be added
+ # in a seperate line. (Dazuko only)
+ # Default: disabled
+-#ClamukoIncludePath /home
++ClamukoIncludePath /home
+ #ClamukoIncludePath /students
+
+ # Set the exclude paths. All subdirectories are also excluded. (Dazuko only)
+diff -ur clamav-0.97.1/etc//freshclam.conf clamav-0.97.1.new/etc//freshclam.conf
+--- clamav-0.97.1/etc//freshclam.conf 2011-01-10 18:48:28.000000000 +0100
++++ clamav-0.97.1.new/etc//freshclam.conf 2011-07-14 18:14:32.705707450 +0200
+@@ -3,9 +3,14 @@
+ ## Please read the freshclam.conf(5) manual before editing this file.
+ ##
+
++## PLD NOTE: Note that freshclam is called periodically via cron
++## Check /etc/sysconfig/clamd for details
++## Seems better to run task once per period than keep daemon running
++## only for that.
++## But if you have arguments please tell us.
+
+ # Comment or remove the line below.
+-Example
++#Example
+
+ # Path to the database directory.
+ # WARNING: It must match clamd.conf's directive!
+@@ -30,11 +35,11 @@
+
+ # Enable verbose logging.
+ # Default: no
+-#LogVerbose yes
++LogVerbose yes
+
+ # Use system logger (can work together with UpdateLogFile).
+ # Default: no
+-#LogSyslog yes
++LogSyslog yes
+
+ # Specify the type of syslog messages - please refer to 'man syslog'
+ # for facility names.
+@@ -48,7 +53,7 @@
+ # By default when started freshclam drops privileges and switches to the
+ # "clamav" user. This directive allows you to change the database owner.
+ # Default: clamav (may depend on installation options)
+-#DatabaseOwner clamav
++DatabaseOwner clamav
+
+ # Initialize supplementary group access (freshclam must be started by root).
+ # Default: no
+@@ -96,7 +101,7 @@
+
+ # Number of database checks per day.
+ # Default: 12 (every two hours)
+-#Checks 24
++Checks 2
+
+ # Proxy settings
+ # Default: disabled
+@@ -118,7 +123,7 @@
+
+ # Send the RELOAD command to clamd.
+ # Default: no
+-#NotifyClamd /path/to/clamd.conf
++#NotifyClamd /etc/clamd.conf
+
+ # Run command after successful database update.
+ # Default: disabled
--- /dev/null
+#!/bin/sh
+
+[ -f /etc/sysconfig/clamd ] && . /etc/sysconfig/clamd
+
+[ -z "$FETCH_AFTER_UPGRADE" ] && FETCH_AFTER_UPGRADE="no"
+
+if [ "$FETCH_AFTER_UPGRADE" = "yes" ]; then
+ if [ "$UPDATE_QUIET" = "yes" ]; then
+ freshclamopt="--quiet"
+ fi
+
+ notify=
+ [ -f /var/lock/subsys/clamd ] && notify="--daemon-notify"
+
+ umask 022
+ /usr/bin/freshclam $freshclamopt -l /var/log/freshclam.log $notify || :
+fi
--- /dev/null
+#!/bin/sh
+#
+# clamd clamd (antyvirus daemon)
+#
+# chkconfig: 345 60 40
+#
+# description: Clam Antivirus daemon
+#
+# processname: clamd
+# pidfile: /var/run/clamav/clamd.pid
+#
+# $Id$
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get service config
+[ -f /etc/sysconfig/clamd ] && . /etc/sysconfig/clamd
+
+start() {
+ # Check if the service is already running?
+ if [ -f /var/lock/subsys/clamd ]; then
+ msg_already_running "Clam Antivirus daemon"
+ return
+ fi
+
+ msg_starting "Clam Antivirus daemon"
+ daemon --pidfile /var/run/clamav/clamd.pid /usr/sbin/clamd
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/clamd
+}
+
+stop() {
+ if [ ! -f /var/lock/subsys/clamd ]; then
+ msg_not_running "Clam Antivirus daemon"
+ return
+ fi
+
+ msg_stopping "Clam Antivirus daemon"
+ killproc --pidfile /var/run/clamav/clamd.pid clamd
+ rm -f /var/lock/subsys/clamd /var/run/clamav/clamd.pid >/dev/null 2>&1
+}
+
+reload() {
+ if [ -f /var/lock/subsys/clamd ]; then
+ msg_reloading "Clam Antivirus daemon"
+ killproc clamd -HUP
+ RETVAL=$?
+ else
+ msg_not_running "Clam Antivirus daemon"
+ RETVAL=7
+ fi
+}
+
+condrestart() {
+ if [ -f /var/lock/subsys/clamd ]; then
+ stop
+ start
+ else
+ msg_not_running "Clam Antivirus daemon"
+ RETVAL=$1
+ fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ try-restart)
+ condrestart 0
+ ;;
+ reload|force-reload)
+ reload
+ ;;
+ status)
+ status clamd
+ exit $?
+ ;;
+ *)
+ msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"
+ exit 3
+esac
+
+exit $RETVAL
--- /dev/null
+/var/log/clamd.log {
+ create 640 clamav root
+ postrotate
+ /bin/killall -HUP clamd
+ endscript
+}
+/var/log/freshclam.log {
+ create 640 clamav root
+ postrotate
+ /bin/killall -HUP freshclam 2>/dev/null || /sbin/service syslog-ng flush-logs >/dev/null
+ endscript
+}
--- /dev/null
+# TODO:
+# - Make freshclam package (script and daemon)
+# - restart amavis in triggers if group membership was modified?
+#
+# Conditional build:
+%bcond_without milter # build without milter subpackage
+%if "%{pld_release}" == "ac"
+%bcond_with llvm # build without llvm support
+%else
+%bcond_without llvm # build without llvm support
+%endif
+
+Summary: An anti-virus utility for Unix
+Summary(pl.UTF-8): Narzędzie antywirusowe dla Uniksów
+Name: clamav
+Version: 0.97.8
+Release: 1
+License: GPL v2+
+Group: Daemons
+Source0: http://downloads.sourceforge.net/clamav/%{name}-%{version}.tar.gz
+# Source0-md5: ac52bcbad3ea72eac08fedb9772f648b
+Source1: %{name}.init
+Source2: %{name}.sysconfig
+Source3: %{name}-milter.init
+Source4: %{name}-cron-updatedb
+Source5: %{name}.logrotate
+Source8: %{name}-post-updatedb
+Source9: %{name}-milter.sysconfig
+Source10: %{name}.tmpfiles
+Source11: clamd.service
+Patch0: %{name}-pld_config.patch
+Patch1: %{name}-nolibs.patch
+Patch2: am-nosilentrules.patch
+Patch3: ac2.68.patch
+URL: http://www.clamav.net/
+BuildRequires: autoconf
+BuildRequires: automake
+BuildRequires: bzip2-devel
+BuildRequires: gmp-devel
+BuildRequires: libltdl-devel
+%{?with_milter:BuildRequires: libmilter-devel}
+BuildRequires: libstdc++-devel
+BuildRequires: libtool
+%{?with_milter:BuildRequires: libwrap-devel}
+%{?with_llvm:BuildRequires: llvm-devel}
+BuildRequires: ncurses-devel
+BuildRequires: rpm >= 4.4.9-56
+BuildRequires: rpmbuild(macros) >= 1.647
+BuildRequires: zlib-devel
+Requires(post,preun): /sbin/chkconfig
+Requires(postun): /usr/sbin/groupdel
+Requires(postun): /usr/sbin/userdel
+Requires(postun,pre): /usr/sbin/usermod
+Requires(pre): /bin/id
+Requires(pre): /usr/bin/getgid
+Requires(pre): /usr/sbin/groupadd
+Requires(pre): /usr/sbin/useradd
+Requires(post,preun,postun): systemd-units >= 38
+Requires: systemd-units >= 38
+Requires(triggerpostun): sed >= 4.0
+Requires: %{name}-libs = %{epoch}:%{version}-%{release}
+Requires: /usr/sbin/usermod
+Requires: rc-scripts >= 0.4.1.23
+Suggests: clamav-database
+Provides: group(clamav)
+Provides: user(clamav)
+Conflicts: logrotate < 3.7-4
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Clam AntiVirus is an open source 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
+- on-access scanning (Linux® and FreeBSD®)
+- 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
+
+%description -l pl.UTF-8
+Clam Antivirus jest potężnym skanerem antywirusowym dla systemów
+uniksowych. Wspiera on AMaViSa, skompresowane pliki, skanowanie
+"on-access" i posiada system bezpiecznej, automatycznej aktualizacji.
+Baza wirusów zawiera ponad 90000 sygnatur. Skaner jest wielowątkowy,
+napisany w C i zgodny z POSIXem.
+
+%package libs
+Summary: Shared libraries for clamav
+Summary(pl.UTF-8): Biblioteki dzielone clamav
+Group: Libraries
+
+%description libs
+Shared libraries for clamav.
+
+%description libs -l pl.UTF-8
+Biblioteki dzielone clamav.
+
+%package milter
+Summary: ClamAV filter using milter interface
+Summary(pl.UTF-8): Filtr ClamAV korzystający z interfejsu milter
+Group: Daemons
+Requires: %{name} = %{epoch}:%{version}-%{release}
+Requires: postfix
+#Requires: sendmail >= 8.11
+Requires: tcp_wrappers
+
+%description milter
+ClamAV sendmail filter using MILTER interface.
+
+%description milter -l pl.UTF-8
+Filtr ClamAV dla sendmaila korzystający z interfejsu MILTER.
+
+%package devel
+Summary: clamav - Development header files and libraries
+Summary(pl.UTF-8): clamav - Pliki nagłówkowe i biblioteki dla programistów
+Group: Development/Libraries
+Requires: %{name}-libs = %{epoch}:%{version}-%{release}
+Requires: bzip2-devel
+Requires: gmp-devel
+Requires: zlib-devel
+
+%description devel
+This package contains the development header files and libraries
+necessary to develop clamav client applications.
+
+%description devel -l pl.UTF-8
+Pliki nagłówkowe i biblioteki konieczne do kompilacji aplikacji
+klienckich clamav.
+
+%package static
+Summary: clamav static libraries
+Summary(pl.UTF-8): Biblioteki statyczne clamav
+Group: Development/Libraries
+Requires: %{name}-devel = %{epoch}:%{version}-%{release}
+
+%description static
+clamav static libraries.
+
+%description static -l pl.UTF-8
+Biblioteki statyczne clamav.
+
+%prep
+%setup -q
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+
+%build
+# automake 1.12+ needs configure.ac not .in
+mv configure.{in,ac}
+%{__libtoolize}
+%{__aclocal} -I m4
+%{__autoconf}
+%{__autoheader}
+%{__automake}
+%configure \
+ --disable-clamav \
+ %{?with_milter:--enable-milter} \
+ --with-dbdir=/var/lib/%{name} \
+ --with-no-cache \
+ --with-ltdl-include=%{_includedir} \
+ --with-ltdl-lib=%{_libdir}
+
+%{__make} \
+ LIBTOOL=%{_bindir}/libtool
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT/etc/{cron.d,logrotate.d,rc.d/init.d,sysconfig} \
+ $RPM_BUILD_ROOT%{_var}/{log,spool/clamav,lib/clamav} \
+ $RPM_BUILD_ROOT%{systemdtmpfilesdir} \
+ $RPM_BUILD_ROOT%{systemdunitdir}
+
+%{__make} install \
+ LIBTOOL=%{_bindir}/libtool \
+ DESTDIR=$RPM_BUILD_ROOT
+%{!?with_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*}
+
+cat <<'EOF' >$RPM_BUILD_ROOT/etc/cron.d/%{name}
+5 * * * * root %{_sbindir}/clamav-cron-updatedb
+EOF
+
+install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
+%if %{with milter}
+install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamav-milter
+cp -p %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/clamav-milter
+%endif
+cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
+install -p %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
+cp -p etc/*.conf $RPM_BUILD_ROOT%{_sysconfdir}
+cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
+
+install -p %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
+
+install %{SOURCE10} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
+
+install %{SOURCE11} $RPM_BUILD_ROOT%{systemdunitdir}
+
+# NOTE: clamd uses sane rights to it's clamd.pid file
+# So better keep it dir
+# If it is fixed use of dir will be unecesary
+install -d $RPM_BUILD_ROOT/var/run/%{name}
+
+:> $RPM_BUILD_ROOT/var/log/freshclam.log
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%triggerin -- amavis-ng
+%addusertogroup -q clamav amavis
+
+%triggerin -- amavisd-new
+%addusertogroup -q clamav amavis
+
+%triggerin -- amavisd
+%addusertogroup -q clamav amavis
+
+%pre
+%groupadd -g 43 clamav
+%useradd -u 43 -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav
+
+%post
+/sbin/chkconfig --add clamd
+%service clamd restart "Clam Antivirus daemon"
+touch /var/log/freshclam.log
+chown clamav:root /var/log/freshclam.log
+chmod 640 /var/log/freshclam.log
+%systemd_post clamd.service
+
+%preun
+if [ "$1" = "0" ]; then
+ %service clamd stop
+ /sbin/chkconfig --del clamd
+fi
+%systemd_preun clamd.service
+
+%postun
+if [ "$1" = "0" ]; then
+ %userremove clamav
+ %groupremove clamav
+fi
+%systemd_reload
+
+%triggerpostun -- %{name} < 0.80
+if [ -f /etc/clamav.conf.rpmsave ]; then
+ echo "Renaming config to new name /etc/clamd.conf"
+ mv -f /etc/clamd.conf /etc/clamd.conf.rpmnew
+ mv -f /etc/clamav.conf.rpmsave /etc/clamd.conf
+ echo "Changing config location in freshclam config"
+ %{__sed} -i -e 's/clamav.conf/clamd.conf/' /etc/freshclam.conf
+fi
+
+%triggerpostun -- %{name} < 0.90-0.rc2.0.10
+%{__cp} -f /etc/clamd.conf{,.rpmsave}
+%{__sed} -i -e '
+ s,^LogSyslog$,& yes,
+ s,^FixStaleSocket$,& yes,
+ s,^AllowSupplementaryGroups$,& yes,
+ s,^ClamukoScanOnOpen$,& yes,
+ s,^ClamukoScanOnClose$,& yes,
+ s,^ClamukoScanOnExec$,& yes,
+ s,^LogTime$,& yes,
+ s,^ScanPE$,& yes,
+' /etc/clamd.conf
+%banner -e %{name}-0.90 <<EOF
+ClamAV config was automatically upgraded to 0.90 format. You should review it
+that it's still valid.
+EOF
+#'
+# unfortunately clamd has no configcheck option so we just have to start it
+# once again after config was broken after upgrade
+touch /var/lock/subsys/clamd
+%service -q clamd restart
+
+%triggerpostun -- %{name} < 0.97.7-4
+%systemd_trigger clamd.service
+
+%post milter
+/sbin/chkconfig --add clamav-milter
+%service clamav-milter restart "Clam Antivirus daemon"
+
+%preun milter
+if [ "$1" = "0" ]; then
+ %service clamav-milter stop
+ /sbin/chkconfig --del clamav-milter
+fi
+
+%post libs -p /sbin/ldconfig
+%postun libs -p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc AUTHORS ChangeLog FAQ NEWS README docs/*.pdf
+%attr(755,root,root) %{_bindir}/clambc
+%attr(755,root,root) %{_bindir}/clamdscan
+%attr(755,root,root) %{_bindir}/clamdtop
+%attr(755,root,root) %{_bindir}/clamscan
+%attr(755,root,root) %{_bindir}/freshclam
+%attr(755,root,root) %{_bindir}/sigtool
+%attr(755,root,root) %{_bindir}/clamconf
+%attr(755,root,root) %{_sbindir}/clamd
+%attr(755,root,root) %{_sbindir}/clamav-cron-updatedb
+%attr(755,root,root) %{_sbindir}/clamav-post-updatedb
+%{systemdtmpfilesdir}/%{name}.conf
+%{systemdunitdir}/clamd.service
+%attr(755,clamav,root) %dir /var/lib/%{name}
+%attr(640,clamav,root) %ghost /var/log/freshclam.log
+%attr(750,clamav,clamav) %dir /var/run/%{name}
+
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamd.conf
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/freshclam.conf
+
+%attr(754,root,root) /etc/rc.d/init.d/clamd
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamd
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/clamav
+%{_mandir}/man[15]/*
+%{_mandir}/man8/clamd*
+
+%if %{with milter}
+%files milter
+%defattr(644,root,root,755)
+%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamav-milter
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamav-milter.conf
+%attr(754,root,root) /etc/rc.d/init.d/clamav-milter
+#%attr(755,root,root) %{_sysconfdir}/cron.daily/clamav-milter
+#%attr(755,root,root) %{_sysconfdir}/log.d/scripts/services/clamav-milter
+#%{_sysconfdir}/log.d/conf/services/clamav-milter.conf
+%attr(755,root,root) %{_sbindir}/clamav-milter
+%{_mandir}/man8/clamav-milter.8*
+%attr(700,clamav,clamav) /var/spool/clamav
+%endif
+
+%files libs
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/lib*.so.*.*
+%attr(755,root,root) %ghost %{_libdir}/libclamav.so.6
+%attr(755,root,root) %ghost %{_libdir}/libclamunrar.so.6
+%attr(755,root,root) %ghost %{_libdir}/libclamunrar_iface.so.6
+
+%files devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/clamav-config
+%attr(755,root,root) %{_libdir}/lib*.so
+%{_libdir}/lib*.la
+%{_includedir}/*.h
+%{_pkgconfigdir}/*.pc
+
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/*.a
--- /dev/null
+# Customized settings
+
+# Define nice level
+SERVICE_RUN_NICE_LEVEL="+0"
+
+# how often update databases - once per X hours
+UPDATE_HOUR=4
+
+# what kind of messages cron should send via email (all, errors, none)?
+UPDATE_MAIL_MESSAGES=errors
+
+# try to download new databases after upgrade of databases?
+# Remember - you need good internet connection for that
+#FETCH_AFTER_UPGRADE=no
--- /dev/null
+d /var/run/clamav 0750 clamav clamav -
--- /dev/null
+[Unit]
+Description=ClamAV daemon
+After=syslog.target
+
+[Service]
+Type=forking
+ExecStart=/usr/sbin/clamd
+ExecReload=/bin/kill -HUP $MAINPID
+PIDFile=/run/clamav/clamd.pid
+Restart=on-failure
+PrivateTmp=true
+
+[Install]
+WantedBy=multi-user.target