CentOS 5.5 上未定义 rpmbuild %{dist}?
我正在尝试在 RPM 规范中使用 %{dist}
标签文件以提供 Fedora Core(例如 fc12
)、CentOS 5(例如 el5
)和 Amazon 的 Linux AMI 之间特定于发行版的依赖关系:
Release: %_svn_revision%{?dist}
不幸的是
# Depencencies
%{?rhel:Requires: ...}
%{?fedora:Requires: ...}
,%{dist}
似乎没有在 CentOS 5.5 中定义,而且我还没有找到与 CentOS 5.5 匹配的特定于发行版的条件(我认为 el5
会匹配,但似乎没有)。 此票证报告了缺少的 %{dist}
CentOS 是 2008 年的版本,但自 2009 年以来就没有更新过。
我如何获得 CentOS 中定义的 %{dist}
以及我应该使用什么条件来匹配 CentOS 5? 任何 RPM 专家都可以为我指出正确的方向吗?
I'm attempting to use the %{dist}
tag in my RPM spec file to provide distribution-specific dependencies between Fedora Core (e.g. fc12
), CentOS 5 (e.g. el5
) and Amazon's Linux AMI:
Release: %_svn_revision%{?dist}
and
# Depencencies
%{?rhel:Requires: ...}
%{?fedora:Requires: ...}
Unfortunately, %{dist}
doesn't appear to be defined in CentOS 5.5, and I haven't found a distribution-specific conditional that matches CentOS 5.5 (I thought el5
would match, but doesn't appear to). This ticket reported the missing %{dist}
in CentOS in 2008, but hasn't been updated since 2009.
How can I get %{dist}
defined in CentOS and what conditional should I use to match CentOS 5?
Can any RPM gurus point me in the right direction?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
CentOS 5 上未定义 dist 宏,因为它不在
/etc/rpm/macros.disttag
中 - 有一个名为buildsys-macros-rhel
的 RPM提供了它,或者 Fedora 上的buildsys-macros
,但由于某种原因它没有被 Centos 重新打包。选项 1) 从此处下载并安装 fedora build-macros
选项 2) 调用 rpmbuild --define 'dist 。每次都会显示 el5'
选项 3) 手动编辑 /etc/rpm/macros.disttag 以添加 rhel (5) 和 dist (.el5) 的宏定义。
然后,您可以在规范文件中使用如下条件:
The dist macros isn't defined on CentOS 5 because it isn't in
/etc/rpm/macros.disttag
- there is a RPM namedbuildsys-macros-rhel
that provides it, orbuildsys-macros
on fedora, but for some reason it is not repackaged by Centos.Option 1) Download and install fedora build-macros from here
Option 2) invoke rpmbuild --define 'dist .el5' every time
Option 3) Manually edit /etc/rpm/macros.disttag to add macro definitions for rhel (5) and dist (.el5).
You can then use conditionals like this in your spec file:
另一种选择是在规范文件中您自己的宏中调用脚本:
它调用属于配置 rpm (redhat-rpm-config) 一部分的脚本。您还可以通过包含以下内容来确保该脚本存在:
然后执行与 ggiroux 定义的相同的条件:
Another option is to call the script within your own macro in the spec file:
which calls a script which is part of the config rpm (redhat-rpm-config). You can also insure that this script is there by including:
and then do the same conditional as ggiroux has defined: