JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Application Packaging Developer's Guide     Oracle Solaris 11 Express 11/10
search filter icon
search icon

Document Information


1.  Designing a Package

2.  Building a Package

The Process of Building a Package (Task Map)

Package Environment Variables

General Rules on Using Environment Variables

Package Environment Variables Summary

Creating a pkginfo File

Defining a Package Instance

Defining a Package Abbreviation (PKG)

Specifying a Package Architecture (ARCH)

Specifying a Package Instruction Set Architecture (SUNW_ISA)

Specifying a Package Version (VERSION)

Defining a Package Name (NAME)

Defining a Package Category (CATEGORY)

How to Create a pkginfo File

Organizing a Package's Contents

How to Organize a Package's Contents

Creating a prototype File

Format of the prototype File

The ftype Field

The class Field

The path Field

Collectively Relocatable Objects

Individually Relocatable Objects

Parametric Path Names

A Brief Word on an Object's Source and Destination Locations

The mode Field

The owner Field

The group Field

Creating a prototype File From Scratch

Example--Creating a prototype File With the pkgproto Command

Fine-Tuning a prototype File Created With the pkgproto Command

Creating Object Entries With File Types v, e, x, and i

Using Multiple Class Definitions

Example--Fine-Tuning a prototype File Created Using the pkgproto Command

Adding Functionality to a prototype File

Defining Additional Objects to Be Created at Install Time

Creating Links at Install Time

Distributing Packages Over Multiple Volumes

Nesting prototype Files

Setting Default Values for the mode, owner, and group Fields

Providing a Search Path for the pkgmk Command

Setting Environment Variables

How to Create a prototype File by Using the pkgproto Command

Building a Package

Using the Simplest pkgmk Command

The pkgmap File

How to Build a Package

3.  Enhancing the Functionality of a Package (Tasks)

4.  Verifying and Transferring a Package

5.  Case Studies of Package Creation

6.  Advanced Techniques for Creating Packages



Package Environment Variables

You can use variables in the required information files, pkginfo and prototype. You can also use an option to the pkgmk command, which is used to build a package. As these files and commands are discussed in this chapter, more context-sensitive information on variables is provided. However, before you begin building your package, you should understand the different types of variables and how they can affect the successful creation of a package.

There are two types of variables:

General Rules on Using Environment Variables

In the pkginfo file, a variable definition takes the form PARAM=value, where the first letter of PARAM is an uppercase letter. These variables are evaluated only at install time. If any of these variables cannot be evaluated, the pkgadd command aborts with an error.

In the prototype file, a variable definition can take the form !PARAM=value or $variable. Both PARAM and variable can begin with either an uppercase or a lowercase letter. Only variables whose values are known at build time are evaluated. If PARAM or variable is a build or install variable whose value is not known at build time, the pkgmk command aborts with an error.

You can also include the option PARAM=value as an option to the pkgmk command. This option works the same as in the prototype file, except that its scope is global to the entire package. The !PARAM=value definition in a prototype file is local to that file and the part of the package it defines.

If PARAM is an install variable, and variable is an install variable or build variable with a known value, the pkgmk command inserts the definition into the pkginfo file so that the definition will be available at install time. However, the pkgmk command does not evaluate PARAM that are in any path names that are specified in the prototype file.

Package Environment Variables Summary

The following table summarizes variable specification formats, location, and scope.

Table 2-2 Package Environment Variables Summary

Where Variable Is Defined
Variable Definition Format
Variable Type Being Defined
When the Variable is Evaluated
Where the Variable is Evaluated
Items the VariableMay Substitute For
pkginfo file
Ignored at build time
Install time
In the pkgmap file
owner, group, path, or link target
prototype file
Build time
In the prototype file and any included files
mode, owner, group, or path
Build time
In the prototype file and any included files
!search and !command commands only
pkgmk command line
Build time
In the prototype file
mode, owner, group, or path
Build time
In the prototype file
!search command only
Install time
In the pkgmap file
owner, group, path, or link target