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.
 .
 djvulibre (3.5.25.2-4) unstable; urgency=low
 .
   * generalize pre-dependency
   * remove unused override from debian/rules (closes: #664292)
   * lower djvudigital default resolution from 600 to 300 dpi (closes: #507539)
Author: Barak A. Pearlmutter <bap@debian.org>
Bug-Debian: http://bugs.debian.org/507539
Bug-Debian: http://bugs.debian.org/664292

---
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>

--- djvulibre-3.5.25.2.orig/configure.ac
+++ djvulibre-3.5.25.2/configure.ac
@@ -98,8 +98,9 @@ AC_PROG_LN_S
 AC_PATH_PROG(AR, ar)
 AC_PATH_PROG(TOUCH, touch)
 AC_PATH_PROG(MKDIR, mkdir)
-AC_PATH_PROG(RSVG, rsvg, false)
+AC_PATH_PROG(RSVG, rsvg-convert, false)
 AC_PATH_PROG(CONVERT, convert, false)
+AC_PATH_PROG(INKSCAPE, inkscape, false)
 AC_PROG_INSTALL
 
 # tweak rm to make libtool happy
--- djvulibre-3.5.25.2.orig/configure
+++ djvulibre-3.5.25.2/configure
@@ -3113,8 +3113,8 @@ $as_echo "no" >&6; }
 fi
 
 
-# Extract the first word of "rsvg", so it can be a program name with args.
-set dummy rsvg; ac_word=$2
+# Extract the first word of "rsvg-convert", so it can be a program name with args.
+set dummy rsvg-convert; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_path_RSVG+set}" = set; then :
--- djvulibre-3.5.25.2.orig/desktopfiles/register-djvu-mime.in
+++ djvulibre-3.5.25.2/desktopfiles/register-djvu-mime.in
@@ -56,35 +56,29 @@ export XDG_DATA_DIRS
 # proceed
 case "$1" in
 install)
-   "$xdg_icon_resource" install --noupdate --context mimetypes \
-       --size 22 ./hi22-djvu.png image-vnd.djvu
-   "$xdg_icon_resource" install --noupdate --context mimetypes \
-       --size 32 ./hi32-djvu.png image-vnd.djvu
-   "$xdg_icon_resource" install --noupdate --context mimetypes \
-       --size 48 ./hi48-djvu.png image-vnd.djvu
-   "$xdg_icon_resource" install --noupdate --context mimetypes \
-       --size 64 ./hi64-djvu.png image-vnd.djvu
+   for n in hi*-djvu.png ; do
+       s=`echo $n | sed -e 's/[a-z]*\([0-9]*\).*/\1/'`
+       "$xdg_icon_resource" install --noupdate --mode system \
+           --context mimetypes --size $s "$n" image-vnd.djvu
+   done
    "$xdg_icon_resource" forceupdate
    ## This is disabled to avoid conflicting with the
    ## djvu information provided by freedesktop.org
    ## "$xdg_mime" install ./djvulibre-mime.xml
    ;;
 uninstall)
-   "$xdg_icon_resource" uninstall --noupdate --context mimetypes \
-       --size 22 image-vnd.djvu
-   "$xdg_icon_resource" uninstall --noupdate --context mimetypes \
-       --size 32 image-vnd.djvu
-   "$xdg_icon_resource" uninstall --noupdate --context mimetypes \
-       --size 48 image-vnd.djvu
-   "$xdg_icon_resource" uninstall --noupdate --context mimetypes \
-       --size 64 image-vnd.djvu
+   for n in hi*-djvu.png ; do
+       s=`echo $n | sed -e 's/[a-z]*\([0-9]*\).*/\1/'`
+       "$xdg_icon_resource" uninstall --noupdate --mode system \
+           --context mimetypes --size $s "$n" image-vnd.djvu
+   done
    "$xdg_icon_resource" forceupdate
    ## This is disabled to avoid conflicting with the
    ## djvu information provided by freedesktop.org
    ## "$xdg_mime" uninstall ./djvulibre-mime.xml
    ;;
 *)
-   echo 1>&2 "Usage: $0 {install|uninstall}"
+   echo 1>&2 "Usage: $0 install"
    exit 10
    ;;
 esac
