Extract source URLs from RPM spec files

Mildred <[email protected]>
Newsgroups gmane.linux.redhat.rpm.general
Message-ID <[email protected]>
Hi,

I would like to create a probram that would download automatically the
source files of packages given a spec file and build it using rpmbuild.

But I just wonder how to extract the source URLs from the spec file. I can't
use standard srep and sed since often the Source line contains variables
that need to be resolved.

I found that rpm has an option --specfile that seems deigned for that
purpose. But rpm do not seems to be aware of the source filenames
unfortunately.

Does anyone knows how I could extract this information without writing a
spec file parser ?

Thanks.

Mildred

-- 
Mildred Ki'lya
Site:   <http://mildred632.free.fr/>
XMPP:   <[email protected]> (GoogleTalk, Jabber)

GPG:    197C A7E6 645B 4299 6D37 684B 6F9D A8D6 [9A7D 2E2B]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.