Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 minidjvu (0.8.svn.2010.05.06+dfsg-2) unstable; urgency=low
 .
   * further update autotools, e.g., step off user-reserved vars
   * remove more derived files from repo; installed by autoreconf
   * bump debian standard version, no changes required
   * add build dependency on autopoint, called by dh-autoreconf
Author: Barak A. Pearlmutter <bap@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>

--- minidjvu-0.8.svn.2010.05.06+dfsg.orig/configure.ac
+++ minidjvu-0.8.svn.2010.05.06+dfsg/configure.ac
@@ -1,215 +1,58 @@
-AC_PREREQ(2.64)
+AC_PREREQ([2.67])
 AC_INIT([minidjvu],[0.8],[alexios@thessalonica.org.ru])
 AC_CONFIG_AUX_DIR(config)
 AC_CONFIG_HEADER(config.h:config/config.h.in)
 AC_CONFIG_MACRO_DIR([m4])
 AC_PREFIX_DEFAULT(/usr/local)
 
-LIBRARY_VERSION=`echo $PACKAGE_VERSION | sed -e 's/\./:/'`
+AM_INIT_AUTOMAKE([subdir-objects foreign])
 
-AC_CANONICAL_HOST
+AC_LANG([C++])
 
-target="$PACKAGE_NAME"
-mdjvulib="lib$PACKAGE_NAME"
+LT_INIT
 
-prefer_static='no'
-prefer_gettext='yes'
-AC_MSG_CHECKING([if we are building for Windows])
-case "$host" in
-  *-mingw32)
-    prefer_static='yes'
-    prefer_gettext='no'
-    target="$target.exe"
-    AC_MSG_RESULT(yes)
-  ;;
-  *)
-    AC_MSG_RESULT(no)
-  ;;
-esac
-
-AC_ARG_ENABLE(
-    [static],
-    [  --enable-static         Enable static building],
-    [static=$enableval],
-    [static=$prefer_static])
-
-AC_ARG_ENABLE(
-    [gettext],
-    [  --enable-gettext        Enable localization via gettext],
-    [gettext=$enableva],
-    [gettext=$prefer_gettext])
-
-AC_ARG_WITH(
-    [tiff],
-    [  --with-tiff             Enable static tiff support],
-    [tiff=$enableval],
-    [tiff=yes])
-
-if test "$static" = "yes"; then
-    if test "x$LDFLAGS" = "x"; then
-        LDFLAGS="-static"
-    fi
-    mdjvulib="$mdjvulib.a"
-    oext='o'
-    SHARED_YES='#'
-else
-    mdjvulib="$mdjvulib.la"
-    oext='lo'
-    STATIC_YES='#'
-fi
-
-case "$host" in
-  *-mingw32)
-    if test "$static" != "yes"; then
-      DLLFLAGS="$DLLFLAGS -Wl,--export-all-symbols"
-    fi
-  ;;
-  *-darwin* | *-macos10*)
-    if test -d /opt/local ; then
-      INCS="-I/opt/local/include"
-      LIBS="-L/opt/local/lib $LIBS"
-    elif test -d /sw ; then
-      INCS="-I/sw/include $CPPFLAGS"
-      LIBS="-L/sw/lib $LIBS"
-    fi
-  ;;
-esac
+AM_GNU_GETTEXT([external])
+AM_GNU_GETTEXT_VERSION([0.18.1])
 
 # Checks for programs.
-
-if test "x$CFLAGS" = "x"; then
-    CFLAGS="-g -pipe -O3"
-fi
-AC_PROG_MAKE_SET
 AC_PROG_CXX
+AC_PROG_AWK
 AC_PROG_CC
-LT_INIT
+AC_PROG_CPP
 AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_MAKE_SET
 AC_PATH_PROG(GZIP, gzip)
 AC_PATH_PROG(RM, rm)
-RM="$RM -f"
 
 # Checks for libraries.
 
-zlib_ok='no'
-dnl Test for libz
-AC_CHECK_LIB(z, inflate, 
-    [z_libs="-lz"; zlib_ok='yes'])
-
-jpeg_ok='no'
-AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
-    [jpeg_libs="-ljpeg"; jpeg_ok='yes'])
+AC_CHECK_LIB(z, inflate)
+AC_CHECK_LIB(jpeg, jpeg_destroy_decompress)
+AC_CHECK_LIB(tiff, TIFFOpen)
 
 # Checks for header files.
-
-if test "$tiff" != 'no'; then
-    have_tiff_header='no'
-    have_libtiff='no'
-    
-    if test "$static" != 'yes' || test "$zlib_ok" = 'yes' -a "$jpeg_ok" = 'yes'; then
-        AC_CHECK_HEADER(tiff.h,  have_tiff_header='yes')
-        AC_CHECK_HEADER(tiffio.h,have_tiff_header='yes',have_tiff_header='no')
-        if test "$have_tiff_header" = 'yes'; then
-            saveLIBS="$LIBS"
-            if test "$static" = 'yes'; then
-                LIBS="$z_libs $jpeg_libs $LIBS"
-            fi
-            
-            have_libtiff='no'
-            AC_CHECK_LIB(tiff,TIFFOpen,have_libtiff='yes',have_libtiff='no')
-            if test "$have_libtiff" != 'no'; then
-                LIBS="-ltiff $LIBS"
-                AC_DEFINE(HAVE_TIFF,1,Define if you have TIFF library)
-            else
-                LIBS=$saveLIBS
-            fi
-        fi
-    fi
-
-    if test "$have_libtiff" != 'yes'; then
-        AC_MSG_WARN(*** Native TIFF support will not be included ***)
-    fi
-fi
-
-PO_YES='#'
-if test "$gettext" != 'no'; then
-    have_intl_header='no'
-    gettext_ok='no'
-    needs_lintl='no'
-    
-    AC_CHECK_HEADER(libintl.h, have_intl_header='yes')
-    if test "$have_intl_header" = 'yes'; then
-        AC_CHECK_FUNC(gettext,gettext_ok='yes')
-        
-        if test "$gettext_ok" = 'no'; then
-            AC_CHECK_LIB(intl,gettext,[gettext_ok='yes'; needs_lintl='yes'])
-        fi
-    fi
-    
-    iconv_ok='no'
-    needs_liconv='no'
-    AC_CHECK_FUNC(iconv, [iconv_ok='yes'])
-    if test "$iconv_ok" = "no"; then
-        AC_CHECK_LIB([iconv], [iconv], [iconv_ok='yes'; needs_liconv='yes'])
-    fi
-    
-    AC_CHECK_PROG(MSGFMT, msgfmt, msgfmt)
-    if test "$MSGFMT" != ""; then 
-    if msgfmt --help 2>&1 | grep illegal >/dev/null ; then
-        echo "msgfmt isn't GNU version"
-        MSGFMT=""
-    fi
-    fi
-
-    if test "$MSGFMT" != "" -a "$gettext_ok" != "no" -a "$iconv_ok" != "no" ; then
-        echo "msgfmt, iconv() and gettext() exist; will build i18n support"
-        AC_DEFINE(HAVE_GETTEXT,,Define if we are building i18n support)
-        PO_YES=''
-        if test "$needs_lintl" != "no"; then
-            intl_libs="-lintl"
-            LIBS="$intl_libs $LIBS"
-        fi
-        if test "$needs_liconv" != "no"; then
-            iconv_libs="-liconv"
-            LIBS="$iconv_libs $LIBS"
-        fi
-    else
-        echo "msgfmt and libintl don't both exist; will not build i18n support"
-    fi
-fi
-
-AC_CHECK_HEADERS([locale.h stdlib.h string.h])
-
-AC_SUBST(target)
-AC_SUBST(mdjvulib)
-AC_SUBST(oext)
-AC_SUBST(OPTS)
-AC_SUBST(INCS)
-AC_SUBST(MSGFMT)
-AC_SUBST(LIBRARY_VERSION)
-AC_SUBST(DLLFLAGS)
-AC_SUBST(PO_YES)
-AC_SUBST(STATIC_YES)
-AC_SUBST(SHARED_YES)
+AC_CHECK_HEADERS([libintl.h locale.h stdint.h stdlib.h string.h])
 
 # Checks for typedefs, structures, and compiler characteristics.
 AC_HEADER_STDBOOL
 AC_C_INLINE
 AC_TYPE_SIZE_T
