yum – RPM包依赖项

前端之家收集整理的这篇文章主要介绍了yum – RPM包依赖项前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我从EPEL存储库中提供的源RPM修改了.spec文件.
# yumdownloader pjproject
# yumdownloader --source pjproject

# diff -u pjproject.spec{.orig,}
--- pjproject.spec.orig 2018-03-27 15:42:37.780641678 +0100
+++ pjproject.spec  2018-03-27 12:54:54.298556634 +0100
@@ -24,13 +24,13 @@


 BuildRequires: alsa-lib-devel
-BuildRequires: gsm-devel
-BuildRequires: libsrtp-devel
+#BuildRequires: gsm-devel
+#BuildRequires: libsrtp-devel
 BuildRequires: libuuid-devel
 BuildRequires: openssl-devel
 BuildRequires: pkgconfig
 BuildRequires: portaudio-devel
-BuildRequires: speex-devel
+#BuildRequires: speex-devel


 %description
@@ -76,23 +76,23 @@
 rm -rf third_party/bdsound
 rm -rf third_party/bin
 rm -rf third_party/g7221
-rm -rf third_party/gsm
+#rm -rf third_party/gsm
 rm -rf third_party/milenage
 rm -rf third_party/mp3
 rm -rf third_party/portaudio
 rm -rf third_party/resample
-rm -rf third_party/speex
-rm -rf third_party/srtp
+#rm -rf third_party/speex
+#rm -rf third_party/srtp
 rm -rf third_party/ilbc
 rm -rf third_party/build/baseclasses
 rm -rf third_party/build/g7221
-rm -rf third_party/build/gsm
+#rm -rf third_party/build/gsm
 rm -rf third_party/build/milenage
 rm -rf third_party/build/portaudio/src
 rm -rf third_party/build/resample
 rm -rf third_party/build/samplerate
-rm -rf third_party/build/speex
-rm -rf third_party/build/srtp
+#rm -rf third_party/build/speex
+#rm -rf third_party/build/srtp
 rm -rf third_party/build/ilbc

 %build
@@ -101,12 +101,8 @@
 # that functionality,and it made it easier to ensure that we don't 
 # bundle any unnecessary libraries.  Please contact me if your project
 # needs this support,and I'll re-enable it
-export CFLAGS="-DPJ_HAS_IPV6=1 ${ARCHFLAGS} %{optflags}"
+export CFLAGS="-DNDEBUG -DPJ_HAS_IPV6=1 ${ARCHFLAGS} %{optflags}"
 %configure --enable-shared        \
-           --with-external-gsm    \
-           --with-external-pa     \
-           --with-external-speex  \
-           --with-external-srtp   \
            --disable-opencore-amr \
            --disable-resample     \
            --disable-sound        \
@@ -116,7 +112,7 @@
            --without-libyuv       \
            --disable-g7221-codec  

-export CFLAGS="-DPJ_HAS_IPV6=1 %{optflags}"
+export CFLAGS="-DNDEBUG -DPJ_HAS_IPV6=1 %{optflags}"
 make %{?_smp_mflags} dep
 make %{?_smp_mflags}

现在,我没有在spec文件中看到任何Requires选项,但原始RPM仍然尝试安装一些额外的包.指定这些依赖项的位置?这是在configure脚本中完成的吗?

原始RPM:

# yum install pjproject-2.3-6.el7.x86_64.rpm
Loaded plugins: fastestmirror
Examining pjproject-2.3-6.el7.x86_64.rpm: pjproject-2.3-6.el7.x86_64
Marking pjproject-2.3-6.el7.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package pjproject.x86_64 0:2.3-6.el7 will be installed
--> Processing Dependency: libgsm.so.1()(64bit) for package: pjproject-2.3-6.el7.x86_64
Loading mirror speeds from cached hostfile
 * base: mirror.econdc.com
 * epel: mirror.netweaver.uk
 * extras: mozart.ee.ic.ac.uk
 * ius: mirrors.ircam.fr
 * updates: mirror.econdc.com
--> Processing Dependency: libspeex.so.1()(64bit) for package: pjproject-2.3-6.el7.x86_64
--> Processing Dependency: libspeexdsp.so.1()(64bit) for package: pjproject-2.3-6.el7.x86_64
--> Processing Dependency: libsrtp.so.0()(64bit) for package: pjproject-2.3-6.el7.x86_64
--> Running transaction check
---> Package gsm.x86_64 0:1.0.13-11.el7 will be installed
---> Package libsrtp.x86_64 0:1.4.4-10.20101004cvs.el7 will be installed
---> Package speex.x86_64 0:1.2-0.19.rc1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================================================================================
 Package                                    Arch                                    Version                                                     Repository                                                    Size
===================================================================================================================================================================================================================
Installing:
 pjproject                                  x86_64                                  2.3-6.el7                                                   /pjproject-2.3-6.el7.x86_64                                  2.1 M
Installing for dependencies:
 gsm                                        x86_64                                  1.0.13-11.el7                                               base                                                          30 k
 libsrtp                                    x86_64                                  1.4.4-10.20101004cvs.el7                                    base                                                         275 k
 speex                                      x86_64                                  1.2-0.19.rc1.el7                                            base                                                          98 k

Transaction Summary
===================================================================================================================================================================================================================
Install  1 Package (+3 Dependent packages)

自定义RPM:

# yum install pjproject-2.3-7.el7.centos.x86_64.rpm 
Loaded plugins: fastestmirror
Examining /var/lib/mock/epel-7-x86_64/result/pjproject-2.3-7.el7.centos.x86_64.rpm: pjproject-2.3-7.el7.centos.x86_64
Marking /var/lib/mock/epel-7-x86_64/result/pjproject-2.3-7.el7.centos.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package pjproject.x86_64 0:2.3-7.el7.centos will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================================================================================
 Package                                    Arch                                    Version                                              Repository                                                           Size
===================================================================================================================================================================================================================
Installing:
 pjproject                                  x86_64                                  2.3-7.el7.centos                                     /pjproject-2.3-7.el7.centos.x86_64                                  2.3 M

Transaction Summary
===================================================================================================================================================================================================================
Install  1 Package

Total size: 2.3 M
Installed size: 2.3 M

编辑:Tue 27 Mar 20:55:48 UTC 2018

所以,我已经安装了自定义版本,repoquery仍然显示speex和其他版本,尽管在yum安装期间不需要它们.这些信息来自哪里?

# repoquery --requires --resolve pjproject
speex-0:1.2-0.19.rc1.el7.x86_64
libstdc++-0:4.8.5-16.el7_4.2.x86_64
libgcc-0:4.8.5-16.el7_4.2.x86_64
glibc-0:2.17-196.el7_4.2.i686
libuuid-0:2.23.2-43.el7_4.2.x86_64
gsm-0:1.0.13-11.el7.x86_64
glibc-0:2.17-196.el7.x86_64
libsrtp-0:1.4.4-10.20101004cvs.el7.x86_64
openssl-libs-1:1.0.2k-8.el7.x86_64
RPM为您提供的一个方便/烦人的事情是自动发现提供和需求.有一种记录在 filter its helpfulness方法.例如,spec文件中的这些行将有效地删除您尝试删除的三个库的直接依赖关系:
# https://fedoraproject.org/wiki/Packaging:AutoProvidesAndRequiresFiltering
%global _privatelibs lib(gsmcodec|srtp|speex)[.]so.*
%global __provides_exclude ^(%{_privatelibs})$
%global __requires_exclude ^(%{_privatelibs})$

您可以通过检查生成的rpm文件来验证它们已消失:

$rpm -q –provides -p ../RPMS/x86_64/pjproject-2.3-6.el7.centos.x86_64.rpm
libpj.so.2()(64位)
libpjlib-util.so.2()(64位)
libpjmedia-audiodev.so.2()(64位)
libpjmedia-codec.so.2()(64位)
libpjmedia-videodev.so.2()(64位)
libpjmedia.so.2()(64位)
libpjnath.so.2()(64位)
libpjsip-simple.so.2()(64位)
libpjsip-ua.so.2()(64位)
libpjsip.so.2()(64位)
libpjsua.so.2()(64位)
libpjsua2.so.2()(64位)
pjproject = 2.3-6.el7.centos
pjproject(x86-64)= 2.3-6.el7.centos

但是,如果使用repoquery,则会获得询问上游包repo而不是自己的自定义构建的结果.

猜你在找的Bash相关文章