Blame SOURCES/golang.macros

fc0505
# Copyright (c) 2015 Jakub Cajka <jcajka@redhat.com>, Jan Chaloupka <jchaloup@redhat.com>
fc0505
# This file is distributed under the terms of GNU GPL license version 3, or
fc0505
# any later version.
fc0505
fc0505
# This file contains macros for building projects in golang for packages
fc0505
# with golang compiler or gcc-go compiler based on an architecture.
fc0505
fc0505
# Define commands for building
fc0505
# BUILD_ID can be generated for golang build no matter of debuginfo
fc0505
%gobuild(o:) \
fc0505
%ifnarch ppc64 \
fc0505
go build -buildmode pie -compiler gc -tags=rpm_crashtraceback -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags'" -a -v -x %{?**};\
fc0505
%else \
fc0505
go build -compiler gc -tags=rpm_crashtraceback -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags'" -a -v -x %{?**};\
fc0505
%endif \
fc0505
fc0505
# Define commands for testing
fc0505
%gotest() go test -compiler gc -ldflags "${LDFLAGS:-}" %{?**};