Jesse
Jesse

Reputation: 996

RPM package build VCS-Git versioning without editing repo files on every update

Desired workflow:

  1. Write the SPECS/*.spec file for the RPM package creator.
  2. Make changes to GitHub repo releases like normal on a regular basis.
  3. Never need to re-write SPECS/*.spec 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 RPM?


Elaboration...

How Arch builds packages

In an Arch Linux PKGBUILD file (for makepkg):

  1. The "version" (pkgver= variable) can be set dynamically from a pkgver() function.
  2. 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 RPM?

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 RPM? If so how and to what extent?

On RPM, the same .spec file may work for rpmbuild to read, just needing some certain settings.

This may require publishing GitHub releases so that rpmbuild can read them from SPECS/*.spec viz Source0:.

What of RPM?

  1. Does RPM have any VCS-sourced (eg Git) dynamic versioning function like Arch's PKGBUILD pkgver() function?
  1. Or, would we need to re-write the RPM repo SPECS/*.spec Version: field every time the VCS/Git repo is updated for a new stable release?

Similar question, but for Debian:

Slightly related:

Upvotes: 0

Views: 14

Answers (0)

Related Questions