Application Packaging Developer's Guide

ProcedureHow to Create a prototype File by Using the pkgproto Command


Note –

It is easier to create information files and installation scripts before you create a prototype file. However, this order is not required. 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 (Tasks).


  1. Determine which package objects will be absolute and which package objects will be relocatable, if not done already.

    For information that will help you complete this step, 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 might 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. If you do not organize your package, 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. Alternatively, create a checkinstall script to determine the appropriate path from file system data.

    The following list gives page numbers for your reference regarding common tasks:

  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
    

    The prototype file can be located anywhere on your system. Keeping your information files and installation scripts in one place simplifies access and maintenance. For additional information on the pkgproto command, see the pkgproto(1) man page.

  7. Edit the prototype file by using your favorite text editor, and add entries for files of type v, e, x, and i.

    For information on the specific changes you might 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. Use your favorite text editor to make the necessary changes, and create corresponding class action scripts.

    For information on the specific changes you might need to make, see Fine-Tuning a prototype File Created With the pkgproto Command and Writing Class Action Scripts.

  9. Edit the prototype file by 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 by 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.

See Also

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