[pkg-go] dh-golang and _link_contents()
Michael Stapelberg
stapelberg at debian.org
Thu May 14 10:24:40 UTC 2015
So, I’ve had a closer look at what’s happening here:
debhelper (and CDBS) install files to debian/tmp by default if there is
more than one binary package in your debian/control. In that situation,
you’d use install files to effectively copy files from debian/tmp to
debian/<package>.
With just one binary package in debian/control (your situation), files are
directly installed into debian/<package>, so install files are useless.
Trying to run dh_install with --sourcedir=debian/myutil illustrates this:
dh_install --sourcedir=debian/myutil
cp -a debian/myutil/usr/bin/myutil debian/myutil//usr/bin/
cp: ‘debian/myutil/usr/bin/myutil’ and ‘debian/myutil//usr/bin/myutil’ are
the same file
So, I think deleting the unwanted files is not only just an option, but the
intended way how this should work.
See the override_dh_auto_install override in
http://anonscm.debian.org/cgit/pkg-go/packages/heartbleeder.git/tree/debian/rules
for an example.
Hope that helps,
On Thu, May 14, 2015 at 1:03 AM, Michael Stapelberg <stapelberg at debian.org>
wrote:
> Please don’t drop pkg-go-maintainers from the CC, this conversation is
> interesting for everyone.
>
> One option to solve your issue is to just delete usr/share/gocode, as one
> of the examples I linked to does (sorry, don’t recall which one).
>
> On Wed, May 13, 2015 at 8:53 PM, Chas Williams III <
> Charles.Williams at brocade.com> wrote:
>
>> Thank you for the links.
>>
>> If I have multiple packages that are related but want to go into
>> separate debian packages, like a server package and some debugging utils
>> that you might optionally want to install.
>>
>> If I don't have an *.install, I get a .deb file with:
>>
>> drwxr-xr-x root/root 0 2015-05-13 11:45 ./usr/share/gocode/
>> drwxr-xr-x root/root 0 2015-05-13 11:45 ./usr/share/gocode/src/
>> drwxr-xr-x root/root 0 2015-05-13 11:45
>> ./usr/share/gocode/src/myutil/
>> drwxr-xr-x root/root 0 2015-05-13 11:45
>> ./usr/share/gocode/src/myutil/src/
>> drwxr-xr-x root/root 0 2015-05-13 11:45
>> ./usr/share/gocode/src/myutil/src/myutil/
>> -rw-r--r-- root/root 128 2015-05-13 11:45
>> ./usr/share/gocode/src/myutil/src/myutil/myutil.go
>> drwxr-xr-x root/root 0 2015-05-13 11:45 ./usr/bin/
>> -rwxr-xr-x root/root 1357256 2015-05-13 11:45 ./usr/bin/myutil
>>
>> I don't want to ship the gocode.
>>
>> On Wed, 2015-05-13 at 12:30 -0600, Michael Stapelberg wrote:
>> > Here are a couple binary-only packages:
>> >
>> >
>> > http://anonscm.debian.org/cgit/pkg-go/packages/etcd.git/
>> > http://anonscm.debian.org/cgit/pkg-go/packages/heartbleeder.git/
>> >
>> > http://anonscm.debian.org/cgit/pkg-go/packages/skydns.git/
>> >
>> >
>> >
>> > Why do you need an install file at all if you’re just dealing with a
>> > binary-only package?
>> >
>> > On Wed, May 13, 2015 at 8:22 PM, Chas Williams III
>> > <Charles.Williams at brocade.com> wrote:
>> > See attached. I can build the golang-stringutils package
>> > fine.
>> > myutil builds but I am unable to create a binary package that
>> > only
>> > contains the utility myutil. I don't need to ship myutil's as
>> > a
>> > development package.
>> >
>> > I have been unable to find an example of dh-golang used to
>> > build a
>> > binary only package.
>> >
>> > On Wed, 2015-05-13 at 12:04 -0600, Michael Stapelberg wrote:
>> > > Without seeing your packaging it’s very hard to help. Maybe
>> > taking a
>> > > look at the existing pkg-go packages helps?
>> > >
>> > > On Wed, May 13, 2015 at 7:21 PM, Chas Williams III
>> > > <Charles.Williams at brocade.com> wrote:
>> > > I think I have it figured out now. I wasn't setting
>> > DH_GOPKG
>> > > on the
>> > > non-library package.
>> > >
>> > > How do you write an *.install file to match file
>> > paths? The
>> > > files don't
>> > > seem to be installed in the temporary root and the
>> > typical
>> > > paths I would
>> > > use don't seem to work.
>> > >
>> > > On Tue, 2015-05-12 at 14:06 -0600, Michael
>> > Stapelberg wrote:
>> > > > Why woulud the build system need to write
>> > > to /usr/share/gocode? You
>> > > > shouldn’t need to touch your dependencies during
>> > build.
>> > > >
>> > > >
>> > > > Can you make your packaging available? Without
>> > seeing the
>> > > code, it’s
>> > > > hard to help.
>> > > >
>> > > > On Tue, May 12, 2015 at 7:44 PM, Chas Williams III
>> > > > <Charles.Williams at brocade.com> wrote:
>> > > > Hello,
>> > > >
>> > > > I have managed to produce a golang Debian
>> > package,
>> > > but I still
>> > > > can't
>> > > > seem to figure out how to use this package
>> > to build
>> > > my Go
>> > > > application.
>> > > >
>> > > > Buildsystem/golang.pm says want I want to
>> > hear:
>> > > >
>> > > >
>> > > >
>> > >
>> >
>> ############################################################################
>> > > > # Symlink all available libraries
>> > > from /usr/share/gocode/src
>> > > > into our
>> > > > # buildroot.
>> > > >
>> > >
>> >
>> ############################################################################
>> > > >
>> > > > But _link_contents() doesn't really seem
>> > to do that.
>> > > It
>> > > > symlinks
>> > > > the directories, but shouldn't it really
>> > create the
>> > > > directories and
>> > > > symlinks the source files (*.go) since
>> > it's unlikely
>> > > the build
>> > > > system
>> > > > can write to /usr/share/gocode?
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > > --
>> > > > Best regards,
>> > > > Michael
>> > >
>> > >
>> > >
>> > >
>> > >
>> > >
>> > > --
>> > > Best regards,
>> > > Michael
>> >
>> >
>> >
>> >
>> >
>> >
>> > --
>> > Best regards,
>> > Michael
>>
>>
>>
>
>
> --
> Best regards,
> Michael
>
--
Best regards,
Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-go-maintainers/attachments/20150514/b65b2133/attachment-0001.html>
More information about the Pkg-go-maintainers
mailing list