简体   繁体   English

RPM需要软件包的i386版本

[英]RPM Requires i386 version of a package

Not really certain if this belongs here... but... 不确定是否属于这里...但是...

I am successfully building an RPM for Centos, the problem is that it is a 32bit binary (don't ask..) - the requires part of the rpm spec only installs the 64bit/x86_64 version of a required library. 我已成功为Centos构建RPM,问题是它是32位二进制文​​件(不要问。)-rpm规范的require部分仅安装所需库的64bit / x86_64版本。

I am linking against libicu, and I want the rpm to automatically install the 32bit version as dependency. 我链接到libicu,我希望rpm自动安装32bit版本作为依赖项。 My requires looks like this in my rpmspec file: 我的需求在我的rpmspec文件中看起来像这样:

Requires: libicu

Building the rpm works fine, except when I try to install the rpm on a completely clean system it yum wants to install this as a dependency: 构建rpm可以正常工作,除了当我尝试在完全干净的系统上安装rpm时,yum希望将其安装为依赖项:

libicu    x86_64

Which does not work because that is only the x86_64 version of the library. 这不起作用,因为那只是该库的x86_64版本。 If I try to install libicu manually: 如果我尝试手动安装libicu:

yum install libicu

I get: 我得到:

libicu    x86_64
libicu    i386

It installs the 32bit version of the library as well, and my application works. 它还安装了该库的32位版本,并且我的应用程序正常工作。 How can I get rpm to install the 32bit version of this library automatically? 如何获得rpm以自动安装此库的32位版本? Any ideas would be appreciated... 任何想法,将不胜感激...

This question probably better belongs in ServerFault, but I believe that as of RPM 4.6.0, you can do something like this: 这个问题可能更好地属于ServerFault,但我认为从RPM 4.6.0开始,您可以执行以下操作:

Requires: libicu%{_isa}
%if %{__isa_bits} == 64
Requires: libicu(%{__isa_name}-32)
%endif

[See http://www.rpm.org/wiki/PackagerDocs/ArchDependencies] [请参阅http://www.rpm.org/wiki/PackagerDocs/ArchDependencies]

However, unfortunately the servers I'm currently working on are running RPM 4.4.2.3, so I've had to use your solution... and thanks for that, btw. 但是,不幸的是,我当前正在使用的服务器正在运行RPM 4.4.2.3,因此我不得不使用您的解决方案...谢谢,顺便说一句。 :-) :-)

I (finally) found an answer that seems to work. 我(终于)找到了一个似乎可行的答案。 Add the following to your Requires: tag in the rpm spec: 将以下内容添加到rpm规范中的Requires:标签中:

actual-so-name()(64bit), actual-so-name-again, package-name

So, in as an example, in my case I need libicu I did the following (just picked one of the icu .so files that I happen to link to): 因此,作为示例,在我的情况下,我需要libicu进行以下操作(只是选择了我碰巧链接到的icu .so文件之一):

Requires: libicui18n.so.36()(64bit), libicuuc.so.36, libicu

This seems to work. 这似乎有效。

Is there a better way? 有没有更好的办法?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM