Desired workflow:
- Write the
debian/control
file for the Debian maintanier package creator. - Make changes to GitHub repo releases like normal on a regular basis.
- Never need to re-write
debian/control
Version:
value because their package builders retrieve that version from the Git repo (or GitHub releases) during the package build process.
Arch does this easily, even without releases; can Debian?
Elaboration…
How Arch builds packages
In an Arch Linux PKGBUILD file (for makepkg
):
- The “version” (
pkgver=
variable) can be set dynamically from apkgver()
function. - This automates the version of the package. (If based on an VCS like Git, updating only the repo will automatically result in the package version being updated for AUR packages.)
Arch does; can Debian?
Arch automates the package versioning process remarkably; once written the repo package build script (PKGBUILD
) never needs to be touched again. So, like with Arch, can the version be automatically retrieved from the VCS source at package build time for Debian? If so how and to what extent?
This certainly will not work for Debian package for dpkg-deb
(with ALL-CAPS) DEBIAN/
directory, but using a “maintanier” structure for dpkg-buildpackage
(with all-lowercase) debian/
directory, a Git repo (or GitHub release) can be sourced to create the DEBIAN/
directory, then the package.
This may require publishing GitHub releases so that dpkg-buildpackage
can read them from debian/watch
.
What of Debian?
- Does Debian have any VCS-sourced (eg Git) dynamic versioning function like Arch’s
PKGBUILD
pkgver()
function?
- Something for
debian/control
ordebian/watch
(I’m having trouble understanding the docs) - Or, what is the structure of the files and contents to do this?
- Or, would we need to re-write the Debian repo
DEBIAN/control
Version:
field every time the VCS/Git repo is updated for a new stable release?
Similar question, but for RPM:
- RPM package build VCS-Git versioning without editing repo files on every update
Slightly related:
- What is the difference between git-buildpackage instead of dpkg-buildpackage?
2