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?
3 Answers
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.

- 3,439
- 1
- 22
- 27
-
Does seem obvious when you put it that way :) %_libdir yay! – Arthur Ulfeldt Jul 26 '10 at 16:39
-
1I'm doing this on centos 6 and %{_libdir} resolves to /usr/lib – Chris Cleeland Feb 08 '13 at 20:51
The path a library is installed into would be determined by the type of package you are creating.

- 2,690
- 5
- 31
- 42
-
I need to write the .spec file to make this happen and in the .spec file I need to add the install locations for each file. How do I specify this? – Arthur Ulfeldt Jul 03 '10 at 22:10
-
There are macros for the standard installation locations. For a general listing: http://www.rpm.org/api/4.4.2.2/config_macros.html . Your target distribution may add more. – JadziaMD Jul 06 '10 at 09:34
It would appear that for Redhat (and CentOS) 6, the RPM macro already injects the —libdir=/usr/lib64.
This is how RH/CentOS 6 sets the lib64 which is through RPM SPEC file.
On RH/CentOS 6, doing automake/configure does not (and according to RH, will not) do the library prefix to /usr/lib64 in case of x86_64 arch type.
All this has been fixed for RH/CentOS 7 and higher.

- 2,239
- 3
- 26
- 37