50e5ddf
diff -urNp xmlto-0.0.24-orig/configure.in xmlto-0.0.24/configure.in
50e5ddf
--- xmlto-0.0.24-orig/configure.in	2011-07-14 12:50:47.000000000 +0200
50e5ddf
+++ xmlto-0.0.24/configure.in	2011-11-29 12:53:50.614481739 +0100
50e5ddf
@@ -109,6 +109,9 @@ AC_PATH_PROG([W3M], [w3m], [w3m])
50e5ddf
 AC_ARG_VAR([TAIL], [Name and path of a tail binary that supports -n.])
50e5ddf
 AC_PATH_PROG([TAIL], [tail], [tail])
50e5ddf
 
50e5ddf
+AC_ARG_VAR([GREP], [Name and path of a GNU grep binary.])
50e5ddf
+AC_PATH_PROG([GREP], [grep], [grep])
50e5ddf
+
50e5ddf
 AC_ARG_VAR([GCP], [Name and path of a GNU cp binary (need at least -P)])
50e5ddf
 AC_PATH_PROG([GCP], [cp], [cp])
50e5ddf
 
50e5ddf
Binary files xmlto-0.0.24-orig/.configure.in.swp and xmlto-0.0.24/.configure.in.swp differ
50e5ddf
diff -urNp xmlto-0.0.24-orig/xmlto.in xmlto-0.0.24/xmlto.in
50e5ddf
--- xmlto-0.0.24-orig/xmlto.in	2011-07-14 12:41:25.000000000 +0200
50e5ddf
+++ xmlto-0.0.24/xmlto.in	2011-11-29 12:53:02.105195055 +0100
50e5ddf
@@ -22,6 +22,7 @@ MKTEMP=@MKTEMP@ # See http://www.mktemp.
50e5ddf
 BASH=@BASH@     # GNU bash, for running the format scripts
50e5ddf
 GETOPT=@GETOPT@ # a getopt that supports --longoptions
50e5ddf
 TAIL=@TAIL@     # a tail that supports -n (posix)
50e5ddf
+GREP=@GREP@     # GNU grep, for searching patterns
50e5ddf
 
50e5ddf
 version () {
50e5ddf
   echo "@PACKAGE@ version @VERSION@"
50e5ddf
@@ -236,6 +237,14 @@ then
50e5ddf
   echo >&2 "@PACKAGE@: Warning: fop not found or not executable."
50e5ddf
   echo >&2 "@PACKAGE@: Using default backend..."
50e5ddf
   USE_BACKEND=DEFAULT
50e5ddf
+else
50e5ddf
+  # we should enable fop.extensions for fop 0_17,0_18 and 0_20*,
50e5ddf
+  # fop1.extensions for the rest
50e5ddf
+  if [ x`$FOP_PATH -v 2>/dev/null | $GREP 0_[12]` = x ]; then
50e5ddf
+    FOPVERSION="fop1"
50e5ddf
+  else
50e5ddf
+    FOPVERSION="fop"
50e5ddf
+  fi
50e5ddf
 fi
50e5ddf
 if [ x"$USE_BACKEND" = xDBLATEX ] && \
50e5ddf
    [ -z "`type -t $DBLATEX_PATH`" ]
50e5ddf
@@ -385,7 +394,7 @@ if [ "$BACKEND_EXTENSIONS" -eq 1 ]
50e5ddf
 then
50e5ddf
   case "$USE_BACKEND" in
50e5ddf
   FOP)
50e5ddf
-      XSLTOPTS="$XSLTOPTS --param fop.extensions '1' --param fop1.extensions '1'" ;;
50e5ddf
+      XSLTOPTS="$XSLTOPTS --param $FOPVERSION.extensions '1'" ;;
50e5ddf
   DBLATEX)
50e5ddf
       ;;
50e5ddf
   DEFAULT)