|
|
Package objects can be delivered either with fixed locations (their location on the installation machine is defined by the package and cannot be changed) or as relocatable (they have no absolute location requirements on the installation machine). The location for relocatable package objects is determined during the installation process.
You can define two types of relocatable objects: collectively relocatable and individually relocatable. All collectively relocatable objects are placed relative to the same directory once the relocatable root directory is established. Individually relocatable objects are not restricted to the same directory location as collectively relocatable objects.
Follow these steps to define package objects as collectively relocatable:
Put a definition for the BASEDIR parameter in your pkginfo(4) file. This parameter names a directory where relocatable objects will be placed by default. If you supply no value for BASEDIR, no package objects are considered as collectively relocatable.
An object is defined as collectively relocatable by using a relative pathname in its entry in the prototype file. A relative pathname does not begin with a slash. For example, src/myfile is a relative pathname, while /src/myfile is a fixed pathname.
A package object is defined as individually relocatable by using a variable in its pathname definition in the prototype(4) file. Your request script must query the installer on where such an object should be placed and assign the response value to the variable. pkgadd(1M) expands the pathname based on the output of your request script at the time of installation. Case study 1 shows an example of the use of variable pathnames and the request script needed to solicit a value for the base directory.