rpmbuild可以忽略某些特定的自动检测到的依赖性吗 [英] Can some specific autodetected dependency be ignored upon rpmbuild

查看:487
本文介绍了rpmbuild可以忽略某些特定的自动检测到的依赖性吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

rpmbuild可以通过查找程序包中包含的二进制文件所需的共享库来自动检测依赖关系,虽然几乎每次都可以想到,但有时候对于某些特定的库来说,这是不可取的。我指的是某些二进制文件需要的库,这些库不是通过rpm包管理提供给系统的,而是由第三方安装程序直接安装的。

rpmbuild can autodetect dependencies by looking up shared libraries required by binaries included in the package and, while this is a good think almost every time, there are time when it is undesirable but only for some specific libraries. I am referring to the case where some binary file requires libraries that are not provided to the system via its rpm package management but installed directly by third party installers.

现在,问题是:有没有办法使自动检测功能保持活动状态(对于软件包中的其他二进制文件很方便),但仅忽略/删除这些特定的库?

Now, the question is: is there a way to keep the autodetect feature active (comes in handy for the other binaries in the package) but ignore/remove only these specific libraries?

AutoReqIgnore : library1
AutoReqIgnore : library2


推荐答案

我没有找到内置方法,但是我写了一个我用作过滤器的小脚本

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;

您可以放置​​自己的正则表达式行,在此示例中,我删除了 libqt -mt.so。*

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

然后,在 .spec 文件中:

# 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}

如您所见,该脚本在源压缩包中的 / build / 下。

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

这篇关于rpmbuild可以忽略某些特定的自动检测到的依赖性吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