From 988dc5390015c1c038917b230e5bc1c067849d3b Mon Sep 17 00:00:00 2001 From: Nicolas Mailhot Date: Feb 14 2018 17:19:49 +0000 Subject: why stop at commit and tag in ldflags when we can also do version and the heketi packager wants version too --- diff --git a/go-compilers.spec b/go-compilers.spec index b6828b4..09612e8 100644 --- a/go-compilers.spec +++ b/go-compilers.spec @@ -1,6 +1,6 @@ Name: go-compilers Version: 3 -Release: 0.10%{?dist} +Release: 0.11%{?dist} Summary: rpm automation to create Go language (golang) packages License: GPLv3+ @@ -126,7 +126,7 @@ install -m 0644 -vp %{SOURCE21} \ %endif %changelog -* Wed Feb 14 2018 Nicolas Mailhot - 3-0.10 +* Wed Feb 14 2018 Nicolas Mailhot - 3-0.11 - merge go-srpm-macros and go-compilers to reduce the number of Go rpm macro packages and make sure all the macros are kept in sync - simplify subpackage naming diff --git a/macros.go-rpm b/macros.go-rpm index 460f65f..4e4e8fa 100644 --- a/macros.go-rpm +++ b/macros.go-rpm @@ -82,8 +82,7 @@ done} cd "%{gobuildpath}/src/%{goipath}" install -m 0755 -vd _bin export GOPATH="%{gobuildpath}:%{gopath}" - %{?commit:export LDFLAGS="${LDFLAGS:-} -X %{goipath}/version.commit=%{commit}"} - %{?tag:export LDFLAGS="${LDFLAGS:-} -X %{goipath}/version.tag=%{tag}"} + export LDFLAGS="${LDFLAGS:-}%{?commit: -X %{goipath}/version.commit=%{commit}}%{?tag: -X %{goipath}/version.tag=%{tag}}%{?version: -X %{goipath}/version=%{version}}" } # Run %%{gotest} on all subdirectories except for those provided in parameters.