具体的例子是我有很多specfiles Source0
:或其他Source
包含宏的行.如何在不实际启动specfile构建或编写自己的解析器的情况下扩展这些宏?
从rpm 4.9开始,您可以使用:
rpmspec -P
这将在stdout上打印出扩展的spec文件
如果它只需要解析您需要的源代码行,那么spectool
就可以为您完成.它是Fedora的rpmdevtools的一部分.
$ spectool ./mg.spec Source0: http://homepage.boetes.org/software/mg/mg-20110120.tar.gz $
这是它的帮助屏幕
Usage: spectool [] 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