changed 5 years ago
Published Linked with GitHub

Proposal: Using automatic release macros in RPM spec files

Notes:

  • We haven't yet decided definitively on the macro and option names.
  • This document assumes Fedora 31 as the version a package should be built for.

Normal release flow

The most common case is release numbers which just get incremented for each build. For these, one could put the following into your spec file, to be filled in automatically:

​​​​Release: %automatic_release

Effectively resulting in:

​​​​Release: 1.fc31

Prereleases

As per the Fedora Versioning Guidelines, release fields for pre-release versions have to stay below 1. To accommodate this, another macro could be used with an option:

​​​​Release: %automatic_release -p 20200224git1234abcd

Example result:

​​​​Release: 0.1.20200224git1234abcd.fc31

Hotfixes

If you need to do a hotfix in an older Fedora version which doesn't affect newer ones, you would append a <minorbump> number to the release field so that upgradeability is ensured. This could also be done using an option:

​​​​Release: %automatic_release -h

Example result:

​​​​Release: 1.fc31.1
Select a repo