how to parse specfiles

Thierry Parmentelat thierry.parmentelat at
Mon Jan 24 12:28:26 UTC 2011

Hi folks

I have a piece of C code that basically parses a specfile, in order to
inspect the value of some variables. I am attaching the code for the record

This code is pretty old but works fine, as far as I don't invoke rpmbuild with options
Meaning that I'm getting the right value for variables as if I was running 
$ rpmbuild my.spec

My problem is, however, that it does not take into account the fact that I can run e.g.
$ rpmbuild --with=debug my.spec
Ideally I'd like to be able to pass spec2make the same options as the ones that rpmbuild supports, like --target (which is handled manually right now), or other --define option

In this code, we do prepare an input for rpmcliInit using rpmcliAllPoptTable
It just feels like the rpmbuild options are not part of this bunch

I can't seem to find any relevant doc or hint, any suggestion or example would be much appreciated  

-  Thanks in advance

-------------- next part --------------
A non-text attachment was scrubbed...
Name: spec2make.c
Type: application/octet-stream
Size: 5747 bytes
Desc: not available
URL: <>

More information about the Rpm-list mailing list