Software Distributor: Cookbook

Packaging Software Products Using swpackage
The swpackage command is used to gather the pieces of a software product together and stick
them into a Software Depot. It's possible to specify lots of things about the product to swpackage.
For example, like what other products have to be installed first, or what products also have to
be on the system.
For the purpose of this cookbook, you will just do the basics: gathering up the bits and putting
them in the depot.
As you saw previously, the basic swpackage command is:
# swpackage -s PSF_FILE @ DEPOT
PSF_FILE is the Product Specification File, and DEPOT is the destination.
HP recommends using the -p option to preview the process, and fix any errors in the PSF before
actually writing anything into the depot.
The Product specification File (PSF)
The Product Specification File (PSF) is where the real work gets done. To make the job of writing
PSF files easier, templates were created and you can fill in the blanks. There are two main areas
that HP recommends that you swinstall software to: /opt and /usr/contrib. Each one
of them has the product broken out differently.
If a product only has a few files -- maybe an executable or two, a few man pages and maybe a
library file -- build it to reside in /usr/contrib/bin, /usr/contrib/man/man1, and
/usr/contrib/lib, respectively. For Gnu-configured software, this usually means setting the
prefix to /usr/contrib.
On the other hand, if this is a major software package -- like Emacs or TCL, I build it with the
prefix set to /opt/PACKAGE_NAME. This keeps it all together in one place, and simplifies the
PSF file. The Post-Install script adds the bin directory to the contents of /etc/PATH, which you
can source in your .cshrc.
Useful Command-line Options
Preview Mode. The task quits after the analysis phase. Nothing
is written to disk.
-p
Verbose Mode
-v
Very Verbose Mode
-vv
Allows software or patches which requires a reboot of the target
system to be installed.
-x autoreboot=true
Allows software or patch installations even if a filesystem, like a
cdrom drive, is not mounted.
-x mount_all_filesystems=false
Allows the installation of software or patches that are incompatible
(wrong HPUX rev or machine architecture) with the target system.
-x allow_incompatible=true
Allows the removal of software that has other products or filesets
dependent on it. For example, some internally-developed tools
require Perl5. If I want to remove it so that I can replace it with a
later version, I can use this option.
-x enforce_dependencies=false
Creating Depot Files or Tapes
The swpackage command is also used to re-package existing software selections from an existing
depot into a depot tape or file. For example, to re-package the procmail product from the depot
directory, /home/bass/depot, into a depot file,/tmp/procmail.depot, use the following:
6