views:

11

answers:

1

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 appreciated...

A: 

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?

maxpenguin
the '36' there refers to the ICU version 3.6, if there's any way to parameterize it, that might be worthwhile. HTH
Steven R. Loomis
You can try dropping the Require tag altogether and letting RPM add a specific requirement to the library -
m1tk4