# Copyright © 2015-2018 Jakub Cajka , # Jan Chaloupka , # Nicolas Mailhot # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # This file contains macros for building projects in golang for packages # with golang compiler or gcc-go compiler based on an architecture. # # SPDX-License-Identifier: GPL-3.0-or-later # Minimal version of gcc providing gcc-go %gccgo_min_vers 5.0.0 # Define commands for building %gobuild(o:) %{expand: %{?gobuilddir:GOPATH="%{gobuilddir}:${GOPATH:+${GOPATH}:}%{?gopath}"} \\ 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} %{build_ldflags}} %{?__golang_extldflags}" %gotest() go test %{gotestflags} %{?**};