Application Packaging Developer's Guide

Creating Information Files

This section discusses optional package information files. With these files you can define package dependencies, provide a copyright message, and reserve additional space on a target system.

Defining Package Dependencies

You need to determine whether your package has dependencies on other packages and if any other packages depend on yours. Package dependencies and incompatibilities can be defined with two of the optional package information files, compver and depend. Delivering a compver file lets you name previous versions of your package that are compatible with the one being installed. Delivering a depend file lets you define three types of dependencies associated with your package. These dependency types are:

The depend file resolves only very basic dependencies. If your package depends upon a specific file or its contents or behavior, the depend file does not supply adequate precision. In this case, a request script or the checkinstall script should be used for detailed dependency checking. The checkinstall script is also the only script capable of cleanly halting the package installation process.


Note –

Be certain that your depend and compver files have entries in the prototype file. The file type should be i (for package information file).


Refer to depend(4) and compver(4) for more information.

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

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

    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.

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
1.0

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)

Writing a Copyright Message

You need to decide whether your package should display a copyright message while it is being installed. If so, create the copyright file.


Note –

You should include a copyright file to provide legal protection for your software application. It might be a good idea to check with the legal department of your company for the exact wording of the message.


To deliver a copyright message, you must create a file named copyright. During installation, the message is displayed exactly as it appears in the file (with no formatting). See copyright(4) for more information.


Note –

Be certain that your copyright file has an entry in the prototype file. Its file type should be i (for package information file).


How to Write a Copyright Message

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

  2. Create a file named copyright with your favorite text editor.

    Enter the text of the copyright message exactly as you want it to appear as your package is installed.

  3. Save your changes and quit the editor.

  4. Complete one of the following tasks.

  5. 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—copyright File

For example, a partial copyright message might look like:


Copyright (c) 1999 Company Name
All Rights Reserved
 
This product is protected by copyright and distributed under
licenses restricting copying, distribution and decompilation.

Reserving Additional Space on a Target System

You need to determine whether your package needs additional disk space on the target system (space in addition to that required by the package objects). If so, create the space information file. This is different than creating empty files and directories at installation time as discussed in Defining Additional Objects to Be Created at Install Time.

While the pkgadd command ensures that there is enough disk space to install your package based on the object definitions in the pkgmap file, a package may require additional disk space beyond that needed by the objects defined in the pkgmap file. For example, your package might create a file after installation, which may contain a database, log files, or some other growing file that consumes disk space. To be sure that there is space set aside for it, you should include a space file specifying the disk space requirements. The pkgadd command checks for the additional space specified in a space file. Refer to space(4) for more information.


Note –

Be certain that your space file has an entry in the prototype file. Its file type should be i (for package information file).


How to Reserve Additional Space on a Target System

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

  2. Create a file named space with your favorite text editor.

    Enter any additional disk space requirements needed by your package, using this format:


    pathname  blocks  inodes
    

    pathname

    Specifies a directory name, which may or may not be the mount point for a file system. 

    blocks

    Specifies the number of 512-byte blocks that you want reserved. 

    inodes

    Specifies the number of required inodes. 

    For more information, see space(4).

  3. Save your changes and quit the editor.

  4. Complete one of the following tasks.

  5. 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—space File

This example space file specifies that 1000 512-byte blocks and 1 inode be set aside in /opt on the target system.


/opt   1000   1