[CentOS-devel] How get a spec file with all macros expanded
johnny at centos.org
Tue Mar 27 12:37:33 UTC 2012
On 03/27/2012 05:56 AM, Marcos Lois Bermúdez wrote:
> I'm building some packages using CentOS 6, and i have a question that i
> can't get answer for, i think that is a common task in rpm build that
> will get some info that will help in automate some process.
> I need to get a spec file with all macro exanded, so i can extract info
> of buildrequires, etc..
If you want to know the buildrequries, you can do this to with the SRPM:
rpm -qp --requires <name>.src.rpm
You can also extract the spec file directly with the command and then do
things with sed or grep to that file:
rpm2cpio <name>.src.rpm | cpio -i *.spec
You can also see all the macro information for rpm with the command:
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 262 bytes
Desc: OpenPGP digital signature
More information about the CentOS-devel