All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] build: use SOURCE_DATE_EPOCH if available to make the build reproducible
@ 2018-10-03  9:59 Michael Olbrich
  0 siblings, 0 replies; only message in thread
From: Michael Olbrich @ 2018-10-03  9:59 UTC (permalink / raw)
  To: keyrings

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 <m.olbrich@pengutronix.de>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 96b5df716e4c..bcb4b0704117 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)\""
 
-- 
2.19.0

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-10-03  9:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-03  9:59 [PATCH] build: use SOURCE_DATE_EPOCH if available to make the build reproducible Michael Olbrich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.