From 4ab63ccd3a6ed5e11fa616fafc9915ef694e8775 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 4 Jan 2014 16:30:49 +0100 Subject: [PATCH] deterministically build crypt.pdf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This entails: • Using pdflatex to influence the modification/creation timestamp in the resulting PDF • Replacing the unique ID with 0/0 • Using the timestamp from crypt.tex instead of the current date/time See also http://superuser.com/a/130804 This change is necessary because for Multi-Arch Debian packages, non-arch-dependent files need to have the same checksum, which is not guaranteed without this commit. See http://bugs.debian.org/734109 --- makefile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/makefile b/makefile index 36e0da5..f322ebf 100644 --- a/makefile +++ b/makefile @@ -373,14 +373,24 @@ doxy: #delete it if we are rebuilding it. docs: crypt.tex rm -f doc/crypt.pdf $(LEFTOVERS) + cp crypt.tex crypt.bak + touch --reference=crypt.tex crypt.bak + (echo "\\def\\fixedpdfdate{"; date +'D:%Y%m%d%H%M%S%:z' -d @$$(stat --format=%Y crypt.tex) | sed "s/:\([0-9][0-9]\)$$/'\1'}/g") > crypt-deterministic.tex + echo "\\pdfinfo{" >> crypt-deterministic.tex + echo "/CreationDate (\fixedpdfdate)" >> crypt-deterministic.tex + echo "/ModDate (\fixedpdfdate) }" >> crypt-deterministic.tex + cat crypt.tex >> crypt-deterministic.tex + mv crypt-deterministic.tex crypt.tex + touch --reference=crypt.bak crypt.tex echo "hello" > crypt.ind latex crypt > /dev/null latex crypt > /dev/null makeindex crypt.idx > /dev/null perl fixupind.pl - latex crypt > /dev/null - dvipdf crypt + pdflatex crypt + sed -i 's,^/ID \[.*\]$$,/ID [<0> <0>],g' crypt.pdf mv -ivf crypt.pdf doc/crypt.pdf + mv crypt.bak crypt.tex rm -f $(LEFTOVERS) docdvi: crypt.tex