Skip to content

Instantly share code, notes, and snippets.

@rpavlik
Last active March 12, 2024 21:54
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rpavlik/0e68877cd47396d39366ae3a59e8fafd to your computer and use it in GitHub Desktop.
Save rpavlik/0e68877cd47396d39366ae3a59e8fafd to your computer and use it in GitHub Desktop.
Debian packaging notes

These are my personal notes on how to handle Debian packaging best locally. Naturally they aren't authoritative, and I may have "missed a memo" - if so, let me know!

  • New package
    • git init
    • gbp import-orig ...
    • debmake
  • Clean up and edit
  • License scan
  • Changelog update for release (timestamp, UNRELEASED -> unstable)
    • gbp dch --release
    • dch --release --news for packages with a NEWS file.
  • Building
    • gbp buildpackage -uc -us - build binary for sid in the cowbuilder
    • gbp buildpackage -uc -us --git-dist=buster - build binary for Buster in the cowbuilder
    • gbp buildpackage -uc -us --git-dist=buster --git-arch=i386 - build binary for Buster 32-bit in the cowbuilder
    • gbp buildpackage -uc -us --git-dist=buster-backports -vCURRENT_BUSTER_VERSION - build binary for buster-backports in the cowbuilder - be sure to look up the current version in buster and update the -v argument
    • against deps: put deps for YOURPACKAGE in ~/extra/pbuilder/deps/YOURPACKAGE and pass DEPS=YOURPACKAGE to the builder. (based on https://wiki.debian.org/PbuilderTricks#How_to_include_local_packages_in_the_build )
  • Update cowbuilders
    • git-pbuilder update updates the sid cowbuilder (default)
    • env DIST=buster git-pbuilder update updates the buster cowbuilder
    • env DIST=buster ARCH=i386 git-pbuilder update updates the buster 32-bit cowbuilder
    • env DIST=buster-backports git-pbuilder update updates the buster-backports cowbuilder
    • equivalent command but with git-pbuilder create creates them, though you may want to export a variable to change where they live. e.g. in Fish, set -U COWBUILDER_BASE /extra/ryan/pbuilder
    • You can use ubuntu distro release names here too:
  • Whalebuilder
    • Install apt-cacher-ng locally
    • Apt-cacher-ng docker image: https://github.com/deployable/docker-apt-cacher-ng
    • Easiest usage: make sure that auto-apt-proxy is included in whatever image you use to build.
    • If using patched whalebuilder, it has that already, otherwise build whalebuilder image like whalebuilder create -d ubuntu -r impish --repository http://us.archive.ubuntu.com/ubuntu --hook 'RUN apt-get install -y -qq auto-apt-proxy' cached/impish
    • whalebuilder create -r bullseye --hook 'RUN apt-get install -y -qq auto-apt-proxy' cached/bullseye
    • Build with something like whalebuilder build cached/bullseye --network bridge copybara_0.0.0.r2746.g2afcc641-1.dsc
  • Signing
    • debsign in the directory works - key ID was set in config file. (~/.devscripts)
    • Have to manually specify debsign -k 1E642ED2F007FDF153B6688E9045010AE5C2B9ED (or F029455EAB70F520FF4A03BD7F534CD56F00321E for old ID) to sign with work key instead of personal.
  • Testing
    • sadt -b -v will run the autopkgtests locally, verbosely, and assuming a built source tree (hence -b)
  • Submitting
    • dput mentors package-name.changes for submitting to https://mentors.debian.net
    • dput ppa:ppanamehere package-name.changes for submitting to a ppa (only uses source packages)
    • osc dput package-name.dsc for submitting to OBS
  • Other important links

gbp pseudo-headers/meta tags in git commit messages:

  • Gbp-Dch: Ignore
  • Gbp-Dch: Short (useful if using gbp dch --full)
  • Gbp-Dch: Full (useful by default - when --full not given )
  • Thanks: msg
  • Closes: bugnumber

This file: 2020-2024 by Rylie Pavlik. CC0 public domain dedication.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment