summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2016-11-19 03:38:48 +0000
committerbrian m. carlson <sandals@crustytoothpaste.net>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')
-rw-r--r--Makefile4
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="([^"]+)"/;' $^ > $@
.fo.pdf:
- $(FOP) -fo $(CUR) -pdf $@
+ $(FOP) -fo $(CUR) -pdf $@.tmp
+ bin/strip-date "$$(sha256sum $(CUR) | cut -d' ' -f1)" < $@.tmp >$@
+ rm $@.tmp
.fo.rtf:
$(FOP) -fo $(CUR) -rtf $@