Contenues dansTrouver plus de documentationRessources d'assistance comprises | Télécharger cet ouvrage au format PDF (433 Ko)
Chapter 1 Designing a PackageBefore you build a package, you need to know which files you need to create and the commands you need to execute. You also need to consider your application software's requirements, and the needs of your customer--the administrators who will be installing your package. This chapter discusses the files, commands, and criteria you should know and think about, before building a package. This is a list of the overview information in this chapter. Where to Find Packaging TasksUse these references to find step-by-step instructions for building and verifying packages. What Are Packages?Application software is delivered in units called packages. A package is a collection of files and directories required for a software product, and is usually designed and built by the application developer after completing the development of the application code. A software product needs to be built into one or more packages so that it can easily be transferred to a distribution medium, be mass produced, and installed by administrators. Package ComponentsThe components of a package fall into two categories: package objects, the application files to be installed, and control files, which control how, where, and if the package is installed. The control files are also divided into two categories: information files and installation scripts. Some of these control files are required and some are optional. To package your applications, you must first create the required components, and any optional components, that make up your package. Then you can build the package using the pkgmk command. To build a package, you must provide the following:
Figure 1-1 describes the contents of a package. Figure 1-1 The Contents of a Package
Required Package ComponentsYou must create the following components before you build your package:
Note - There are two pkginfo man pages. The first is a section 1 command, which displays information about installed packages. The second is a section 4 file, which describes the characteristics of a package. When accessing the man pages, be sure to specify from which section you want the man page. For example: man -s 4 pkginfo
Optional Package ComponentsPackage Information FilesThere are four optional package information files you can include in your package:
Each package information file should have an entry in the prototype file. See "Creating Information Files"for more information on creating these files. Package Installation ScriptsInstallation scripts are not required. However, you can provide scripts that perform customized actions during the installation of your package. An installation script has the following characteristics.
The four script types are as follows:
See "Creating Installation Scripts"for a more information on installation scripts. Things to Think About Before Building a PackageBefore building a package, you need to decide whether your product is going to be made up of one or more packages. (Note that many small packages take longer to install than one big package.) Although it is a good idea to create a single package, it is not always possible. If you decide to build more than one package, you need to determine how to segment the application code. This section provides a list of criteria to use when planning to build packages. Many of the good packaging criteria present trade-offs among themselves. It will often be difficult to satisfy all requirements equally. These criteria are presented in order of importance; however, this sequence is meant to serve as a flexible guide depending on the circumstances. Although each of these criteria is important, it is up to you to optimize these requirements to produce a good set of packages. For more design ideas, see Chapter 6, Advanced Package Creation Techniques. Make Packages Installable RemotelyAll packages must be installable remotely. Being installable remotely means that the administrator installing your package might be trying to install it on a client system, not necessarily to the root file system where the pkgadd command is being executed. Optimize for Client-Server ConfigurationsIf you are designing a package for a Solaris 2.5 or earlier release, you should consider the various types of system software configurations (for example, standalone, diskless, and server) when laying out packages. Good packaging design divides the affected files to optimize installation of each configuration type. For example, the contents of root (/) and usr should be segmented so that dataless and server configurations can easily be supported. Package by Functional BoundariesPackages should be self-contained and distinctly identified with a set of functionality. For example, a package containing UFS should contain all UFS utilities and be limited to only UFS binaries. Packages should be organized from a customer's point of view into functional units. Package Along Royalty BoundariesPut code that requires royalty payments due to contractual agreements in a dedicated package or group of packages. Do not disperse the code into more packages than necessary. Package by System DependenciesKeep system-dependent binaries in dedicated packages. For example, the kernel code should be in a dedicated package with each implementation architecture corresponding to a distinct package instance. This rule also applies to binaries for different architectures. For example, SPARCTM binaries would be in one package and binaries for an x86 system would be in another. Eliminate Overlap in PackagesWhen constructing packages, eliminate duplicate files whenever possible. Unnecessary duplication of files results in support and version difficulties. If your product has multiple packages, repeatedly compare the contents of these packages for redundancies. Package Along Localization BoundariesLocalization-specific items should be in their own package. An ideal packaging model would have a product's localizations delivered as one package per locale. Unfortunately, in some cases organizational boundaries may conflict with the functional and product boundaries criteria. International defaults can also be delivered in a package. This would isolate the files necessary for localization changes and standardize delivery format of localization packages. Packaging Commands, Files, and ScriptsThe purpose of this section is to describe the commands, files, and scripts you might use when manipulating packages. They are described in man pages and in detail throughout this book, in relation to the specific task they perform. Table 1-1 shows the commands available to help you build, verify, install, and obtain information about a package. Table 1-1 Packaging Commands
Table 1-2 shows the information files available to help you build a package. Table 1-2 Package Information Files
Table 1-3 describes optional installation scripts that you can write that affect if and how a package is installed. Table 1-3 Package Installation Scripts
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||