Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Application Packaging Developer's Guide
Previous Next

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 package being installed.

Delivering a depend file lets you define three types of dependencies associated with your package. These dependency types are as follows:

  • A prerequisite package – Your package depends on the existence of another package

  • A reverse dependency – Another package depends on the existence of your package


    Note - Use the reverse dependency type only when a package that cannot deliver a depend file relies on your package.


  • An incompatible package – Your package is incompatible with the named package

The depend file resolves only very basic dependencies. If your package depends upon a specific file, its contents, or its 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 the depend(4) and compver(4) man pages for more information.

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

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. 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 the copyright(4) man page for more information.


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


How to Write a Copyright Message

  1. Make the directory that contains your information files the current working directory.
  2. Create a file named copyright with your favorite text editor.

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

Example 3-3 copyright File

For example, a partial copyright message might look like the following:

Copyright (c) 2003 Company Name
All Rights Reserved
 
This product is protected by copyright and distributed under
licenses restricting copying, distribution, and decompilation.
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.

Reserving Additional Space on a Target System

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

The pkgadd command ensures that there is enough disk space to install your package based on the object definitions in the pkgmap file. However, 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 reserved for it, you should include a space file that specifies the disk space requirements. The pkgadd command checks for the additional space specified in a space file. Refer to the space(4) man page for more information.


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


How to Reserve Additional Space on a Target System

  1. Make the directory that contains your information files the current working directory.
  2. Create a file named space with your favorite text editor.

    Specify any additional disk space requirements needed by your package. Use 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 the space(4) man page.

  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.

Example 3-4 space File

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

/opt   1000   1
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.

Previous Next

 
 
  Published under the terms fo the Public Documentation License Version 1.01. Design by Interspire