Overriding %{dist} in an RPM build

Before code goes up stream, it should be rigorously tested. In order to do so, we build Kernels based on the corresponding Fedora version, as Fedora tracks Linux Stable fairly closely. However, we want to be able to distinguish between a Kernel we build with one that comes from Fedora.

The %{dist} label is used to distinguish between Fedora, CentOS, and RHEL in a fedpkg based system. WQe are not using that, but we would like to honor the use of dist in our builds. To override it, I can add a definition of sdist in my file:

Let me say that my builds, instead of having the dist of fc40 (Fedora Core: fs) I am going to use my initials of ay and number my kernels from 01 to 99.

 cat ~/.rpmmacros 
%dist .ay01

To prove that this is what would be used in building the Kernel RPM I can use RPM spec. This version shows the name of the Source RPM:

rpmspec -q --srpm ~/rpmbuild/SPECS/kernel.spec

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.