Where to store VCS version in RPM?

quickshiftin asked:

We’re using Git as our VCS and RPMs for packaging. I’d like to store the Git hash a package was built from, but I’m not sure on the most appropriate place.

There are a number of tags available to an RPM, however I don’t see any for a VCS version (maybe glanced over it?).

I’m quite leery about adding a custom tag, just looking at the 50,000 ft level.

One solution that feels pretty hacky would be to put the Git hash in the description field. We’re not using it for anything else at this point, but wow, that just feels ugly.

So what is the most appropriate place to store a VCS version in an RPM?

My answer:


Fedora (and very rarely RHEL) place this information in the Release tag.

For instance:

Name:           mypackage
Version:        0.0.1
Release:        20140114git0abcdef

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.