Skip to content

Commit

Permalink
Allow to override build date with SOURCE_DATE_EPOCH
Browse files Browse the repository at this point in the history
in order to make builds reproducible.
See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.

While it is already possible to do reproducible builds without
this patch, this patch makes it the default,
so that distributions do not have to discover the BUILD_INFO variable.

Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
  • Loading branch information
bmwiedemann committed Jul 21, 2019
1 parent 77a5e9e commit cbdb7e9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ OCIUMOUNTINSTALLDIR=$(PREFIX)/share/oci-umount/oci-umount.d

SELINUXOPT ?= $(shell selinuxenabled 2>/dev/null && echo -Z)

BUILD_INFO := $(shell date +%s)
ifdef SOURCE_DATE_EPOCH
BUILD_INFO := ${SOURCE_DATE_EPOCH}
else
BUILD_INFO := $(shell date +%s)
endif

GO_MD2MAN := ${BUILD_BIN_PATH}/go-md2man
GINKGO := ${BUILD_BIN_PATH}/ginkgo
Expand Down

0 comments on commit cbdb7e9

Please sign in to comment.