Can some specific autodetected dependency be ignored upon rpmbuild

As of rpm-4.9 (Fedora 15), rpm has a standard method to enable filtering of the autogenerated dependencies.

For example, you can write

%global __requires_exclude ^libthirdpartyplugin.so$

I have not found a built-in way, but I wrote a small script that I used as a filter:

#!/usr/bin/perl -w
use strict;
use IPC::Open2;

# This quick script will run the native find-requires (first parameter)
# and then strip out packages we don't want listed.
open2(\*IN, \*OUT, @ARGV);
print OUT while (<STDIN>);
close(OUT);
my $list = join('', <IN>);

# Apply my filter(s):
$list =~ s/^libqt-mt.so.*?$//mg;

print $list;

You can put your own regular expression lines, in this example I removed libqt-mt.so.*

Then, in the .spec file:

# Note: 'global' evaluates NOW, 'define' allows recursion later...
%global _use_internal_dependency_generator 0
%global __find_requires_orig %{__find_requires}
%define __find_requires %{_builddir}/%{?buildsubdir}/build/find-requires %{__find_requires_orig}

As you can see, this script is in the source tarball under /build/ .