Package: xmlto
Version: 0.0.25.2
Severity: normal
Tags: patch upstream

xmlto epub generates a "mimetype" file that contains a newline at the
end. The requirement, however, is a mimetype file just with the string
"application/epub+zip", as one can test with the "epubcheck" program:

(on the developers-reference package)

$ xmlto epub index.dbk
$ epubcheck index.epub

produces an error

Validating against EPUB version 2.0
ERROR: index.epub/mimetype:
Mimetype file should contain only the string "application/epub+zip".

The applied patch fixes this; the problem is however in upstream.

Best

Ole
--- xmlto-0.0.25/debian/patches/fix_epub_mimetype.patch
+++ xmlto-0.0.25/debian/patches/fix_epub_mimetype.patch
@@ -0,0 +1,14 @@
+Author: Ole Streicher <deb...@liska.ath.cx>
+Description: Fix mimetype file in epub.
+ The file must not have a newline at the end.
+--- a/format/docbook/epub
++++ b/format/docbook/epub
+@@ -18,7 +18,7 @@
+     then
+     echo >&2 "Creating epub file"
+   fi
+-  echo "application/epub+zip" > mimetype
++  echo -n "application/epub+zip" > mimetype
+   EPUB_NAME=$(basename "${XSLT_PROCESSED%.*}").epub
+   [ -e "$XSLT_PROCESSED" ] && rm "$XSLT_PROCESSED"
+   ${ZIP_PATH} -0Xq $EPUB_NAME mimetype
--- xmlto-0.0.25/debian/patches/series
+++ xmlto-0.0.25/debian/patches/series
@@ -1,3 +1,4 @@
 getopt_noextensions_fix.patch
 652974_local_only_in_function.patch
 format_fo_passivetex_check.patch
+fix_epub_mimetype.patch

Reply via email to