export and respect SOURCE_DATE_EPOCH

to improve reproducibility of pve-docs, pve-doc-generator and
pve-doc-mediawiki builds, as well as man pages generated by
pve-doc-generator when called via dpkg-buildpackage.

timestamps embedded in the documentation now always reflect the last changelog
entry of the package to which the documentation belongs (pve-docs for html,
epub and pdf, individual packages for man pages).

ported from pve-docs:b965ad63ad80b5967f5bc1f0327eb548b6049045

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
This commit is contained in:
Stoiko Ivanov 2019-02-27 20:37:32 +01:00 committed by Dietmar Maurer
parent 398ad28a6a
commit 8a328f848b

View File

@ -15,6 +15,10 @@ GEN_DEB=${GEN_PACKAGE}_${DOCRELEASE}-${PKGREL}_${ARCH}.deb
DOC_DEB=${DOC_PACKAGE}_${DOCRELEASE}-${PKGREL}_all.deb
export SOURCE_DATE_EPOCH ?= $(shell dpkg-parsechangelog -STimestamp)
SOURCE_DATE_HUMAN := $(shell date -d "@${SOURCE_DATE_EPOCH}")
all: index.html
.PHONY: verify-images
@ -64,7 +68,7 @@ INDEX_INCLUDES= \
man8-index-table.adoc \
$(sort $(addsuffix .html, ${MANUAL_PAGES}) ${CHAPTER_LIST})
ADOC_STDARG=-b $(shell pwd)/asciidoc/pmg-html -f asciidoc/asciidoc-pmg.conf -a icons -a data-uri -a "date=$(shell date)" -a "revnumber=${DOCRELEASE}"
ADOC_STDARG=-b $(shell pwd)/asciidoc/pmg-html -f asciidoc/asciidoc-pmg.conf -a icons -a data-uri -a "date=${SOURCE_DATE_HUMAN}" -a "revnumber=${DOCRELEASE}"
BROWSER?=xdg-open