--- djvulibre-3.5.25.2.orig/desktopfiles/Makefile.in
+++ djvulibre-3.5.25.2/desktopfiles/Makefile.in
@@ -32,6 +32,7 @@ INSTALL = @INSTALL@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_DATA = @INSTALL_DATA@
 CONVERT = @CONVERT@
+INKSCAPE = @INKSCAPE@
 RSVG = @RSVG@
 XDG_MIME = @XDG_MIME@
 XDG_ICON_RESOURCE = @XDG_ICON_RESOURCE@
@@ -45,12 +46,18 @@ datadir_djvu = ${datadir}/djvu/osi/deskt
 
 all: icons register-djvu-mime 
 
-icons: hi22-djvu.png hi32-djvu.png hi48-djvu.png hi64-djvu.png hi-djvu.svgz 
+PNGICONS = hi16-djvu.png hi20-djvu.png hi22-djvu.png hi24-djvu.png \
+           hi32-djvu.png hi48-djvu.png hi64-djvu.png hi72-djvu.png \
+           hi96-djvu.png hi128-djvu.png hi256-djvu.png
 
-hi22-djvu.png hi32-djvu.png hi48-djvu.png hi64-djvu.png: djvu.svg
+icons: ${PNGICONS} hi-djvu.svgz 
+
+${PNGICONS}: djvu.svg
 	s=`echo $@ | sed -e 's/[a-z]*\([0-9]*\).*/\1/'`; \
-	  ${RSVG} -w $${s} -h $${s} $< $@ \
+	  ${RSVG} -w $${s} -h $${s} -o $@ $< \
           || ${CONVERT} -geometry $${s}x$${s} -depth 8 -background none $< $@ \
+	  || ${INKSCAPE} --without-gui --export-width=$${s} \
+                         --export-height=$${s} --export-png=$@ $< \
 	  || cp ${srcdir}/prebuilt-$@ $@
 
 hi-djvu.svgz: djvu.svg
--- djvulibre-3.5.25.2.orig/tools/djvused.1
+++ djvulibre-3.5.25.2/tools/djvused.1
@@ -282,6 +282,11 @@ This command only selects the shared ann
 a component file already exists.  Otherwise it creates a new shared
 annotation component file and makes sure that it is imported by all
 pages in the document.
+.TP
+.BI "showsel"
+Shows the currently selected component files
+with the same format as command
+.BR ls .
 
 .SS Text and annotation commands
 .TP
@@ -378,6 +383,10 @@ a double-quoted string representing the
 .SM UTF-8
 encoded meta-data value.
 .TP
+.BI "remove-meta"
+Remove the meta-data part of the annotations of 
+the selected component files.
+.TP
 .BI "set-meta [" "djvusedmetafile" "]"
 Set the meta-data part of the annotations of the selected component file.
 The remaining part of the annotations is left unchanged.
@@ -428,6 +437,9 @@ with option
 Print the outline of the document.
 Nothing is printed if the document contains no outline.
 .TP
+.BI "remove-outline"
+Removes the outline from the document.
+.TP
 .BI "set-outline [" djvusedoutlinefile "]"
 Insert outline information into the document.
 The optional argument
--- djvulibre-3.5.25.2.orig/tools/djvudigital.1
+++ djvulibre-3.5.25.2/tools/djvudigital.1
@@ -66,7 +66,7 @@ converting the file.
 Specify the desired resolution to 
 .I resolution
 dots per inch.
-The default is 600 dpi.
+The default is 300 dpi.
 .TP
 .BI "--psrotate=" "angle"
 Rotate the PostScript file by 
--- djvulibre-3.5.25.2.orig/tools/djvudigital
+++ djvulibre-3.5.25.2/tools/djvudigital
@@ -166,7 +166,7 @@ gsarg0="-sDEVICE=djvusep -dNOPAUSE -dBAT
 gsarg1=
 gsarg2=
 csepargs=
-dpi="600"
+dpi="300"
 gsprinted="-dPrinted"
 gsepsf="-dEPSCrop"
 gsverbosity=
