Designing a Package
Before 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 Tasks
Use 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 Components
The 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:
Package objects (the application software files)
Two required information files (the pkginfo and prototype files)
Optional information files and installation scripts
The figure below describes the contents of a package.
Figure 1-1 The Contents of a Package
![](figures/ch1_designpkg.fig53.gif)
Required Package Components
You must create the following components before you build your package:
Package Objects
These are the components that make up the application. They can be:
Files (executable or data)
Directories
Named pipes
Links
Devices
The pkginfo file
The pkginfo file is a required package information file defining parameter values such as the package abbreviation, the full package name, and the package architecture. For more information, see "Creating a pkginfo File" and the pkginfo(4) man page.
Note - There are two pkginfo(1) 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
The prototype file
The prototype file is a required package information file that lists the components of the package. It describes the location, attributes, and file type for each component within a package.
In the prototype file, there is one entry for each package object, information file, and installation script. An entry consists of several fields of information describing the object. For more information, see "Creating a prototype File" and the prototype(4) man page.
Optional Package Components
Package Information Files
There are four optional package information files you can include in your package:
-
Defines previous versions of the package that are compatible with this version.
-
Indicates other packages with which this package has special relationships.
-
Defines disk space requirements for the target environment, beyond what is needed by the objects defined in the prototype file. For example, additional space might be needed for files that are dynamically created at installation time.
-
Defines the text for a copyright message displayed at the time of package installation.