File squid-3.1.10-swapdir.patch of Package squid3.import5582

diff -ruN squid-3.1.10-orig/configure.ac squid-3.1.10/configure.ac
--- squid-3.1.10-orig/configure.ac	2010-12-22 06:48:27.000000000 +0100
+++ squid-3.1.10/configure.ac	2011-01-04 12:47:51.000000000 +0100
@@ -198,6 +198,21 @@
 )
 AC_SUBST(DEFAULT_LOG_DIR)
 
+DEFAULT_SWAPDIR="$localstatedir/cache"
+AC_ARG_WITH(swapdir,
+  AS_HELP_STRING([--with-swapdir=PATH],[Default location for squid SWAP files. default: $DEFAULT_SWAPDIR]),
+ [ case $withval in
+   yes|no)
+     AC_MSG_ERROR( --with-swapdir requires a directory PATH. --with-swapdir=PATH )
+     ;;
+   *)
+     DEFAULT_SWAPDIR="$withval"
+     ;;
+   esac
+ ]
+)
+AC_SUBST(DEFAULT_SWAPDIR)
+
 DEFAULT_PIDFILE="$localstatedir/run/squid.pid"
 AC_ARG_WITH(pidfile,
   AS_HELP_STRING([--with-pidfile=PATH],[Default location for squid PID file. default: PREFIX/var/run/squid.pid]),
diff -ruN squid-3.1.10-orig/src/Makefile.am squid-3.1.10/src/Makefile.am
--- squid-3.1.10-orig/src/Makefile.am	2010-12-22 06:46:56.000000000 +0100
+++ squid-3.1.10/src/Makefile.am	2011-01-04 12:46:29.000000000 +0100
@@ -721,7 +721,7 @@
 DEFAULT_STORE_LOG       = $(DEFAULT_LOG_PREFIX)/store.log
 DEFAULT_PID_FILE        = $(DEFAULT_PIDFILE)
 DEFAULT_NETDB_FILE      = $(DEFAULT_LOG_PREFIX)/netdb.state
-DEFAULT_SWAP_DIR        = $(localstatedir)/cache
+DEFAULT_SWAP_DIR        = $(DEFAULT_SWAPDIR)
 DEFAULT_PINGER		= $(libexecdir)/`echo pinger | sed '$(transform);s/$$/$(EXEEXT)/'`
 DEFAULT_UNLINKD		= $(libexecdir)/`echo unlinkd | sed '$(transform);s/$$/$(EXEEXT)/'`
 DEFAULT_DISKD		= $(libexecdir)/`echo diskd | sed '$(transform);s/$$/$(EXEEXT)/'`
diff -ruN squid-3.1.10-orig/src/Makefile.in squid-3.1.10/src/Makefile.in
--- squid-3.1.10-orig/src/Makefile.in	2010-12-22 06:47:54.000000000 +0100
+++ squid-3.1.10/src/Makefile.in	2011-01-04 12:46:29.000000000 +0100
@@ -2026,7 +2026,7 @@
 DEFAULT_STORE_LOG = $(DEFAULT_LOG_PREFIX)/store.log
 DEFAULT_PID_FILE = $(DEFAULT_PIDFILE)
 DEFAULT_NETDB_FILE = $(DEFAULT_LOG_PREFIX)/netdb.state
-DEFAULT_SWAP_DIR = $(localstatedir)/cache
+DEFAULT_SWAP_DIR = $(DEFAULT_SWAPDIR)
 DEFAULT_PINGER = $(libexecdir)/`echo pinger | sed '$(transform);s/$$/$(EXEEXT)/'`
 DEFAULT_UNLINKD = $(libexecdir)/`echo unlinkd | sed '$(transform);s/$$/$(EXEEXT)/'`
 DEFAULT_DISKD = $(libexecdir)/`echo diskd | sed '$(transform);s/$$/$(EXEEXT)/'`