-
-CFLAGS="$CFLAGS -Wall -Wshadow"
-CFLAGS="$CFLAGS -pedantic-errors -Wpointer-arith -Waggregate-return"
-CFLAGS="$CFLAGS -Wlong-long -Wredundant-decls -Wcast-qual -Wcast-align"
-DEFS="$DEFS -D__STRICT_ANSI__ -DNDEBUG"
-OPTS="-Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations"
+AC_TYPE_INT16_T
+AC_TYPE_INT32_T
+AC_TYPE_SIZE_T
+AC_TYPE_UINT16_T
+AC_TYPE_UINT32_T
 
 # Checks for library functions.
 AC_FUNC_MALLOC
 AC_FUNC_REALLOC
 AC_CHECK_FUNCS([memset pow setlocale strcspn strrchr])
 
-AC_CONFIG_FILES([Makefile])
-AC_CONFIG_FILES([src/Makefile])
-AC_CONFIG_FILES([tools/Makefile])
-AC_CONFIG_FILES([po/Makefile])
+# Trailer
+AC_CONFIG_FILES([Makefile
+                 doc/Makefile
+                 doc/ru/Makefile
+                 include/Makefile
+		 po/Makefile.in])
 AC_OUTPUT
--- /dev/null
+++ minidjvu-0.8.svn.2010.05.06+dfsg/Makefile.am
@@ -0,0 +1,45 @@
+ACLOCAL_AMFLAGS = -I m4
+
+SUBDIRS = include doc po
+
+AM_CPPFLAGS = -Iinclude
+AM_CPPFLAGS += -D__STRICT_ANSI__
+AM_CPPFLAGS += -DNDEBUG
+
+WARNFLAGS = -Wall
+WARNFLAGS += -Wshadow
+WARNFLAGS += -pedantic-errors -Wpointer-arith -Waggregate-return
+WARNFLAGS += -Wlong-long -Wredundant-decls -Wcast-qual -Wcast-align
+WARNFLAGS += -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations
+
+AM_CFLAGS = $(WARNFLAGS)
+AM_CXXFLAGS = $(WARNFLAGS)
+
+localedir = $(datadir)/locale
+DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
+
+lib_LTLIBRARIES = libminidjvu.la
+
+libminidjvu_la_SOURCES = src/matcher/no_mdjvu.h src/matcher/bitmaps.h	\
+ src/matcher/common.h src/djvu/bs.h src/jb2/jb2coder.h			\
+ src/jb2/bmpcoder.h src/jb2/zp.h src/jb2/jb2const.h			\
+ src/base/mdjvucfg.h src/matcher/cuts.c src/matcher/patterns.c		\
+ src/matcher/frames.c src/matcher/bitmaps.c src/alg/nosubst.c		\
+ src/alg/erosion.c src/alg/smooth.c src/alg/delegate.c			\
+ src/alg/classify.c src/alg/render.c src/alg/clean.c			\
+ src/alg/adjust_y.c src/alg/blitsort.c src/alg/split.c			\
+ src/alg/average.c src/alg/compress.c src/djvu/djvuload.c		\
+ src/djvu/djvusave.c src/djvu/djvuinfo.c src/djvu/iff.c			\
+ src/image-io/tiffload.c src/image-io/tiff.c src/image-io/pbm.c		\
+ src/image-io/tiffsave.c src/image-io/bmp.c src/jb2/proto.c		\
+ src/base/3graymap.c src/base/2io.c src/base/5image.c			\
+ src/base/4bitmap.c src/base/version.c src/base/6string.c		\
+ src/base/1error.c src/base/0porting.c src/djvu/djvudir.cpp		\
+ src/djvu/bs.cpp src/jb2/jb2coder.cpp src/jb2/bmpcoder.cpp		\
+ src/jb2/jb2load.cpp src/jb2/zp.cpp src/jb2/jb2save.cpp
+
+bin_PROGRAMS = minidjvu
+
+minidjvu_SOURCES = tools/minidjvu.c
+
+minidjvu_LDADD = libminidjvu.la
--- minidjvu-0.8.svn.2010.05.06+dfsg.orig/wscript
+++ minidjvu-0.8.svn.2010.05.06+dfsg/wscript
@@ -14,7 +14,7 @@ def configure(conf):
     conf.check(header_name='math.h')
     conf.check(lib='m')
 
-    conf.check(header_name='tiffio.h', define_name='HAVE_TIFF')
+    conf.check(header_name='tiffio.h', define_name='HAVE_LIBTIFF')
     conf.check(lib='tiff')
 
     conf.check(header_name='libintl.h', define_name='HAVE_I18N')
