开发者

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.

I am linking against libicu, and I want the rpm to automatically install the 32bit version as dependency. My requires looks like this in my rpmspec file:

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:

libicu    x86_64

Which does not work because that is only the x86_64 version of the library. If I try to install libicu manually:

yum install libicu

I get:

libicu    x86_64
libicu    i386

It installs the 32bit version of the library as well, and my application works. How can I get rpm to install the 32bit version of this library automatically? Any ideas would be apprecia开发者_运维技巧ted...


This question probably better belongs in ServerFault, but I believe that as of RPM 4.6.0, you can do something like this:

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

[See 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. :-)


I (finally) found an answer that seems to work. Add the following to your Requires: tag in the rpm spec:

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):

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

This seems to work.

Is there a better way?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