build: use SOURCE_DATE_EPOCH if available to make the build reproducible
Subsystems (2)
PATCH 1/1 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 <[email protected]>
--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
@@ -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)\""
Signature · 1 line
2.19.0