我应该在规范文件中的哪里添加操作系统,以便生成的 RPM 包含操作系统和架构?
我正在几个不同的虚拟机(CentOS5 32 和 64、CentOS6 32 和 64、Fedora 等)上构建软件包。生成的 RPM 文件包含 name.version.release.arch.rpm,如下所示:
foo-1.1-1.i386.rpm
但是,我希望它输出为:
foo-1.1-1.el5.i386.rpm
Where (在规范文件中?.rpmmacros?)和 <我该怎么做?
提前致谢。
I'm building packages on a few different VMs (CentOS5 32 & 64, CentOS6 32 & 64, Fedora, etc). and the resulting RPM file contains the name.version.release.arch.rpm, as in:
foo-1.1-1.i386.rpm
But instead, I want it to output as:
foo-1.1-1.el5.i386.rpm
Where (in the spec file? .rpmmacros?) and how do I do that?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 .spec 文件中使用:
这被替换为例如 el6 RHEL6 等。至少在安装了“@Development tools”和 rpmdevtools 的 Oracle Linux 6.5 上。
In .spec file use this:
This is substituted to e.g. el6 RHEL6 etc. At least on Oracle Linux 6.5 with installed '@Development tools' and rpmdevtools.
在
Release
标记中:通常,人们会创建一个自定义定义,然后包含以下内容:
然后,您还可以根据您构建的操作系统使用逻辑来定义 OSshort。
更新:我修改了
Release
标记,使其仅使用已定义的 OSshort。然后,您可以在规范文件中保留它未定义的状态,并在构建命令期间定义它编写逻辑来测试操作系统/发行版并自动生成,这涉及到解析,这有点复杂,我现在找不到示例。
In the
Release
tag:Often, people create a custom definition and then include that:
Then, you could also use logic to define OSshort based upon what OS you're building on.
Updated: I modified the
Release
tag to only use OSshort if it's defined. Then, you can leave it undefined in the spec file and define it during the build commandWriting logic to test OS/distributions and automatically generate that involves parsing that's a bit more complex and I can't find an example right now.