--- minidjvu-0.8.svn.2010.05.06+dfsg.orig/INSTALL
+++ minidjvu-0.8.svn.2010.05.06+dfsg/INSTALL
@@ -1,8 +1,14 @@
-USUAL INSTALLATION
+USUAL AUTOTOOLS-BASED INSTALLATION
 __________________
 
 Check that development package of libtiff is installed.
-Run "make". Then, "make install" will copy bin/minidjvu into /usr/local/bin.
+Run:
+ autoreconf --install
+ ./configure
+ make
+ make install
+Will install minidjvu executable into /usr/local/bin/, as well as
+various support files, documentation, development files, etc.
 
 
 
@@ -27,7 +33,7 @@ The release directory should be treated
 The library is built from sources in `minidjvu' subdirectory.
 The program is built from sources in `src' subdirectory.
 
-To enable TIFF support, define HAVE_TIFF to 1, add libtiff include directory
+To enable TIFF support, define HAVE_LIBTIFF to 1, add libtiff include directory
 to the include path, then link against libtiff.
 
 
@@ -41,7 +47,7 @@ Under Linux, you can always try somethin
     
 or, if you want TIFF support,
 
-    g++ -DHAVE_TIFF=1 -I. `find -name "*.c*"` -O2 -ltiff -o bin/minidjvu
+    g++ -DHAVE_LIBTIFF=1 -I. `find -name "*.c*"` -O2 -ltiff -o bin/minidjvu
 
 Under MSVC, watch for those __declspec directives in
 `minidjvu/base/0porting/0porting.h' - if you wish a DLL, turn them on.
--- /dev/null
+++ minidjvu-0.8.svn.2010.05.06+dfsg/po/Makevars
@@ -0,0 +1,41 @@
+# Makefile variables for PO directory in any package using GNU gettext.
+
+# Usually the message domain is the same as the package name.
+DOMAIN = $(PACKAGE)
+
+# These two variables depend on the location of this directory.
+subdir = po
+top_builddir = ..
+
+# These options get passed to xgettext.
+XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
+
+# This is the copyright holder that gets inserted into the header of the
+# $(DOMAIN).pot file.  Set this to the copyright holder of the surrounding
+# package.  (Note that the msgstr strings, extracted from the package's
+# sources, belong to the copyright holder of the package.)  Translators are
+# expected to transfer the copyright for their translations to this person
+# or entity, or to disclaim their copyright.  The empty string stands for
+# the public domain; in this case the translators are expected to disclaim
+# their copyright.
+COPYRIGHT_HOLDER = Ilya Mezhirov and Alexey Kryukov
+
+# This is the email address or URL to which the translators shall report
+# bugs in the untranslated strings:
+# - Strings which are not entire sentences, see the maintainer guidelines
+#   in the GNU gettext documentation, section 'Preparing Strings'.
+# - Strings which use unclear terms or require additional context to be
+#   understood.
+# - Strings which make invalid assumptions about notation of date, time or
+#   money.
+# - Pluralisation problems.
+# - Incorrect English spelling.
+# - Incorrect formatting.
+# It can be your email address, or a mailing list address where translators
+# can write to without being subscribed, or the URL of a web page through
+# which the translators can contact you.
+MSGID_BUGS_ADDRESS = alexios@thessalonica.org.ru
+
+# This is the list of locale categories, beyond LC_MESSAGES, for which the
+# message catalogs shall be used.  It is usually empty.
+EXTRA_LOCALE_CATEGORIES =
--- /dev/null
+++ minidjvu-0.8.svn.2010.05.06+dfsg/po/LINGUAS
@@ -0,0 +1 @@
+ru
--- minidjvu-0.8.svn.2010.05.06+dfsg.orig/po/ru.po
+++ minidjvu-0.8.svn.2010.05.06+dfsg/po/ru.po
@@ -6,215 +6,402 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: Minidjvu 0.8\n"
-"Report-Msgid-Bugs-To: Alexey Kryukov <alexios@thessalonica.org.ru>\n"
-"POT-Creation-Date: 2009-06-27 14:05+0400\n"
+"Report-Msgid-Bugs-To: alexios@thessalonica.org.ru\n"
+"POT-Creation-Date: 2012-11-14 07:53+0000\n"
 "PO-Revision-Date: 2009-06-27 14:05+0400\n"
 "Last-Translator: Alexey Kryukov <alexios@thessalonica.org.ru>\n"
 "Language-Team: Russian <ru@li.org>\n"
+"Language: ru\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
 "X-Poedit-Language: Russian\n"
 "X-Poedit-Country: RUSSIAN FEDERATION\n"
 
-#: minidjvu.c:92
+#: src/alg/compress.c:154
+msgid "deciding what pieces are letters"
+msgstr "выясняем, какие из участков являются буквами"
+
+#: src/alg/compress.c:157
+msgid "sorting blits"
+msgstr "сортировка блитов"
+
+#: src/alg/compress.c:159
+msgid "sorting bitmaps"
+msgstr "сортировка картинок"
+
+#: src/alg/compress.c:164
+msgid "matching patterns"
+msgstr "сопоставление с образцами"
+
+#: src/alg/compress.c:167
+msgid "adjusting substitution coordinates"
+msgstr "уточняются координаты подстановки"
+
+#: src/alg/compress.c:170
+msgid "removing unused bitmaps"
+msgstr "удаление неиспользуемых картинок"
+
+#: src/alg/compress.c:175
 #, c-format
-msgid "Cannot generate a unique name for %s\n"
-msgstr "Не удалось создать уникальное имя для %s\n"
+msgid "the image now has %d bitmaps\n"
+msgstr "теперь изображение содержит %d картинок\n"
+
+#: src/alg/compress.c:181
+msgid "sorting bitmaps (again)"
+msgstr "повторная сортировка картинок"
+
+#: src/alg/compress.c:192
+msgid "finding prototypes"
+msgstr "поиск прототипов"
+
+#: src/alg/compress.c:196
+#, c-format
+msgid "%d bitmaps have prototypes\n"
+msgstr "%d картинок имеют прототипы\n"
+
+#: src/alg/compress.c:288
+#, c-format
+msgid "Classification: %d of %d completed\n"
+msgstr "Классификация: выполнено %d из %d\n"
+
+#: src/alg/compress.c:298
+#, c-format
+msgid "Prototype search: %d of %d completed\n"
+msgstr "Поиск прототипов: выполнено %d из %d\n"
+
+#: src/alg/compress.c:319
+#, c-format
+msgid "deciding what pieces are letters in page #%d\n"
+msgstr "выясняем, какие из участков на странице #%d являются буквами\n"
+
+#: src/alg/compress.c:322
+#, c-format
+msgid "sorting letters in page #%d\n"
+msgstr "сортировка букв на странице #%d\n"
+
+#: src/alg/compress.c:331
+#, c-format
+msgid "started classification\n"
+msgstr "начинается классификация\n"
+
+#: src/alg/compress.c:336
+#, c-format
+msgid "finished classification\n"
+msgstr "классификация окончена\n"
+
+#: src/alg/compress.c:369
+#, c-format
+msgid "started prototype search\n"
+msgstr "начинается поиск прототипов\n"
+
+#: src/alg/compress.c:372
+#, c-format
+msgid "finished prototype search\n"
+msgstr "поиск прототипов окончен\n"
+
+#: src/base/1error.c:18
+msgid "unable to write to file"
+msgstr "запись в файл невозможна"
+
+#: src/base/1error.c:20
+msgid "unable to read from file"
+msgstr "чтение из файла невозможно"
+
+#: src/base/1error.c:22
+msgid "I/O error"
+msgstr "ошибка ввода/вывода"
 
-#: minidjvu.c:115
+#: src/base/1error.c:24
+msgid "bad PBM file"
+msgstr "неподходящий файл PBM"
+
+#: src/base/1error.c:26
+msgid "bad Windows BMP file (perhaps it has non-bitonal data)"
+msgstr "неподходящий файл BMP (вероятно, изображение не является монохромным)"
+
+#: src/base/1error.c:28
+msgid "bad DjVu file"
+msgstr "неподходящий файл DjVu"
+
+#: src/base/1error.c:30
+msgid "bad bilevel data in DjVu file"
+msgstr "неподходящий формат монохромного изображения в файле DjVu"
+
+#: src/base/1error.c:32
+msgid "bad TIFF file (perhaps it has non-bitonal data)"
+msgstr "неподходящий файл TIFF (вероятно, изображение не является монохромным)"
+
+#: src/base/1error.c:34
+msgid "unsupported type of DjVu file"
+msgstr "эта разновидность файлов DjVu не поддерживается"
+
+#: src/base/1error.c:36
+msgid "bilevel data not found in DjVu file"
+msgstr "монохромное изображение не найдено в файле DjVu"
+
+#: src/base/1error.c:38
+msgid "somehow prototype references recursed"
+msgstr "ссылки на прототип находятся в циклической зависимости"
+
+#: src/base/1error.c:40
+msgid "minidjvu was compiled without TIFF support"
+msgstr "minidjvu собран без поддержки TIFF"
+
+#: src/base/1error.c:42
+msgid "minidjvu was compiled without PNG support"
+msgstr "minidjvu собран без поддержки PNG"
+
+#: src/base/1error.c:45
+msgid "some weird error happened, probably caused by a bug in minidjvu"
+msgstr ""
+"Произошла непонятная ошибка. Скорее всего, она вызвана ошибкой в коде "
+"minidjvu."
+
+#: tools/minidjvu.c:93
 #, c-format
+msgid "Cannot generate a unique name for %s\n"
+msgstr "Не удалось создать уникальное имя для %s\n"
 
+#: tools/minidjvu.c:116
 msgid "encode/decode bitonal DjVu files"
 msgstr "кодирование и расшифровка монохромных DJVU-файлов"
 
-#: minidjvu.c:119
+#: tools/minidjvu.c:119
+#, c-format
+msgid "minidjvu - %s\n"
+msgstr ""
+
+#: tools/minidjvu.c:120
 #, c-format
 msgid "Warning: program and library version mismatch:\n"
 msgstr "Предупреждение: версии программы и библиотеки не совпадают:\n"
 
-#: minidjvu.c:120
-#, c-format
-msgid  "    program version %s, library version %s.\n"
+#: tools/minidjvu.c:121
+#, fuzzy, c-format
+msgid ""
+"    program version %s, library version %s.\n"
+"\n"
 msgstr "    версия программы %s, версия библиотеки %s.\n"
 
-#: minidjvu.c:128
+#: tools/minidjvu.c:129
 #, c-format
 msgid "Usage:\n"
 msgstr "Использование:\n"
 
-#: minidjvu.c:129
+#: tools/minidjvu.c:130
 #, c-format
 msgid "single page encoding/decoding:\n"
 msgstr "кодирование или расшифровка одиночной страницы:\n"
 
-#: minidjvu.c:131
+#: tools/minidjvu.c:131
+#, c-format
+msgid "    minidjvu [options] <input file> <output file>\n"
+msgstr ""
+
+#: tools/minidjvu.c:132
 #, c-format
 msgid "multiple pages encoding:\n"
 msgstr "многостраничное кодирование:\n"
 
-#: minidjvu.c:133
+#: tools/minidjvu.c:133
+#, c-format
+msgid "    minidjvu [options] <input file> ... <output file>\n"
+msgstr ""
+
+#: tools/minidjvu.c:134
 #, c-format
 msgid "Formats supported:\n"
 msgstr "Поддерживаемые форматы:\n"
 
-#: minidjvu.c:135
+#: tools/minidjvu.c:136
 #, c-format
-msgid  "    DjVu (single-page bitonal), PBM, Windows BMP"
+msgid "    DjVu (single-page bitonal), PBM, Windows BMP"
 msgstr "    DjVu (одностраничный монохромный), PBM, Windows BMP"
 
-#: minidjvu.c:137
+#: tools/minidjvu.c:138
 #, c-format
 msgid ", TIFF.\n"
 msgstr ", TIFF.\n"
 
-#: minidjvu.c:139
+#: tools/minidjvu.c:140
 #, c-format
 msgid "; TIFF support is OFF.\n"
 msgstr "; поддержка TIFF отключена.\n"
 
-#: minidjvu.c:141
+#: tools/minidjvu.c:142
 #, c-format
 msgid "Options:\n"
 msgstr "Параметры:\n"
 
-#: minidjvu.c:142
+#: tools/minidjvu.c:143
 #, c-format
-msgid  "    -A, --Averaging:               compute \"average\" representatives\n"
-msgstr "    -A, --Averaging:               вычислять усредненные варианты представления символов\n"
+msgid ""
+"    -A, --Averaging:               compute \"average\" representatives\n"
+msgstr ""
+"    -A, --Averaging:               вычислять усредненные варианты "
+"представления символов\n"
 
-#: minidjvu.c:143
+#: tools/minidjvu.c:144
 #, c-format
-msgid  "    -a <n>, --aggression <n>:      set aggression level (default 100)\n"
-msgstr "    -a <n>, --aggression <n>:      установить уровень агрессии (по умолчанию 100)\n"
+msgid "    -a <n>, --aggression <n>:      set aggression level (default 100)\n"
+msgstr ""
+"    -a <n>, --aggression <n>:      установить уровень агрессии (по умолчанию "
+"100)\n"
 
-#: minidjvu.c:144
+#: tools/minidjvu.c:145
 #, c-format
-msgid  "    -c, --clean                    remove small black pieces\n"
+msgid "    -c, --clean                    remove small black pieces\n"
 msgstr "    -c, --clean                    удалять небольшие черные пятна\n"
 
-#: minidjvu.c:145
+#: tools/minidjvu.c:146
 #, c-format
-msgid  "    -d <n> --dpi <n>:              set resolution in dots per inch\n"
-msgstr "    -d <n> --dpi <n>:              установить разрешение в точках на дюйм\n"
+msgid "    -d <n> --dpi <n>:              set resolution in dots per inch\n"
+msgstr ""
+"    -d <n> --dpi <n>:              установить разрешение в точках на дюйм\n"
 
-#: minidjvu.c:146
+#: tools/minidjvu.c:147
 #, c-format
-msgid  "    -e, --erosion                  sacrifice quality to gain in size\n"
-msgstr "    -e, --erosion                  пожертвовать качеством ради выигрыша в объеме\n"
+msgid "    -e, --erosion                  sacrifice quality to gain in size\n"
+msgstr ""
+"    -e, --erosion                  пожертвовать качеством ради выигрыша в "
+"объеме\n"
 
-#: minidjvu.c:147
+#: tools/minidjvu.c:148
 #, c-format
-msgid  "    -i, --indirect:                generate an indirect multipage document\n"
-msgstr "    -i, --indirect:                сохранять каждую страницу документа как отдельный файл\n"
+msgid ""
+"    -i, --indirect:                generate an indirect multipage document\n"
+msgstr ""
+"    -i, --indirect:                сохранять каждую страницу документа как "
+"отдельный файл\n"
 
-#: minidjvu.c:148
+#: tools/minidjvu.c:149
 #, c-format
-msgid  "    -l, --lossy:                   use all lossy options (-s -c -m -e -A)\n"
-msgstr "    -l, --lossy:                   включить все параметры сжатия с потерями (-s -c -m -e -A)\n"
+msgid ""
+"    -l, --lossy:                   use all lossy options (-s -c -m -e -A)\n"
+msgstr ""
+"    -l, --lossy:                   включить все параметры сжатия с потерями "
+"(-s -c -m -e -A)\n"
 
-#: minidjvu.c:149
+#: tools/minidjvu.c:150
 #, c-format
-msgid  "    -m, --match:                   match and substitute patterns\n"
-msgstr "    -m, --match:                   использовать сравнение и подстановку образцов\n"
+msgid "    -m, --match:                   match and substitute patterns\n"
+msgstr ""
+"    -m, --match:                   использовать сравнение и подстановку "
+"образцов\n"
 
-#: minidjvu.c:150
+#: tools/minidjvu.c:151
 #, c-format
-msgid  "    -n, --no-prototypes:           do not search for prototypes\n"
+msgid "    -n, --no-prototypes:           do not search for prototypes\n"
 msgstr "    -n, --no-prototypes:           отказаться от поиска прототипов\n"
 
-#: minidjvu.c:151
+#: tools/minidjvu.c:152
 #, c-format
-msgid  "    -p <n>, --pages-per-dict <n>:  pages per dictionary (default 10)\n"
-msgstr "    -p <n>, --pages-per-dict <n>:  количество страниц в словаре (по умолчанию 10)\n"
+msgid "    -p <n>, --pages-per-dict <n>:  pages per dictionary (default 10)\n"
+msgstr ""
+"    -p <n>, --pages-per-dict <n>:  количество страниц в словаре (по "
+"умолчанию 10)\n"
 
-#: minidjvu.c:152
+#: tools/minidjvu.c:153
 #, c-format
-msgid  "    -r, --report:                  report multipage coding progress\n"
-msgstr "    -r, --report:                  информировать о ходе многостраничного кодирования\n"
+msgid "    -r, --report:                  report multipage coding progress\n"
+msgstr ""
+"    -r, --report:                  информировать о ходе многостраничного "
+"кодирования\n"
 
-#: minidjvu.c:153
+#: tools/minidjvu.c:154
 #, c-format
-msgid  "    -s, --smooth:                  remove some badly looking pixels\n"
-msgstr "    -s, --smooth:                  удалять отдельные неудачные пиксели\n"
+msgid "    -s, --smooth:                  remove some badly looking pixels\n"
+msgstr ""
+"    -s, --smooth:                  удалять отдельные неудачные пиксели\n"
 
-#: minidjvu.c:154
+#: tools/minidjvu.c:155
 #, c-format
-msgid  "    -v, --verbose:                 print messages about everything\n"
+msgid "    -v, --verbose:                 print messages about everything\n"
 msgstr "    -v, --verbose:                 сообщать обо всех операциях\n"
 
-#: minidjvu.c:155
+#: tools/minidjvu.c:156
+#, fuzzy, c-format
+msgid ""
+"    -X, --Xtension:                file extension for shared dictionary "
+"files\n"
+msgstr ""
+"    -e, --erosion                  пожертвовать качеством ради выигрыша в "
+"объеме\n"
+
+#: tools/minidjvu.c:157
 #, c-format
-msgid  "    -w, --warnings:                do not suppress TIFF warnings\n"
+msgid "    -w, --warnings:                do not suppress TIFF warnings\n"
 msgstr "    -w, --warnings:                не подавлять предупреждения TIFF\n"
 
-#: minidjvu.c:156
+#: tools/minidjvu.c:158
 #, c-format
 msgid "See the man page for detailed description of each option.\n"
 msgstr "Подробное описание всех параметров содержится в руководстве man.\n"
 
-#: minidjvu.c:184
+#: tools/minidjvu.c:186
 #, c-format
 msgid "loading a DjVu page from `%s'\n"
 msgstr "загрузка страницы DjVu из файла `%s'\n"
 
-#: minidjvu.c:193
+#: tools/minidjvu.c:195
 #, c-format
 msgid "loaded; the page has %d bitmaps and %d blits\n"
 msgstr "загрузка завершена; страница содержит %d картинок и %d блитов\n"
 
-#: minidjvu.c:228
+#: tools/minidjvu.c:230
 #, c-format
 msgid "encoding to `%s'\n"
 msgstr "кодирование в файл `%s'\n"
 
-#: minidjvu.c:244
+#: tools/minidjvu.c:246
 #, c-format
 msgid "loading from Windows BMP file `%s'\n"
 msgstr "загрузка изображения из файла Windows BMP `%s'\n"
 
-#: minidjvu.c:249
+#: tools/minidjvu.c:251
 #, c-format
 msgid "loading from TIFF file `%s'\n"
 msgstr "загрузка изображения из файла TIFF `%s'\n"
 
-#: minidjvu.c:256
+#: tools/minidjvu.c:258
 #, c-format
 msgid "resolution is %d dpi\n"
 msgstr "разрешение составляет %d dpi\n"
 
-#: minidjvu.c:265 minidjvu.c:337
+#: tools/minidjvu.c:267 tools/minidjvu.c:339
 #, c-format
 msgid "bitmap %d x %d rendered\n"
 msgstr "загружено битовое изображение %d x %d\n"
 
