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"
# Create package
dh-make-golang make -dep14 -pristine-tar -type library -upstream_git_history -wrap-and-sort ast github.com/gonvenience/idem
...
2025/07/31 19:11:29 Starting "dh-make-golang v0.8.0 linux/amd64"
2025/07/31 19:11:29 Downloading "github.com/gonvenience/idem/..."
2025/07/31 19:11:29 Determining upstream version number
2025/07/31 19:11:29 Found latest tag "v0.0.2"
2025/07/31 19:11:29 INFO: master is ahead of "v0.0.2" by 69 commits
2025/07/31 19:11:29 Package version is "0.0.2"
2025/07/31 19:11:29 findMains: Running /usr/bin/go list -e -f {{.ImportPath}} {{.Name}} github.com/gonvenience/idem/... in /tmp/dh-make-golang1247743337/src/github.com/gonvenience/idem
2025/07/31 19:11:29 Determining dependencies
2025/07/31 19:11:30 Downloading https://github.com/gonvenience/idem/archive/v0.0.2.tar.gz
2025/07/31 19:11:31 Moving tempfile to "golang-github-gonvenience-idem_0.0.2.orig.tar.gz"
2025/07/31 19:11:31 Adding remote "origin" with URL "git@salsa.debian.org:go-team/packages/golang-github-gonvenience-idem.git"
2025/07/31 19:11:31 Adding remote "upstreamvcs" with URL "https://github.com/gonvenience/idem"
2025/07/31 19:11:31 Running "git fetch --tags upstreamvcs"
...
# Check if there are dependencies that need packaging
dh-make-golang estimate github.com/gonvenience/idem
2025/07/31 21:18:39 Bringing github.com/gonvenience/idem to Debian requires packaging the following Go modules:
github.com/gonvenience/idem
cat golang-github-gonvenience-idem/go.mod
module github.com/gonvenience/idem
go 1.23.0
require (
github.com/gonvenience/ytbx v1.4.6
github.com/onsi/ginkgo/v2 v2.23.3
github.com/onsi/gomega v1.36.2
gopkg.in/yaml.v3 v3.0.1
)
for x in gonvenience/ytbx onsi/ginkgo/v2 onsi/gomega gopkg.in/yaml.v3
do
dh-make-golang search $x
apt-file search $x
done
# => All dependencies already in Debian
# Create repository and push unmodified upstream code as a start
dh-make-golang create-salsa-project golang-github-gonvenience-idem
cd golang-github-gonvenience-idem
# 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