Using rpmspec to query .spec file macros

Philip Prindeville philipp_subx at redfish-solutions.com
Thu Mar 5 19:44:36 UTC 2015


I'm trying to write some build automation using mock, etc. and I need to 
be able to query a .spec file for some values.  I did a "rpmspec --help" 
and tried to go by the output but it never mentions where the spec file 
goes in the arguments, for instance!

I tried:

target=fedora-21-x86_64
...
rpmspec --target=$target *.spec --eval="%version"

but this just prints "%version" as the output.  How do you query a .spec 
file for the macros it defines?

I did a quick search for "rpmspec" "--eval" but this didn't turn up 
anything useful.

Is there a tutorial on using rpmdevtools?

Thanks,

-Philip



More information about the devel mailing list