path: root/Makefile
diff options
authorbrian m. carlson <>2016-11-19 03:38:48 +0000
committerbrian m. carlson <>2016-11-19 03:38:48 +0000
commit669985f97d84b6bbdb449744310a27b5519d06fc (patch)
tree12dc938b38ffc0cd4eda60031bf666f6c2f15c4d /Makefile
parent831515692ddb5a9bc5211a71bd1d29e34e4563f9 (diff)
Produce reproducible PDFs.
Set the CreationDate in the document info dictionary to the epoch, and replace the date entries in the XMP metadata with spaces. Finally, generate the file identifier based on an SHA-256 hash of the XSL-FO file. Adobe generally uses MD5 for this purpose, but the specification is silent on the size of the identifier, so use something secure.
Diffstat (limited to 'Makefile')
1 files changed, 3 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 19d7ebe..4fbede5 100644
--- a/Makefile
+++ b/Makefile
@@ -55,7 +55,9 @@ depend: $(DEPFILES)
-e 'print "$$r: $$1\n" if /xi:include.*href="([^"]+)"/;' $^ > $@
- $(FOP) -fo $(CUR) -pdf $@
+ $(FOP) -fo $(CUR) -pdf $@.tmp
+ bin/strip-date "$$(sha256sum $(CUR) | cut -d' ' -f1)" < $@.tmp >$@
+ rm $@.tmp
$(FOP) -fo $(CUR) -rtf $@