3

tl;dr:

We build an RPM package that automatically detect dependencies (no Requires in .spec file). How can I remove dependencies from this RPM package.

Long story:-> I'm shipping the dynamic libraries along with the binary but RPMs automatic dependencies mechanism obviously lists that shipped libraries also as dependencies. How to avoid this?

PnotNP
  • 155
  • 1
  • 5

2 Answers2

5

I you don't want rpm to process these dependencies automatically; you can use:

AutoReqProv: no

However, I have multiple time packaged myself binaries and the libraries they depend on; rpm has never caused me any trouble in that way; maybe your way of packaging is not optimal?

For further reading on the automatic dependencies: http://ftp.rpm.org/max-rpm/s1-rpm-depend-auto-depend.html

Chris Maes
  • 3,282
  • 3
  • 21
  • 32
  • Ok let me ask you this, after you package the said libraries and create RPM; does `rpm -qp --requires ` shows the packaged libraries listed there? If yes, then thats what I'm trying to avoid. – PnotNP Mar 13 '18 at 00:40
0

These dependencies that are listed in rpm -qp -requires <pkg>.rpm are virtual packages if automatic dependencies is specified in <pkg>.spec file. These virtual packages are NOT library soname but rather just virtual package names (even though they look like soname).

e.g. on Fedora 27, this works

$ rpm -q --whatprovides "libQt5Core.so.5()(64bit)"        
qt5-qtbase-5.9.2-5.fc27.x86_64   

but this doesn't

$ rpm -q --whatprovides libQt5Core.so.5
no package provides libQt5Core.so.5
$ rpm -q --whatprovides libQt5Core
no package provides libQt5Core
$ rpm -q --whatprovides Qt5Core
no package provides Qt5Core

If your own <pkg>.rpm itself bundles the libraries (i.e. provides these virtual packages) then RPM will not complain if these virtual packages are not installed on the system since they are supplied with your package.

PnotNP
  • 155
  • 1
  • 5