[debian-edu-commits] debian-edu/ 01/01: Add build rules to create epub versoin too.

Petter Reinholdtsen pere at moszumanska.debian.org
Wed Jun 18 06:11:30 UTC 2014


This is an automated email from the git hooks/post-receive script.

pere pushed a commit to branch master
in repository debian-edu-doc.

commit a09eaabb6c4dbcf431ff0afe330e7159da5c7a15
Author: Petter Reinholdtsen <pere at hungry.com>
Date:   Wed Jun 18 08:11:04 2014 +0200

    Add build rules to create epub versoin too.
---
 Makefile                             |  2 +-
 debian/changelog                     |  1 +
 debian/control                       |  1 +
 documentation/common/Makefile.common | 29 +++++++++++++++++++++++++++--
 4 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 07360dd..48e2fdd 100644
--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,7 @@ update-copyright:
 		> debian/copyright
 	rm documentation/*/copyright.manual
 
-readme status build install dist-clean clean pdf::
+readme status build install dist-clean clean pdf epub::
 	$(MAKE) -C $(SRCDIR)/debian-edu-squeeze $@
 	$(MAKE) -C $(SRCDIR)/debian-edu-wheezy $@
 	$(MAKE) -C $(SRCDIR)/rosegarden $@
diff --git a/debian/changelog b/debian/changelog
index 4697b08..4b6d903 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -32,6 +32,7 @@ debian-edu-doc (1.5~XXX) UNRELEASED; urgency=medium
   * Added Dutch (nl) audacity manual by Frans Spiesschaert (Closes:
     #751678).
   * Update Norwegian Bokmål translation of the Rosegarden manual.
+  * Add build rules to create epub versoin too.
 
  -- Wolfgang Schweer <wschweer at arcor.de>  Thu, 03 Apr 2014 14:52:00 +0200
 
diff --git a/debian/control b/debian/control
index c958665..dcac5d1 100644
--- a/debian/control
+++ b/debian/control
@@ -8,6 +8,7 @@ Build-Depends-Indep: docbook-utils, poxml, ldp-docbook-xsl, dblatex, po4a,
  texlive-lang-cyrillic, texlive-lang-danish,  texlive-lang-spanish,
  texlive-lang-french, texlive-lang-german, texlive-lang-italian,
  texlive-lang-norwegian, texlive-lang-dutch, imagemagick
+ , dbtoepub
 Maintainer: Debian Edu Developers <debian-edu at lists.debian.org>
 Uploaders: Holger Levsen <holger at debian.org>, 
  David Prévot <taffit at debian.org>
diff --git a/documentation/common/Makefile.common b/documentation/common/Makefile.common
index 99d6ff2..8c44e03 100644
--- a/documentation/common/Makefile.common
+++ b/documentation/common/Makefile.common
@@ -5,6 +5,7 @@ DESTDIR=
 DESTPATH = /usr/share/doc
 LANGUAGES = `find . -name "$(name).*.po" | sed -e "s/.\/$(name).//" -e "s/.po//"`
 # Program name and option
+DBTOEPUB = dbtoepub
 XP = xsltproc --nonet --novalid --xinclude ../common/html.xsl
 DBLATEX = dblatex -T db2latex --backend=xetex --xsl-user=../common/user_param.xsl --xsl-user=../common/xetex_param.xsl -p ../common/pdf.xsl
 # that's ugly, smarter approach appreciated
@@ -30,8 +31,10 @@ status:
 	done
 	@cat fixme-status.txt
 
+build: build-html build-epub
+
 ifndef LINGUA
-build:
+build-html:
 	# create localized XML files
 	po4a --msgmerge-opt --no-location po4a.cfg
 	msgcat --no-location -o $(name).pot $(name).pot
@@ -42,11 +45,18 @@ build:
 	sed -i "s/href=\"index.html/href=\"$(name).en.html/g" $(name).en.html
 	# build the other HTML versions
 	-for f in $(LANGUAGES) ; do \
+		echo "Creating HTML for $$f"; \
 		$(XP) $(name).$$f.xml && mv index.html $(name).$$f.html ; \
 		sed -i "s/href=\"index.html/href=\"$(name).$$f.html/g" $(name).$$f.html ; \
 	done
+build-epub:
+	-for LINGUA in $(LANGUAGES) ; do \
+		echo "Creating epub for $$LINGUA"; \
+		po4a --translate-only $(name).$$LINGUA.xml po4a.cfg ; \
+		$(DBTOEPUB) $(name).$$LINGUA.xml ; \
+	done
 else
-build:
+build-html:
 	# create the localized XML file
 	po4a --translate-only $(name).$(LINGUA).xml po4a.cfg
 	# rewrap the PO file just to be sure
@@ -55,6 +65,7 @@ build:
 	$(XP) $(name).$(LINGUA).xml && mv index.html $(name).$(LINGUA).html
 	# restore internal links
 	sed -i "s/href=\"index.html/href=\"$(name).$(LINGUA).html/g" $(name).$(LINGUA).html
+build-epub: epub
 endif
 
 ifndef LINGUA
@@ -66,6 +77,15 @@ pdf:
 	$(DBLATEX) $(name).$(LINGUA).xml --param=lingua=$(LINGUA)
 endif
 
+ifndef LINGUA
+epub:
+	$(DBTOEPUB) $(name).xml
+else
+epub:
+	po4a --translate-only $(name).$(LINGUA).xml po4a.cfg
+	$(DBTOEPUB) $(name).$(LINGUA).xml
+endif
+
 install: build
 	# en needs to be first
 	for f in en $(LANGUAGES) ; do \
@@ -102,6 +122,9 @@ install: build
 			  rm $$LANGPATH/images/*.pdf ; \
 			fi ; \
 		fi ; \
+		if [ -e $(name).$$f.epub ] ; then \
+			cp $(name).$$f.epub $$LANGPATH/$(name).epub ; \
+		fi ; \
 	done 		
 	rm $(DESTDIR)/debian-edu-doc-en/$(DESTPATH)/debian-edu-doc-en/images/*.pdf ; \
 
@@ -112,3 +135,5 @@ clean:
 	rm -f *.po~
 
 dist-clean:	clean
+	rm -f *.epub
+	rm -f *.pdf

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/debian-edu-doc.git



More information about the debian-edu-commits mailing list