Application Packaging Developer's Guide

ProcedureHow to Define Package Dependencies

  1. Make the directory that contains 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. Use this format:


    string string . . .
    

    The value of 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. Use this format:


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

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

    pkg-abbrev

    Specifies the package abbreviation, such as SUNWcadap.

    pkg-name

    Specifies 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.

    (arch)

    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 delimiters.

    version

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

    For more information, see depend(4).

  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.


Example 3–1 compver File

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


release 3.0
release 2.0
version 1.1
1.0

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 3–2 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 the following:


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

See Also

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 these tasks and provides step-by-step instructions on how to transfer your verified package to a distribution medium.