Description: Tweaks for openjpeg support
 Very small adjustments to allow Leptonica to compile cleanly
 with OpenJPEG 2.0. This adds JPEG 2000 support to the library.
 I expect this patch to be revised shortly once we shift to
 OpenJPEG 2.1.
 .
 leptonlib (1.71-2) unstable; urgency=low
 .
   * Add support for JPEG 2000 now that openjpeg2 is in Debian.
Author: Jeff Breidenbach <jab@debian.org>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- leptonlib-1.71.orig/configure.ac
+++ leptonlib-1.71/configure.ac
@@ -78,10 +78,10 @@ AS_IF([test "x$with_libwebp" != xno],
   )
 )
 
-AS_IF([test "x$with_libopenjp2" != xno],
+AS_IF([test "x$with_libopenjpeg" != xno],
   AC_CHECK_LIB([openjp2], [opj_create_decompress],
     AC_DEFINE([HAVE_LIBJP2K], 1, [Define to 1 if you have libopenjp2.]) AC_SUBST([LIBJP2K_LIBS], [-lopenjp2]),
-    AS_IF([test "x$with_libopenjp2" = xyes], AC_MSG_ERROR([libopenjp2 support requested but library not found]))
+    AS_IF([test "x$with_libopenjpeg" = xyes], AC_MSG_ERROR([libopenjp2 support requested but library not found]))
   )
 )
 
--- leptonlib-1.71.orig/src/jp2kio.c
+++ leptonlib-1.71/src/jp2kio.c
@@ -108,7 +108,7 @@
 
     /* Leptonica supports both 2.0 and 2.1.  If you have 2.0,
      * change MINOR to 0.  */
-#define  MINOR   1
+#define  MINOR   0
 
 #if MINOR == 0
   static const l_int32  OpjMinor = 0;

--- leptonlib-1.71.orig/src/libversions.c
+++ leptonlib-1.71/src/libversions.c
@@ -69,7 +69,7 @@
 #endif
 
 #if HAVE_LIBJP2K  /* assuming it's 2.1 */
-#include "openjpeg-2.1/openjpeg.h"
+#include "openjpeg-2.0/openjpeg.h"
 #endif
 
 #define stringJoinInPlace(s1, s2) \
