JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Application Packaging Developer's Guide
search filter icon
search icon

Document Information

Preface

1.  Designing a Package

2.  Building a Package

3.  Enhancing the Functionality of a Package (Tasks)

4.  Verifying and Transferring a Package

5.  Case Studies of Package Creation

6.  Advanced Techniques for Creating Packages

Specifying the Base Directory

The Administrative Defaults File

Becoming Comfortable With Uncertainty

Using the BASEDIR Parameter

Using Parametric Base Directories

Examples--Using Parametric Base Directories

The pkginfo File

The pkgmap File

Managing the Base Directory

Accommodating Relocation

Walking Base Directories

Using the BASEDIR Parameter

The pkginfo File

The pkgmap File

Example--Analysis Scripts That Walk a BASEDIR

The request Script

The checkinstall Script

Using Relative Parametric Paths

The pkginfo File

The pkgmap File

Example--A request Script That Walks a Relative Parametric Path

Supporting Relocation in a Heterogeneous Environment

Traditional Approach

Relocatable Packages

Example-A Traditional Relocatable Package

The pkginfo File

The pkgmap File

Absolute Packages

Example-A Traditional Absolute Package

The pkgmap File

Composite Packages

Example-A Traditional Solution

The pkginfo File

The pkgmap File

Beyond Tradition

Another Look at Composite Packages

Making Absolute Path Names Look Relocatable

Example--Modifying a File

Description

Implementation

Example

Example--Creating a New File

Description

Implementation

Example

Example--A Composite Package

The pkginfo File

The pkgmap File

Making Packages Remotely Installable

Example - Installing to a Client System

Example - Installing to a Server or Standalone System

Example - Mounting Shared File Systems

Patching Packages

The checkinstall Script

The preinstall Script

The Class Action Script

The postinstall Script

The patch_checkinstall Script

The patch_postinstall Script

Upgrading Packages

The request Script

The postinstall Script

Creating Class Archive Packages

Structure of the Archive Package Directory

Keywords to Support Class Archive Packages

The faspac Utility

Glossary

Index

Making Packages Remotely Installable

All packages must be installable remotely. Installable remotely means you do not assume the administrator installing your package is installing to the root (/) file system of the system running the pkgadd command. If, in one of your procedure scripts, you need to get to the /etc/vfstab file of the target system, you need to use the PKG_INSTALL_ROOT environment variable. In other words, the path name /etc/vfstab will get you to the /etc/vfstab file of the system running the pkgadd command, but the administrator may be installing to a client at /export/root/client3. The path ${PKG_INSTALL_ROOT}/etc/vfstab is guaranteed to get you to the target file system.

Example – Installing to a Client System

In this example, the SUNWstuf package is installed to client3, which is configured with /opt in its root (/) file system. One other version of this package is already installed on client3, and the base directory is set to basedir=/opt/$PKGINST from an administration file, thisadmin. (For more information on administration files, see The Administrative Defaults File.) The pkgadd command executed on the server is:

# pkgadd -a thisadmin -R /export/root/client3 SUNWstuf

The table below lists the environment variables and their values that are passed to the procedure scripts.

Table 6-1 Values Passed to Procedure Scripts

Environment Variable
Value
PKGINST
SUNWstuf.2
PKG_INSTALL_ROOT
/export/root/client3
CLIENT_BASEDIR
/opt/SUNWstuf.2
BASEDIR
/export/root/client3/opt/SUNWstuf.2

Example – Installing to a Server or Standalone System

To install to the server or a standalone system under the same circumstances as the previous example, the command is:

# pkgadd -a thisadmin SUNWstuf

The table below lists the environment variables and their values that are passed to the procedure scripts.

Table 6-2 Values Passed to Procedure Scripts

Environment Variable
Value
PKGINST
SUNWstuf.2
PKG_INSTALL_ROOT
Not defined.
CLIENT_BASEDIR
/opt/SUNWstuf.2
BASEDIR
/opt/SUNWstuf.2

Example – Mounting Shared File Systems

Assume that the SUNWstuf package creates and shares a file system on the server at /export/SUNWstuf/share. When the package is installed to the client systems, their /etc/vfstab files need to be updated to mount this shared file system. This is a situation where you can use the CLIENT_BASEDIR variable.

The entry on the client needs to present the mount point with reference to the client's file system. This line should be constructed correctly whether the installation is from the server or from the client. Assume that the server's system name is $SERVER. You can go to $PKG_INSTALL_ROOT/etc/vfstab and, using the sed or awk commands, construct the following line for the client's /etc/vfstab file.

$SERVER:/export/SUNWstuf/share - $CLIENT_BASEDIR/usr nfs - yes ro

For example, for the server universe and the client system client9, the line in the client system's /etc/vfstab file would look like:

universe:/export/SUNWstuf/share - /opt/SUNWstuf.2/usr nfs - yes ro

Using these parameters correctly, the entry always mounts the client's file system, whether it is being constructed locally or from the server.