Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] How do I add a file (zip) to a package without compressing it

On Fri, Jul 29, 2011 at 09:11:20AM +1000, Marghanita da Cruz wrote:
> Marghanita da Cruz wrote:
> >peter@xxxxxxxxxxxxxxxxxx wrote:
> ><snip>
> >>zip -0 file.epub mimetype
> >>
> >>-0 says don't compress.  It's a zero, not an `oh'.
> >>
> ><snip>
> >
> >Thanks - looks like the command I was looking for.
> >
> Any suggestions of how to fix this problem?
> "ERROR: test6.epub: extra field length for first filename must be 0, but
> was 21 "
> The requirements for the mimetype file are
> a)no LF or LF/CR at the end of the line in the file
> b)it must be the first file in the package
> I can't figure out how to check either of these or specify them, or whether
> they are relevent to the above error.

Goog search reveals:
    The Linux zip(1) command
    If you use the Linux zip(1) command to update or create EPUB
    files you must use the -X, --no-extra command-line option,
    if you do not the platform dependent extra fields will confuse
    epubcheck(1) which will emit errors like “extra field length
    for first filename must be 0, but was 28”.

BTW, have you considered using http://calibre-ebook.com/
I think it's in most distros and on windows.