Some portions of your software that belong with the main body might be optional, and some users might not want to install them. Examples include localization files for different locales, man pages and other documentation, and header files needed only by developers or DTrace users.
Traditionally, optional content has been delivered in separate packages. Administrators installed optional content by installing these optional packages. One problem with this solution is that the administrator must discover optional packages to install by examining lists of available packages.
IPS uses facets to deliver optional package content. Facets are similar to variants: Each facet has a name and a value, and actions can contain multiple tags for different facet names.
In the image, the default value for all facet properties that start with facet.debug. or facet.optional. is false. The default value for all other facet properties is true.
On a packaged action, the value of a facet tag can be specified as either true or all.
Actions that have a facet tag with a value of all are installed only if every facet on that action that has a value of all has a value of true in the image.
Actions that have a facet tag with a value of true are installed if any facet on that action that has a value of true has a value of true in the image.
Use the pkgmogrify command to add facet tags to your package manifests, using regular expressions to match different types of files. Using the pkgmogrify command is described in detail in Modifying Package Manifests Programmatically.
To produce a list of facets that are available for you to set on your packaged actions, use the pkg facet -a command to display the values of all facets that are explicitly set in the image and all facets that are set in installed packages.
If you introduce a new facet in your software, whether that action will be installed depends on what name you choose for the facet as well as what other facets are set on that action. If your new facet is the only facet set on the action, the action will be installed as follows:
If you name the facet facet.debug.mysoftware or facet.optional.mycomponent, the action will be installed only if the user sets the value of the facet image property to true.
If you choose any other name for your new facet, the action will be installed unless the user sets the value of the facet image property to false.
In addition to specifying optional components, you can use facet.version-lock. facet tags to specify dependency version restrictions as described in Constraints and Freezing.