Ticket #3035: rough_epub_makefile.patch

File rough_epub_makefile.patch, 1.3 KB (added by masenm, 13 years ago)
  • Makefile

    old new  
    55ROOT_ID =
    66PDF_OUTPUT = LFS-BOOK.pdf
    77NOCHUNKS_OUTPUT = LFS-BOOK.html
     8EPUB_OUTPUT = LFS-BOOK.epub
    89SHELL = /bin/bash
    910
    1011ifdef V
     
    5960        fi;
    6061        $(Q)fop $(RENDERTMP)/lfs-pdf.fo $(BASEDIR)/$(PDF_OUTPUT)
    6162
     63epub: validate
     64        @echo "Generating HTML/XML for EPUB..."
     65        $(Q)if [ ! -e $(BASEDIR) ]; then \
     66          mkdir -p $(BASEDIR); \
     67        fi;
     68        $(Q)mkdir -p $(RENDERTMP)/lfs-epub
     69        $(Q)xsltproc --nonet --output $(RENDERTMP)/lfs-epub/ \
     70        stylesheets/lfs-xsl/docbook-xsl-1.76.1/epub/docbook.xsl \
     71        $(RENDERTMP)/lfs-full.xml &>/dev/null
     72
     73        @echo "Generating EPUB file..."
     74        $(Q)echo "application/epub+zip" > $(RENDERTMP)/lfs-epub-mimetype
     75        $(Q)zip -0Xq  $(BASEDIR)/$(EPUB_OUTPUT) $(RENDERTMP)/lfs-epub-mimetype
     76        $(Q)zip -Xr9Dq $(BASEDIR)/$(EPUB_OUTPUT) $(RENDERTMP)/lfs-epub/*
     77
    6278nochunks: validate profile-html
    6379        @echo "Generating non chunked XHTML file..."
    6480        $(Q)xsltproc --nonet -stringparam rootid "$(ROOT_ID)" \
     
    8096        $(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP)
    8197        $(Q)rm -f $(RENDERTMP)/lfs-{full,html,pdf}.xml
    8298        $(Q)rm -f $(RENDERTMP)/lfs-pdf.fo
     99        $(Q)rm -rf $(RENDERTMP)/lfs-epub*
    83100
    84101validate: tmpdir
    85102        @echo "Processing bootscripts..."