nphilipp / fedora-infra / rpmautospec

Forked from fedora-infra/rpmautospec 4 years ago
Generate changelog and release fields for RPM's spec files
Members 5
Nils Philippsen committed 3 years ago

Python Package for Automatic Generation of RPM Release Fields and Changelogs

This project hosts the rpmautospec python package and script, which has these functions:

  • Attempt to automatically calculate release numbers and generate an RPM changelog from the dist-git repository of a package.
  • Tag commits in a dist-git repository with build NEVRs (quoting certain special characters).


  • python3
  • python3-pygit2


The script allows testing the various algorithms for automatic release and changelog generation. It accepts normal CLI options, run python --help for more information.

Generating a Changelog

This is how you can use it:

  • Clone a dist-git repository
fedpkg clone -a guake
  • Generating the changelog, pointing it to the repository cloned above
python generate-changelog guake

Note: You can also generate a good basic changelog using:

git log --after=2018-01-28 --pretty=oneline \
  --format='%w(1000)**%h**%n* %cd %an <%ae>%n%w(60,0,2)- %s%n' \
  --date="format:%a %b %d %Y"

Calculating the Next Value for the Release Field

Calculate the next value for the RPM release field (i.e. to be used for the next build) by running the script this way:

python calculate-release [--algorithm ...] <pkgname> <disttag> [<evr>]


python calculate-release bash fc31
python --algorithm holistic_heuristic gimp fc30

Tagging Dist-Git Repositories with Build NEVRs

To tag a dist-git repository with <name>-[<epoch>:]<version>-<release> for existing builds, run the script like this:

python tag-project <path-to-project-repository>


python tag-project /home/fedora-packages/python-arrow


License: MIT