Score:0

Creating .deb for Go fails

rs flag

Trying to build a custom package fails like this:

~/deploy# dpkg-buildpackage -us -uc 
dpkg-buildpackage: info: source package deploy
dpkg-buildpackage: info: source version 1.0-1
dpkg-buildpackage: info: source distribution unstable
dpkg-buildpackage: info: source changed by Foo Bar <[email protected]>
dpkg-buildpackage: info: host architecture amd64
 dpkg-source --before-build .
 debian/rules clean
dh clean --builddirectory=_build --buildsystem=golang --with=golang
   dh_auto_clean -O--builddirectory=_build -O--buildsystem=golang
   dh_autoreconf_clean -O--builddirectory=_build -O--buildsystem=golang
   dh_clean -O--builddirectory=_build -O--buildsystem=golang
 dpkg-source -b .
dpkg-source: error: can't build with source format '3.0 (quilt)': no upstream tarball found at ../deploy_1.0.orig.tar.{bz2,gz,lzma,xz}
dpkg-buildpackage: error: dpkg-source -b . subprocess returned exit status 255

Hereunder my ˋdebian/controlˋ content.

Source: deploy
Maintainer: Foo Bar ([email protected])
Standards-Version: 4.6.1
Section: utils
Priority: optional
Homepage: https://gitlab.co toso.com/contoso/deploy
Rules-Requires-Root: no
Build-Depends: debhelper-compat (= 12),
               debhelper (>=12),
               dh-golang,
               golang-any

Package: deploy
Architecture: amd64
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: Command used to send Docker webhooks.
 Command used to send Docker webhooks.

My ˋdebian/rulesˋ file:

#!/usr/bin/make -f
#export DH_GOLANG_EXCLUDES := internal
%:
        dh $@ --builddirectory=_build --buildsystem=golang --with=golang

And endly my repo structure :

# ls -la
total 39
drwxr-xr-x 5 root root   6 Feb 17 00:23 .
drwx------ 9 root root  18 Feb 17 00:46 ..
drwxr-xr-x 3 root root   7 Feb 17 00:46 debian
drwxr-xr-x 7 root root  10 Feb 16 22:41 .git
-rw-r--r-- 1 root root 841 Feb 16 23:52 main.go

Any hint on why it crashes because of a missing tarball?

Score:1
rs flag

Solution found, needed to change my rules file to the following :

#!/usr/bin/make -f

%:
        dh $@ --buildsystem=golang --with=golang

override_dh_auto_build:
        go build -v ./...

override_dh_auto_install:
        mkdir -p debian/deploy/usr/bin
        install deploy debian/deploy/usr/bin

override_dh_auto_test:
        echo "Skpping dh_auto_test"
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.