简体   繁体   English

rpm 打包:使用 rpm 安装但其他需要它的 rpm 找不到的文件

[英]rpm packaging: files installed using rpm but not found by other rpm which requires it

problem: my rpm package installs the following but doesn't finds it when other package uses it as a dependency:问题:我的 rpm 包安装了以下内容,但当其他包将其用作依赖项时找不到它:

sudo rpm -qlp libjaeger-16.0.0-3641.g0b61b1fc.el8.x86_64.rpm

/usr/lib64/libjaegertracing.so.0
/usr/lib64/libjaegertracing.so.0.6.1
/usr/lib64/libopentracing.so.1
/usr/lib64/libopentracing.so.1.6.0
/usr/lib64/libthrift.so.0.13.0

and for rpm package with this package being mentioned in Requires field, it does specify what shared libs you need:对于在Requires字段中提到的带有此包的 rpm 包,它确实指定了您需要的共享库:

Error: 
 Problem 1: conflicting requests
  - nothing provides libjaegertracing.so.0()(64bit) needed by ceph-common-2:16.0.0-3642.g90dc7b19.el8.x86_64
  - nothing provides libopentracing.so.1()(64bit) needed by ceph-common-2:16.0.0-3642.g90dc7b19.el8.x86_64
  - nothing provides libthrift.so.0.13.0()(64bit) needed by ceph-common-2:16.0.0-3642.g90dc7b19.el8.x86_64

but as you see, even after understanding which file are provided by Required rpm, it is not able to resolve the location for these files.但是如您所见,即使了解了 Required rpm 提供了哪些文件,它也无法解析这些文件的位置。

considerations and checkes I did:我所做的考虑和检查:

  1. being build in the same platform (64bit)在同一平台上构建(64位)
  2. experimentally checked in a dummy spec file >> works fine with rpm --provides also listing shared libs,在虚拟规范文件中进行实验检查 >> 与rpm --provides工作正常 -- 还提供列出共享库,
    rpm -q --provides libjaeger2-1-1.x86_64
    libjaeger2 = 1-1
    libjaeger2(x86-64) = 1-1
    libjaegertracing.so.0()(64bit)
    libopentracing.so.1()(64bit)
    libthrift.so.0.13.0()(64bit)

but when I do the same for main source rpm created I do not see shared libs in provides:但是当我对创建的主源 rpm 执行相同操作时,我没有在提供中看到共享库:

❯ sudo rpm -q --provides libjaeger-16.0.0-3641.g0b61b1fc.el8.x86_64.rpm

libjaeger = 2:16.0.0-3641.g0b61b1fc.el8
libjaeger(x86-64) = 2:16.0.0-3641.g0b61b1fc.el8

how do I make sure rpm is able to resolve and find these shared libraries?我如何确保 rpm 能够解析并找到这些共享库?

relevant part of spec file:规范文件的相关部分:

%if %{with jaeger}
%files -n libjaeger
#will have to change with find_package method
%{_libdir}/libopentracing.so.*
%{_libdir}/libthrift.so.*
%{_libdir}/libjaegertracing.so.*

%post -n libjaeger -p /sbin/ldconfig
%postun -n libjaeger -p /sbin/ldconfig

%files -n libjaeger-devel
%{_includedir}/thrift
%{_includedir}/jaegertracing
%{_includedir}/opentracing
%{_libdir}/libopentracing.so
%{_libdir}/libthrift.so
%{_libdir}/libjaegertracing.so
%endif



 %package -n libjaeger
    Summary:    Ceph distributed file system client library
    %if 0%{?suse_version}
    Group:      System/Libraries
    %endif
    Obsoletes:  libjaeger < %{_epoch_prefix}%{version}-%{release}
    %description -n libjaeger
    Ceph is a distributed network file system designed to provide excellent
    performance, reliability, and scalability.

You probably disabled automatic provides.您可能禁用了自动提供。 See: http://ftp.rpm.org/max-rpm/s1-rpm-depend-auto-depend.html见: http : //ftp.rpm.org/max-rpm/s1-rpm-depend-auto-depend.html

You either have to enable it again by deleting the line with AutoReqProv or explicitly write it in spec:您必须通过删除带有AutoReqProv的行来再次启用它,或者在规范中明确写入它:

  Provides: libjaegertracing.so.0()(64bit)
  Provides: libopentracing.so.1()(64bit)

The first is preferred as the second is hard to maintain.第一个是首选,因为第二个很难维护。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM