Software Distributor - Packaging

Packaging

Software packages are built by means of a specification file, a set of install scripts, and the actual software content. The install scripts are executed during software installation, verification, and removal, and can be used to prepare a system for the software and to perform activation or deactivation of the package. The specification file determines how the software package will be organized, list the locations of the various files to be loaded into the package, restrict the systems on which the package can be installed, and determine the security configuration of the package. It also provides various information about the package, such as a name, version, and description.

Software packages are organized in a hierarchy of containers, with the highest level being a bundle or product and the lowest being the filesets and then files. The hierarchy is arranged as follows:

  • Bundle
    • Product(s)
      • Subproduct(s)
        • Fileset(s)
          • Files

Actually only the Product and Fileset levels are needed for many packages. The Subproduct level is sometimes used to group together Filesets, while the Bundle provides a higher-level grouping for related products. There can be one or more filesets in a Product, and one or more products in a Bundle. The Fileset level is used specifically for loading the files. A product can be installed without all of its associated filesets, &c.

The filesets and products can be linked together by various requirement tags, which cause swinstall to select the appropriate dependencies automatically.

Each fileset can have multiple control scripts specific to the files it will load. These scripts are executed in the following order during an installation:

  • checkinstall — run during a pre-install analysis phase to check if the fileset can be loaded on the system.
  • preinstall — run just prior to loading the files in the fileset.
  • postinstall — run immediately following the file load, and before a reboot, if any.
  • configure — run after postinstall script and after a reboot, if any, to perform final configuration of the installed package.

There is a corresponding set of scripts that are executed in the reverse order during a swremove:

  • checkremove
  • unconfigure
  • preremove
  • postremove

Other scripts include verify for performing a sanity check with the swverify command, unpreinstall, and unpostinstall. All, some, or none of these scripts can be included in the package, depending on the requirements of the installation. They are useful for performing cleanup of previous packages, creating links, adding the software directory to various search environment variables, and so forth.

Read more about this topic:  Software Distributor