-#: minidjvu.c:272
+#: tools/minidjvu.c:274
 #, c-format
 msgid "loading from PBM file `%s'\n"
 msgstr "загрузка изображения из файла PBM `%s'\n"
 
-#: minidjvu.c:284 minidjvu.c:344
+#: tools/minidjvu.c:286 tools/minidjvu.c:346
 #, c-format
 msgid "smoothing the bitmap\n"
 msgstr "сглаживание битового изображения\n"
 
-#: minidjvu.c:298
+#: tools/minidjvu.c:300
 #, c-format
 msgid "saving to Windows BMP file `%s'\n"
 msgstr "сохранение в файл Windows BMP `%s'\n"
 
-#: minidjvu.c:303
+#: tools/minidjvu.c:305
 #, c-format
 msgid "saving to TIFF file `%s'\n"
 msgstr "сохранение в файл TIFF `%s'\n"
 
-#: minidjvu.c:310
+#: tools/minidjvu.c:312
 #, c-format
 msgid "saving to PBM file `%s'\n"
 msgstr "сохранение в файл PBM `%s'\n"
 
-#: minidjvu.c:328
+#: tools/minidjvu.c:330
 #, c-format
 msgid ""
 "\n"
@@ -223,7 +410,7 @@ msgstr ""
 "\n"
 "РАСШИФРОВКА\n"
 
