我对 rpm 构建还很陌生,我一直试图理解 spec 文件中“Provides”的语法,但没有成功。我有以下用于构建 clamav rpm 的 spec 文件片段:
Summary: End-user tools for the Clam Antivirus scanner
Name: clamav
Version: 0.103.12
Release: 1%{?dist}
%package data
Summary: Virus signature data for the Clam Antivirus scanner
Requires: ns-clamav-filesystem = %{version}-%{release}
Provides: data(clamav) = full
Provides: clamav-db = %{version}-%{release}
Obsoletes: clamav-db < %{version}-%{release}
BuildArch: noarch
%package update
Summary: Auto-updater for the Clam Antivirus scanner data-files
Requires: ns-clamav-filesystem = %{version}-%{release}
Requires: ns-clamav-lib = %{version}-%{release}
Provides: data(clamav) = empty
Provides: clamav-data-empty = %{version}-%{release}
Obsoletes: clamav-data-empty < %{version}-%{release}
%package -n ns-clamd
Summary: The Clam AntiVirus Daemon
Requires: data(clamav)
Requires: ns-clamav-filesystem = %{version}-%{release}
Requires: ns-clamav-lib = %{version}-%{release}
Requires: coreutils
Requires(pre): shadow-utils
我知道这里的“提供:”表示什么,并且提供旁边的括号表示模块的安装(针对该包)。在我的例子中,%package data
(clamav-data)在安装时,它还会向 rpm/yum 声明它提供clamav-db
和data(clamav)
。
我data(clamav)
不明白。它与默认包名前缀有什么关系clamav-data
?不应该是吗clamav(data)
?
我如何data(clamav
在 yum/rpm 中搜索此 )?我可以在 rpm 信息中看到这一点,但是当我安装它时,我如何像在其他软件包上一样搜索它?例如yum info <package>
# rpm -q --requires RPMS/x86_64/ns-clamd-0.103.12-1.el8.x86_64.rpm
/bin/sh
/bin/sh
/bin/sh
/bin/sh
coreutils
data(clamav)
# rpm -q RPMS/noarch/ns-clamav-data-0.103.12-1.el8.noarch.rpm --provides
clamav-db = 0.103.12-1.el8
config(ns-clamav-data) = 0.103.12-1.el8
data(clamav) = full
ns-clamav-data = 0.103.12-1.el8