Is it possible to ignore some specific autodetect dependency with rpmbuild

rpmbuild can automatically detect dependencies by looking at the shared libraries needed for the binaries included in the package, and although this is good, think almost every time, there is a time when this is undesirable, but only for some specific libraries. I mean the case when some binaries require libraries that are not provided to the system through rpm package management, but are installed directly by third-party installers.

Now the question arises: is there a way to keep the active autodetection function (useful for other binaries in the package), but ignore / delete only these specific libraries?

Sort of

AutoReqIgnore : library1 AutoReqIgnore : library2 
+4
source share
2 answers

I did not find the built-in method, 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 strings, in this example I deleted 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 original tarball under /build/ .

+3
source

Starting with rpm-4.9 (Fedora 15), rpm has a standard method for filtering auto-generated dependencies.

For example, you can write

 %global __requires_exclude ^libthirdpartyplugin.so$ 
+3
source

All Articles