Application Packaging Developer's Guide

How to Create a prototype File Using the pkgproto Command


Note –

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.


  1. 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.

  2. 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).

  3. If your package has collectively relocatable objects, edit the pkginfo file to set the BASEDIR parameter to the appropriate value.

    For example:


    BASEDIR=/opt

    For information on collectively relocatable objects, see Collectively Relocatable Objects.

  4. 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 ... 

    See ... 

    Creating a request script

    How to Write a request Script

    Creating a checkinstall script

    How to Gather File System Data

    Individually relocatable objects 

    Individually Relocatable Objects

  5. 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.

  6. 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.

  7. 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.

  8. 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.

  9. 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.

  10. 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.

  11. Save your changes and quit the editor.

Where to Go Next

If you are ready to go to the next task, see How to Build a Package.