简体   繁体   English

如何重建 rpm 包排除某些依赖项?

[英]How can I rebuild rpm package exclude some dependencies?

Have next kind of question.有下一种问题。 Wanna to rebuild garbage collector (gc-7.1-10.el6.src.rpm) and exclude ld-linux.so.2, ld-linux.so.2(GLIBC_2.3) & libpthread.so.0(GLIBC_2.3.2) dependencies.想要重建垃圾收集器 (gc-7.1-10.el6.src.rpm) 并排除 ld-linux.so.2, ld-linux.so.2(GLIBC_2.3) & libpthread.so.0(GLIBC_2.3.2) ) 依赖项。 How can I get something similar I want?我怎样才能得到我想要的类似的东西? (CentOS 6) (CentOS 6)

% rpm -qp -R rpmbuild/RPMS/i386/gc-7.1-10.el6.i386.rpm
/sbin/ldconfig  
/sbin/ldconfig  
ld-linux.so.2  
ld-linux.so.2(GLIBC_2.3)  
libc.so.6  
libc.so.6(GLIBC_2.0)  
libc.so.6(GLIBC_2.1)  
libc.so.6(GLIBC_2.1.3)  
libc.so.6(GLIBC_2.2.4)  
libc.so.6(GLIBC_2.3)  
libcord.so.1  
libdl.so.2  
libdl.so.2(GLIBC_2.1)  
libgc.so.1  
libgcc_s.so.1  
libgcc_s.so.1(GCC_3.0)  
libgcc_s.so.1(GCC_3.3.1)  
libgccpp.so.1  
libm.so.6  
libpthread.so.0  
libpthread.so.0(GLIBC_2.0)  
libpthread.so.0(GLIBC_2.1)  
libpthread.so.0(GLIBC_2.2)  
libpthread.so.0(GLIBC_2.2.3)  
libpthread.so.0(GLIBC_2.3.2)  
libstdc++.so.6  
libstdc++.so.6(CXXABI_1.3)  
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(VersionedDependencies) <= 3.0.3-1
rtld(GNU_HASH)

Need I edit my spec file, or change and rebuild my tar.gz archive ?我需要编辑我的规范文件,或者更改和重建我的 tar.gz 档案吗?

Just define requires you want to exclude by :只需定义您要排除的要求:

%define __requires_exclude libXXX.so.X %define __requires_exclude libXXX.so.X

Most of these dependencies are created by the "find-requires" feature.大多数依赖项是由“find-requires”功能创建的。 If you specify this in your .spec file:如果您在.spec文件中指定它:

AutoReq: no

None of them are created.它们都不是被创建的。

I'm unsure of an easy way to exclude single ones, however.但是,我不确定排除单个的简单方法。 It's all or nothing.要么全有要么全无。

The easiest way to disable automatic dependency extraction is to remove the execute bits from the file(s) that cause the dependency: rpm does not extract dependencies from non-executable files automatically.禁用自动依赖提取的最简单方法是从导致依赖的文件中删除执行位:rpm 不会自动从非可执行文件中提取依赖。

You can also filter the dependencies (the filtering is different in different versions of rpm but is possible in all versions of rpm).您还可以过滤依赖项(过滤在不同的 rpm 版本中是不同的,但在所有 rpm 版本中都是可能的)。

However the dependencies that you wish to filter are not usually a problem.但是,您希望过滤的依赖项通常不是问题。 Are you trying to build on a newer machine and install on an older machine, with an older version of glibc?您是否尝试在较新的机器上构建并安装在较旧的机器上,并使用较旧版本的 glibc?

You need this to just disable one or more provie or require你需要这个来禁用一个或多个 provie 或 require

http://www.rpm.org/wiki/PackagerDocs/DependencyGenerator http://www.rpm.org/wiki/PackagerDocs/DependencyGenerator

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM