From: Michael Olbrich Date: Wed, 3 Oct 2018 11:32:17 +0200 Subject: [PATCH] build: use SOURCE_DATE_EPOCH if available to make the build reproducible The build date is included into the binary. As a result, the binaries change with the build date. Use SOURCE_DATE_EPOCH[1] if defined. This allows packages to make the build reproducible by setting SOURCE_DATE_EPOCH to a fixed value. [1] https://reproducible-builds.org/specs/source-date-epoch/ Signed-off-by: Michael Olbrich --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 351e749760f7..c5aafd5fbdc5 100644 --- a/Makefile +++ b/Makefile @@ -104,7 +104,7 @@ all: keyctl request-key key.dns_resolver ############################################################################### #RPATH = -Wl,-rpath,$(LIBDIR) -VCPPFLAGS := -DPKGBUILD="\"$(shell date -u +%F)\"" +VCPPFLAGS := -DPKGBUILD="\"$(shell date $(if $(SOURCE_DATE_EPOCH),--date @$(SOURCE_DATE_EPOCH)) -u +%F)\"" VCPPFLAGS += -DPKGVERSION="\"keyutils-$(VERSION)\"" VCPPFLAGS += -DAPIVERSION="\"libkeyutils-$(APIVERSION)\""