diff --git a/traefik1.7.changes b/traefik1.7.changes index 7dc0a5b..219e5ff 100644 --- a/traefik1.7.changes +++ b/traefik1.7.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue May 25 13:50:00 UTC 2021 - Bernhard Wiedemann + +- Allow to override build date with SOURCE_DATE_EPOCH + in order to make builds reproducible (boo#1047218) + ------------------------------------------------------------------- Thu Apr 29 14:22:24 UTC 2021 - alexandre.vicenzi@suse.com diff --git a/traefik1.7.spec b/traefik1.7.spec index 8c83f24..01644d6 100644 --- a/traefik1.7.spec +++ b/traefik1.7.spec @@ -16,7 +16,6 @@ # %define project github.com/traefik/traefik -%define build_date %(date +"%Y%m%d") Name: traefik1.7 Version: 1.7.30 @@ -51,6 +50,7 @@ Pointing Traefik at your orchestrator should be the only configuration step you %setup -q -n traefik-%{version} %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 %{name} ./cmd/traefik/ %install