Если анализируются только исходные строки, spectool
сделает это за вас.Это часть Fedora rpmdevtools .
$ spectool ./mg.spec
Source0: http://homepage.boetes.org/software/mg/mg-20110120.tar.gz
$
Вот экран справки
Usage: spectool [<options>] <specfile>
Options:
operating mode:
-l, --lf, --list-files lists the expanded sources/patches (default)
-g, --gf, --get-files gets the sources/patches that are listed with
a URL
-h, --help display this help screen
files on which to operate:
-A, --all all files, sources and patches (default)
-S, --sources all sources
-P, --patches all patches
-s, --source x[,y[,...]] specified sources
-p, --patch a[,b[,...]] specified patches
misc:
-d, --define 'macro value' defines RPM macro 'macro' to be 'value'
-C, --directory dir download into specified directory (default '.')
-R, --sourcedir download into rpm's %{_sourcedir}
-n, --dryrun, --dry-run don't download anything, just show what would be
done
-D, --debug output debug info, don't clean up when done