From 5d5e943c515f78fc37668792f9867d2f71b1dce3 Mon Sep 17 00:00:00 2001 From: Carlos Maddela Date: Tue, 15 Aug 2017 03:25:37 +1000 Subject: [PATCH] Reproducibly generate PDF documentation from TeX sources. --- debian/changelog | 1 + debian/control | 6 +++--- ....patch => 28-pdftex-reproducibility.patch} | 17 ++++++++++------- debian/patches/series | 2 +- debian/rules | 19 +++++-------------- 5 files changed, 20 insertions(+), 25 deletions(-) rename debian/patches/{28-fudge-pdf-doc-ids.patch => 28-pdftex-reproducibility.patch} (59%) diff --git a/debian/changelog b/debian/changelog index 0e4ca8f..313525e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,7 @@ dvdisaster (0.79.5-4) UNRELEASED; urgency=medium * Use alternative way of installing icons to remove dependency on dh-exec. * Drop redundant dependency on dpkg-dev. + * Reproducibly generate PDF documentation from TeX sources. -- Carlos Maddela Mon, 14 Aug 2017 23:04:38 +1000 diff --git a/debian/control b/debian/control index 60f886c..4a09f58 100644 --- a/debian/control +++ b/debian/control @@ -12,9 +12,9 @@ Build-Depends: debhelper (>= 10), libgtk2.0-dev, libpng-dev, pkg-config -# Build-Depends-Indep: texlive-fonts-recommended, -# texlive-latex-base, -# texlive-latex-extra +Build-Depends-Indep: texlive-fonts-recommended, + texlive-latex-base, + texlive-latex-extra Standards-Version: 4.0.1 Vcs-Browser: https://anonscm.debian.org/git/pkg-opt-media/dvdisaster.git Vcs-Git: https://anonscm.debian.org/git/pkg-opt-media/dvdisaster.git diff --git a/debian/patches/28-fudge-pdf-doc-ids.patch b/debian/patches/28-pdftex-reproducibility.patch similarity index 59% rename from debian/patches/28-fudge-pdf-doc-ids.patch rename to debian/patches/28-pdftex-reproducibility.patch index 748e7cc..f8fee2b 100644 --- a/debian/patches/28-fudge-pdf-doc-ids.patch +++ b/debian/patches/28-pdftex-reproducibility.patch @@ -1,26 +1,29 @@ From: Carlos Maddela Date: Thu, 5 Jan 2017 19:14:35 +1100 -Subject: Generate the same PDF document IDs for build reproducibility. +Subject: Apply pdftex workarounds for build reproducibility. -Description: Generate the same PDF IDs for build reproducibility. +Description: Apply pdftex workarounds for build reproducibility. + * Generate the same PDF IDs. + * Suppress additional metadata for included images. Author: Carlos Maddela Forwarded: not-needed -Last-Update: 2016-12-21 +Last-Update: 2017-08-15 --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ --- - documentation/user-manual/manual.tex | 1 + - 1 file changed, 1 insertion(+) + documentation/user-manual/manual.tex | 2 ++ + 1 file changed, 2 insertions(+) diff --git a/documentation/user-manual/manual.tex b/documentation/user-manual/manual.tex -index 60fb51e..aaab4fa 100644 +index 60fb51e..bf4364d 100644 --- a/documentation/user-manual/manual.tex +++ b/documentation/user-manual/manual.tex -@@ -65,6 +65,7 @@ +@@ -65,6 +65,8 @@ \fancyfoot{} \fancyfoot[LE,RO]{page \thepage\ of \pageref{LastPage}} +\pdftrailerid{dvdisaster} ++\pdfsuppressptexinfo=-1 \begin{document} \definecolor{lightorange}{RGB}{255,224,150} diff --git a/debian/patches/series b/debian/patches/series index ebd02f0..8136eba 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -19,7 +19,7 @@ 25-fix-man-pages.patch 26-fix-display-of-manual.pdf.patch 27-allow-opening-in-browser-again.patch -28-fudge-pdf-doc-ids.patch +28-pdftex-reproducibility.patch 29-fix-more-typos.patch 30-hurd-kfreebsd-ftbfs.patch 31-improve-hurd-and-kfreebsd-support.patch diff --git a/debian/rules b/debian/rules index 4e176dd..53a47e0 100755 --- a/debian/rules +++ b/debian/rules @@ -11,7 +11,8 @@ export DEB_VERSION export FORCE_SOURCE_DATE = 1 MUTABLE_FILES := build.h $(wildcard locale/*.po) \ - documentation/config/version.tex + documentation/config/version.tex \ + documentation/user-manual/manual.pdf BUILDROOT := $(CURDIR)/debian/tmp ICONS := $(wildcard contrib/dvdisaster*.png) @@ -41,17 +42,8 @@ override_dh_clean: override_dh_auto_build-arch: make all -# For the time being, we'll just package the upstream-generated -# manual.pdf, since we can't build the PDF reproducibly ourselves. -# The reason we can't is most probably due to the fact that the -# LaTeX document embeds other PDF documents and PNG images. -# Although we are able to reproduce the PDF's creation and mod -# dates, as well as its PDF IDs, the stream elements representing -# the embedded images are always what seem to differ each time we -# try to generate the PDF. override_dh_auto_build-indep: - # make manual - true + make manual override_dh_auto_install-arch: dh_auto_install -a -- BUILDROOT=$(BUILDROOT) @@ -66,9 +58,8 @@ override_dh_auto_install-indep: true # Ensure that none of the text files that the application -# tries to display directly are not compressed, as it doesn't +# tries to display directly are compressed, as it doesn't # automatically decompress text files. -override_dh_compress: +override_dh_compress-arch: dh_compress -p dvdisaster \ -XCHANGELOG -XCREDITS -XREADME.MODIFYING -XTODO - dh_compress --remaining-packages