Detecting version in a SPEC file

Lamont Peterson lamont at
Mon Feb 19 02:48:17 UTC 2007


I'm refactoring a package (perl module) that needs to build on CentOS4/RHEL4 
and FC6/RHEL5.  This package depends on GnuPG, whose version changed from 
FC3 -> FC6.  The change from gpg 1.2 to gpg 1.4 actually means that the tests 
(%check) will fail unless I use a different set of test results for the two 

I would like to test (in a %if %endif block) which version of GnuPG is 
installed on the system.  I could run an "rpm --queryformat" command to get 
the version, but I was hoping that there is a better way, since rpmbuild 
already can check versions of installed packages for BuildRequires.
Lamont Peterson <lamont at>
Senior Instructor
Guru Labs, L.C. [ ]

NOTE:  All messages from this email address should be digitally signed with my
       0xDC0DD409 GPG key. It is available on the keyserver as
       well as other keyservers that sync with MIT's.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : 

More information about the devel mailing list