#! /bin/sh -e
if [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
    -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
    -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
    *)
        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
        exit 1;;
esac

exit 0

@DPATCH@
diff -Nur libapache2-mod-python-3.2.10.orig/configure.in libapache2-mod-python-3.2.10/configure.in
--- libapache2-mod-python-3.2.10.orig/configure.in	2006-04-12 14:03:09.000000000 +0200
+++ libapache2-mod-python-3.2.10/configure.in	2006-08-18 23:44:37.000000000 +0200
@@ -107,15 +107,17 @@
   ALL="dso"
 
   # check Apache version
-  AC_MSG_CHECKING(Apache version)
-  HTTPD="`${APXS} -q SBINDIR`/`${APXS} -q TARGET`"
-  ver=`$HTTPD -v | awk '/version/ {print $3}' | awk -F/ '{print $2}'`
-  AC_MSG_RESULT($ver)
+# peterh: Remove apache version check for debian package, since we don't
+# want to build-depend on apache2.
+#  AC_MSG_CHECKING(Apache version)
+#  HTTPD="`${APXS} -q SBINDIR`/`${APXS} -q TARGET`"
+#  ver=`$HTTPD -v | awk '/version/ {print $3}' | awk -F/ '{print $2}'`
+#  AC_MSG_RESULT($ver)
 
   # make sure version begins with 2
-  if test -z "`echo $ver | egrep \^2`"; then
-    AC_MSG_ERROR([This version of mod_python only works with Apache 2. The one you have seems to be $ver.])
-  fi
+#  if test -z "`echo $ver | egrep \^2`"; then
+#    AC_MSG_ERROR([This version of mod_python only works with Apache 2. The one you have seems to be $ver.])
+#  fi
 
   # determine LIBEXEC
   AC_MSG_CHECKING(for Apache libexec directory)
@@ -287,7 +289,7 @@
 # get the mod_python version
 AC_SUBST(MP_VERSION)
 MP_VERSION=`awk '/MPV_STRING/ {print $3}' src/include/mpversion.h`
-MP_VERSION=`echo $MP_VERSION | sed 's/["]//g'`
+MP_VERSION=`echo $MP_VERSION | sed 's/"//g'`
 
 # get --with-python-src. The python src is required to generate the documentation
 # It is not required to compile or install mod_python itself
