diff -Nru clamav-0.98.1+dfsg/clamd/fan-syscalllib.h clamav-0.98.1+dfsg/clamd/fan-syscalllib.h
--- clamav-0.98.1+dfsg/clamd/fan-syscalllib.h	2014-05-29 23:24:40.000000000 -0400
+++ clamav-0.98.1+dfsg/clamd/fan-syscalllib.h	2014-01-13 12:02:18.000000000 -0500
@@ -2,18 +2,27 @@
 #define __FANOTIFY_SYSCALL_LIB
 
 #include <unistd.h>
-#include <sys/types.h>
-#include <sys/syscall.h>
+#include <linux/types.h>
+
+#if defined(__x86_64__)
+# define __NR_fanotify_init	300
+# define __NR_fanotify_mark	301
+#elif defined(__i386__)
+# define __NR_fanotify_init	338
+# define __NR_fanotify_mark	339
+#else
+# error "System call numbers not defined for this architecture"
+#endif
 
 static inline int fanotify_init(unsigned int flags, unsigned int event_f_flags)
 {
-	return syscall(SYS_fanotify_init, flags, event_f_flags);
+	return syscall(__NR_fanotify_init, flags, event_f_flags);
 }
 
 static inline int fanotify_mark(int fanotify_fd, unsigned int flags, __u64 mask,
 				int dfd, const char *pathname)
 {
-	return syscall(SYS_fanotify_mark, fanotify_fd, flags, mask,
+	return syscall(__NR_fanotify_mark, fanotify_fd, flags, mask,
 		       dfd, pathname);
 }
 #endif
diff -Nru clamav-0.98.1+dfsg/configure.ac clamav-0.98.1+dfsg/configure.ac
--- clamav-0.98.1+dfsg/configure.ac	2014-05-29 23:24:40.000000000 -0400
+++ clamav-0.98.1+dfsg/configure.ac	2014-01-13 12:02:34.000000000 -0500
@@ -34,9 +34,8 @@
 
 dnl -Wall and -Werror here are NOT CFLAGS, they refer to automake warnings
 dnl enable stealth builds and psychedelic tests
-AM_INIT_AUTOMAKE([-Wall -Wportability -Wno-override -Werror std-options foreign dist-bzip2 no-define color-tests parallel-tests tar-ustar])
+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_PROG_AR
 
 dnl we told automake to not define these, since we want to include
 dnl the date in the version
@@ -465,15 +464,22 @@
 AC_ARG_ENABLE(check,
 [  --enable-check           Enable 'check' unit tests (default=auto)], enable_check_ut=$enableval, enable_check_ut="auto" )
 
-if test "$enable_check_ut" = "auto" ; then
-	PKG_CHECK_EXISTS([check], [enable_check_ut="yes"],
-			 [enable_check_ut="no"])
+if test "$enable_check_ut" != "no" ; then
+	AC_LIB_FIND([check],[check.h],
+			AC_LANG_PROGRAM([#include <check.h>],[srunner_create(0)]),
+			[CHECK_CPPFLAGS="$INCCHECK"; CHECK_LIBS="$LTLIBCHECK"],
+			[])
 fi
+AC_SUBST([CHECK_CPPFLAGS])
+AC_SUBST([CHECK_LIBS])
+AM_CONDITIONAL([HAVE_LIBCHECK],test "X$HAVE_LIBCHECK" = "Xyes")
 
-if test "$enable_check_ut" = "yes" ; then
-	PKG_CHECK_MODULES([CHECK], [check >= 0.9.4])
+if test "x$CHECK_LIBS" = "x" -a "$enable_check_ut" = "yes"; then
+    AC_MSG_ERROR([
+
+ERROR!  Check was configured, but not found.  Get it from http://check.sf.net/
+])
 fi
-AM_CONDITIONAL([HAVE_LIBCHECK],test "X$CHECK_LIBS" != "X")
 
 AC_ARG_ENABLE(coverage,
 	      AC_HELP_STRING([--enable-coverage],
diff -Nru clamav-0.98.1+dfsg/debian/changelog clamav-0.98.1+dfsg/debian/changelog
--- clamav-0.98.1+dfsg/debian/changelog	2014-05-29 23:24:40.000000000 -0400
+++ clamav-0.98.1+dfsg/debian/changelog	2014-05-29 23:21:47.000000000 -0400
@@ -1,3 +1,11 @@
+clamav (0.98.1+dfsg-1+deb7u4) stable; urgency=medium
+
+  * cherry pick upstream patches to fix a crash while using clamscan. Added
+    patches: 0007-bb-10970-Force-a-filesize-limit-of-UINT_MAX-2.patch and
+    0008-Key-off-INT_MAX.patch. (Closes: #749715).
+
+ -- Sebastian Andrzej Siewior <sebastian@breakpoint.cc>  Thu, 29 May 2014 19:28:10 +0200
+
 clamav (0.98.1+dfsg-1+deb7u3) stable; urgency=medium
 
   [ Sebastian Andrzej Siewior ]
diff -Nru clamav-0.98.1+dfsg/debian/control clamav-0.98.1+dfsg/debian/control
--- clamav-0.98.1+dfsg/debian/control	2014-05-29 23:24:40.000000000 -0400
+++ clamav-0.98.1+dfsg/debian/control	2014-05-29 23:21:09.000000000 -0400
@@ -6,10 +6,10 @@
  Michael Tautschnig <mt@debian.org>, Scott Kitterman <scott@kitterman.com>
 Build-Depends: debhelper (>= 6.0.7), po-debconf, zlib1g-dev, libbz2-dev, libmilter-dev,
  perl, bc, check, libtommath-dev, libltdl-dev, electric-fence, libncurses5-dev, python,
- dh-autoreconf, automake1.11, pkg-config
+ libxml2-dev, dh-autoreconf, automake1.11, pkg-config
 Standards-Version: 3.9.5
-Vcs-Git: git://git.debian.org/pkg-clamav/clamav.git
-Vcs-Browser: http://git.debian.org/?p=pkg-clamav/clamav.git;a=summary
+Vcs-Git: git://anonscm.debian.org/pkg-clamav/clamav.git
+Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-clamav/clamav.git;a=summary
 Homepage: http://www.clamav.net/
 XS-Testsuite: autopkgtest
 
diff -Nru clamav-0.98.1+dfsg/debian/.git-dpm clamav-0.98.1+dfsg/debian/.git-dpm
--- clamav-0.98.1+dfsg/debian/.git-dpm	2014-05-29 23:24:40.000000000 -0400
+++ clamav-0.98.1+dfsg/debian/.git-dpm	2014-05-29 23:21:09.000000000 -0400
@@ -1,6 +1,6 @@
 # see git-dpm(1) from git-dpm package
-d1c4510893190e33e55f43e0e674011b5e157f61
-d1c4510893190e33e55f43e0e674011b5e157f61
+58105f31d82c1b83d23cfbb00b4ebb749e0614bc
+58105f31d82c1b83d23cfbb00b4ebb749e0614bc
 f9dd30121dc6926a7a1f704662656aaebe567d5e
 f9dd30121dc6926a7a1f704662656aaebe567d5e
 clamav_0.98.1+dfsg.orig.tar.gz
diff -Nru clamav-0.98.1+dfsg/debian/patches/0001-Change-paths-in-sample-conf-file-to-match-Debian.patch clamav-0.98.1+dfsg/debian/patches/0001-Change-paths-in-sample-conf-file-to-match-Debian.patch
--- clamav-0.98.1+dfsg/debian/patches/0001-Change-paths-in-sample-conf-file-to-match-Debian.patch	1969-12-31 19:00:00.000000000 -0500
+++ clamav-0.98.1+dfsg/debian/patches/0001-Change-paths-in-sample-conf-file-to-match-Debian.patch	2014-05-29 23:21:09.000000000 -0400
@@ -0,0 +1,40 @@
+From 137bf4cb213ae4525cdbb8303b1d906385498559 Mon Sep 17 00:00:00 2001
+From: Scott Kitterman <scott@kitterman.com>
+Date: Mon, 10 Mar 2014 19:20:18 -0400
+Subject: Change paths in sample conf file to match Debian
+
+---
+ etc/clamav-milter.conf.sample | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/etc/clamav-milter.conf.sample b/etc/clamav-milter.conf.sample
+index b7d66a4..ed0d519 100644
+--- a/etc/clamav-milter.conf.sample
++++ b/etc/clamav-milter.conf.sample
+@@ -64,7 +64,7 @@ Example
+ # 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 @@ Example
+ # with the same socket: clamd servers will be selected in a round-robin fashion.
+ #
+ # Default: no default
+-#ClamdSocket tcp:scanner.mydomain:7357
++ClamdSocket /var/run/clamav/clamd
+ 
+ 
+ ##
+@@ -212,7 +212,7 @@ Example
+ # A full path is required.
+ #
+ # Default: disabled
+-#LogFile /tmp/clamav-milter.log
++#LogFile /var/log/clamav/clamav-milter.log
+ 
+ # By default the log file is locked for writing - the lock protects against
+ # running clamav-milter multiple times.
diff -Nru clamav-0.98.1+dfsg/debian/patches/0002-Sebastian-Andrzej-Siewior.patch clamav-0.98.1+dfsg/debian/patches/0002-Sebastian-Andrzej-Siewior.patch
--- clamav-0.98.1+dfsg/debian/patches/0002-Sebastian-Andrzej-Siewior.patch	1969-12-31 19:00:00.000000000 -0500
+++ clamav-0.98.1+dfsg/debian/patches/0002-Sebastian-Andrzej-Siewior.patch	2014-05-29 23:21:09.000000000 -0400
@@ -0,0 +1,103 @@
+From 2493e18d6facdf0363bdb0933238e0061dacf9d5 Mon Sep 17 00:00:00 2001
+From: Scott Kitterman <scott@kitterman.com>
+Date: Mon, 10 Mar 2014 19:28:15 -0400
+Subject: =?UTF-8?q?=20=20[=20Sebastian=20Andrzej=20Siewior=20]=0A=20=20*?=
+ =?UTF-8?q?=20unit=5Ftest:=20check=5Fclamav:=20skip=20.rar=20files=20if=20?=
+ =?UTF-8?q?there=20is=20no=20rar=20support=20to=20fix=0A=20=20=20=20test?=
+ =?UTF-8?q?=20failure=20(and=20FTBFS)=20when=20tests=20are=20run?=
+
+---
+ unit_tests/check_clamav.c | 50 +++++++++++++++++++++++++++++++++++------------
+ 1 file changed, 37 insertions(+), 13 deletions(-)
+
+diff --git a/unit_tests/check_clamav.c b/unit_tests/check_clamav.c
+index 3473082..3ccd5d5 100644
+--- a/unit_tests/check_clamav.c
++++ b/unit_tests/check_clamav.c
+@@ -361,9 +361,24 @@ static const int expected_testfiles = 48;
+ static const int expected_testfiles = 46;
+ #endif
+ 
++static unsigned skip_unrar_files(void)
++{
++	const char *s = getenv("unrar_disabled");
++
++	if (!s)
++		return 0;
++
++	if (strcmp(s, "1"))
++		return 0;
++
++	/* number of .rar files we skipp */
++	return 2;
++}
++
+ static void init_testfiles(void)
+ {
+     struct dirent *dirent;
++    int expect = expected_testfiles;
+     unsigned i = 0;
+ 
+     DIR *d = opendir(OBJDIR"/../test");
+@@ -375,13 +390,18 @@ static void init_testfiles(void)
+     while ((dirent = readdir(d))) {
+ 	if (strncmp(dirent->d_name, "clam", 4))
+ 	    continue;
++	if (strstr(dirent->d_name, ".rar") && skip_unrar_files()) {
++		cli_dbgmsg("skipping (no unrar) %s\n", dirent->d_name);
++		continue;
++	}
+ 	i++;
+ 	testfiles = cli_realloc(testfiles, i*sizeof(*testfiles));
+ 	fail_unless(!!testfiles, "cli_realloc");
+ 	testfiles[i-1] = strdup(dirent->d_name);
+     }
+     testfiles_n = i;
+-    fail_unless_fmt(testfiles_n == expected_testfiles, "testfiles: %d != %d", testfiles_n, expected_testfiles);
++    expect -= skip_unrar_files();
++    fail_unless_fmt(testfiles_n == expect, "testfiles: %d != %d", testfiles_n, expect);
+ 
+     closedir(d);
+ }
+@@ -560,6 +580,8 @@ END_TEST
+ 
+ static Suite *test_cl_suite(void)
+ {
++    int expect = expected_testfiles;
++
+     Suite *s = suite_create("cl_api");
+     TCase *tc_cl = tcase_create("cl_dup");
+     TCase *tc_cl_scan = tcase_create("cl_scan");
+@@ -585,18 +607,20 @@ static Suite *test_cl_suite(void)
+     suite_add_tcase(s, tc_cl_scan);
+     tcase_add_checked_fixture (tc_cl_scan, engine_setup, engine_teardown);
+ #ifdef CHECK_HAVE_LOOPS
+-    tcase_add_loop_test(tc_cl_scan, test_cl_scandesc, 0, expected_testfiles);
+-    tcase_add_loop_test(tc_cl_scan, test_cl_scandesc_allscan, 0, expected_testfiles);
+-    tcase_add_loop_test(tc_cl_scan, test_cl_scanfile, 0, expected_testfiles);
+-    tcase_add_loop_test(tc_cl_scan, test_cl_scanfile_allscan, 0, expected_testfiles);
+-    tcase_add_loop_test(tc_cl_scan, test_cl_scandesc_callback, 0, expected_testfiles);
+-    tcase_add_loop_test(tc_cl_scan, test_cl_scandesc_callback_allscan, 0, expected_testfiles);
+-    tcase_add_loop_test(tc_cl_scan, test_cl_scanfile_callback, 0, expected_testfiles);
+-    tcase_add_loop_test(tc_cl_scan, test_cl_scanfile_callback_allscan, 0, expected_testfiles);
+-    tcase_add_loop_test(tc_cl_scan, test_cl_scanmap_callback_handle, 0, expected_testfiles);
+-    tcase_add_loop_test(tc_cl_scan, test_cl_scanmap_callback_handle_allscan, 0, expected_testfiles);
+-    tcase_add_loop_test(tc_cl_scan, test_cl_scanmap_callback_mem, 0, expected_testfiles);
+-    tcase_add_loop_test(tc_cl_scan, test_cl_scanmap_callback_mem_allscan, 0, expected_testfiles);
++    expect -= skip_unrar_files();
++
++    tcase_add_loop_test(tc_cl_scan, test_cl_scandesc, 0, expect);
++    tcase_add_loop_test(tc_cl_scan, test_cl_scandesc_allscan, 0, expect);
++    tcase_add_loop_test(tc_cl_scan, test_cl_scanfile, 0, expect);
++    tcase_add_loop_test(tc_cl_scan, test_cl_scanfile_allscan, 0, expect);
++    tcase_add_loop_test(tc_cl_scan, test_cl_scandesc_callback, 0, expect);
++    tcase_add_loop_test(tc_cl_scan, test_cl_scandesc_callback_allscan, 0, expect);
++    tcase_add_loop_test(tc_cl_scan, test_cl_scanfile_callback, 0, expect);
++    tcase_add_loop_test(tc_cl_scan, test_cl_scanfile_callback_allscan, 0, expect);
++    tcase_add_loop_test(tc_cl_scan, test_cl_scanmap_callback_handle, 0, expect);
++    tcase_add_loop_test(tc_cl_scan, test_cl_scanmap_callback_handle_allscan, 0, expect);
++    tcase_add_loop_test(tc_cl_scan, test_cl_scanmap_callback_mem, 0, expect);
++    tcase_add_loop_test(tc_cl_scan, test_cl_scanmap_callback_mem_allscan, 0, expect);
+ #endif
+     return s;
+ }
diff -Nru clamav-0.98.1+dfsg/debian/patches/0003-configure-use-pkg-config-for-check-so-test-is-detect.patch clamav-0.98.1+dfsg/debian/patches/0003-configure-use-pkg-config-for-check-so-test-is-detect.patch
--- clamav-0.98.1+dfsg/debian/patches/0003-configure-use-pkg-config-for-check-so-test-is-detect.patch	1969-12-31 19:00:00.000000000 -0500
+++ clamav-0.98.1+dfsg/debian/patches/0003-configure-use-pkg-config-for-check-so-test-is-detect.patch	2014-05-29 23:21:09.000000000 -0400
@@ -0,0 +1,61 @@
+From 3bfb03f1f9b8317ff355f0c65cde1e9b3fd5cc43 Mon Sep 17 00:00:00 2001
+From: Scott Kitterman <scott@kitterman.com>
+Date: Mon, 10 Mar 2014 19:46:48 -0400
+Subject: configure: use pkg-config for check so test is detected and tests
+ will run
+
+---
+ configure.ac           | 19 ++++++-------------
+ unit_tests/Makefile.am |  4 ++--
+ 2 files changed, 8 insertions(+), 15 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index c91baeb..41df5d0 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -464,22 +464,15 @@ enable_ut_install=no
+ AC_ARG_ENABLE(check,
+ [  --enable-check           Enable 'check' unit tests (default=auto)], enable_check_ut=$enableval, enable_check_ut="auto" )
+ 
+-if test "$enable_check_ut" != "no" ; then
+-	AC_LIB_FIND([check],[check.h],
+-			AC_LANG_PROGRAM([#include <check.h>],[srunner_create(0)]),
+-			[CHECK_CPPFLAGS="$INCCHECK"; CHECK_LIBS="$LTLIBCHECK"],
+-			[])
++if test "$enable_check_ut" = "auto" ; then
++	PKG_CHECK_EXISTS([check], [enable_check_ut="yes"],
++			 [enable_check_ut="no"])
+ fi
+-AC_SUBST([CHECK_CPPFLAGS])
+-AC_SUBST([CHECK_LIBS])
+-AM_CONDITIONAL([HAVE_LIBCHECK],test "X$HAVE_LIBCHECK" = "Xyes")
+ 
+-if test "x$CHECK_LIBS" = "x" -a "$enable_check_ut" = "yes"; then
+-    AC_MSG_ERROR([
+-
+-ERROR!  Check was configured, but not found.  Get it from http://check.sf.net/
+-])
++if test "$enable_check_ut" = "yes" ; then
++	PKG_CHECK_MODULES([CHECK], [check >= 0.9.4])
+ fi
++AM_CONDITIONAL([HAVE_LIBCHECK],test "X$CHECK_LIBS" != "X")
+ 
+ AC_ARG_ENABLE(coverage,
+ 	      AC_HELP_STRING([--enable-coverage],
+diff --git a/unit_tests/Makefile.am b/unit_tests/Makefile.am
+index d85d7b6..a4d9d84 100644
+--- a/unit_tests/Makefile.am
++++ b/unit_tests/Makefile.am
+@@ -33,10 +33,10 @@ check_clamav_SOURCES = check_clamav.c checks.h checks_common.h $(top_builddir)/l
+ 		       check_jsnorm.c check_str.c check_regex.c\
+ 		       check_disasm.c check_uniq.c check_matchers.c\
+ 		       check_htmlnorm.c check_bytecode.c
+-check_clamav_CPPFLAGS = -I$(top_srcdir) @CHECK_CPPFLAGS@ -DSRCDIR=\"$(abs_srcdir)\" -DOBJDIR=\"$(abs_builddir)\"
++check_clamav_CPPFLAGS = -I$(top_srcdir) @CHECK_CFLAGS@ -DSRCDIR=\"$(abs_srcdir)\" -DOBJDIR=\"$(abs_builddir)\"
+ check_clamav_LDADD = $(top_builddir)/libclamav/libclamav.la @THREAD_LIBS@ @CHECK_LIBS@
+ check_clamd_SOURCES = check_clamd.c checks_common.h
+-check_clamd_CPPFLAGS = -I$(top_srcdir) @CHECK_CPPFLAGS@ -DSRCDIR=\"$(abs_srcdir)\" -DBUILDDIR=\"$(abs_builddir)\"
++check_clamd_CPPFLAGS = -I$(top_srcdir) @CHECK_CFLAGS@ -DSRCDIR=\"$(abs_srcdir)\" -DBUILDDIR=\"$(abs_builddir)\"
+ check_clamd_LDADD = @CHECK_LIBS@ @CLAMD_LIBS@
+ else
+ check_clamd_SOURCES = check_clamav_skip.c
diff -Nru clamav-0.98.1+dfsg/debian/patches/0004-Stop-using-a-cargo-culted-syscall-table-and-trust-th.patch clamav-0.98.1+dfsg/debian/patches/0004-Stop-using-a-cargo-culted-syscall-table-and-trust-th.patch
--- clamav-0.98.1+dfsg/debian/patches/0004-Stop-using-a-cargo-culted-syscall-table-and-trust-th.patch	1969-12-31 19:00:00.000000000 -0500
+++ clamav-0.98.1+dfsg/debian/patches/0004-Stop-using-a-cargo-culted-syscall-table-and-trust-th.patch	2014-05-29 23:21:09.000000000 -0400
@@ -0,0 +1,45 @@
+From fa5fdd205e4958c304f3dfd10173eb4e0c35596f Mon Sep 17 00:00:00 2001
+From: Scott Kitterman <scott@kitterman.com>
+Date: Mon, 10 Mar 2014 19:57:02 -0400
+Subject: Stop using a cargo-culted syscall table and trust the glibc headers
+
+---
+ clamd/fan-syscalllib.h | 17 ++++-------------
+ 1 file changed, 4 insertions(+), 13 deletions(-)
+
+diff --git a/clamd/fan-syscalllib.h b/clamd/fan-syscalllib.h
+index 288cd99..b130635 100644
+--- a/clamd/fan-syscalllib.h
++++ b/clamd/fan-syscalllib.h
+@@ -2,27 +2,18 @@
+ #define __FANOTIFY_SYSCALL_LIB
+ 
+ #include <unistd.h>
+-#include <linux/types.h>
+-
+-#if defined(__x86_64__)
+-# define __NR_fanotify_init	300
+-# define __NR_fanotify_mark	301
+-#elif defined(__i386__)
+-# define __NR_fanotify_init	338
+-# define __NR_fanotify_mark	339
+-#else
+-# error "System call numbers not defined for this architecture"
+-#endif
++#include <sys/types.h>
++#include <sys/syscall.h>
+ 
+ static inline int fanotify_init(unsigned int flags, unsigned int event_f_flags)
+ {
+-	return syscall(__NR_fanotify_init, flags, event_f_flags);
++	return syscall(SYS_fanotify_init, flags, event_f_flags);
+ }
+ 
+ static inline int fanotify_mark(int fanotify_fd, unsigned int flags, __u64 mask,
+ 				int dfd, const char *pathname)
+ {
+-	return syscall(__NR_fanotify_mark, fanotify_fd, flags, mask,
++	return syscall(SYS_fanotify_mark, fanotify_fd, flags, mask,
+ 		       dfd, pathname);
+ }
+ #endif
diff -Nru clamav-0.98.1+dfsg/debian/patches/0005-configure.ac-patches-to-got-with-autoreconf-and-auto.patch clamav-0.98.1+dfsg/debian/patches/0005-configure.ac-patches-to-got-with-autoreconf-and-auto.patch
--- clamav-0.98.1+dfsg/debian/patches/0005-configure.ac-patches-to-got-with-autoreconf-and-auto.patch	1969-12-31 19:00:00.000000000 -0500
+++ clamav-0.98.1+dfsg/debian/patches/0005-configure.ac-patches-to-got-with-autoreconf-and-auto.patch	2014-05-29 23:21:09.000000000 -0400
@@ -0,0 +1,40 @@
+From cbdf7f7418d29942b7f367be843678e111a96518 Mon Sep 17 00:00:00 2001
+From: Scott Kitterman <scott@kitterman.com>
+Date: Mon, 10 Mar 2014 20:41:13 -0400
+Subject: configure.ac patches to got with autoreconf and automake1.11
+
+---
+ configure.ac               | 3 ++-
+ libclamav/c++/configure.ac | 3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 41df5d0..c9e3f97 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -34,8 +34,9 @@ AC_CREATE_TARGET_H([target.h])
+ 
+ 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_INIT_AUTOMAKE([-Wall -Wportability -Wno-override -Werror std-options foreign dist-bzip2 no-define color-tests parallel-tests tar-ustar])
+ AM_SILENT_RULES([yes])
++AM_PROG_AR
+ 
+ dnl we told automake to not define these, since we want to include
+ dnl the date in the version
+diff --git a/libclamav/c++/configure.ac b/libclamav/c++/configure.ac
+index d72dcd1..353a302 100644
+--- a/libclamav/c++/configure.ac
++++ b/libclamav/c++/configure.ac
+@@ -20,8 +20,9 @@ AC_CONFIG_SRCDIR([llvm/configure])
+ AC_CONFIG_MACRO_DIR([m4])
+ AC_CONFIG_HEADER([clamavcxx-config.h])
+ AC_CANONICAL_TARGET
+-AM_INIT_AUTOMAKE([1.9 -Wall -Wportability -Werror foreign no-define color-tests tar-pax])
++AM_INIT_AUTOMAKE([-Wall -Wportability -Werror foreign no-define color-tests tar-pax])
+ AM_SILENT_RULES([yes])
++AM_PROG_AR
+ 
+ cxxset=${CXXFLAGS+set}
+ AC_PROG_CXX
diff -Nru clamav-0.98.1+dfsg/debian/patches/0006-Fix-STAT64-definition-and-add-missing-includes.patch clamav-0.98.1+dfsg/debian/patches/0006-Fix-STAT64-definition-and-add-missing-includes.patch
--- clamav-0.98.1+dfsg/debian/patches/0006-Fix-STAT64-definition-and-add-missing-includes.patch	1969-12-31 19:00:00.000000000 -0500
+++ clamav-0.98.1+dfsg/debian/patches/0006-Fix-STAT64-definition-and-add-missing-includes.patch	2014-05-29 23:21:09.000000000 -0400
@@ -0,0 +1,41 @@
+From d1c4510893190e33e55f43e0e674011b5e157f61 Mon Sep 17 00:00:00 2001
+From: Scott Kitterman <scott@kitterman.com>
+Date: Mon, 10 Mar 2014 20:44:29 -0400
+Subject: Fix STAT64 definition and add missing includes.
+
+---
+ libclamav/clamav.h | 5 ++++-
+ shared/output.c    | 1 +
+ 2 files changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/libclamav/clamav.h b/libclamav/clamav.h
+index fc6c642..0fc2fe6 100644
+--- a/libclamav/clamav.h
++++ b/libclamav/clamav.h
+@@ -22,10 +22,13 @@
+ #define __CLAMAV_H
+ 
+ /* Certain OSs already use 64bit variables in their stat struct */
+-#define STAT64_BLACKLIST !defined(__FreeBSD__) && !defined(__APPLE__)
++#define STAT64_BLACKLIST !defined(__FreeBSD__) && !defined(__APPLE__) && !defined(__linux__) && !defined(__FreeBSD_kernel__) && !defined(__hurd__)
+ 
+ #if defined(HAVE_STAT64) && STAT64_BLACKLIST
+ 
++#include <stdio.h>
++#include <sys/types.h>
++#include <sys/stat.h>
+ #include <unistd.h>
+ 
+ #define STATBUF struct stat64
+diff --git a/shared/output.c b/shared/output.c
+index 3af3acd..5e947a5 100644
+--- a/shared/output.c
++++ b/shared/output.c
+@@ -51,6 +51,7 @@
+ #endif
+ 
+ #include "output.h"
++#include "libclamav/clamav.h"
+ #include "libclamav/others.h"
+ #include "libclamav/str.h"
+ 
diff -Nru clamav-0.98.1+dfsg/debian/patches/0007-bb-10970-Force-a-filesize-limit-of-UINT_MAX-2.patch clamav-0.98.1+dfsg/debian/patches/0007-bb-10970-Force-a-filesize-limit-of-UINT_MAX-2.patch
--- clamav-0.98.1+dfsg/debian/patches/0007-bb-10970-Force-a-filesize-limit-of-UINT_MAX-2.patch	1969-12-31 19:00:00.000000000 -0500
+++ clamav-0.98.1+dfsg/debian/patches/0007-bb-10970-Force-a-filesize-limit-of-UINT_MAX-2.patch	2014-05-29 23:21:09.000000000 -0400
@@ -0,0 +1,33 @@
+From defbea3a64080912a274830744ebd1e3748fc37f Mon Sep 17 00:00:00 2001
+From: Shawn Webb <swebb@sourcefire.com>
+Date: Fri, 11 Apr 2014 13:41:18 -0400
+Subject: bb #10970 - Force a filesize limit of UINT_MAX - 2
+
+---
+ libclamav/scanners.c | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/libclamav/scanners.c b/libclamav/scanners.c
+index ec553eb..49cf3c2 100644
+--- a/libclamav/scanners.c
++++ b/libclamav/scanners.c
+@@ -3107,6 +3107,19 @@ static int scan_common(int desc, cl_fmap_t *map, const char **virname, unsigned
+ {
+     cli_ctx ctx;
+     int rc;
++    STATBUF sb;
++
++    /* We have a limit of around 2.8GB (UINT_MAX - 2). Enforce it here. */
++    if (desc > 0) {
++        if (FSTAT(desc, &sb))
++            return CL_ESTAT;
++
++        if (sb.st_size > (UINT_MAX - 2))
++            return CL_CLEAN;
++    } else {
++        if (map != NULL && map->real_len > (UINT_MAX - 2))
++            return CL_CLEAN;
++    }
+ 
+     memset(&ctx, '\0', sizeof(cli_ctx));
+     ctx.engine = engine;
diff -Nru clamav-0.98.1+dfsg/debian/patches/0008-Key-off-INT_MAX.patch clamav-0.98.1+dfsg/debian/patches/0008-Key-off-INT_MAX.patch
--- clamav-0.98.1+dfsg/debian/patches/0008-Key-off-INT_MAX.patch	1969-12-31 19:00:00.000000000 -0500
+++ clamav-0.98.1+dfsg/debian/patches/0008-Key-off-INT_MAX.patch	2014-05-29 23:21:09.000000000 -0400
@@ -0,0 +1,35 @@
+From 58105f31d82c1b83d23cfbb00b4ebb749e0614bc Mon Sep 17 00:00:00 2001
+From: Shawn Webb <swebb@sourcefire.com>
+Date: Tue, 15 Apr 2014 10:24:58 -0400
+Subject: Key off INT_MAX
+
+---
+ libclamav/scanners.c | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/libclamav/scanners.c b/libclamav/scanners.c
+index 49cf3c2..628e0d8 100644
+--- a/libclamav/scanners.c
++++ b/libclamav/scanners.c
+@@ -3109,15 +3109,15 @@ static int scan_common(int desc, cl_fmap_t *map, const char **virname, unsigned
+     int rc;
+     STATBUF sb;
+ 
+-    /* We have a limit of around 2.8GB (UINT_MAX - 2). Enforce it here. */
+-    if (desc > 0) {
++    /* We have a limit of around 2.17GB (INT_MAX - 2). Enforce it here. */
++    if (map != NULL) {
++        if ((size_t)(map->real_len) > (size_t)(INT_MAX - 2))
++            return CL_CLEAN;
++    } else {
+         if (FSTAT(desc, &sb))
+             return CL_ESTAT;
+ 
+-        if (sb.st_size > (UINT_MAX - 2))
+-            return CL_CLEAN;
+-    } else {
+-        if (map != NULL && map->real_len > (UINT_MAX - 2))
++        if ((size_t)(sb.st_size) > (size_t)(INT_MAX - 2))
+             return CL_CLEAN;
+     }
+ 
diff -Nru clamav-0.98.1+dfsg/debian/patches/series clamav-0.98.1+dfsg/debian/patches/series
--- clamav-0.98.1+dfsg/debian/patches/series	1969-12-31 19:00:00.000000000 -0500
+++ clamav-0.98.1+dfsg/debian/patches/series	2014-05-29 23:21:09.000000000 -0400
@@ -0,0 +1,8 @@
+0001-Change-paths-in-sample-conf-file-to-match-Debian.patch
+0002-Sebastian-Andrzej-Siewior.patch
+0003-configure-use-pkg-config-for-check-so-test-is-detect.patch
+0004-Stop-using-a-cargo-culted-syscall-table-and-trust-th.patch
+0005-configure.ac-patches-to-got-with-autoreconf-and-auto.patch
+0006-Fix-STAT64-definition-and-add-missing-includes.patch
+0007-bb-10970-Force-a-filesize-limit-of-UINT_MAX-2.patch
+0008-Key-off-INT_MAX.patch
diff -Nru clamav-0.98.1+dfsg/debian/rules clamav-0.98.1+dfsg/debian/rules
--- clamav-0.98.1+dfsg/debian/rules	2014-05-29 23:24:40.000000000 -0400
+++ clamav-0.98.1+dfsg/debian/rules	2014-05-29 23:21:09.000000000 -0400
@@ -39,6 +39,11 @@
   endif
 endif
 
+# LLVM doesn't work on these archs, so no point in breaking the build over it.
+ifneq (,$(filter $(DEB_HOST_ARCH), hurd-i386 ppc64 powerpcspe ppc64el))
+  export enable_llvm=no
+endif
+
 config.status: configure
 	dh_testdir
 	egrep '^#[[:alpha:]]' etc/clamd.conf.sample | sed -e 's/^#//' | awk '{print $$1}' | while read opt; do \
@@ -60,8 +65,8 @@
 	  fi;\
 	done;
 	# Add here commands to configure the package.
-	dh_autoreconf -i
-	./configure CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --disable-clamav --with-dbdir=/var/lib/clamav/ --sysconfdir=/etc/clamav --enable-milter --disable-clamuko --with-gnu-ld --enable-dns-fix ${DEBUG_OPTS} --disable-unrar --libdir=\$${prefix}/lib --with-system-tommath  --without-included-ltdl
+	dh_autoreconf
+	./configure CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --disable-clamav --with-dbdir=/var/lib/clamav --sysconfdir=/etc/clamav --enable-milter --disable-clamuko --with-gnu-ld --enable-dns-fix ${DEBUG_OPTS} --disable-unrar --libdir=\$${prefix}/lib --with-system-tommath  --without-included-ltdl
 
 build: build-stamp
 build-stamp: build-arch build-indep
diff -Nru clamav-0.98.1+dfsg/debian/source/format clamav-0.98.1+dfsg/debian/source/format
--- clamav-0.98.1+dfsg/debian/source/format	2014-05-29 23:24:40.000000000 -0400
+++ clamav-0.98.1+dfsg/debian/source/format	2014-05-18 16:44:41.000000000 -0400
@@ -1 +1 @@
-1.0
+3.0 (quilt)
diff -Nru clamav-0.98.1+dfsg/debian/source/lintian-overrides clamav-0.98.1+dfsg/debian/source/lintian-overrides
--- clamav-0.98.1+dfsg/debian/source/lintian-overrides	1969-12-31 19:00:00.000000000 -0500
+++ clamav-0.98.1+dfsg/debian/source/lintian-overrides	2014-05-29 23:21:09.000000000 -0400
@@ -0,0 +1,3 @@
+# The new location for the upstream signing key is upstream/signing-key.{asc,pgp}, but lintian is not yet updated.
+# See: https://bugs.debian.org/738597
+clamav source: debian-watch-file-pubkey-file-is-missing
diff -Nru clamav-0.98.1+dfsg/debian/upstream/signing-key.asc clamav-0.98.1+dfsg/debian/upstream/signing-key.asc
--- clamav-0.98.1+dfsg/debian/upstream/signing-key.asc	1969-12-31 19:00:00.000000000 -0500
+++ clamav-0.98.1+dfsg/debian/upstream/signing-key.asc	2014-05-18 16:44:41.000000000 -0400
@@ -0,0 +1,43 @@
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+Version: GnuPG v2.0.22 (GNU/Linux)
+
+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
+MjiCtk3kDuDp
+=xBx3
+-----END PGP PUBLIC KEY BLOCK-----
diff -Nru clamav-0.98.1+dfsg/debian/watch clamav-0.98.1+dfsg/debian/watch
--- clamav-0.98.1+dfsg/debian/watch	2014-05-29 23:24:40.000000000 -0400
+++ clamav-0.98.1+dfsg/debian/watch	2014-05-18 16:44:41.000000000 -0400
@@ -1,4 +1,4 @@
 version=3
-opts=uversionmangle=s/(\d+)(rc)/$1~$2/,dversionmangle=s/\+dfsg// \
+opts="uversionmangle=s/(\d+)(rc)/$1~$2/,dversionmangle=s/\+dfsg//,pgpsigurlmangle=s/$/.sig/" \
 http://sf.net/clamav/clamav-(.*).tar.gz debian uupdate
 
diff -Nru clamav-0.98.1+dfsg/etc/clamav-milter.conf.sample clamav-0.98.1+dfsg/etc/clamav-milter.conf.sample
--- clamav-0.98.1+dfsg/etc/clamav-milter.conf.sample	2014-05-29 23:24:40.000000000 -0400
+++ clamav-0.98.1+dfsg/etc/clamav-milter.conf.sample	2014-01-13 12:02:18.000000000 -0500
@@ -64,7 +64,7 @@
 # daemon (main thread).
 #
 # Default: disabled
-#PidFile /var/run/clamav/clamav-milter.pid
+#PidFile /var/run/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 /var/run/clamav/clamd
+#ClamdSocket tcp:scanner.mydomain:7357
 
 
 ##
@@ -212,7 +212,7 @@
 # A full path is required.
 #
 # Default: disabled
-#LogFile /var/log/clamav/clamav-milter.log
+#LogFile /tmp/clamav-milter.log
 
 # By default the log file is locked for writing - the lock protects against
 # running clamav-milter multiple times.
diff -Nru clamav-0.98.1+dfsg/libclamav/c++/configure.ac clamav-0.98.1+dfsg/libclamav/c++/configure.ac
--- clamav-0.98.1+dfsg/libclamav/c++/configure.ac	2014-05-29 23:24:40.000000000 -0400
+++ clamav-0.98.1+dfsg/libclamav/c++/configure.ac	2014-01-13 12:02:18.000000000 -0500
@@ -20,9 +20,8 @@
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_HEADER([clamavcxx-config.h])
 AC_CANONICAL_TARGET
-AM_INIT_AUTOMAKE([-Wall -Wportability -Werror foreign no-define color-tests tar-pax])
+AM_INIT_AUTOMAKE([1.9 -Wall -Wportability -Werror foreign no-define color-tests tar-pax])
 AM_SILENT_RULES([yes])
-AM_PROG_AR
 
 cxxset=${CXXFLAGS+set}
 AC_PROG_CXX
diff -Nru clamav-0.98.1+dfsg/libclamav/clamav.h clamav-0.98.1+dfsg/libclamav/clamav.h
--- clamav-0.98.1+dfsg/libclamav/clamav.h	2014-05-29 23:24:40.000000000 -0400
+++ clamav-0.98.1+dfsg/libclamav/clamav.h	2014-01-13 12:02:34.000000000 -0500
@@ -22,13 +22,10 @@
 #define __CLAMAV_H
 
 /* Certain OSs already use 64bit variables in their stat struct */
-#define STAT64_BLACKLIST !defined(__FreeBSD__) && !defined(__APPLE__) && !defined(__linux__) && !defined(__FreeBSD_kernel__) && !defined(__hurd__)
+#define STAT64_BLACKLIST !defined(__FreeBSD__) && !defined(__APPLE__)
 
 #if defined(HAVE_STAT64) && STAT64_BLACKLIST
 
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
 #include <unistd.h>
 
 #define STATBUF struct stat64
diff -Nru clamav-0.98.1+dfsg/shared/output.c clamav-0.98.1+dfsg/shared/output.c
--- clamav-0.98.1+dfsg/shared/output.c	2014-05-29 23:24:40.000000000 -0400
+++ clamav-0.98.1+dfsg/shared/output.c	2014-01-13 12:02:18.000000000 -0500
@@ -51,7 +51,6 @@
 #endif
 
 #include "output.h"
-#include "libclamav/clamav.h"
 #include "libclamav/others.h"
 #include "libclamav/str.h"
 
diff -Nru clamav-0.98.1+dfsg/unit_tests/check_clamav.c clamav-0.98.1+dfsg/unit_tests/check_clamav.c
--- clamav-0.98.1+dfsg/unit_tests/check_clamav.c	2014-05-29 23:24:40.000000000 -0400
+++ clamav-0.98.1+dfsg/unit_tests/check_clamav.c	2014-01-13 12:02:34.000000000 -0500
@@ -361,24 +361,9 @@
 static const int expected_testfiles = 46;
 #endif
 
-static unsigned skip_unrar_files(void)
-{
-	const char *s = getenv("unrar_disabled");
-
-	if (!s)
-		return 0;
-
-	if (strcmp(s, "1"))
-		return 0;
-
-	/* number of .rar files we skipp */
-	return 2;
-}
-
 static void init_testfiles(void)
 {
     struct dirent *dirent;
-    int expect = expected_testfiles;
     unsigned i = 0;
 
     DIR *d = opendir(OBJDIR"/../test");
@@ -390,18 +375,13 @@
     while ((dirent = readdir(d))) {
 	if (strncmp(dirent->d_name, "clam", 4))
 	    continue;
-	if (strstr(dirent->d_name, ".rar") && skip_unrar_files()) {
-		cli_dbgmsg("skipping (no unrar) %s\n", dirent->d_name);
-		continue;
-	}
 	i++;
 	testfiles = cli_realloc(testfiles, i*sizeof(*testfiles));
 	fail_unless(!!testfiles, "cli_realloc");
 	testfiles[i-1] = strdup(dirent->d_name);
     }
     testfiles_n = i;
-    expect -= skip_unrar_files();
-    fail_unless_fmt(testfiles_n == expect, "testfiles: %d != %d", testfiles_n, expect);
+    fail_unless_fmt(testfiles_n == expected_testfiles, "testfiles: %d != %d", testfiles_n, expected_testfiles);
 
     closedir(d);
 }
@@ -580,8 +560,6 @@
 
 static Suite *test_cl_suite(void)
 {
-    int expect = expected_testfiles;
-
     Suite *s = suite_create("cl_api");
     TCase *tc_cl = tcase_create("cl_dup");
     TCase *tc_cl_scan = tcase_create("cl_scan");
@@ -607,20 +585,18 @@
     suite_add_tcase(s, tc_cl_scan);
     tcase_add_checked_fixture (tc_cl_scan, engine_setup, engine_teardown);
 #ifdef CHECK_HAVE_LOOPS
-    expect -= skip_unrar_files();
-
-    tcase_add_loop_test(tc_cl_scan, test_cl_scandesc, 0, expect);
-    tcase_add_loop_test(tc_cl_scan, test_cl_scandesc_allscan, 0, expect);
-    tcase_add_loop_test(tc_cl_scan, test_cl_scanfile, 0, expect);
-    tcase_add_loop_test(tc_cl_scan, test_cl_scanfile_allscan, 0, expect);
-    tcase_add_loop_test(tc_cl_scan, test_cl_scandesc_callback, 0, expect);
-    tcase_add_loop_test(tc_cl_scan, test_cl_scandesc_callback_allscan, 0, expect);
-    tcase_add_loop_test(tc_cl_scan, test_cl_scanfile_callback, 0, expect);
-    tcase_add_loop_test(tc_cl_scan, test_cl_scanfile_callback_allscan, 0, expect);
-    tcase_add_loop_test(tc_cl_scan, test_cl_scanmap_callback_handle, 0, expect);
-    tcase_add_loop_test(tc_cl_scan, test_cl_scanmap_callback_handle_allscan, 0, expect);
-    tcase_add_loop_test(tc_cl_scan, test_cl_scanmap_callback_mem, 0, expect);
-    tcase_add_loop_test(tc_cl_scan, test_cl_scanmap_callback_mem_allscan, 0, expect);
+    tcase_add_loop_test(tc_cl_scan, test_cl_scandesc, 0, expected_testfiles);
+    tcase_add_loop_test(tc_cl_scan, test_cl_scandesc_allscan, 0, expected_testfiles);
+    tcase_add_loop_test(tc_cl_scan, test_cl_scanfile, 0, expected_testfiles);
+    tcase_add_loop_test(tc_cl_scan, test_cl_scanfile_allscan, 0, expected_testfiles);
+    tcase_add_loop_test(tc_cl_scan, test_cl_scandesc_callback, 0, expected_testfiles);
+    tcase_add_loop_test(tc_cl_scan, test_cl_scandesc_callback_allscan, 0, expected_testfiles);
+    tcase_add_loop_test(tc_cl_scan, test_cl_scanfile_callback, 0, expected_testfiles);
+    tcase_add_loop_test(tc_cl_scan, test_cl_scanfile_callback_allscan, 0, expected_testfiles);
+    tcase_add_loop_test(tc_cl_scan, test_cl_scanmap_callback_handle, 0, expected_testfiles);
+    tcase_add_loop_test(tc_cl_scan, test_cl_scanmap_callback_handle_allscan, 0, expected_testfiles);
+    tcase_add_loop_test(tc_cl_scan, test_cl_scanmap_callback_mem, 0, expected_testfiles);
+    tcase_add_loop_test(tc_cl_scan, test_cl_scanmap_callback_mem_allscan, 0, expected_testfiles);
 #endif
     return s;
 }
diff -Nru clamav-0.98.1+dfsg/unit_tests/Makefile.am clamav-0.98.1+dfsg/unit_tests/Makefile.am
--- clamav-0.98.1+dfsg/unit_tests/Makefile.am	2014-05-29 23:24:40.000000000 -0400
+++ clamav-0.98.1+dfsg/unit_tests/Makefile.am	2014-01-13 12:02:34.000000000 -0500
@@ -33,10 +33,10 @@
 		       check_jsnorm.c check_str.c check_regex.c\
 		       check_disasm.c check_uniq.c check_matchers.c\
 		       check_htmlnorm.c check_bytecode.c
-check_clamav_CPPFLAGS = -I$(top_srcdir) @CHECK_CFLAGS@ -DSRCDIR=\"$(abs_srcdir)\" -DOBJDIR=\"$(abs_builddir)\"
+check_clamav_CPPFLAGS = -I$(top_srcdir) @CHECK_CPPFLAGS@ -DSRCDIR=\"$(abs_srcdir)\" -DOBJDIR=\"$(abs_builddir)\"
 check_clamav_LDADD = $(top_builddir)/libclamav/libclamav.la @THREAD_LIBS@ @CHECK_LIBS@
 check_clamd_SOURCES = check_clamd.c checks_common.h
-check_clamd_CPPFLAGS = -I$(top_srcdir) @CHECK_CFLAGS@ -DSRCDIR=\"$(abs_srcdir)\" -DBUILDDIR=\"$(abs_builddir)\"
+check_clamd_CPPFLAGS = -I$(top_srcdir) @CHECK_CPPFLAGS@ -DSRCDIR=\"$(abs_srcdir)\" -DBUILDDIR=\"$(abs_builddir)\"
 check_clamd_LDADD = @CHECK_LIBS@ @CLAMD_LIBS@
 else
 check_clamd_SOURCES = check_clamav_skip.c
