#44 Stop using deprecated %__global_ldflags macro.
Merged 2 years ago by gotmax23. Opened 2 years ago by gotmax23.
gotmax23/go-rpm-macros master  into  master

@@ -26,9 +26,9 @@ 

  # Define commands for building

  %gobuild(o:) %{expand:

  %{?gobuilddir:GOPATH="%{gobuilddir}:${GOPATH:+${GOPATH}:}%{?gopath}"} \\

- go build -compiler gccgo -gccgoflags     "$RPM_OPT_FLAGS ${LDFLAGS:-%{?currentgoldflags} %__global_ldflags} %{?__golang_extldflags}" -a -v -x %{?**};

+ go build -compiler gccgo -gccgoflags     "$RPM_OPT_FLAGS ${LDFLAGS:-%{?currentgoldflags} %{build_ldflags}} %{?__golang_extldflags}" -a -v -x %{?**};

  }

  

  # Define commands for testing

- %gotestflags -compiler gccgo -gccgoflags "$RPM_OPT_FLAGS ${LDFLAGS:-%{?currentgoldflags} %__global_ldflags} %{?__golang_extldflags}"

+ %gotestflags -compiler gccgo -gccgoflags "$RPM_OPT_FLAGS ${LDFLAGS:-%{?currentgoldflags} %{build_ldflags}} %{?__golang_extldflags}"

  %gotest() go test %{gotestflags} %{?**};

@@ -29,7 +29,7 @@ 

  #

  #    %make GOBUILDFLAGS="%gobuildflags"

  #

- %gobuildflags() %{expand:%{gocompilerflags} -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} %{?currentgoldflags} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -compressdwarf=false -extldflags '%__global_ldflags %{?__golang_extldflags}'" -a -v -x}

+ %gobuildflags() %{expand:%{gocompilerflags} -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} %{?currentgoldflags} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -compressdwarf=false -extldflags '%{build_ldflags} %{?__golang_extldflags}'" -a -v -x}

  

  # Turn off Go modules

  %gomodulesmode GO111MODULE=off
@@ -50,7 +50,7 @@ 

  

  # Define commands for testing

  %gotestflags      %{gocompilerflags}

- %gotestextldflags %__global_ldflags %{?__golang_extldflags}

+ %gotestextldflags %{build_ldflags} %{?__golang_extldflags}

  %gotest() %{expand:

    %undefine _auto_set_build_flags

    %{?gomodulesmode} go test %{gotestflags} -ldflags "${LDFLAGS:-} %{?currentgoldflags} -extldflags '%{gotestextldflags}'" %{?**};