How can I rebuild rpm package exclude some dependencies?
Asked Answered
C

4

7

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. How can I get something similar I want? (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 ?

Cloy answered 10/10, 2011 at 16:39 Comment(2)
Do you want to link them statically?Babbitt
But I just suppose its can help meCloy
V
11

Just define requires you want to exclude by :

%define __requires_exclude libXXX.so.X

Vocabulary answered 17/7, 2015 at 2:8 Comment(1)
This is a rpm-4.9 feature. If you're running Centos 6 you cannot use it (still in rpm-4.8).Albacore
R
7

Most of these dependencies are created by the "find-requires" feature. If you specify this in your .spec file:

AutoReq: no

None of them are created.

I'm unsure of an easy way to exclude single ones, however. It's all or nothing.

Roasting answered 24/11, 2011 at 1:50 Comment(1)
yeap, its work, but in this case u ll get Segmentation fault error, & its so sad :)Cloy
C
1

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.

You can also filter the dependencies (the filtering is different in different versions of rpm but is possible in all versions of 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?

Chlamys answered 15/7, 2015 at 15:57 Comment(0)
V
0

You need this to just disable one or more provie or require

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

Vocabulary answered 15/7, 2015 at 6:55 Comment(3)
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes.Disposal
I did refer to full explain about excluding one or more require from auto requires generation .. any way I'll write one answer ...Surrebutter
And the link above is, indeed, invalid now.Thereat

© 2022 - 2024 — McMap. All rights reserved.