How to convert an epub package to regular epub? I have some epub files in my iCloud Drive that are essentially packages.  I can show package contents and then it shows me a hierarchy of files and folders.

How can I convert this structure to a standard epub that any regular epub reader will understand?
FWIW, here's a shell command that works:

 cd my-broken.epub

 # iTunes/Books seems to add a file 
 # 'iTunesMetadata.plist', and it produces a warning.
 # May also contain private data, so better delete it.

 rm iTunesMetadata.plist 

 zip -X -r ../fixed.epub mimetype *


As far as I can tell, compression does not need to be deactivated (-0). epubcheck has no complaints. There might be differences between versions of the epub spec, however. My test was with an epub 3.0 file.