From 3a80f800392031b8a6c3e8a3c55841c2dd12a956 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 13 Oct 2014 12:32:25 +0200 Subject: [PATCH] deterministic build of tfm.pdf --- makefile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/makefile b/makefile index 4eea681..60b10fb 100644 --- a/makefile +++ b/makefile @@ -125,6 +125,15 @@ rsatest: $(LIBNAME) demo/rsa.o $(CC) $(CFLAGS) demo/rsa.o $(LIBNAME) -o rsatest docdvi: tfm.tex + cp tfm.tex tfm.bak + touch --reference=tfm.tex tfm.bak + (printf "%s" "\def\fixedpdfdate{"; date +'D:%Y%m%d%H%M%S%:z' -d @$$(stat --format=%Y tfm.tex) | sed "s/:\([0-9][0-9]\)$$/'\1'}/g") > tfm-deterministic.tex + printf "%s\n" "\pdfinfo{" >> tfm-deterministic.tex + printf "%s\n" " /CreationDate (\fixedpdfdate)" >> tfm-deterministic.tex + printf "%s\n}\n" " /ModDate (\fixedpdfdate)" >> tfm-deterministic.tex + cat tfm.tex >> tfm-deterministic.tex + mv tfm-deterministic.tex tfm.tex + touch --reference=tfm.bak tfm.tex touch tfm.ind latex tfm >/dev/null latex tfm >/dev/null @@ -133,7 +142,9 @@ docdvi: tfm.tex docs: docdvi latex tfm >/dev/null - dvipdf tfm + pdflatex tfm >/dev/null + sed -b -i 's,^/ID \[.*\]$$,/ID [<0> <0>],g' tfm.pdf + mv tfm.bak tfm.tex mv -f tfm.pdf doc #This rule cleans the source tree of all compiled code, not including the pdf