Product SiteDocumentation Site

18.2.2. Dealing with automatic dependency generation

One of the features in RPM 4.x is the automatic generation of dependencies. For a variety of reasons including different package layouts, different directory structures, or different versions of RPM, you may need to disable some or all of automatic generation of dependencies.
You can disable the automatic generation of dependencies by placing the following directive in your spec file:
Autoreq: 0
If you do so, you need to use the Requires: tag to manually define all requirements. This is not a good solution to the issue of automatic dependencies however. Most likely, you will need to override the %{__find_requires} and %{__find_provides} macros in order to filter out any unwanted dependencies.
These two macros resolve to shell scripts that perform the automated dependency checks, as you can see with the rpm --eval command:
$ rpm --eval "%__find_provides"
/usr/lib/rpm/find-provides
rpm --eval "%__find_requires"
/usr/lib/rpm/find-requires
You can override these scripts to filter out any dependencies that cause problems for your packages.