如何找到源包的依赖要求?

如何找到源包的依赖要求?

如果我从源代码编译包,如何找到所需的依赖项?我注意到在 Centos7 上编译 Python 3 时,找到所需库的唯一方法是运行 tar 球附带的配置脚本并查找故障。有一个更好的方法吗?

答案1

我所知道的最直接的方法是在兼容的发行版上使用包维护者确定的相关构建要求。由于 Python 3 在 CentOS 中不可用,因此您必须查看 EPEL 或其他一些存储库; Fedora 主机相关源码包

要列出基于 RPM 的发行版的构建依赖项,请查看包的.spec文件:构建依赖项列在 下BuildRequires。对于Python 3:

BuildRequires: autoconf
BuildRequires: bluez-libs-devel
BuildRequires: bzip2
BuildRequires: bzip2-devel
BuildRequires: desktop-file-utils
BuildRequires: expat-devel

BuildRequires: findutils
BuildRequires: gcc-c++
%if %{with gdbm}
BuildRequires: gdbm-devel
%endif
BuildRequires: glibc-all-langpacks
BuildRequires: glibc-devel
BuildRequires: gmp-devel
BuildRequires: libappstream-glib
BuildRequires: libffi-devel
BuildRequires: libnsl2-devel
BuildRequires: libtirpc-devel
BuildRequires: libGL-devel
BuildRequires: libuuid-devel
BuildRequires: libX11-devel
BuildRequires: ncurses-devel

BuildRequires: openssl-devel
BuildRequires: pkgconfig
BuildRequires: readline-devel
BuildRequires: redhat-rpm-config >= 127
BuildRequires: sqlite-devel
BuildRequires: gdb

BuildRequires: tar
BuildRequires: tcl-devel
BuildRequires: tix-devel
BuildRequires: tk-devel

%if %{with valgrind}
BuildRequires: valgrind-devel
%endif

BuildRequires: xz-devel
BuildRequires: zlib-devel

BuildRequires: /usr/bin/dtrace

# workaround http://bugs.python.org/issue19804 (test_uuid requires ifconfig)
BuildRequires: /usr/sbin/ifconfig

%if %{with rpmwheels}
BuildRequires: python-setuptools-wheel
BuildRequires: python-pip-wheel
%endif

答案2

rpm.org,依赖关系在文件中定义.spec

使用此标签,包可以要求安装另一个具有匹配名称或提供的包(如果包包含 Requires: 将被安装)。当安装新软件包以及删除具有匹配的 Provides: 的软件包时,将检查此项。

他们提供的例子,

    Requires: python perl

相关内容