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.
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
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.
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.
Make the directory that contains your information files the current working directory.
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.
Save your changes and quit the editor.
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 . . . |
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.
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.
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.
Optional. Specifies the value assigned to the VERSION parameter in the pkginfo file.
For more information, see depend(4).
Save your changes and quit the editor.
Complete one of the following tasks:
If you want to create additional information files and installation scripts, skip to the next task, How to Write a Copyright Message.
If you have not created your prototype file, complete the procedure How to Create a prototype File by Using the pkgproto Command. Skip to Step 7.
If you have already created your prototype file, edit it and add an entry for each file you just created.
Build your package.
See How to Build a Package, if needed.
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.
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) |
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.
You need to decide whether your package should display a copyright message while it is being installed. If so, create the copyright file.
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.
Be certain that your copyright file has an entry in the prototype file. The file type should be i (for package information file).
Make the directory that contains your information files the current working directory.
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.
Save your changes and quit the editor.
Complete one of the following tasks.
If you want to create additional information files and installation scripts, skip to the next task, How to Reserve Additional Space on a Target System.
If you have not created your prototype file, complete the procedure How to Create a prototype File by Using the pkgproto Command. Skip to Step 5.
If you have already created your prototype file, edit it and add an entry for the information file you just created.
Build your package.
See How to Build a Package, if needed.
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. |
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.
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.
Be certain that your space file has an entry in the prototype file. The file type should be i (for package information file).
Make the directory that contains your information files the current working directory.
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 |
Specifies a directory name, which may or may not be the mount point for a file system.
Specifies the number of 512-byte blocks that you want reserved.
Specifies the number of required inodes.
For more information, see the space(4) man page.
Save your changes and quit the editor.
Complete one of the following tasks.
If you want to create installation scripts, skip to the next task, How to Write a request Script.
If you have not created your prototype file, complete the procedure in How to Create a prototype File by Using the pkgproto Command. Skip to Step 5.
If you have already created your prototype file, edit it and add an entry for the information file you just created.
Build your package.
See How to Build a Package, if needed.
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 |
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.