简体   繁体   English

如何在创建RPM软件包之前检查依赖关系?

[英]How to check for dependencies before creating an RPM package?

As the title suggests, how do I check without having to compile the package myself? 如标题所示,如何检查而不必自己编译软件包? In my case, I am going to build a package from somewhere else. 就我而言,我将从其他地方构建一个程序包。

EDIT : Sorry for being unclear. 编辑 :很抱歉,不清楚。 What I mean by "build a package from somewhere else" is that I have to create a RPM package from source code, not by installing it. 我所说的“从其他地方构建软件包”的意思是我必须从源代码创建RPM软件包,而不是通过安装它。 Without having to run ./configure, is there other way to check? 不必运行./configure,还有其他检查方法吗? In the RPM spec file, I have to put in BuildRequire, but how do it know? 在RPM规范文件中,我必须放入BuildRequire,但是它怎么知道? In SFML source for example, it doesn't have a configure file. 例如,在SFML源中,它没有配置文件。

Good upstream developers usually include minimal required versions of packages they require to build (besides autotools & family of course). 优秀的上游开发人员通常包括他们需要构建的软件包的最低要求版本(除了自动工具和产品系列之外)。 Other than that you can check configure.ac file. 除此之外,您还可以检查configure.ac文件。 It requires basic knowledge of autotools, but if you can read it it will give you ideas what the package is checking for during configure without actually running it. 它需要具备自动工具的基本知识,但是如果您可以阅读它,它将为您提供在不实际运行的情况下在配置过程中检查软件包的内容。

Another option is to have a minimal "buildroot" that will not have any special libraries installed by default. 另一个选择是拥有最小的“ buildroot”,默认情况下不会安装任何特殊的库。 This way you can run configure, it will fail because of missing dependency so you can add it to your list. 这样,您可以运行configure,但由于缺少依赖项而失败,因此可以将其添加到列表中。 Then rinse & repeat until the package builds. 然后冲洗并重复直到包装成型。

Last but not least, check if some distribution is already packaging said software and have a look at their dependencies. 最后但并非最不重要的一点是,检查某些发行版是否已经打包了上述软件,并查看了它们的依赖性。 They will most likely be correct. 他们很可能是正确的。

In any case, if the package is FLOSS, get in touch with authors and try to get them to list any specific dependencies in their documentation (README, or some other file distributed with sources). 无论如何,如果软件包是FLOSS,请与作者联系并尝试使他们列出其文档(README或与源一起分发的某些其他文件)中的任何特定依赖项。

Update 1: Note that different distributions can have different names for the same package. 更新1:请注意,不同的发行版可以为同一软件包使用不同的名称。 For example "apache-commons-daemon" in Fedora, "commons-daemon" in Debian world and "dev-java/commons-daemon" in Gentoo. 例如,Fedora中的“ apache-commons-daemon”,Debian world中的“ commons-daemon”和Gentoo中的“ dev-java / commons-daemon”。

Use rpm -qp --requires . 使用rpm -qp --requires For example: 例如:

rpm -qp --requires  xchat-2.8.8-0.fc13.src.rpm

Shows: 显示:

perl  
perl(ExtUtils::Embed)  
python-devel  
openssl-devel  
pkgconfig  
tcl-devel  
GConf2-devel  
dbus-devel >= 0.60
dbus-glib-devel >= 0.60
glib2-devel >= 2.10.0
gtk2-devel >= 2.10.0
bison >= 1.35
gettext  
/bin/sed  
libtool  
libsexy-devel  
desktop-file-utils >= 0.10
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(CompressedFileNames) <= 3.0.4-1

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

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