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

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

问题:我的 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

对于在 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

但是如您所见,即使在了解 Required rpm 提供了哪些文件之后,也无法解析这些文件的位置。

我所做的考虑和检查:

  1. 正在同一平台(64 位)中构建
  2. 在虚拟规范文件中进行了实验检查 >> 与 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)

但是当我对创建的主源 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

如何确保 rpm 能够解析并找到这些共享库?

规范文件的相关部分:

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

您可能禁用了自动提供。参见:http://ftp.rpm.org/max-rpm/s1-rpm-depend-auto-depend.html

您要么必须通过删除带有 AutoReqProv 的行再次启用它,要么在规范中明确写入它:

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

首选第一种,因为第二种难以维护。