From d1401a6f780d06c93e97b43f7511120ea87f8281 Mon Sep 17 00:00:00 2001 From: Jan Chaloupka Date: Jul 16 2015 14:45:34 +0000 Subject: Initial commit - resolves: #1241156 --- diff --git a/go-srpm-macros.spec b/go-srpm-macros.spec new file mode 100644 index 0000000..c2a4872 --- /dev/null +++ b/go-srpm-macros.spec @@ -0,0 +1,32 @@ +Name: go-srpm-macros +Version: 1 +Release: 1%{?dist} +Summary: RPM macros for building Golang packages for various architectures +Group: Development/Libraries +License: GPLv3+ +Source0: macros.go-srpm +BuildArch: noarch +# for install command +BuildRequires: coreutils + +%description +The package provides macros for building projects in Go +on various architectures. + +%prep +# nothing to prep, just for hooks + +%build +# nothing to build, just for hooks + +%install +install -m 644 -D "%{SOURCE0}" \ + '%{buildroot}%{_rpmconfigdir}/macros.d/macros.go-srpm' + +%files +%{_rpmconfigdir}/macros.d/macros.go-srpm + +%changelog +* Tue Jul 07 2015 jchaloup - 1-1 +- Initial commit + resolves: #1241156 diff --git a/macros.go-srpm b/macros.go-srpm new file mode 100644 index 0000000..0829ac7 --- /dev/null +++ b/macros.go-srpm @@ -0,0 +1,28 @@ +# Copyright (c) 2015 Jakub Cajka , Jan Chaloupka +# This file is distributed under the terms of GNU GPL license version 3, or +# any later version. + +# This file contains macros for building projects in golang for packages +# with golang compiler or gcc-go compiler based on an architecture. +# Golang is primarly for primary architectures, gcc-go for secondary. +# +# This file provides only macros and must not use any other package. + +# Define arches for PA and SA +%golang_arches %{ix86} x86_64 %{arm} +%gccgo_arches %{power64} s390x aarch64 +%go_arches %{golang_arches} %{gccgo_arches} + +# Where to set GOPATH for builds +%gopath %{_datadir}/gocode + +# Minimal version of gcc providing gcc-go +%gccgo_min_vers 5.0.0 + +# Define commands for building +%golang_build go build -compiler gc +%gcc_go_build go build -compiler gccgo -gccgoflags "$RPM_OPT_FLAGS" + +# Define commands for testing +%golang_test go test -compiler gc +%gcc_go_test go test -compiler gccgo -gccgoflags "$RPM_OPT_FLAGS"