Search code examples
centosrpmrpm-spec

How to make an rpm spec that installs libraries to /usr/lib xor /usr/lib64 based on arch?


I'm working on an RPM spec for centos and it needs to install the shared libraries to /usr/lib64 if the arch is 64 bit and /usr/lib otherwise?


Solution

  • That's not how it's supposed to work. It's not the kernel type that should determine where your libraries go, but the library types themselves - 64-bit .so's go to /usr/lib64, 32-bit to /usr/lib.

    You can't have one RPM contain both architectures, the result should be 2 different RPMs, and if I am not mistaken RPM macros should resolve this for you if you use %_libdir.