-1

我的目的是libmy.so通过 RPM 分发已经构建的可安装库。

以下是 .spec 文件的片段:

%define elX el5
%define arch x86_64

Name: my_rpm
Version: 1.0
Requires: <package name which installs libxx.so >

%prep

%define debug_package %{nil}

%build

%install

%files

%defattr(-, root, root)

/home/%{elX}/%{arch}/%{name}_%{version}/lib/libmy.so

在编译时libmy.so,我将它与libxx.so作为另一个 RPM 的一部分安装的链接。

在安装作为上述步骤 1 的一部分创建的 RPM 时,即使libxx.so安装在机器上也会出现以下依赖错误

$ rpm -ivh *rpm

error: Failed dependencies:

libxx.so()(64bit) is needed by *rpm

我们尝试了以下方法。

在分析过程中,我们观察到 所在的路径libxx.so不存在于 中ld.so.conf。但是,添加一个libxx.so位于的路径条目并没有帮助我们。

请让我们知道我们是否需要执行任何其他步骤来消除此依赖项错误。

4

1 回答 1

3

When you install, rpm is looking for an entry in the RPM database; it does not test for the file on the system or linkable.

What is the output of

$ rpm -q --whatprovides libXX.so

That will list which package provides libXX.so. If no package provides it, your RPM will have a dependency error. Remove libXX.so from the Requires: entry. If you're not manually specifying it, it may be detected automatically. In your spec file, you can set:

AutoReqProv: no

That will disable ALL automatic detection of Requires:.

http://ftp.rpm.org/max-rpm/s1-rpm-depend-auto-depend.html

于 2011-09-12T18:13:30.050 回答