-#: minidjvu.c:329 minidjvu.c:384
+#: tools/minidjvu.c:331 tools/minidjvu.c:386
 #, c-format
 msgid ""
 "________\n"
@@ -232,27 +419,27 @@ msgstr ""
 "___________\n"
 "\n"
 
-#: minidjvu.c:356
+#: tools/minidjvu.c:358
 #, c-format
 msgid "splitting the bitmap into pieces\n"
 msgstr "разбивка битового изображение на участки\n"
 
-#: minidjvu.c:361
+#: tools/minidjvu.c:363
 #, c-format
-msgid "the splitted image has %d pieces\n"
+msgid "the split image has %d pieces\n"
 msgstr "после разбиения картинка состоит из %d участков\n"
 
-#: minidjvu.c:366
+#: tools/minidjvu.c:368
 #, c-format
 msgid "cleaning\n"
 msgstr "очистка\n"
 
-#: minidjvu.c:370
+#: tools/minidjvu.c:372
 #, c-format
 msgid "the cleaned image has %d pieces\n"
 msgstr "после очистки картинка состоит из %d участков\n"
 
-#: minidjvu.c:383
+#: tools/minidjvu.c:385
 #, c-format
 msgid ""
 "\n"
@@ -261,7 +448,7 @@ msgstr ""
 "\n"
 "КОДИРОВАНИЕ\n"
 
-#: minidjvu.c:399
+#: tools/minidjvu.c:401
 #, c-format
 msgid ""
 "\n"
@@ -270,7 +457,7 @@ msgstr ""
 "\n"
 "ФИЛЬТРОВКА\n"
 
-#: minidjvu.c:400
+#: tools/minidjvu.c:402
 #, c-format
 msgid ""
 "_________\n"
@@ -279,17 +466,19 @@ msgstr ""
 "__________\n"
 "\n"
 
-#: minidjvu.c:443
+#: tools/minidjvu.c:447
 #, c-format
 msgid "when encoding many pages, output file must be DjVu\n"
-msgstr "при многостраничном кодировании результирующий файл должен быть в формате DjVu\n"
+msgstr ""
+"при многостраничном кодировании результирующий файл должен быть в формате "
+"DjVu\n"
 
-#: minidjvu.c:451
+#: tools/minidjvu.c:455
 #, c-format
 msgid "Could not create a temporary file\n"
 msgstr "Не удалось создать временный файл\n"
 
-#: minidjvu.c:456
+#: tools/minidjvu.c:460
 #, c-format
 msgid ""
 "\n"
@@ -298,7 +487,7 @@ msgstr ""
 "\n"
 "МНОГОСТРАНИЧНОЕ КОДИРОВАНИЕ\n"
 
-#: minidjvu.c:457
+#: tools/minidjvu.c:461
 #, c-format
 msgid ""
 "__________________\n"
@@ -307,181 +496,42 @@ msgstr ""
 "___________________________\n"
 "\n"
 
-#: minidjvu.c:458
+#: tools/minidjvu.c:462
 #, c-format
 msgid "%d pages total\n"
 msgstr "всего %d страниц\n"
 
-#: minidjvu.c:489
+#: tools/minidjvu.c:496
 #, c-format
 msgid "Loading: %d of %d completed\n"
 msgstr "Загрузка: выполнено %d из %d\n"
 
-#: minidjvu.c:517
+#: tools/minidjvu.c:524
 #, c-format
 msgid "saving page #%d into %s using dictionary %s\n"
 msgstr "сохранение страницы #%d в файл %s с использованием словаря %s\n"
 
-#: minidjvu.c:531
+#: tools/minidjvu.c:538
 #, c-format
 msgid "Saving: %d of %d completed\n"
 msgstr "Сохранение: выполнено %d из %d\n"
 
-#: minidjvu.c:624
+#: tools/minidjvu.c:631
 #, c-format
 msgid "bad --pages-per-dict value\n"
 msgstr "неподходящее значение --pages-per-dict\n"
 
-#: minidjvu.c:636
+#: tools/minidjvu.c:643
 #, c-format
 msgid "bad resolution\n"
 msgstr "неподходящее разрешение\n"
 
-#: minidjvu.c:651
+#: tools/minidjvu.c:664
 #, c-format
 msgid "unknown option: %s\n"
 msgstr "неизвестный параметр: %s\n"
 
-#: minidjvu.c:699
+#: tools/minidjvu.c:719
 #, c-format
 msgid "alive_bitmap_counter = %d\n"
 msgstr "счетчик битовых изображений = %d\n"