--- djvulibre-3.5.25.2.orig/tools/djvumake.cpp
+++ djvulibre-3.5.25.2/tools/djvumake.cpp
@@ -768,22 +768,22 @@ parse_color_name(const char *s, char *rg
     const char *name; 
     unsigned char r, g, b; 
   } stdcols[] = { 
-    {"aqua",    '\x00', '\xFF', '\xFF'},
-    {"black",   '\x00', '\x00', '\x00'},
-    {"blue",    '\x00', '\x00', '\xFF'},
-    {"fuchsia", '\xFF', '\x00', '\xFF'},
-    {"gray",    '\x80', '\x80', '\x80'},
-    {"green",   '\x00', '\x80', '\x00'},
-    {"lime",    '\x00', '\xFF', '\x00'},
-    {"maroon",  '\x80', '\x00', '\x00'},
-    {"navy",    '\x00', '\x00', '\x80'},
-    {"olive",   '\x80', '\x80', '\x00'},
-    {"purple",  '\x80', '\x00', '\x80'},
-    {"red",     '\xFF', '\x00', '\x00'},
-    {"silver",  '\xC0', '\xC0', '\xC0'},
-    {"teal",    '\x00', '\x80', '\x80'},
-    {"white",   '\xFF', '\xFF', '\xFF'},
-    {"yellow",  '\xFF', '\xFF', '\x00'},
+    {"aqua",    0x00, 0xFF, 0xFF},
+    {"black",   0x00, 0x00, 0x00},
+    {"blue",    0x00, 0x00, 0xFF},
+    {"fuchsia", 0xFF, 0x00, 0xFF},
+    {"gray",    0x80, 0x80, 0x80},
+    {"green",   0x00, 0x80, 0x00},
+    {"lime",    0x00, 0xFF, 0x00},
+    {"maroon",  0x80, 0x00, 0x00},
+    {"navy",    0x00, 0x00, 0x80},
+    {"olive",   0x80, 0x80, 0x00},
+    {"purple",  0x80, 0x00, 0x80},
+    {"red",     0xFF, 0x00, 0x00},
+    {"silver",  0xC0, 0xC0, 0xC0},
+    {"teal",    0x00, 0x80, 0x80},
+    {"white",   0xFF, 0xFF, 0xFF},
+    {"yellow",  0xFF, 0xFF, 0x00},
     {0}
   };
   // potential color names
--- djvulibre-3.5.25.2.orig/libdjvu/miniexp.cpp
+++ djvulibre-3.5.25.2/libdjvu/miniexp.cpp
@@ -868,11 +868,9 @@ print_c_string(const char *s, char *d, b
           char letter = 0;
           static const char *tr1 = "\"\\tnrbf";
           static const char *tr2 = "\"\\\t\n\r\b\f";
-          { // extra nesting for windows
-            for (int i=0; tr2[i]; i++)
-              if (c == tr2[i])
-                letter = tr1[i];
-          }
+          for (int i=0; tr2[i]; i++)
+            if (c == tr2[i])
+              letter = tr1[i];
           char_out('\\', d, n);
           if (letter)
             char_out(letter, d, n);
@@ -1437,9 +1435,18 @@ read_c_string(miniexp_io_t *io, int &c)
       else if (c=='\\')
         {
           c = io->fgetc(io);
-          if (c == '\n')
+          if (c == '\n')             // LF
             {
               c = io->fgetc(io);
+              if (c == '\r')         // LFCR
+                c = io->fgetc(io);
+              continue;
+            }
+          else if (c == '\r')        // CR
+            {
+              c = io->fgetc(io);
+              if (c == '\n')         // CRLF
+                c = io->fgetc(io);
               continue;
             }
           else if (c>='0' && c<='7')
@@ -1484,11 +1491,9 @@ read_c_string(miniexp_io_t *io, int &c)
             }
           static const char *tr1 = "tnrbfva";
           static const char *tr2 = "\t\n\r\b\f\013\007";
-          { // extra nesting for windows
-            for (int i=0; tr1[i]; i++)
-              if (c == tr1[i])
-                c = tr2[i];
-          }
+          for (int i=0; tr1[i]; i++)
+            if (c == tr1[i])
+              c = tr2[i];
         }
       append(c,s,l,m);
       c = io->fgetc(io);
@@ -1716,10 +1721,8 @@ minilisp_finish(void)
   ASSERT(!gc.lock);
   // clear minivars
   minivar_t::mark(gc_clear);
-  { // extra nesting for windows
-    for (int i=0; i<recentsize; i++)
-      gc.recent[i] = 0;
-  }
+  for (int i=0; i<recentsize; i++)
+    gc.recent[i] = 0;
   // collect everything
   gc_run();
   // deallocate mblocks
