NOTE: This is a draft, and needs a lot of fleshing out -- if people would rather it live somewhere other than under PackagingDrafts, that's fine by me, so long as the bit about _use_internal_dependency_generator is in the wiki somewhere, hopefully sparing at least one other person the loss of several hours :)
RPM usually does an excellent job of figuring out what a package requires and what it depends on, automatically. However, sometimes there are times you want to disable this entirely (_strongly_ discouraged) or filter out certain errant provides.
How rpm does it ("the plumbing")
... probably just a link to elsewhere ...
Disabling dependency auto-generation
Filtering provides
... bit about the different ways and macros here ...
Unlike the other types of filtering, in order to override the default req/prov generation one has to explicitly set the _use_internal_dependency_generator to 0 in their spec file.
... note about how this seems to override the other, macro based filters as well (e.g. __perl_provides)
requires filtering
In one's specfile, one could have:
Source91: filter-requires.sh %define _use_internal_dependency_generator 0 %define __find_requires %{SOURCE91}
filter-requires.sh would look something like:
#!/bin/sh if [ -x /usr/lib/rpm/redhat/find-requires ] ; then FINDREQ=/usr/lib/rpm/redhat/find-requires else FINDREQ=/usr/lib/rpm/find-requires fi $FINDREQ $* | sed -e '/libbadreq.so/d'
See Packaging:AutoProvidesAndRequiresFiltering for more detail.
provides filtering
In one's specfile, one could have:
Source92: filter-provides.sh %define _use_internal_dependency_generator 0 %define __find_provides %{SOURCE92}
filter-provides.sh would look something like:
#!/bin/sh if [ -x /usr/lib/rpm/redhat/find-provides ] ; then FINDPROV=/usr/lib/rpm/redhat/find-provides else FINDPROV=/usr/lib/rpm/find-provides fi $FINDPROV $* | sed -e '/libbadprov.so/d'
Perl filtering
... pull in bit from Packaging/Perl