The following groups of environment variables are available to all installation scripts. Some of the environment variables can be modified by a request script or a checkinstall script.
The request script or the checkinstall script can set or modify any of the standard parameters in the pkginfo file, except for the required parameters. The standard installation parameters are described in detail in the pkginfo(4) man page.
The BASEDIR parameter can only be modified starting with the Solaris 2.5 release and compatible releases.
You can define your own installation environment variables by assigning values to them in the pkginfo file. Such environment variables must be alphanumeric with initial capital letters. Any of these environment variables can be changed by a request script or a checkinstall script.
Both a request script and a checkinstall script can define new environment variables by assigning values to them and putting them in the installation environment.
The following table lists environment variables that are available to all installation scripts through the environment. None of these environment variables can be modified by a script.
Environment Variable |
Description |
---|---|
CLIENT_BASEDIR |
The base directory with respect to the target system. While BASEDIR is the variable to use if you are referring to a specific package object from the install system (most likely a server), CLIENT_BASEDIR is the path to include in files placed on the client system. CLIENT_BASEDIR exists if BASEDIR exists and is identical to BASEDIR if there is no PKG_INSTALL_ROOT. |
INST_DATADIR |
The directory where the package now being read is located. If the package is being read from a tape, this variable will be the location of a temporary directory where the package has been transferred into directory format. In other words, assuming there is no extension to the package name (for example, SUNWstuff.d), the request script for the current package would be found at $INST_DATADIR/$PKG/install. |
PATH |
The search list used by sh to find commands on script invocation. PATH is usually set to /sbin:/usr/sbin:/usr/bin:/usr/sadm/install/bin. |
PKGINST |
The instance identifier of the package being installed. If another instance of the package is not already installed, the value is the package abbreviation (for example, SUNWcadap). Otherwise, the value is the package abbreviation followed by a suffix, such as SUNWcadap.4. |
PKGSAV |
The directory where files can be saved for use by removal scripts or where previously saved files can be found. Available only in the Solaris 2.5 release and compatible releases. |
PKG_CLIENT_OS |
The operating system of the client where the package is being installed. The value of this variable is Solaris. |
PKG_CLIENT_VERSION |
The Solaris version in x.y format. |
PKG_CLIENT_REVISION |
The Solaris build revision. |
PKG_INSTALL_ROOT |
The root file system on the target system where the package is being installed. This variable exists only if the pkgadd and pkgrm commands were invoked with the -R option. This conditional existence facilitates its use in procedure scripts in the form ${PKG_INSTALL_ROOT}/somepath. |
PKG_NO_UNIFIED |
An environment variable that gets set if the pkgadd and pkgrm commands were invoked with the -M and -R options. This environment variable is passed to any package installation script or package command that is part of the package environment. |
UPDATE |
This environment variable does not exist under most installation environments. If this variable does exist (with the value yes), it means one of two things. Either a package with the same name, version, and architecture is already installed on the system. Or this package is overwriting an installed package of the same name at the direction of the administrator. In these events, the original base directory is always used. |