<div dir="ltr">dh_golang assumes that your source package consists of precisely one Go package, not multiple.<div><br></div><div>Why are you having multiple libraries in the same source package?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 14, 2015 at 7:33 PM, Chas Williams III <span dir="ltr"><<a href="mailto:Charles.Williams@brocade.com" target="_blank">Charles.Williams@brocade.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">OK, I have another odd little problem.  If I have multiple packages in<br>
the source tree:<br>
<br>
        $ ls -R src<br>
        src:<br>
        myutil  stringutils2<br>
<br>
        src/myutil:<br>
        myutil.go<br>
<br>
        src/stringutils2:<br>
        stringutils2.go<br>
<br>
<br>
where stringutils2 is just another package, it doesn't get copied over<br>
"correctly" to the build directory:<br>
<br>
        $ ls -R obj-x86_64-linux-gnu/<br>
        obj-x86_64-linux-gnu/:<br>
        src<br>
<br>
        obj-x86_64-linux-gnu/src:<br>
        <a href="http://github.com" target="_blank">github.com</a>  myutil  <a href="http://vyatta.net" target="_blank">vyatta.net</a><br>
<br>
        obj-x86_64-linux-gnu/src/myutil:<br>
        build.log  README  src<br>
<br>
        obj-x86_64-linux-gnu/src/myutil/src:<br>
        myutil  stringutils2<br>
<br>
        obj-x86_64-linux-gnu/src/myutil/src/myutil:<br>
        myutil.go<br>
<br>
        obj-x86_64-linux-gnu/src/myutil/src/stringutils2:<br>
        stringutils2.go<br>
