Este contenido no está disponible en el idioma seleccionado.

2.8. Software Collection Macros


The Software Collection packaging macro scl defines where to relocate the Software Collection's file structure. The relocated file structure is a file system used exclusively by the Software Collection.
The %scl_package macro defines files ownership for the Software Collection's metapackage and provides additional packaging macros to use in the Software Collection environment.
To be able to build a conventional package and a Software Collection package with a single spec file, prefix the Software Collection macros with %{?scl:macro}, as in the following example:
%{?scl:Requires: %scl_runtime}
In the example above, the %scl_runtime macro is the value of the Requires tag. Both the macro and the tag use the %{?scl: prefix.

2.8.1. Macros Specific to a Software Collection

The table below shows a list of all macros specific to a particular Software Collection. All the macros have default values that you will not need to change in most cases.
Table 2.1. Software Collection Specific Macros
Macro
Description
Example value
%scl_name
name of the Software Collection
software_collection_1
%scl_prefix
name of the Software Collection with a dash appended at the end
software_collection_1-
%pkg_name
name of the original package
perl
%_scl_prefix
root of the Software Collection (not package's root)
/opt/provider/
%_scl_scripts
location of Software Collection's scriptlets
/opt/provider/software_collection_1/
%_scl_root
installation root (install-root) of the package
/opt/provider/software_collection_1/root/
%scl_require_package software_collection_1 package_2
depend on a particular package from a specific Software Collection
software_collection_1-package_2

2.8.2. Macros Not Specific to a Software Collection

The table below shows a list of macros that are not specific to a particular Software Collection. Because these macros are not relocated and do not point to the Software Collection file system, they allow you to point to the system root file system. These macros use _root as a prefix.
All the macros have default values that you will not need to change in most cases.
Table 2.2. Software Collection Non-Specific Macros
Macro
Description
Relocated
Example value
%_root_prefix
Software Collection's %_prefix macro
no
/usr/
%_root_exec_prefix
Software Collection's %_exec_prefix macro
no
/usr/
%_root_bindir
Software Collection's %_bindir macro
no
/usr/bin/
%_root_sbindir
Software Collection's %_sbindir macro
no
/usr/sbin/
%_root_datadir
Software Collection's %_datadir macro
no
/usr/share/
%_root_sysconfdir
Software Collection's %_sysconfdir macro
no
/etc/
%_root_libexecdir
Software Collection's %_libexecdir macro
no
/usr/libexec/
%_root_sharedstatedir
Software Collection's %_sharedstatedir macro
no
/usr/com/
%_root_localstatedir
Software Collection's %_localstatedir macro
no
/usr/var/
%_root_includedir
Software Collection's %_includedir macro
no
/usr/include/
%_root_infodir
Software Collection's %_infodir macro
no
/usr/share/info/
%_root_mandir
Software Collection's %_mandir macro
no
/usr/share/man/
%_root_initddir
Software Collection's %_initddir macro
no
/etc/rc.d/init.d/
%_root_libdir
Software Collection's %_libdir macro, this macro does not work if Software Collection's metapackage is platform-independent
no
/usr/lib/

2.8.3. The nfsmountable Macro

Using a Software Collection macro nfsmountable allows you to change values for the _sysconfdir, _sharedstatedir, and _localstatedir macros so that your Software Collection can have its state files and configuration files located outside the Software Collection's /opt file system hierarchy. This makes the files easier to manage and is also required when using your Software Collection over NFS.
If you do not need support for Software Collections over NFS, using nfsmountable is optional but recommended. For more information, see Section 3.1, “Using Software Collections over NFS”.
Red Hat logoGithubRedditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

© 2024 Red Hat, Inc.