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