Mailinglist Archive: opensuse-buildservice (244 mails)

< Previous Next >
Re: [opensuse-buildservice] Re: %goprep macro not found by rpm-build
  • From: Graham Anderson <graham@xxxxxxxxxx>
  • Date: Fri, 08 Jun 2012 17:17:57 +0200
  • Message-id: <9850415.MCnUFKqfdT@excession>
On Friday 08 Jun 2012 07:33:39 Michał Papis wrote:
I was using this instruction: http://en.opensuse.org/openSUSE:Packaging_Go

is there any way that could be updated with proper example?

Thanks for bringing this up, I'll add some lines to show an example with a
real world package.

In the meantime a quick explanation. The %goprep macro prepares a directory
structure inside the build that mimicks the the expected locations that the Go
toolchain build tool "go" expects to see.

On the wiki page, where it shows the following entry in the .spec recipe:

%goprep $IMPORTPATH_NAMESPACE

You should replace $IMPORTPATH_NAMESPACE with the package import path you
would use to import the package into a go source file. For example if I was
importing the protocol buffer package in my go source I would have:

import "code.google.com/p/goprotobuf"

Thus, in the .spec file for the protocol buffer package on OBS, this becomes:

%goprep code.google.com/p/goprotobuf

In your case, this should be:

%goprep github.com/sm/json

Hope this helps, let me know if you have any further questions about building
go packages on OBS.


Cheers the noo,
Graham
< Previous Next >