I use a script like this all the time:
Code:
#!/bin/bash
rm -f "$1"
zip -X0 "$1" mimetype
zip -X9Dr "$1" META-INF OEBPS
which is basically the same you do.
Now, the question is, what is the content of your "mimetype" file? It should be:
Code:
application/epub+zip
and only that, no newline at the end or anything else.