It is easier to create information files and installation scripts before creating a prototype file. However, this is not required, and you can always edit the prototype file after changing your package contents. For more information on information files and installation scripts, see Chapter 3, Enhancing the Functionality of a Package.
Determine which package objects will be absolute and which will be relocatable, if not done already.
For information that will help you complete this task, see The path Field.
Organize your package's objects to mimic their location on the target system.
If you already organized your packages as described in Organizing a Package's Contents, note that you may need to make some changes based on your decisions in Step 1. If you have not organized your package yet, you should do so now (otherwise you cannot use the pkgproto command to create a basic prototype file).
If your package has collectively relocatable objects, edit the pkginfo file to set the
BASEDIR parameter to the appropriate value.
For information on collectively relocatable objects, see Collectively Relocatable Objects.
If your package has individually relocatable objects, create a request script to prompt the installer for the appropriate path name or a checkinstall script to determine the appropriate path from file system data.
For Information On ...
Creating a request script
Creating a checkinstall script
Individually relocatable objects
Change the owner and group on all of your package components to be the intended owner and group on the target systems.
Use the chown -R and the chgrp -R commands on your package directory and information files directory.
Execute the pkgproto command to create a basic prototype file.
The pkgproto command scans your directories to create a basic file. For example:
$ cd package-directory $ pkgproto ./package-directory > prototype
Like the pkginfo file, the prototype file can be located anywhere on your system. However, it might be a good idea to keep your information files and installation scripts in one place, for easy access and maintenance. For additional information on the pkgproto command, see the pkgproto(1) man page.
Edit the prototype file using your favorite text editor, and add entries for files of type v, e, x, and i.
For information on the specific changes you may need to make, see Fine-Tuning a prototype File Created With the pkgproto Command.
Optional. If you are using multiple classes, edit the prototype and pkginfo files using your favorite text editor to make the necessary changes, and create corresponding class action scripts.
For information on the specific changes you may need to make, see Fine-Tuning a prototype File Created With the pkgproto Command and Writing Class Action Scripts.
Edit the prototype file using your favorite text editor to redefine path names and change other field settings.
For more information, see Fine-Tuning a prototype File Created With the pkgproto Command.
Optional. Edit the prototype file using your favorite text editor to add functionality to your prototype file.
For more information, see Adding Functionality to a prototype File.
Save your changes and quit the editor.
If you are ready to go to the next task, see How to Build a Package.