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
On 08/11/16 15:59, arnaud gaboury wrote:
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
spec files being output by gofed are nearly optimal for golang packages. If you want to learn packaging in general, I'd suggest not to target for golang in first step.
Matthias
On Wed, Nov 9, 2016 at 8:56 AM Matthias Runge mrunge@matthias-runge.de wrote:
On 08/11/16 15:59, arnaud gaboury wrote:
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
spec files being output by gofed are nearly optimal for golang packages. If you want to learn packaging in general, I'd suggest not to target for golang in first step.
Unfortunately, I need to build the package as there is none. This is not my first one, so I am not lost. Just wonder what the correct way.
Matthias _______________________________________________ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-leave@lists.fedoraproject.org