I am writing a .spec file for an app built with go[0].
I first made a build following the official doc, then write a .spec file
and built with it .rpm. Everything is OK but I have some doubts when I look
at some other .spec files for application writen in GO, or create a spec
file for my app using gofed[1], or even read Fedora wiki about GO
packages[2].
Spec files are indeed much more complicated, with
At the beginig, one can usually see something similar to the following:
%if 0%{?fedora} || 0%{?rhel} == 6
%global with_debug 1
%global with_bundled 0
%global with_check 1
%else
%global with_debug 0
%global with_bundled 1
%global with_check 0
%endif
%if 0%{?with_debug}
%global _dwz_low_mem_die_limit 0
%else
%global debug_package %{nil}
%endif
---------------------------------------------------
Then in %build something invoking the <go build> command is used instead of
gcc make:
%if 0%{?with_debug}
function gobuild { go build -a -ldflags "-B 0x$(head -c20 /dev/urandom|od
-An -tx1|tr -d ' \n')" -v -x "$@"; }
%else
function gobuild { go build -a "$@" -ldflags "-X
%{import_path}/version.GitSHA %{shortcommit}"; }
%endif
Do I have to use go gcc or gobuild instead of make ? I am not cross
compiling as the resulting package will be for my box, i.e. amd64.
Thank you for help/tips as doc is not easy to find.
[
0]https://github.com/mattermost/platform
[
1]https://github.com/gofed/gofed
[
2]https://fedoraproject.org/wiki/PackagingDrafts/Go