[debian-edu-commits] [Git][debian-edu/debian-edu-doc][master] 3 commits: debian/control: Add strip-nondeterminism to Build-Depends-Indep.

WolfgangSchweer gitlab at salsa.debian.org
Thu Jan 17 19:46:36 GMT 2019


WolfgangSchweer pushed to branch master at Debian Edu / debian-edu-doc


Commits:
d5d208df by Wolfgang Schweer at 2019-01-17T19:37:50Z
debian/control: Add strip-nondeterminism to Build-Depends-Indep.

- - - - -
4fe0149e by Wolfgang Schweer at 2019-01-17T19:39:33Z
Adjust Makefile.common so that PDF and EPUB manuals can be built reproducibly.

Set timestamps for PDF and EPUB manuals to the start of Unix time.
Also, in case of EPUB files the generated article ID is unique and needs to be
tweaked and (beeing a zip file) strip-nondeterminism is used to get rid of
the remaining difference.

- - - - -
ebc78b4b by Wolfgang Schweer at 2019-01-17T19:43:02Z
Add changelog entries for last commits.

- - - - -


3 changed files:

- debian/changelog
- debian/control
- documentation/common/Makefile.common


Changes:

=====================================
debian/changelog
=====================================
@@ -4,6 +4,16 @@ debian-edu-doc (2.10.11) UNRELEASED; urgency=medium
   * ITIL manual:
     - Norwegian Bokmål: Allan Nordhøy.
 
+  [ Wolfgang Schweer ]
+  * documentation/common/Makefile.common:
+    - Set timestamps for PDF and EPUB manuals to the start of Unix time. Also,
+      in case of EPUB files the generated article ID is unique and needs to be
+      tweaked and (beeing a zip file) strip-nondeterminism is used to get rid of
+      the remaining difference.
+      With these changes the manuals can be built reproducibly.
+  * debian/control:
+    - Add strip-nondeterminism to Build-Depends-Indep.
+
  -- Holger Levsen <holger at debian.org>  Sat, 01 Jan 2019 00:00:00 +0100
 
 debian-edu-doc (2.10.10) unstable; urgency=medium


=====================================
debian/control
=====================================
@@ -13,6 +13,7 @@ Build-Depends-Indep: dblatex,
                      lmodern,
                      po4a,
                      poxml,
+                     strip-nondeterminism,
                      texlive-lang-cyrillic,
                      texlive-lang-european,
                      texlive-lang-french,


=====================================
documentation/common/Makefile.common
=====================================
@@ -10,7 +10,7 @@ LANGUAGES = $(subst $(name).,,$(subst .po,,$(wildcard *.po)))
 # Program name and option
 DBTOEPUB = dbtoepub
 XP = xsltproc --nonet --novalid --xinclude ../common/html.xsl
-DBLATEX = dblatex -T db2latex -b xetex -p ../common/dblatex.xsl
+DBLATEX = SOURCE_DATE_EPOCH=0 SOURCE_DATE_EPOCH_TEX_PRIMITIVES=1 dblatex -T db2latex -b xetex -p ../common/dblatex.xsl
 SED_JA_REGEX = 's/dbtimestamp/dbtimestamp\ format=\"Y\ 年\ m\ 月\ d\ 日\"/'
 
 # Use Make internal function 'subst': substitute -manual with nothing to get
@@ -63,6 +63,14 @@ build-epub:
 	# build the English EPUB version
 	echo "Creating epub for en"
 	$(DBTOEPUB) $(name).xml
+	unzip -q $(name).epub -d epub
+	sed -i 's#_idm[0-9]\{14\}#_idm1234567#' epub/OEBPS/content.opf
+	sed -i 's#_idm[0-9]\{14\}#_idm1234567#' epub/OEBPS/toc.ncx
+	find epub -exec touch -d @0 {} \;
+	rm $(name).epub
+	zip -q -r -o $(name).epub epub/
+	rm -rf epub/
+	strip-nondeterminism -t zip $(name).epub
 	# build all other EPUB versions
 	-for LINGUA in $(LANGUAGES) ; do \
 		echo "Creating epub for $$LINGUA"; \
@@ -105,10 +113,26 @@ endif
 ifndef LINGUA
 epub:
 	$(DBTOEPUB) $(name).xml
+	unzip -q $(name).epub -d epub
+	sed -i 's#_idm[0-9]\{14\}#_idm1234567#' epub/OEBPS/content.opf
+	sed -i 's#_idm[0-9]\{14\}#_idm1234567#' epub/OEBPS/toc.ncx
+	find epub -exec touch -d @0 {} \;
+	rm $(name).epub
+	zip -q -r -o $(name).epub epub/
+	rm -rf epub/
+	strip-nondeterminism -t zip $(name).epub
 else
 epub:
 	po4a --translate-only $(name).$(LINGUA).xml po4a.cfg
 	$(DBTOEPUB) $(name).$(LINGUA).xml
+	unzip -q $(name).$(LINGUA).epub -d epub
+	sed -i 's#_idm[0-9]\{14\}#_idm1234567#' epub/OEBPS/content.opf
+	sed -i 's#_idm[0-9]\{14\}#_idm1234567#' epub/OEBPS/toc.ncx
+	find epub -exec touch -d @0 {} \;
+	rm $(name).$(LINGUA).epub
+	zip -q -r -o $(name).$(LINGUA).epub epub/
+	rm -rf epub/
+	strip-nondeterminism -t zip $(name).$(LINGUA).epub
 endif
 
 install: build
@@ -154,6 +178,16 @@ install: build
 		fi ; \
 		if [ -e $(name).$$f.epub ] ; then \
 			cp $(name).$$f.epub $$LANGPATH/$(name).epub ; \
+			cd $$LANGPATH ; \
+			unzip -q $(name).epub -d epub ; \
+			sed -i 's#_idm[0-9]\{14\}#_idm1234567#' epub/OEBPS/content.opf ; \
+			sed -i 's#_idm[0-9]\{14\}#_idm1234567#' epub/OEBPS/toc.ncx ; \
+			find epub -exec touch -d @0 {} \; ; \
+			rm $(name).epub ; \
+			zip -q -r -o $(name).epub epub/ ; \
+			rm -rf epub/ ; \
+			strip-nondeterminism -t zip $(name).epub ; \
+			cd - ; \
 		fi ; \
 	done 		
 	rm $(DESTDIR)/debian-edu-doc-en/$(DESTPATH)/debian-edu-doc-en/$(name)-images/*.pdf ; \



View it on GitLab: https://salsa.debian.org/debian-edu/debian-edu-doc/compare/c0f7cb95a0bdc98cc5a739e568614aab09c0f30c...ebc78b4b79f286d966b1d1f080af6d51e7db69f1

-- 
View it on GitLab: https://salsa.debian.org/debian-edu/debian-edu-doc/compare/c0f7cb95a0bdc98cc5a739e568614aab09c0f30c...ebc78b4b79f286d966b1d1f080af6d51e7db69f1
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-edu-commits/attachments/20190117/b4d0110d/attachment-0001.html>


More information about the debian-edu-commits mailing list