Commit cd326ab9 authored by Jonas Bernoulli's avatar Jonas Bernoulli

make: Add epub target

Closes #3579.
parent 827d0208
......@@ -2,12 +2,16 @@
*~
/*.tar
/*.tar.gz
/Documentation/*.epub
/Documentation/*.html
/Documentation/*.info
/Documentation/*.pdf
/Documentation/META-INF/
/Documentation/OEBPS/
/Documentation/dir
/Documentation/epub.xml
/Documentation/magit/
/Documentation/magit-popup/
/Documentation/mimetype
/Documentation/stats/
/config.mk
/lisp/magit-autoloads.el
......
......@@ -12,6 +12,7 @@ all: info
info: $(INFOPAGES) dir
html: $(HTMLFILES)
pdf: $(PDFFILES)
epub: $(EPUBFILES)
%.info: %.texi
@printf "Generating $@\n"
......@@ -46,6 +47,15 @@ html-dir: $(TEXIFILES)
@printf "Generating $@\n"
@texi2pdf --clean $< > /dev/null
%.epub: %.texi
@printf "Generating $@\n"
@makeinfo --docbook $< -o epub.xml
@xsltproc $(DOCBOOK_XSL) epub.xml 2> /dev/null
@echo "application/epub+zip" > mimetype
@zip -X --quiet --recurse-paths -0 $@ mimetype
@zip -X --quiet --recurse-paths -9 --no-dir-entries $@ META-INF OEBPS
@$(RMDIR) $(EPUBTRASH)
## Install ###########################################################
install: install-info install-docs
......@@ -63,6 +73,7 @@ install-info: info
clean:
@printf "Cleaning Documentation/*...\n"
@$(RMDIR) dir $(INFOPAGES) $(HTMLFILES) $(HTMLDIRS) $(PDFFILES)
@$(RMDIR) $(EPUBFILES) $(EPUBTRASH)
## Release management ################################################
......@@ -122,17 +133,19 @@ publish-stats: stats
@aws cloudfront create-invalidation \
--distribution-id $(CFRONT_DIST) --paths "/stats/*" > /dev/null
publish-manuals: html html-dir pdf
publish-manuals: $(PUBLISH_TARGETS)
@aws s3 cp $(PKG).html $(PUBLISH_TARGET)
@aws s3 cp $(PKG).pdf $(PUBLISH_TARGET)
@aws s3 cp $(PKG).epub $(PUBLISH_TARGET)
@aws s3 sync --delete $(PKG) $(PUBLISH_TARGET)$(PKG)/
@printf "Generating CDN invalidation\n"
@aws cloudfront create-invalidation --distribution-id $(CFRONT_DIST) --paths \
"$(subst $(space),$(comma),$(addprefix $(PUBLISH_PATH),$(CFRONT_PATHS)))" > /dev/null
release-manuals: html html-dir pdf
release-manuals: $(PUBLISH_TARGETS)
@aws s3 cp $(PKG).html $(RELEASE_TARGET)
@aws s3 cp $(PKG).pdf $(RELEASE_TARGET)
@aws s3 cp $(PKG).epub $(RELEASE_TARGET)
@aws s3 sync --delete $(PKG) $(RELEASE_TARGET)$(PKG)/
@printf "Generating CDN invalidation\n"
@aws cloudfront create-invalidation --distribution-id $(CFRONT_DIST) --paths \
......
......@@ -26,6 +26,7 @@ help:
$(info make html - generate html manual files)
$(info make html-dir - generate html manual directories)
$(info make pdf - generate pdf manuals)
$(info make epub - generate epub manuals)
$(info )
$(info Install)
$(info =======)
......@@ -86,6 +87,9 @@ html-dir:
pdf:
@$(MAKE) -C Documentation pdf
epub:
@$(MAKE) -C Documentation epub
## Install ###########################################################
install: install-lisp install-docs
......
......@@ -43,6 +43,7 @@ INFOPAGES = $(addsuffix .info,$(filter-out git-commit,$(PACKAGES)))
HTMLFILES = $(addsuffix .html,$(filter-out git-commit,$(PACKAGES)))
HTMLDIRS = $(filter-out git-commit,$(PACKAGES))
PDFFILES = $(addsuffix .pdf,$(filter-out git-commit,$(PACKAGES)))
EPUBFILES = $(addsuffix .epub,$(filter-out git-commit,$(PACKAGES)))
ELS = git-commit.el
ELS += magit-utils.el
......@@ -195,3 +196,11 @@ ORG_LOAD_PATH += -L ../../org/lisp
ORG_LOAD_PATH += -L ../../org/contrib/lisp
ORG_LOAD_PATH += -L ../../ox-texinfo+
endif
## Publish ###########################################################
PUBLISH_TARGETS ?= html html-dir pdf epub
DOCBOOK_XSL ?= /usr/share/xml/docbook/stylesheet/docbook-xsl/epub/docbook.xsl
EPUBTRASH = epub.xml META-INF OEBPS
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment