如何制作一个基于 arch 将库安装到 /usr/lib xor /usr/lib64 的 rpm 规范?
我正在为 centos 制定 RPM 规范,如果 arch 是 64 位,则需要将共享库安装到 /usr/lib64 ,否则需要安装到 /usr/lib 吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
对于 Redhat(和 CentOS)6,RPM 宏似乎已经注入了 —libdir=/usr/lib64。
这就是 RH/CentOS 6 通过 RPM SPEC 文件设置 lib64 的方式。
在 RH/CentOS 6 上,执行 automake/configure 不会(并且根据 RH,不会)在 x86_64 架构类型的情况下将库前缀添加到 /usr/lib64。
所有这些都已在 RH/CentOS 7 及更高版本中得到修复。
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.
库的安装路径将由您创建的包的类型决定。
The path a library is installed into would be determined by the type of package you are creating.
这不是它应该如何工作的。决定库位置的不是内核类型,而是库类型本身 - 64 位 .so 位于 /usr/lib64,32 位 .so 位于 /usr/lib。
你不能让一个 RPM 包含两种架构,结果应该是 2 个不同的 RPM,如果我没记错的话,如果你使用 %_libdir,RPM 宏应该会为你解决这个问题。
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.