|
|||
3. Enhancing the Functionality of a Package (Tasks) Creating Information Files and Installation Scripts (Task Map) 4. Verifying and Transferring a Package 5. Case Studies of Package Creation |
Creating Information FilesThis 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 DependenciesYou 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:
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
Example 3-1 compver FileIn 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 FileThis 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 AlsoAfter 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 MessageYou 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
Example 3-3 copyright FileFor 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 AlsoAfter 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 SystemYou 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
Example 3-4 space FileThis 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 AlsoAfter 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. |
||
|