Feel free to edit/change/move/enhance/fix/... this page!

Which version of a spec file or which source rpm is used while building a certain binary rpm?

Method currently used by Dag

copied from a mail by Dag:

I have started to put the svn revision in the SPEC file for the binary builds. I specify in the latest Changelog entry either something like:

        * Fri Jan 18 2008 Dag Wieers <dag@wieers.com> - 1.8.0-1 - 5683/dag

or

        * Fri Jan 18 2008 Dag Wieers <dag@wieers.com> - 1.8.0-1 - 5683+/dag

This indicates that it was build either with the vanilla 5683 revision submitted by dag. Or a modified one (possible commit after a succesful build).

Since I do not want to first build it for all distributions, then commit the SPEC and then build again, I cannot know in advance what the revision will be. Of course, with a build system, you do not have that problem :)

Method currently used by Dries

Rpms can only be built when the spec file is committed to the subversion. This means the buildsystem always knows the exact version of the spec file which has been used for a binary rpm. The 'svn last commit revision' is added at the end of the first line of the %changelog:

 rpm --changelog -qp aget/aget/el5-i386/aget-0.4-5.2.el5.rf.i386.rpm | head -1
* Sun Apr 09 2006 Dries Verachtert <dries@ulyssis.org> - 0.4-5.2 #6041

The source rpms don't have a distribution marker like 'el5' in there name but instead the svn last commit revision. This revision is also stored at the end of the first line of the %changelog:

rpm --changelog -qp aget/aget/SRPMS/aget-0.4-5.2.rf.svn6041.src.rpm | head -1
* Sat Apr 08 2006 Dries Verachtert <dries@ulyssis.org> - 0.4-5.2 #6041

Add new spec file tag

RPM5 makes it possible to add new tags in the spec file which are also stored in the binary rpm files. You can get the value of the tag with rpmquery. For example you could add to the spec file:

RpmrepoVersion: 5132

driesverachtert/BinaryRpmToSourceRpmRelation (last edited 2008-02-27 15:29:33 by dverachtert)