Application Packaging Developer's Guide

How to Define Package Dependencies

  1. Make the directory containing your information files the current working directory.

  2. If previous versions of your package exist and you need to specify that your new package is compatible with them, create a file named compver with your favorite text editor.

    List the versions with which your package is compatible, using this format:

    string string . . .


    Is identical to the value assigned to the VERSION parameter in the pkginfo file, for each compatible package.

  3. Save your changes and quit the editor.

  4. If your package depends on the existence of other packages, other packages depend on the existence of your package, or your package is incompatible with another package, create a file named depend with your favorite text editor.

    Add an entry for each dependency, using this format:

    type pkg-abbrev pkg-name
        (arch) version
        (arch) version . . .


    Defines the dependency type. Must be one of the following characters: P (prerequisite package), I (incompatible package), or R (reverse dependency).


    Specifies the package abbreviation, such as SUNWcadap.


    Sepcifies the full package name, such as Chip designers need CAD application software to design abc chips. Runs only on xyz hardware and is installed in the usr partition.


    Optional. Specifies the type of hardware on which the package runs. For example, sparc or x86. If you specify an architecture, you must use the parentheses as delimeters.


    Optional. Specifies the value assigned to the VERSION parameter in the pkginfo file.

    For more information, see the depend(4) man page.

  5. Save your changes and quit the editor.

  6. Complete one of the following tasks:

  7. Build your package.

    See "How to Build a Package", if needed.

Where to Go Next

After you build the package, install it to confirm that it installs correctly and verify its integrity. Chapter 4, Verifying and Transferring a Package explains how to do this and provides step-by-step instructions on how to transfer your verified package to a distribution medium.

Example--compver File

In this example, there are four versions of a package: 1.0, 1.1, 2.0, and the new package, 3.0, which is compatible with all the three previous versions. The compver file for the newest version might look like:

release 3.0
release 2.0
version 1.1

Note -

The entries do not have to be in sequential order. However, they should exactly match the definition of the VERSION parameter in each package's pkginfo file. In this example, the package designers used different formats in the first three versions.

Example--depend File

This example assumes that the sample package, SUNWcadap, requires that the SUNWcsr and SUNWcsu packages already be installed on a target system. The depend file for SUNWcadap looks like:

P SUNWcsr Core Solaris, (Root)
P SUNWcsu Core Solaris, (Usr)