在构建 RPM 时,如何使 _topdir 相对于 .spec 文件的位置? [英] How do you make _topdir relative to the location of the .spec file when building an RPM?
本文介绍了在构建 RPM 时,如何使 _topdir 相对于 .spec 文件的位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个 .spec
文件,它依赖于一个名为 _topdir
的变量.
I have a .spec
file that relies on a variable called _topdir
.
现在,当您从 git 检出 SRPM 源代码时,您必须更改 _topdir
指向的位置,以使 rpmbuild
正常运行.
Right now when you checkout the SRPM source from git, you have to go and change where _topdir
is pointing to to get the rpmbuild
to function correctly.
# We need the following line so that RPM can find the BUILD and SOURCES and RPMS dirs.
%define _topdir /root/projects/my-project/my-project-srpm/
你如何指定 _topdir
应该相对于 .spec
文件的位置,以便 _topdir
不是硬编码?
How do you specify that _topdir
should be relative to the location of the .spec
file so that _topdir
isn't hard coded?
推荐答案
像这样在命令行指定你的 topdir ...
specify your topdir on the command line like so ...
rpmbuild --define "_topdir \`pwd\`" ...
这篇关于在构建 RPM 时,如何使 _topdir 相对于 .spec 文件的位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文