-
-#: compress.c:153
-msgid "deciding what pieces are letters"
-msgstr "выясняем, какие из участков являются буквами"
-
-#: compress.c:156
-msgid "sorting blits"
-msgstr "сортировка блитов"
-
-#: compress.c:158
-msgid "sorting bitmaps"
-msgstr "сортировка картинок"
-
-#: compress.c:163
-msgid "matching patterns"
-msgstr "сопоставление с образцами"
-
-#: compress.c:166
-msgid "adjusting substitution coordinates"
-msgstr "уточняются координаты подстановки"
-
-#: compress.c:169
-msgid "removing unused bitmaps"
-msgstr "удаление неиспользуемых картинок"
-
-#: compress.c:174
-#, c-format
-msgid "the image now has %d bitmaps\n"
-msgstr "теперь изображение содержит %d картинок\n"
-
-#: compress.c:180
-msgid "sorting bitmaps (again)"
-msgstr "повторная сортировка картинок"
-
-#: compress.c:191
-msgid "finding prototypes"
-msgstr "поиск прототипов"
-
-#: compress.c:195
-#, c-format
-msgid "%d bitmaps have prototypes\n"
-msgstr "%d картинок имеют прототипы\n"
-
-#: compress.c:287
-#, c-format
-msgid "Classification: %d of %d completed\n"
-msgstr "Классификация: выполнено %d из %d\n"
-
-#: compress.c:297
-#, c-format
-msgid "Prototype search: %d of %d completed\n"
-msgstr "Поиск прототипов: выполнено %d из %d\n"
-
-#: compress.c:318
-#, c-format
-msgid "deciding what pieces are letters in page #%d\n"
-msgstr "выясняем, какие из участков на странице #%d являются буквами\n"
-
-#: compress.c:321
-#, c-format
-msgid "sorting letters in page #%d\n"
-msgstr "сортировка букв на странице #%d\n"
-
-#: compress.c:330
-#, c-format
-msgid "started classification\n"
-msgstr "начинается классификация\n"
-
-#: compress.c:335
-#, c-format
-msgid "finished classification\n"
-msgstr "классификация окончена\n"
-
-#: compress.c:368
-#, c-format
-msgid "started prototype search\n"
-msgstr "начинается поиск прототипов\n"
-
-#: compress.c:371
-#, c-format
-msgid "finished prototype search\n"
-msgstr "поиск прототипов окончен\n"
-
-#: 1error.c:18
-msgid "unable to write to file"
-msgstr "запись в файл невозможна"
-
-#: 1error.c:20
-msgid "unable to read from file"
-msgstr "чтение из файла невозможно"
-
-#: 1error.c:22
-msgid "I/O error"
-msgstr "ошибка ввода/вывода"
-
-#: 1error.c:24
-msgid "bad PBM file"
-msgstr "неподходящий файл PBM"
-
-#: 1error.c:26
-msgid "bad Windows BMP file (perhaps it has non-bitonal data)"
-msgstr "неподходящий файл BMP (вероятно, изображение не является монохромным)"
-
-#: 1error.c:28
-msgid "bad DjVu file"
-msgstr "неподходящий файл DjVu"
-
-#: 1error.c:30
-msgid "bad bilevel data in DjVu file"
-msgstr "неподходящий формат монохромного изображения в файле DjVu"
-
-#: 1error.c:32
-msgid "bad TIFF file (perhaps it has non-bitonal data)"
-msgstr "неподходящий файл TIFF (вероятно, изображение не является монохромным)"
-
-#: 1error.c:34
-msgid "unsupported type of DjVu file"
-msgstr "эта разновидность файлов DjVu не поддерживается"
-
-#: 1error.c:36
-msgid "bilevel data not found in DjVu file"
-msgstr "монохромное изображение не найдено в файле DjVu"
-
-#: 1error.c:38
-msgid "somehow prototype references recursed"
-msgstr "ссылки на прототип находятся в циклической зависимости"
-
-#: 1error.c:40
-msgid "minidjvu was compiled without TIFF support"
-msgstr "minidjvu собран без поддержки TIFF"
-
-#: 1error.c:42
-msgid "minidjvu was compiled without PNG support"
-msgstr "minidjvu собран без поддержки PNG"
-
-#: 1error.c:45
-msgid "some weird error happened, probably caused by a bug in minidjvu"
-msgstr "Произошла непонятная ошибка. Скорее всего, она вызвана ошибкой в коде minidjvu."
-
--- /dev/null
+++ minidjvu-0.8.svn.2010.05.06+dfsg/po/POTFILES.in
@@ -0,0 +1,5 @@
+# List of source files which contain translatable strings.
+src/alg/compress.c
+src/base/1error.c
+src/base/mdjvucfg.h
+tools/minidjvu.c
--- /dev/null
+++ minidjvu-0.8.svn.2010.05.06+dfsg/include/Makefile.am
@@ -0,0 +1,13 @@
+nobase_include_HEADERS = minidjvu/jb2.h minidjvu/alg/classify.h		\
+ minidjvu/alg/compress.h minidjvu/alg/split.h minidjvu/alg/render.h	\
+ minidjvu/alg/smooth.h minidjvu/alg/alg.h minidjvu/alg/adjust_y.h	\
+ minidjvu/alg/clean.h minidjvu/alg/nosubst.h minidjvu/alg/erosion.h	\
+ minidjvu/alg/blitsort.h minidjvu/alg/delegate.h			\
+ minidjvu/alg/average.h minidjvu/djvu/iff.h minidjvu/djvu/djvu.h	\
+ minidjvu/image-io/tiff.h minidjvu/image-io/pbm.h			\
+ minidjvu/image-io/image-io.h minidjvu/image-io/bmp.h			\
+ minidjvu/minidjvu.h minidjvu/base/4bitmap.h minidjvu/base/1error.h	\
+ minidjvu/base/3graymap.h minidjvu/base/0porting.h			\
+ minidjvu/base/version.h minidjvu/base/6string.h			\
+ minidjvu/base/5image.h minidjvu/base/base.h minidjvu/base/2io.h	\
+ minidjvu/matcher.h
--- minidjvu-0.8.svn.2010.05.06+dfsg.orig/include/minidjvu/alg/smooth.h
+++ minidjvu-0.8.svn.2010.05.06+dfsg/include/minidjvu/alg/smooth.h
@@ -4,7 +4,7 @@
 
 
 /*
- * `smooth' is applied to a bitmap even before it's splitted.
+ * `smooth' is applied to a bitmap even before it is split.
  * 
  * Right now, the algorithm flips pixels which are surrounded
  * by at least 3 of 4 neighboring pixels of another color.
--- /dev/null
+++ minidjvu-0.8.svn.2010.05.06+dfsg/doc/Makefile.am
@@ -0,0 +1,5 @@
+SUBDIRS = ru
+
+dist_man_MANS = minidjvu.1
+
+doc_DATA = decode.html encode.html tifftodjvu_help.html
--- /dev/null
+++ minidjvu-0.8.svn.2010.05.06+dfsg/doc/ru/Makefile.am
@@ -0,0 +1,2 @@
+mandir = @mandir@/ru
+dist_man_MANS = minidjvu.1
--- minidjvu-0.8.svn.2010.05.06+dfsg.orig/src/image-io/tiffload.c
+++ minidjvu-0.8.svn.2010.05.06+dfsg/src/image-io/tiffload.c
@@ -4,7 +4,7 @@
 
 #include "../base/mdjvucfg.h"
 
-#if HAVE_TIFF
+#ifdef HAVE_LIBTIFF
     #include <tiffio.h>
     #define MDJVU_USE_TIFFIO
 #endif
@@ -13,7 +13,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#if HAVE_TIFF
+#ifdef HAVE_LIBTIFF
 
 static mdjvu_bitmap_t load_tiff(const char *path, int32 *presolution, mdjvu_error_t *perr, uint32 idx)
 {
@@ -134,11 +134,11 @@ MDJVU_IMPLEMENT uint32 mdjvu_get_tiff_pa
     return dircount;
 }
 
-#endif /* HAVE_TIFF */
+#endif /* HAVE_LIBTIFF */
 
 MDJVU_IMPLEMENT mdjvu_bitmap_t mdjvu_load_tiff(const char *path, int32 *presolution, mdjvu_error_t *perr, uint32 idx)
 {
-    #if HAVE_TIFF
+    #ifdef HAVE_LIBTIFF
         return load_tiff(path, presolution, perr, idx);
     #else
         *perr = mdjvu_get_error(mdjvu_error_tiff_support_disabled);
--- minidjvu-0.8.svn.2010.05.06+dfsg.orig/src/image-io/tiff.c
+++ minidjvu-0.8.svn.2010.05.06+dfsg/src/image-io/tiff.c
@@ -4,7 +4,7 @@
 
 #include "../base/mdjvucfg.h"
 
-#if HAVE_TIFF
+#ifdef HAVE_LIBTIFF
     #include <tiffio.h>
     #define MDJVU_USE_TIFFIO
 #endif
@@ -14,7 +14,7 @@
 
 MDJVU_IMPLEMENT int mdjvu_have_tiff_support(void)
 {
-    #if HAVE_TIFF
+    #ifdef HAVE_LIBTIFF
         return 1;
     #else
         return 0;
@@ -23,7 +23,7 @@ MDJVU_IMPLEMENT int mdjvu_have_tiff_supp
 
 MDJVU_IMPLEMENT void mdjvu_disable_tiff_warnings(void)
 {
-    #if HAVE_TIFF
+    #ifdef HAVE_LIBTIFF
         TIFFSetWarningHandler(NULL);
     #endif
 }
--- minidjvu-0.8.svn.2010.05.06+dfsg.orig/src/image-io/tiffsave.c
+++ minidjvu-0.8.svn.2010.05.06+dfsg/src/image-io/tiffsave.c
@@ -4,14 +4,14 @@
 
 #include "../base/mdjvucfg.h"
 
-#if HAVE_TIFF
+#ifdef HAVE_LIBTIFF
     #include <tiffio.h>
     #define MDJVU_USE_TIFFIO
 #endif
 
 #include <minidjvu/minidjvu.h>
 
-#if HAVE_TIFF
+#ifdef HAVE_LIBTIFF
 
 #ifndef COMPRESSION_PACKBITS
     #define COMPRESSION_PACKBITS 32771
@@ -64,11 +64,11 @@ static int save_tiff(mdjvu_bitmap_t bitm
     return 1;
 }
 
-#endif /* HAVE_TIFF */
+#endif /* HAVE_LIBTIFF */
 
 MDJVU_IMPLEMENT int mdjvu_save_tiff(mdjvu_bitmap_t bitmap, const char *path, mdjvu_error_t *perr)
 {
-    #if HAVE_TIFF
+    #ifdef HAVE_LIBTIFF
         return save_tiff(bitmap, path, perr);
     #else
         *perr = mdjvu_get_error(mdjvu_error_tiff_support_disabled);
--- /dev/null
+++ minidjvu-0.8.svn.2010.05.06+dfsg/m4/doorjam
@@ -0,0 +1 @@
+hold the m4 door open
--- minidjvu-0.8.svn.2010.05.06+dfsg.orig/tools/minidjvu.c
+++ minidjvu-0.8.svn.2010.05.06+dfsg/tools/minidjvu.c
@@ -3,7 +3,7 @@
  */
 
 #include <minidjvu/minidjvu.h>
-#include "../src/base/mdjvucfg.h" /* for i18n, HAVE_TIFF */
+#include "../src/base/mdjvucfg.h" /* for i18n, HAVE_LIBTIFF */
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -38,8 +38,8 @@ const char* dict_suffix = NULL;
 
 static int get_ext_delim_pos(const char *fname)
 {
-    int pos = strcspn(fname,".");
-    int last = 0;
+    size_t pos = strcspn(fname,".");
+    size_t last = 0;
     
     while (last + pos != strlen(fname))
     {
@@ -360,7 +360,7 @@ static mdjvu_image_t split_and_destroy(m
     mdjvu_bitmap_destroy(bitmap);
     if (verbose)
     {
-        printf(_("the splitted image has %d pieces\n"),
+        printf(_("the split image has %d pieces\n"),
                 mdjvu_image_get_blit_count(image));
     }
     if (clean)
@@ -671,7 +671,7 @@ static int process_options(int argc, cha
 int main(int argc, char **argv)
 {
     int arg_start;
-#ifdef HAVE_TIFF
+#ifdef HAVE_LIBTIFF
     int tiff_cnt;
 #endif
 
@@ -695,7 +695,7 @@ int main(int argc, char **argv)
     {
         multipage_encode(argc - 2, argv + 1, argv[argc - 1], 0);
     }
-#ifdef HAVE_TIFF
+#ifdef HAVE_LIBTIFF
     else if (decide_if_tiff(argv[1]) && (tiff_cnt = mdjvu_get_tiff_page_count(argv[1])) > 1 )
     {
         multipage_encode(tiff_cnt, argv + 1, argv[argc - 1], 1);
