JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Application Packaging Developer's Guide
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



Creating a pkginfo File

The pkginfo file is an ASCII file that describes the characteristics of a package along with information that helps control the flow of installation.

Each entry in the pkginfo file is a line that establishes the value of a parameter using the format PARAM=value. PARAM can be any of the standard parameters described in the pkginfo(4) man page. There is no required order in which the parameters must be specified.

Note - Each value can be enclosed with single or double quotation marks (for example, 'value' or “value”). If value contains any characters that are considered special to a shell environment, you should use quotation marks. The examples and case studies in this book do not use quotation marks. See the pkginfo(4) man page for an example that uses double quotation marks.

You can also create your own package parameters by assigning a value to them in the pkginfo file. Your parameters must begin with a capital letter followed by either uppercase or lowercase letters. An uppercase letter indicates that the parameter (variable) will be evaluated at install time (as opposed to build time). For information on the difference between install variables and build variables, see Package Environment Variables.

Note - Trailing whitespace after any parameter value is ignored.

You must define these five parameters in a pkginfo file: PKG, NAME, ARCH, VERSION, and CATEGORY. The PATH, PKGINST, and INSTDATE parameters are inserted automatically by the software when the package is built. Do not modify these eight parameters. For information on the remaining parameters, see the pkginfo(4) man page.

Defining a Package Instance

The same package can have different versions, be compatible with different architectures, or both. Each variation of a package is known as a package instance. A package instance is determined by combining the definitions of the PKG, ARCH, and VERSION parameters in the pkginfo file.

The pkgadd command assigns a package identifier to each package instance at installation time. The package identifier is the package abbreviation with a numerical suffix, for example SUNWadm.2. This identifier distinguishes a package instance from any other package, including instances of the same package.

Defining a Package Abbreviation (PKG)

A package abbreviation is a short name for a package that is defined by the PKG parameter in the pkginfo file. A package abbreviation must have these characteristics:

Specifying a Package Architecture (ARCH)

The ARCH parameter in the pkginfo file identifies which architectures are associated with the package. The architecture name has a maximum length of 16 alphanumeric characters. If a package is associated with more than one architecture, specify the architectures in a comma-separated list.

This is an example of a package architecture specification in a pkginfo file:

Specifying a Package Instruction Set Architecture (SUNW_ISA)

The SUNW_ISA parameter in the pkginfo file identifies which instruction set architecture is associated with a Sun Microsystems package. The values are as follows:

For example, the SUNW_ISA value in a pkginfo file for a package containing 64–bit objects would be:


If SUNW_ISA is not set, the default instruction set architecture of the package is set to the value of the ARCH parameter.

Specifying a Package Version (VERSION)

The VERSION parameter in the pkginfo file identifies the version of the package. The version has a maximum length of 256 ASCII characters, and cannot begin with a left parenthesis.

This is an example version of a specification in a pkginfo file:

VERSION=release 1.0

Defining a Package Name (NAME)

A package name is the full name of the package, which is defined by the NAME parameter in the pkginfo file.

Because system administrators often use package names to determine whether a package needs to be installed, writing clear, concise, and complete package names is important. Package names must meet the following criteria:

Here is an example package name defined in a pkginfo file:

NAME=Chip designers need CAD application software to design
abc chips.  Runs only on xyz hardware and is installed in the
usr partition.

Defining a Package Category (CATEGORY)

The CATEGORY parameter in the pkginfo file specifies in which categories a package belongs. At a minimum, a package must belong to either the system or application category. Category names consist of alphanumeric characters. Category names have a maximum length of 16 characters and are case insensitive.

If a package belongs to more than one category, specify the categories in a comma-separated list.

Here is an example CATEGORY specification in a pkginfo file:


How to Create a pkginfo File

  1. Using your favorite text editor, create a file named pkginfo.

    You can create this file anywhere on your system.

  2. Edit the file and define the five required parameters.

    The five required parameters are: PKG, NAME, ARCH, VERSION, and CATEGORY. For more information on these parameters, see Creating a pkginfo File.

  3. Add any optional parameters to the file.

    Create your own parameters or see the pkginfo(4) man page for information on the standard parameters.

  4. Save your changes and quit the editor.

Example 2-1 Creating a pkginfo File

This example shows the contents of a valid pkginfo file, with the five required parameters defined, as well as the BASEDIR parameter. The BASEDIR parameter is discussed in more detail in The path Field.

NAME=Chip designers need CAD application software to design abc chips.  
Runs only on xyz hardware and is installed in the usr partition.
VERSION=release 1.0
See Also

See How to Organize a Package's Contents.