Toolserver:Admin:pkgbuild

This page was moved from the Toolserver wiki.
Toolserver has been replaced by Toolforge. As such, the instructions here may no longer work, but may still be of historical interest.
Please help by updating examples, links, template links, etc. If a page is still relevant, move it to a normal title and leave a redirect.

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).

If you want to update a package, you have to remove it on hemlock first, update the version-number in the .spec-file and re-install it (see Creating a new package).

Creating a new package edit

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 edit

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 edit

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.

Category:Admin:Software