Application Packaging Developer's Guide

Fine-Tuning a prototype File Created With the pkgproto Command

Although the pkgproto command is useful in creating an initial prototype file, it does not create entries for every package object that needs to be defined, or make complete entries. The pkgproto command does not:

Therefore, you probably need to modify the prototype file to include at least some of these object definitions, possibly redefine path names and other field settings, and include some of the features described in "Adding Functionality to a prototype File".

Creating Object Entries With File Types v, e, x, and i

At the very least, you need to modify the prototype file to add objects with file type i. If you stored your information files and installation scripts in the first level of your package directory (for example, /home/jane/SUNWcadap/pkginfo), then an entry in the prototype file would look like:


i pkginfo

If you did not store your information files and installation scripts in the first level of your package directory, then you need to specify their source location. For example:


i pkginfo=/home/jane/InfoFiles/pkginfo

Or, you can use the !search command to specify the location for the pkgmk command to look when building the package. See "Providing a Search Path for the pkgmk Command" for more information.

To add entries for objects with file types v, e, and x, follow the format described in "The Format of the prototype File", or refer to the prototype(4) man page.


Note -

Remember to always assign a class to files with a file type of e (editable) and have an associated class action script for that class. Otherwise, the files will be removed during package removal, even if the path name is shared with other packages.


Using Multiple Class Definitions

If you use the pkgproto command to create your basic prototype file, you can assign all of the package objects to the none class or one, specific class. As shown in "Creating a prototype File With the pkgproto Command", the basic pkgproto command assigns all objects to the none class. To assign all objects to a specific class, you can use the -c option. For example:


$ pkgproto -c classname /home/jane/SUNWcadap > 
/home/jane/InfoFiles/prototype

If you use multiple classes, you may need to manually edit the prototype file and modify the class field for each object. If you use classes, you also need to define the CLASSES parameter in the pkginfo file and write class action scripts. As mentioned previously, using classes is an optional feature and is discussed in detail in "Writing Class Action Scripts".

Example--Fine-Tuning a prototype File Created Using the pkgproto Command

Given the prototype file created by the pkgproto command in "Creating a prototype File With the pkgproto Command", there are several modifications that need to be made.