搜索

2.8. Software Collection Macros

download PDF
Software Collection 打包宏 scl 定义在哪里重新定位软件集合的文件结构。重新定位的文件结构是由 Software Collection 只使用的文件系统。
%scl_package 宏定义 Software Collection 的 metapackage 的文件所有权,并提供额外的打包宏以便在 Software Collection 环境中使用。
要能够使用单个 spec 文件构建传统软件包和 Software Collection 软件包,请为 Software Collection 宏添加前缀 %{?scl:macro},如下例所示:
%{?scl:Requires: %scl_runtime}
在上例中,%scl_runtime 宏是 Requires 标签的值。宏和标签都使用 %{?scl: 前缀。

2.8.1. 特定于 Software Collection 的宏

下表显示了特定于特定软件集合的所有宏的列表。所有宏都有默认值,在大多数情况下,您不需要更改它们。
表 2.1. Software Collection Specific Macros
Macro
描述
示例值
%scl_name
Software Collection 的名称
software_collection_1
%scl_prefix
Software Collection 的名称,在末尾附加一个短划线
software_collection_1-
%pkg_name
原始软件包的名称
perl
%_scl_prefix
Software Collection 的根(而不是软件包的根)
/opt/provider/
%_scl_scripts
Software Collection 的 scriptlet 的位置
/opt/provider/software_collection_1/
%_scl_root
软件包的安装根(install-root)
/opt/provider/software_collection_1/root/
%scl_require_package software_collection_1 package_2
依赖于特定 Software Collection 中的特定软件包
software_collection_1-package_2

2.8.2. 宏不特定于软件集合

下表显示了不特定于特定 Software Collection 的宏列表。由于这些宏没有被重新定位且不指向 Software Collection 文件系统,所以它们允许您指向系统根文件系统。这些宏使用 _root 作为前缀。
所有宏都有默认值,在大多数情况下,您不需要更改它们。
表 2.2. Software Collection Non-Specific Macros
Macro
描述
relocated
示例值
%_root_prefix
Software Collection 的 %_prefix
/usr/
%_root_exec_prefix
Software Collection 的 %_exec_prefix
/usr/
%_root_bindir
Software Collection 的 %_bindir
/usr/bin/
%_root_sbindir
Software Collection 的 %_sbindir
/usr/sbin/
%_root_datadir
Software Collection 的 %_datadir
/usr/share/
%_root_sysconfdir
Software Collection 的 %_sysconfdir
/etc/
%_root_libexecdir
Software Collection 的 %_libexecdir
/usr/libexec/
%_root_sharedstatedir
Software Collection 的 %_sharedstatedir
/usr/com/
%_root_localstatedir
Software Collection 的 %_localstatedir
/usr/var/
%_root_includedir
Software Collection 的 %_includedir
/usr/include/
%_root_infodir
Software Collection 的 %_infodir
/usr/share/info/
%_root_mandir
Software Collection 的 %_mandir
/usr/share/man/
%_root_initddir
Software Collection 的 %_initddir
/etc/rc.d/init.d/
%_root_libdir
Software Collection 的 %_libdir 宏,如果 Software Collection 的 metapackage 是独立于平台的,则这个宏无法正常工作
/usr/lib/

2.8.3. nfsmountable Macro

使用 Software Collection 宏 nfsmountable 可让您更改 _sysconfdir_sharedstatedir_localstatedir 宏的值,以便软件集合可以将其状态文件和配置文件位于 Software Collection 的 /opt 文件系统层次结构之外。这使得文件更易于管理,在通过 NFS 使用软件集合时也需要。
如果您不需要通过 NFS 支持 Software Collections,请使用 nfsmountable 是可选的,但推荐使用。如需更多信息,请参阅 第 3.1 节 “通过 NFS 使用 Software Collections”
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.