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/holiman/uint256
...
2025/07/31 19:12:17 Starting "dh-make-golang v0.8.0 linux/amd64"
2025/07/31 19:12:17 Downloading "github.com/holiman/uint256/..."
2025/07/31 19:12:18 Determining upstream version number
2025/07/31 19:12:18 Found latest tag "v1.3.2"
2025/07/31 19:12:18 INFO: master is ahead of "v1.3.2" by 2 commits
2025/07/31 19:12:18 Package version is "1.3.2"
2025/07/31 19:12:18 findMains: Running /usr/bin/go list -e -f {{.ImportPath}} {{.Name}} github.com/holiman/uint256/... in /tmp/dh-make-golang2837260193/src/github.com/holiman/uint256
2025/07/31 19:12:18 Determining dependencies
2025/07/31 19:12:18 Downloading https://github.com/holiman/uint256/archive/v1.3.2.tar.gz
2025/07/31 19:12:19 Moving tempfile to "golang-github-holiman-uint256_1.3.2.orig.tar.gz"
2025/07/31 19:12:19 Adding remote "origin" with URL "git@salsa.debian.org:go-team/packages/golang-github-holiman-uint256.git"
2025/07/31 19:12:19 Adding remote "upstreamvcs" with URL "https://github.com/holiman/uint256"
2025/07/31 19:12:19 Running "git fetch --tags upstreamvcs"
...
# Check if there are dependencies that need packaging
dh-make-golang estimate github.com/holiman/uint256
2025/07/31 20:11:07 Bringing github.com/holiman/uint256 to Debian requires packaging the following Go modules:
github.com/holiman/uint256
cat golang-github-holiman-uint256/go.mod
module github.com/holiman/uint256
go 1.19
# => No, this package has no dependencies at all.
# Create repository and push unmodified upstream code as a start
dh-make-golang create-salsa-project golang-github-holiman-uint256
cd golang-github-holiman-uint256
# 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
FYI @momoto
Edited by Otto Kekäläinen