Draft: Initial debian/ by dh-make-golang
DO NOT MERGE
This is an example of what an MR that creates the initial debian/
contents might look like. Additionally one needs to file an ITP and polish the debian/
contents by at minimum updating the package description and addressing all TODO
items.
This was created by running a custom dh-make-golang version inside a clean Debian Sid container to have the latest and greatest functionality of everything:
# Start a clean container with loop mount to current directory on host
podman run --interactive --tty --rm --shm-size=1G --cap-add SYS_PTRACE --volume=$PWD:/tmp/test --workdir=/tmp/test debian:sid bash
# Inside container install development version of dh-make-golang (see commits at https://salsa.debian.org/otto/dh-make-golang/-/commits/debian/latest)
apt update && apt install -y curl
curl -LO https://salsa.debian.org/otto/dh-make-golang/-/jobs/7890897/artifacts/raw/debian/output/dh-make-golang_0.8+git20250727.a6fe7fa-1~otto+salsaci+20250729+35_amd64.deb
apt install -y ./dh-make-golang*.deb
# Define username and email to use as author in the initial git commits (instead of `root@localhost`)
export DEBEMAIL=otto@debian.org
export DEBFULLNAME="Otto Kekäläinen"
git config --global user.name "Otto Kekäläinen"
git config --global user.email otto@debian.org
# Create package
dh-make-golang make -dep14 -pristine-tar -type library -upstream_git_history -wrap-and-sort ast github.com/homeport/dyff
...
2025/07/31 19:08:15 Starting "dh-make-golang v0.8.0 linux/amd64"
2025/07/31 19:08:15 Verifying arguments: invalid import path "https://github.com/homeport/dyff" — did you specify a Go package import path?
root@733c76cbe92d:/tmp/test# dh-make-golang make -dep14 -pristine-tar -type program -upstream_git_history -wrap-and-sort ast github.com/homeport/dyff
2025/07/31 19:08:26 Starting "dh-make-golang v0.8.0 linux/amd64"
2025/07/31 19:08:26 Downloading "github.com/homeport/dyff/..."
2025/07/31 19:08:27 Determining upstream version number
2025/07/31 19:08:27 Found latest tag "v1.10.1"
2025/07/31 19:08:27 INFO: master is ahead of "v1.10.1" by 72 commits
2025/07/31 19:08:27 Package version is "1.10.1"
2025/07/31 19:08:27 findMains: Running /usr/bin/go list -e -f {{.ImportPath}} {{.Name}} github.com/homeport/dyff/... in /tmp/dh-make-golang1092194853/src/github.com/homeport/dyff
go: downloading github.com/gonvenience/bunt v1.4.2
go: downloading github.com/spf13/cobra v1.9.1
go: downloading github.com/gonvenience/neat v1.3.16
go: downloading github.com/gonvenience/term v1.0.4
go: downloading github.com/gonvenience/ytbx v1.4.7
go: downloading gopkg.in/yaml.v3 v3.0.1
go: downloading github.com/gonvenience/idem v0.0.2
go: downloading github.com/gonvenience/text v1.0.9
go: downloading github.com/lucasb-eyer/go-colorful v1.2.0
go: downloading github.com/mitchellh/hashstructure v1.1.0
go: downloading github.com/sergi/go-diff v1.4.0
go: downloading github.com/texttheater/golang-levenshtein v1.0.1
go: downloading github.com/mattn/go-isatty v0.0.20
go: downloading github.com/mitchellh/go-ps v1.0.0
go: downloading golang.org/x/term v0.33.0
go: downloading gopkg.in/yaml.v2 v2.4.0
go: downloading github.com/BurntSushi/toml v1.5.0
go: downloading github.com/virtuald/go-ordered-json v0.0.0-20170621173500-b18e6e673d74
go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.7
go: downloading github.com/spf13/pflag v1.0.7
go: downloading golang.org/x/sys v0.34.0
go: downloading github.com/mattn/go-ciede2000 v0.0.0-20170301095244-782e8c62fec3
go: downloading golang.org/x/sync v0.16.0
go: downloading github.com/russross/blackfriday/v2 v2.1.0
2025/07/31 19:08:28 Determining dependencies
2025/07/31 19:08:29 Downloading https://github.com/homeport/dyff/archive/v1.10.1.tar.gz
2025/07/31 19:08:30 Moving tempfile to "dyff_1.10.1.orig.tar.gz"
2025/07/31 19:08:30 Adding remote "origin" with URL "git@salsa.debian.org:go-team/packages/dyff.git"
2025/07/31 19:08:30 Adding remote "upstreamvcs" with URL "https://github.com/homeport/dyff"
2025/07/31 19:08:30 Running "git fetch --tags upstreamvcs"
...
# Check if there are dependencies that need packaging
dh-make-golang estimate github.com/homeport/dyff
no required module provides package github.com/homeport/dyff; to add it:
go get github.com/homeport/dyff
2025/07/31 21:27:11 estimate: get direct dependencies: get module dir: go list: args: [go list -f {{.Dir}} github.com/homeport/dyff];
error: exit status 1
# (above command broken)
cat dyff/go.mod
module github.com/homeport/dyff
go 1.23.0
require (
github.com/gonvenience/bunt v1.4.0
github.com/gonvenience/idem v0.0.1
github.com/gonvenience/neat v1.3.15
github.com/gonvenience/term v1.0.3
github.com/gonvenience/text v1.0.8
github.com/gonvenience/ytbx v1.4.6
github.com/lucasb-eyer/go-colorful v1.2.0
github.com/mitchellh/hashstructure v1.1.0
github.com/onsi/ginkgo/v2 v2.23.0
github.com/onsi/gomega v1.36.2
github.com/spf13/cobra v1.9.1
github.com/texttheater/golang-levenshtein v1.0.1
gopkg.in/yaml.v3 v3.0.1
)
for x in <above packages>
do
dh-make-golang search $x
apt-file search $x
done
# => All dependencies already in Debian except golang-github-gonvenience-idem-dev, which will be packaged in https://salsa.debian.org/go-team/packages/golang-github-gonvenience-idem
# Create repository and push unmodified upstream code as a start
dh-make-golang create-salsa-project dyff
cd dyff
# Note: This command must be run outside the container on the host directly so it has access to the users SSH key and Salsa account credentials
git push --force --verbose
# Create a new branch for this MR and commit the newly created files on it
git checkout -b import/$(dpkg-parsechangelog -SVersion)
git add debian
git commit -m "Initial debian/ by dh-make-golang"
git push --verbose
Edited by Otto Kekäläinen