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

The special system classes

The system provides three special classes:

The sed class script

The sed installation class provides a method of installing and removing objects that require modification to an existing object on the target machine. (The file must have already been installed by another package.) A sed class action script delivers sed instructions in the format shown in the next example. You can give instructions that will be executed during either installation or removal. Two commands indicate when instructions should be executed. sed instructions that follow the !install command are executed during package installation and those that follow the !remove command are executed during package removal. It does not matter in which order the commands are used in the file.

The sed class action script executes automatically at installation time if a file belonging to class sed exists. The name of the sed class file should be the same as the name of the file upon which the instructions will be executed.

   # comment, which may appear on any line in the file
   !install
   # sed(1) instructions which are to be invoked during
   # installation of the object
   [address [,address]] function [arguments]
      . . .
   

!remove # sed(1) instructions to be invoked during the removal process [address [,address]] function [arguments] . . .

address, function, and arguments are as defined in the sed(1) manual page. See case study 5a and case study 5b for examples of sed class action scripts.

The awk class script

The awk installation class provides a method of installing and removing objects that require modification to an existing object on the target machine (the object must have been previously installed from another package installation). Modifications are delivered as awk instructions in an awk class action script.

The awk class action script executes automatically at the time of installation if a file belonging to class awk exists. Such a file contains instructions for the awk class script in the format shown in the following example. Two commands indicate when instructions should be executed. awk instructions that follow the !install command are executed during package installation and those that follow the !remove command are executed during package removal. It does not matter in which order the commands are used in the file.

The name of the awk class file should be the same as the name of the file upon which the instructions will be executed.

   # comment, which may appear on any line in the file
   !install
   # awk(1) program to install changes
      . . . (awk program)
   

!remove # awk1(1) program to remove changes . . . (awk program)

The file to be modified is used as input to awk and the output of the script ultimately replaces the original object. Parameters cannot be passed to awk using this syntax.

See case study 5a for example awk class action script examples.

The build class script

The build class installs or removes objects by executing instructions that create or modify the object file. These instructions are delivered as a build class action script.

The name of the instruction file should be the same as the name of the file upon which the instructions will be executed.

The build class action script executes automatically at installation time if a file belonging to class build exists.

A build script must be executable by sh(1). The script's output becomes the new version of the file as it is built.

See case study 5c for an example build class action script.


Next topic: The procedure script
Previous topic: Removal of classes

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004