Packaging golang-github-vmware-govmomi - usage of makros

Hi,

I am trying to build a package for govmomi: https://github.com/vmware/govmomi.git
The project can be found here: https://build.opensuse.org/package/show/home:Herbster0815:SLES:15/golang-github-vmware-govmomi

I have seen that there is package available for Fedora so I grabbed the spec-file, but noticed, that Fedora uses different go-makros: https://download-ib01.fedoraproject.org/pub/fedora/linux/releases/32/Everything/source/tree/Packages/g/golang-github-vmware-govmomi-0.21.0-3.fc32.src.rpm

I tried lot of things but I cannot get the binaries to be built as used in Fedora’s spec-file:

%if %{with binary}
%build
for cmd in govc toolbox/toolbox vcsim; do
  %gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd
done
mv %{gobuilddir}/bin/toolbox %{gobuilddir}/bin/govmomi-toolbox
%endif

Can someone help here? I have no experience in go or packaging go.

Thx in advance!

Hi
I would have a look here to see what macros are used with openSUSE and building go applications;
https://en.opensuse.org/openSUSE:Packaging_Go

Next I would look in the golang devel repository at some of the packages to see what is what :wink:
https://build.opensuse.org/project/show/devel:languages:go

Hi Malcolm,

thank you for the links but I would not have asked if I would not have been read the manuals :wink:
Anyway: With documentation and try-and-error I managed to get the package and its dependencies be built. The binaries seem to work so far :slight_smile: