[pkg-go] Simple binary + library package example

Anthony Fok foka at debian.org
Thu May 31 05:15:55 BST 2018


Hi Tong,

喂,大哥,人家 Stephen 好意告訴你使用 dh-make-golang,
你卻說:「我知道,但不是應該用 dh-golang 的嘛?」

大哥,你究竟有沒有親自試過 dh-make-golang?

    sudo apt install dh-make-golang
    man dh-make-golang
    dh-make-golang -help

etc. to learn the tool.

dh-make-golang and dh-golang are two different yet both essential tools.
One is a tool for starting a new package from scratch.
One is required for all stage of building and packaging and is thus
listed in Build-Depends.

If you are confusing the two, or you haven't even tried running the tool yet,
you are just blindly asking questions without thinking...  小心犯眾憎  :-p

It ain't gonna be too easy.  And don't expect "simple straightforward
instruction" because there isn't any yet, especially because the
process isn't that simple and straightforward.

Please visit https://go-team.pages.debian.net/ and start reading, and
begin experimenting.

dh-make-golang by default creates template either for "program" or for
"library".
You want both in the same source package?
You manually tweak the debian/control after a "dh-make-golang make" run,
and that was why Arnaud Rebillout gave you
https://salsa.debian.org/go-team/packages/continuity to look at.

You were supposed to go and compare how debian/* files (especially
debian/control)
differ from the output of "dh-make-golang -type program
github.com/containerd/continuity",
而不是埋怨人家沒有給你 "simple instruction".  :-p

Yes, the learning curve for a new DM and DD is steep.
Heck, it was quite difficult even for a "veteran" like me who has been
DD since 1997
to dive into the world of git-buildpackage and Go packaging.

I have a bash script which might be helpful for you to understand the
build process:
https://gist.github.com/anthonyfok/8d3a2909eb8c8211456b#file-build-latest-go-package-sh-L217-L222

But for starters, dh-make-golang guides you through almost the entire process.
Go and spend an hour or two, maybe start out with a simple library-only package,
then maybe with continuity or with hugo (pretending they are "program" only),
and _then_ we will be happy to answer your further questions.

Cheers,
Anthony

On Wed, May 30, 2018 at 9:32 PM, Tong Sun <pkgoyq.xpt at neverbox.com> wrote:
>
>>> On 05/30/2018 10:54 AM, Tong Sun wrote:
>>>
>>>
>>> Hi everyone,
>>>
>>> I'm a first time DM and  first time trying to maintain a Go package.
>>> Can anyone give me some simple instruction on how to maintain/start-with
>>> a simple Go package like this?
>>> I.e., from
>>> turning from https://github.com/containerd/continuity
>>> to https://salsa.debian.org/go-team/packages/continuity
>>> then build.
>>> what are the major steps/tools involved?
>
>
>> This page should be a good start:
>> https://people.debian.org/~stapelberg/2015/07/27/dh-make-golang.html
>
>
> I know that.
>
> Isn't binary-only and binary + library packages are supposed to be build
> with `dh-golang` instead? and I don't see how to use `dh-golang` covered in
> that page either.
>
> I'm not asking for extensive and comprehensive explanations.
> I'm only asking for some simple instruction on the major steps/tools
> involved.
>
>
>
> _______________________________________________
> Pkg-go-maintainers mailing list
> Pkg-go-maintainers at alioth-lists.debian.net
> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-go-maintainers



More information about the Pkg-go-maintainers mailing list