From f6be27b05fb2bddd3a5e8425251874d640a6cdaf8b52629983ba5adf30715a7f Mon Sep 17 00:00:00 2001 From: Richard Brown Date: Tue, 25 May 2021 11:24:55 +0000 Subject: [PATCH] Accepting request 894441 from home:bmwiedemann:branches:devel:kubic Allow to override build date with SOURCE_DATE_EPOCH in order to make builds reproducible (boo#1047218) The %% is replaced by % by rpm OBS-URL: https://build.opensuse.org/request/show/894441 OBS-URL: https://build.opensuse.org/package/show/devel:kubic/traefik?expand=0&rev=5 --- traefik.changes | 6 ++++++ traefik.spec | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/traefik.changes b/traefik.changes index 6ba11db..4d42e84 100644 --- a/traefik.changes +++ b/traefik.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed May 19 09:06:54 UTC 2021 - Bernhard Wiedemann + +- Allow to override build date with SOURCE_DATE_EPOCH + in order to make builds reproducible (boo#1047218) + ------------------------------------------------------------------- Thu Apr 29 10:07:36 UTC 2021 - alexandre.vicenzi@suse.com diff --git a/traefik.spec b/traefik.spec index 2b6405d..08f46e9 100644 --- a/traefik.spec +++ b/traefik.spec @@ -16,7 +16,6 @@ # %define project github.com/traefik/traefik -%define build_date %(date +"%Y%m%d") Name: traefik Version: 2.4.8 @@ -51,6 +50,7 @@ Pointing Traefik at your orchestrator should be the only configuration step you %setup -q %build +build_date=$(date -u -d @${SOURCE_DATE_EPOCH:-$(date +%%s)} +"%%Y%%m%%d") %{goprep} %{project} # tarball causes "inconsistent vendoring" @@ -63,7 +63,7 @@ go generate go build \ -buildmode=pie \ -mod=vendor \ - -ldflags "-s -w -X github.com/traefik/traefik/v2/pkg/version.Version=%{version} -X github.com/traefik/traefik/v2/pkg/version.Codename='' -X github.com/traefik/traefik/v2/pkg/version.BuildDate=%{build_date}" \ + -ldflags "-s -w -X github.com/traefik/traefik/v2/pkg/version.Version=%{version} -X github.com/traefik/traefik/v2/pkg/version.Codename='' -X github.com/traefik/traefik/v2/pkg/version.BuildDate=${build_date}" \ -o traefik ./cmd/traefik/ %install