Application Packaging Developer's Guide

ProcedureHow to Write Class Action Scripts

  1. Make the directory that contains your information files the current working directory.

  2. Assign the package objects in the prototype file the desired class names.

    For example, assigning objects to an application and manpage class would look like the following:


    f manpage /usr/share/man/manl/myappl.1l
    f application /usr/bin/myappl
  3. Modify the CLASSES parameter in the pkginfo file to contain the class names you want to use in your package.

    For example, entries for the application and manpage classes would look like the following:


    CLASSES=manpage application none

    Note –

    The none class is always installed first and removed last, regardless of where it appears in the definition of the CLASSES parameter.


  4. If you are a creating a class action script for a file that belongs to the sed, awk, or build class, make the directory that contains the package object your current working directory.

  5. Create the class action scripts or package objects (for files that belong to the sed, awk, or build class).

    For example, an installation script for a class named application would be named i.application and a removal script would be named r.application.

    Remember, when a file is part of a class that has a class action script, the script must install the file. The pkgadd command does not install files for which a class action script exists, although it does verify the installation. And, if you define a class but do not deliver a class action script, the only action taken for that class is to copy components from the installation medium to the target system (the default pkgadd behavior).

  6. Complete one of the following tasks.

  7. Build your package.

    See How to Build a Package, if needed.

Where to Go Next

After you build the package, install it to confirm that it installs correctly and verify its integrity. Chapter 4, Verifying and Transferring a Package explains how to do this and provides step-by-step instructions on how to transfer your verified package to a distribution medium.