2573N/A.. The contents of this file are subject to the terms of the
2573N/A Common Development and Distribution License (the "License").
2573N/A You may not use this file except in compliance with the License.
2573N/A See the License for the specific language governing permissions
2573N/A and limitations under the License.
2573N/A.. When distributing Covered Code, include this CDDL HEADER in each
2573N/A If applicable, add the following below this CDDL HEADER, with the
2573N/A fields enclosed by brackets "[]" replaced with your own identifying
2573N/A information: Portions Copyright [yyyy] [name of copyright owner]
2573N/A.. Copyright (c) 2011, Oracle
and/or its affiliates. All rights reserved.
2585N/AIn this chapter we explore how variants and facets are used in
2585N/AIPS to provide different installation options to the end user.
2585N/ASince Oracle Solaris supports multiple architectures, one common error
2585N/Amade with the SVR4 packaging system was the accidental installation
2585N/Aof packages for an incorrect architecture. With the introduction of
2585N/Asoftware repositories, the prospect of maintaining a separate
2585N/Arepository for each supported architecture seemed unappealing
2585N/Ato ISVs and error prone for customers. As a result, IPS supports
2585N/Ainstallation of a single package on multiple architectures.
2585N/AThe mechanism that implements this feature is called a
2585N/A*variant*. A variant enables the properties of the target image
2585N/Ato determine which software components are actually installed.
2525N/AA variant has two parts: its name, and the list of possible values.
2585N/AThe variants defined in Oracle Solaris 11 are:
2573N/A ======================== =================
2573N/A ======================== =================
2573N/A ======================== =================
2585N/AVariants appear in two places in a package:
2585N/A * A ``set`` action names the variant and defines the values that
2585N/A * Any action that can only be installed for a subset of the
2585N/A variant values has a tag that specifies the name of the
2585N/A variant and the value on which it is installed.
2585N/AFor example, a package that delivers the symbolic link ``
/var/ld/64``
2525N/ANote that components that are delivered on both sparc and i386 receive
2525N/Ano variant tag, but those delivered to one architecture or the other
2525N/Areceive the appropriate tag. It is perfectly reasonable for actions
2525N/Ato contain multiple tags for different variant names; there might be
2525N/Adebug and nondebug binaries for both sparc and i386.
2585N/AIn Oracle Solaris, kernel components are commonly elided from packages
2525N/Ainstalled in zones, as they serve no useful purpose. Thus, they are
2525N/Aare not installed in non-global zones. This is typically done in the
2585N/Amanifest during publication with a |pkgmogrify| rule. Thus the packages
2525N/Afrom the i386 and sparc builds are already marked for zones. We then
2585N/Ause the |pkgmerge| command to take the packages from the sparc and i386
2585N/Abuilds and merge them together. This is far more reliable and faster
2585N/Athan attempting to construct such packages manually.
3363N/Apredefined to have a default version of ``false``; thus, developers
3363N/Acan provide debug versions of their components, tagged with the
3363N/Aappropriate variant, and users can select that variant if problems
3363N/Aarise. Remember that variants are set per image, so selecting a
3363N/Asuitable name that is unique at the appropriate resolution for that
3363N/Apiece of software is important.
3363N/AIn addition, any variant tags not described here are assumed to
3363N/Ahave a default value of ``false`` in the image. This allows
3363N/Athe definition of custom variants not explicitly set in the
2585N/ANote that variant tags are applied to any actions that differ between
2585N/Aarchitectures during merging; this includes dependencies, ``set`` actions,
2585N/Aetc. Packages that are marked as not supporting one of the variant values
2585N/Aof the current image are not considered for installation.
2585N/AThe |pkgmerge| man page provides several examples of merging packages. Note
2585N/Athat it will merge across multiple different variants at the same time if
2525N/AOften, package developers have optional portions of their software
2585N/Athat actually belong with the main body, but some people might not
2585N/Awant to install. Some examples are localization files for different
2525N/Alocales, man pages and other documentation, header files needed
2585N/Aonly by developers or DTrace users.
2525N/ATraditionally, such optional content has been placed in separate
2585N/Apackages with an arbitrarily selected naming convention (such as
2585N/Aappending ``-dev`` or ``-devel`` to the package name) enabling administrators
2525N/Ato select the optional content.
2525N/AThis has led to various problems, such as adding a new locale
2525N/Afor all the software on a system being a rather irritating task,
2525N/Aas the admin has to discover all the necessary packages by examining
2525N/Athe lists of available packages.
2585N/AIPS has implemented a mechanism similar to variants called *facets*
2525N/Ato deal with this problem. Like variants, facets have a name and
2585N/Aa value. The value is either set to ``true`` or ``false`` in the
2585N/Aimage. The default value is ``true``. The facet namespace is hierarchal,
2585N/Awith matching rules such that the longest match wins.
2585N/AFor example, the default value for all facets is ``true``; the |pkg| client
2585N/Aimplicitly sets ``facet.*`` to ``true``.
2585N/ADocumentation in Oracle Solaris packages is tagged with the type of
2585N/Adocumentation. For example, man pages are tagged with
2585N/AThe following commands include man pages but exclude all other documentation
2585N/Afrom being installed in this image::
2585N/ASimilarly, the following commands install only the German localization in this
2585N/AIf an action contains multiple facet tags, the action is installed if the value
2585N/Aof any of the facet tags is ``true``.
2585N/AThe ``pkg facet`` command is useful in determining which facets are
2585N/AThe package developer can use |pkgmogrify| to quickly tag his
2525N/Aman pages, localizations, etc. using regular expressions to
2585N/Amatch the different types of files. This is described in detail
2585N/AFacets can also be used to manage dependencies, essentially turning
2585N/Adependencies on and off, depending on whether the facet is set. See
2585N/AOracle Solaris facets that might be of use for software developers include:
2573N/A======================== ================== ==================
2573N/A======================== ================== ==================