[CentOS] How get a spec preprocesed with all macros expanded.

Tue Mar 27 19:19:06 UTC 2012
Marcos Lois Bermudez <marcos.discalis at gmail.com>


Excuse my poor explication.

This is my scenario, now i have some tasks that i make semi-manual that i
want to automate, basically i have some package sources (spec, patches and
in some cases additional files), this packages are fetched from SCM and
converted to SRPMs, to build later with mock, but i need to build these
packages in order with some staging process, so there are some
inter-package dependeces, this is the part that i make semi-automatic.

The problem arrises, when some of these spec support diferent archs os
distributions, some of then have macros that include / exclude certain
build requisites (also run-time requisites), so a grep of spec give me all
requires (some of then are inside a 'if' that evaluates false), it's a
roundabout; from my part, but i'm triing to solve this.

Basically that i want is the spec file as rpmbuild interpret it, i try to
find somethink but i can't figure a tool to get this info (also some other
info of the spec that is conditional based on rpm macros), now i'm surfing
the rpm API and i think that i'm near the solution.