<br>
stringutils2 needs to up two levels to be found by the default<br>
GOPATH or am I doing something wrong?<br>
<span class="im HOEnZb"><br>
On Thu, 2015-05-14 at 04:24 -0600, Michael Stapelberg wrote:<br>
</span><div class="HOEnZb"><div class="h5">> So, I’ve had a closer look at what’s happening here:<br>
><br>
><br>
> debhelper (and CDBS) install files to debian/tmp by default if there<br>
> is more than one binary package in your debian/control. In that<br>
> situation, you’d use install files to effectively copy files from<br>
> debian/tmp to debian/<package>.<br>
><br>
><br>
> With just one binary package in debian/control (your situation), files<br>
> are directly installed into debian/<package>, so install files are<br>
> useless. Trying to run dh_install with --sourcedir=debian/myutil<br>
> illustrates this:<br>
><br>
><br>
> dh_install --sourcedir=debian/myutil<br>
> cp -a debian/myutil/usr/bin/myutil debian/myutil//usr/bin/<br>
> cp: ‘debian/myutil/usr/bin/myutil’ and ‘debian/myutil//usr/bin/myutil’<br>
> are the same file<br>
><br>
><br>
> So, I think deleting the unwanted files is not only just an option,<br>
> but the intended way how this should work.<br>
><br>
><br>
> See the override_dh_auto_install override<br>
> in <a href="http://anonscm.debian.org/cgit/pkg-go/packages/heartbleeder.git/tree/debian/rules" target="_blank">http://anonscm.debian.org/cgit/pkg-go/packages/heartbleeder.git/tree/debian/rules</a> for an example.<br>
><br>
><br>
> Hope that helps,<br>
><br>
> On Thu, May 14, 2015 at 1:03 AM, Michael Stapelberg<br>
> <<a href="mailto:stapelberg@debian.org">stapelberg@debian.org</a>> wrote:<br>
>         Please don’t drop pkg-go-maintainers from the CC, this<br>
>         conversation is interesting for everyone.<br>
><br>
><br>
>         One option to solve your issue is to just delete<br>
>         usr/share/gocode, as one of the examples I linked to does<br>
>         (sorry, don’t recall which one).<br>
><br>
>         On Wed, May 13, 2015 at 8:53 PM, Chas Williams III<br>
>         <<a href="mailto:Charles.Williams@brocade.com">Charles.Williams@brocade.com</a>> wrote:<br>
>                 Thank you for the links.<br>
><br>
>                 If I have multiple packages that are related but want<br>
>                 to go into<br>
>                 separate debian packages, like a server package and<br>
>                 some debugging utils<br>
>                 that you might optionally want to install.<br>
><br>
>                 If I don't have an *.install, I get a .deb file with:<br>
><br>
>                 drwxr-xr-x root/root         0 2015-05-13<br>
>                 11:45 ./usr/share/gocode/<br>
>                 drwxr-xr-x root/root         0 2015-05-13<br>
>                 11:45 ./usr/share/gocode/src/<br>
>                 drwxr-xr-x root/root         0 2015-05-13<br>
>                 11:45 ./usr/share/gocode/src/myutil/<br>
>                 drwxr-xr-x root/root         0 2015-05-13<br>
>                 11:45 ./usr/share/gocode/src/myutil/src/<br>
>                 drwxr-xr-x root/root         0 2015-05-13<br>
>                 11:45 ./usr/share/gocode/src/myutil/src/myutil/<br>
>                 -rw-r--r-- root/root       128 2015-05-13<br>
>                 11:45 ./usr/share/gocode/src/myutil/src/myutil/myutil.go<br>
>                 drwxr-xr-x root/root         0 2015-05-13<br>
>                 11:45 ./usr/bin/<br>
>                 -rwxr-xr-x root/root   1357256 2015-05-13<br>
>                 11:45 ./usr/bin/myutil<br>
><br>
>                 I don't want to ship the gocode.<br>
><br>
>                 On Wed, 2015-05-13 at 12:30 -0600, Michael Stapelberg<br>
>                 wrote:<br>
>                 > Here are a couple binary-only packages:<br>
>                 ><br>
>                 ><br>
>                 ><br>
>                 <a href="http://anonscm.debian.org/cgit/pkg-go/packages/etcd.git/" target="_blank">http://anonscm.debian.org/cgit/pkg-go/packages/etcd.git/</a><br>
>                 ><br>
>                 <a href="http://anonscm.debian.org/cgit/pkg-go/packages/heartbleeder.git/" target="_blank">http://anonscm.debian.org/cgit/pkg-go/packages/heartbleeder.git/</a><br>
>                 ><br>
>                 ><br>
>                 <a href="http://anonscm.debian.org/cgit/pkg-go/packages/skydns.git/" target="_blank">http://anonscm.debian.org/cgit/pkg-go/packages/skydns.git/</a><br>
>                 ><br>
>                 ><br>
>                 ><br>
>                 > Why do you need an install file at all if you’re<br>
>                 just dealing with a<br>
>                 > binary-only package?<br>
>                 ><br>
>                 > On Wed, May 13, 2015 at 8:22 PM, Chas Williams III<br>
>                 > <<a href="mailto:Charles.Williams@brocade.com">Charles.Williams@brocade.com</a>> wrote:<br>
>                 >         See attached.  I can build the<br>
>                 golang-stringutils package<br>
>                 >         fine.<br>
>                 >         myutil builds but I am unable to create a<br>
>                 binary package that<br>
>                 >         only<br>
>                 >         contains the utility myutil.  I don't need<br>
>                 to ship myutil's as<br>
>                 >         a<br>
>                 >         development package.<br>
>                 ><br>
>                 >         I have been unable to find an example of<br>
>                 dh-golang used to<br>
>                 >         build a<br>
>                 >         binary only package.<br>
>                 ><br>
>                 >         On Wed, 2015-05-13 at 12:04 -0600, Michael<br>
>                 Stapelberg wrote:<br>
>                 >         > Without seeing your packaging it’s very<br>
>                 hard to help. Maybe<br>
>                 >         taking a<br>
>                 >         > look at the existing pkg-go packages<br>
>                 helps?<br>
>                 >         ><br>
>                 >         > On Wed, May 13, 2015 at 7:21 PM, Chas<br>
>                 Williams III<br>
>                 >         > <<a href="mailto:Charles.Williams@brocade.com">Charles.Williams@brocade.com</a>> wrote:<br>
>                 >         >         I think I have it figured out now.<br>
>                 I wasn't setting<br>
>                 >         DH_GOPKG<br>
>                 >         >         on the<br>
>                 >         >         non-library package.<br>
>                 >         ><br>
>                 >         >         How do you write an *.install file<br>
>                 to match file<br>
>                 >         paths?  The<br>
>                 >         >         files don't<br>
>                 >         >         seem to be installed in the<br>
>                 temporary root and the<br>
>                 >         typical<br>
>                 >         >         paths I would<br>
>                 >         >         use don't seem to work.<br>
>                 >         ><br>
>                 >         >         On Tue, 2015-05-12 at 14:06 -0600,<br>
>                 Michael<br>
>                 >         Stapelberg wrote:<br>
>                 >         >         > Why woulud the build system need<br>
>                 to write<br>
>                 >         >         to /usr/share/gocode? You<br>
>                 >         >         > shouldn’t need to touch your<br>
>                 dependencies during<br>
>                 >         build.<br>
>                 >         >         ><br>
>                 >         >         ><br>
>                 >         >         > Can you make your packaging<br>
>                 available? Without<br>
>                 >         seeing the<br>
>                 >         >         code, it’s<br>
>                 >         >         > hard to help.<br>
>                 >         >         ><br>
>                 >         >         > On Tue, May 12, 2015 at 7:44 PM,<br>
>                 Chas Williams III<br>
>                 >         >         > <<a href="mailto:Charles.Williams@brocade.com">Charles.Williams@brocade.com</a>><br>
>                 wrote:<br>
>                 >         >         >         Hello,<br>
>                 >         >         ><br>
>                 >         >         >         I have managed to<br>
>                 produce a golang Debian<br>
>                 >         package,<br>
>                 >         >         but I still<br>
>                 >         >         >         can't<br>
>                 >         >         >         seem to figure out how<br>
>                 to use this package<br>
>                 >         to build<br>
>                 >         >         my Go<br>
>                 >         >         >         application.<br>
>                 >         >         ><br>
>                 >         >         >         Buildsystem/<a href="http://golang.pm" target="_blank">golang.pm</a><br>
>                 says want I want to<br>
>                 >         hear:<br>
>                 >         >         ><br>
>                 >         >         ><br>
>                 >         >         ><br>
>                 >         ><br>
>                 ><br>
>                  ############################################################################<br>
>                 >         >         >         # Symlink all available<br>
>                 libraries<br>
>                 >         >         from /usr/share/gocode/src<br>
>                 >         >         >         into our<br>
>                 >         >         >         # buildroot.<br>
>                 >         >         ><br>
>                 >         ><br>
>                 ><br>
>                  ############################################################################<br>
>                 >         >         ><br>
>                 >         >         >         But _link_contents()<br>
>                 doesn't really seem<br>
>                 >         to do that.<br>
>                 >         >         It<br>
>                 >         >         >         symlinks<br>
>                 >         >         >         the directories, but<br>
>                 shouldn't it really<br>
>                 >         create the<br>
>                 >         >         >         directories and<br>
>                 >         >         >         symlinks the source<br>
>                 files (*.go) since<br>
>                 >         it's unlikely<br>
>                 >         >         the build<br>
>                 >         >         >         system<br>
>                 >         >         >         can write<br>
>                 to /usr/share/gocode?<br>
>                 >         >         ><br>
>                 >         >         ><br>
>                 >         >         ><br>
>                 >         >         ><br>
>                 >         >         ><br>
>                 >         >         ><br>
>                 >         >         ><br>
>                 >         >         ><br>
>                 >         >         > --<br>
>                 >         >         > Best regards,<br>
>                 >         >         > Michael<br>
>                 >         ><br>
>                 >         ><br>
>                 >         ><br>
>                 >         ><br>
>                 >         ><br>
>                 >         ><br>
>                 >         > --<br>
>                 >         > Best regards,<br>
>                 >         > Michael<br>
>                 ><br>
>                 ><br>
>                 ><br>
>                 ><br>
>                 ><br>
>                 ><br>
>                 > --<br>
>                 > Best regards,<br>
>                 > Michael<br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
>         --<br>
>         Best regards,<br>
>         Michael<br>
><br>
><br>
><br>
><br>
> --<br>
> Best regards,<br>
> Michael<br>
<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Best regards,<br>Michael</div>
</div>