How can I put my Go binary into a Debian package? Since Go is statically linked, I just have a single executable--I don\'t need a lot of complicated project metadata information
There is an official Debian policy document describing the packaging procedure for Go: https://go-team.pages.debian.net/packaging.html
For libraries: Use dh-make-golang to create a package skeleton. Name your package with a name derived from import path, with a -dev
suffix, e.g. golang-github-lib-pq-dev. Specify the dependencies ont Depends:
line. (These are source dependencies for building, not binary dependencies for running, since Go statically links all source.)
Installing the library package will install its source code to /usr/share/golang/src
(possibly, the compiled libraries could go into .../pkg
). Building depending Go packages will use the artifacts from those system-wide locations.
For executables: Use dh-golang to create the package. Specify dependencies in Build-Depends:
line (see above regarding packaging the dependencies).