DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Packaging your software applications

Approach

This approach to modifying /etc/inittab uses the build class. A build class file is executed as a shell script and its output becomes the new version of the file for which it is named. In other words, the file inittab(F) that is delivered with this package is executed and the output of that execution becomes /etc/inittab.

The build class file is executed during package installation and package removal. The argument install is passed to the file if it is being executed at installation time. Notice in the sample build file that installation actions are defined by testing for this argument.

To edit /etc/inittab using the build class, you must:

  1. Define the build file in the prototype(F) file.

    The prototype file entry for the build class file should be of class build and file type e. Be certain that the CLASSES parameter in the pkginfo file includes build. See the sample pkginfo file and sample prototype file for this example.

  2. Create the build file.

    The sample build file performs the following procedures:


    a.
    Edits /etc/inittab to remove any changes already existing for this package. Notice that the filename /etc/inittab is hard-coded into the sed command.

    b.
    If the package is being installed, adds the new line to the end of /etc/inittab. A comment tag is included in this new entry to remind us from where that entry came.

    c.
    Executes init q.
This solution addresses the drawbacks in case studies 5a and 5b. Only one file is needed (beyond the pkginfo and prototype files), that file is short and simple, it works with multiple instances of a package because the $PKGINST parameter is used, and no postinstall script is required because init q can be executed from the build file.
Next topic: pkginfo file
Previous topic: Techniques

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003