我如何在 specfile 中指定两个 BuildRequires 项目,其中第二个项目依赖于正在安装的第一个项目?

How can I specify two BuildRequires items in a specfile where the 2nd relies on the 1st being installed?

我正在尝试构建一个 RPM,它有两个 BuildRequires 项;第一个是存储库 RPM,它是第二个 RPM 的来源。第二个 BuildRequires 项显然依赖于正在安装的第一个存储库,但两者是一起安装的,因此第二个 RPM 不是来自所需的存储库,因为它尚未安装。我可以配置为先安装第一个,然后再尝试安装第二个吗?

BuildRequires:  source-for-second-rpm
BuildRequires:  second-rpm

....

Getting requirements for /root/rpmbuild/SPECS/stuff.spec
 --> source-for-second-rpm
 --> 1:second-rpm     < this is not the correct version as above not yet installed

....

Installing:
 second-rpm                sourced-from-other-repository!
 source-for-second-rpm     sourced-correctly

这意味着在这两个 rpm 中没有正确设置依赖项。

通常second-rpm应该Requiressource-for-second-rpm,显然不是这样的。如果这些要求设置正确,rpm 将以正确的顺序安装。

不,在 RPM SPEC 文件中还没有这样的规定。 你仍然可以做一件事:-

a) 首先安装 source-for-second-rpm。
b) 安装您刚刚制作的 RPM。

注意:- 不要提及 source-for-second-rpm 作为 RPM 的依赖项。

假设我想构建一个名为 abc.rpm 的 RPM,它依赖于 python36。 现在 python36 个软件包在 epel-release 存储库中可用。

因此,您需要执行以下操作:-
a) yum 安装 epel-release
b) 百胜安装 abc.rpm