Toolserver:Admin:pkgbuild

pkgbuild is a tool from Sun which builds Solaris packages from RPM spec files. We use pkgbuild to build the TS-local software packages (/opt/ts).

Creating a new package

 * Note: You must do this on hemlock, or another administrative system, not a login server.

First, check out the ts-specs repo: svn co https://svn.toolserver.org/svnroot/toolserver/trunk/ts-specs

For a trivial program (one that is not a library or a daemon, and doesn't need a 64-bit version), copy an existing spec file (e.g. editors/TSjoe.spec) to a new spec in the appropriate category. Edit it and make any necessary customisations. Most things should be fairly obvious.

Then build it: pkgtool build-only whatever/TSmyprog.spec. If the build succeeds, install it on the current system: pkgtool install-pkgs whatever/TSmyprog.spec, and make sure it works.

Once the package is ready, upload it to the Puppet package repository: % ./upload whatever/TSmyprog.spec

After uploading the package, use Puppet to install it on all hosts.

Once you're done, commit the package back to SVN.

Library packages
Packages which deliver libraries should be compiled for both 32- and 64-bit systems. This means that all programs can link against the library.

To build both easily, you need two spec files: the base spec, and the master spec. The base spec understands how to build the software, but doesn't know anything about packaging it. There are examples of base specs in the base/ directory that should work for most libraries.

The master spec uses the base spec to build both 32- and 64-bit versions of the package. See graphics/TSlibpng.spec for an example of a library master spec.

Daemons
Daemon programs should deliver an SMF manifest to allow the program to be started. See sysutils/TSopenssh for an example of a package that delivers an SMF manifest and method file from ext-sources</tt>.