Questo contenuto non è disponibile nella lingua selezionata.
2.7. Package Layout
Each Software Collection's layout consists of the metapackage, which installs a subset of other packages, and a number of the Software Collection's packages, which are installed within the Software Collection namespace.
2.7.1. Metapackage Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
Each Software Collection includes a metapackage, which installs a subset of the Software Collection's packages that are essential for the user to perform most common tasks with the Software Collection. For example, the essential packages can provide the Perl language interpreter, but no Perl extension modules. The metapackage contains a basic file system hierarchy and delivers a number of the Software Collection's scriptlets.
The purpose of the metapackage is to make sure that all essential packages in the Software Collection are properly installed and that it is possible to enable the Software Collection.
The metapackage produces the following packages that are also part of the Software Collection:
- The main package: %name
- The main package in the Software Collection contains dependencies of the base packages, which are included in the Software Collection. The main package does not contain any files.When specifying dependencies for your Software Collection's packages, ensure that no other package in your Software Collection depends on the main package. The purpose of the main package is to install only those packages that are essential for the user to perform most common tasks with the Software Collection.Normally, the main package does not specify any build time dependencies (for instance, packages that are only build time dependencies of another Software Collection's packages).For example, if the name of the Software Collection is
myorganization-ruby193
, then the main package macro is expanded to:myorganization-ruby193
myorganization-ruby193
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - The runtime subpackage: %name-runtime
- The runtime subpackage in the Software Collection owns the Software Collection's file system and delivers the Software Collection's scriptlets. This package needs to be installed for the user to be able to use the Software Collection.For example, if the name of the Software Collection is
myorganization-ruby193
, then the runtime subpackage macro is expanded to:myorganization-ruby193-runtime
myorganization-ruby193-runtime
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - The build subpackage: %name-build
- The build subpackage in the Software Collection delivers the Software Collection's build configuration. It contains RPM macros needed for building packages into the Software Collection. The build subpackage is optional and can be excluded from the Software Collection.For example, if the name of the Software Collection is
myorganization-ruby193
, then the build subpackage macro is expanded to:myorganization-ruby193-build
myorganization-ruby193-build
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The contents of themyorganization-ruby193-build
subpackage are shown below:cat /etc/rpm/macros.ruby193-config %scl myorganization-ruby193
$ cat /etc/rpm/macros.ruby193-config %scl myorganization-ruby193
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - The syspaths subpackage: %name-syspaths
- The syspaths subpackage in the Software Collection provides an optional way to install convenient shell wrappers and symbolic links into the standard path, thus altering the base system installation, but making binary files in the Software Collection packages easier to use.For example, if the name of the Software Collection is
myorganization-ruby193
, then the syspaths subpackage macro is expanded to:myorganization-ruby193-syspaths
myorganization-ruby193-syspaths
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For more information about the syspaths subpackage, see Section 3.3, “Providing syspaths Subpackages”. - The scldevel subpackage: %name-scldevel
- The scldevel subpackage in the %name Software Collection contains development files, which are useful when developing packages of another Software Collection that depends on the %name Software Collection. The scldevel subpackage is optional and can be excluded from the %name Software Collection.For example, if the name of the Software Collection is
myorganization-ruby193
, then the scldevel subpackage macro is expanded to:myorganization-ruby193-scldevel
myorganization-ruby193-scldevel
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For more information about the scldevel subpackage, see Section 4.1, “Providing an scldevel Subpackage”.
2.7.2. Creating a Metapackage Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
When creating a new metapackage:
- Define the following macros at the top of the metapackage spec file, above the
%scl_package
macro:scl_name_prefix
that specifies the provider's name to be used as a prefix in your Software Collection's name, for example, myorganization-. This is different from_scl_prefix
, which specifies the root of your Software Collection but also uses the provider's name. See Section 2.4, “The Software Collection Prefix” for more information.scl_name_base
that specifies the base name of your Software Collection, for example, ruby.scl_name_version
that specifies the version of your Software Collection, for example, 193.
- You are advised to define a Software Collection macro
nfsmountable
that changes the location of configuration and state files and makes your Software Collection usable over NFS. For more information, see Section 3.1, “Using Software Collections over NFS”. - Consider specifying all packages in your Software Collection that are essential for the Software Collection run time as dependencies of the metapackage. That way you can ensure that the packages are installed with the Software Collection metapackage.
- You are advised to add
Requires: scl-utils-build
to the build subpackage. - You are not required to use conditionals for Software Collection-specific macros in the metapackage.
- Include any path redefinition that the packages in your Software Collection may require in the
enable
scriptlet.For information on commonly used path redefinitions, see Section 2.9, “Commonly Used Path Redefinitions”. - Always make sure that the metapackage contains the
%setup
macro in the%prep
section, otherwise building the Software Collection will fail. If you do not need to use a particular option with the%setup
macro, add the%setup -c -T
command to the%prep
section.This is because the%setup
macro defines and creates the%buildsubdir
directory, which is normally used for storing temporary files at build time. If you do not define%setup
in your Software Collection packages, files in the%buildsubdir
directory will be overwritten, causing the build to fail. - Add any macros you need to use to the
macros.%{scl}-config
file in the build subpackage.
Example of the Metapackage
To get an idea of what a typical metapackage for a Software Collection named myorganization-ruby193 looks like, see the following example: