Standards doc for building a COMxxx package

This is a guide for making a package for submission to the Solaris pkg-get companion CD archive. The purpose of doing so is to provide useful pre-built freeware binaries to people that are not currently delivered by Sun's "Companion CD" effort, yet based around the libraries and utils shipped with the Companion CD.

Ideally, you will

Note: No alpha, beta, or otherwise unstable software will be accepted to the archives. Additionally, Sun-built SFWxxx packages take precedence over COMxxx packages.

The overriding guideline, is to provide a transparent user experience. The user should in all cases be able to do

 pkg-get install xyz
and have xyz just work, with no extra fuss.

Configuration standards

All packages will be configured to deliver binaries "ready to run", as judged by professional sysadmin standards. No by-hand steps should be needed. For example, COMossh has rc scripts that automatically build ssh host keys, if needed.

Exceptions to this rule are only if the software needs fundamental by-hand configuration to do anything useful.
Example: Sun's own packaging of mysql, SFWmysql

Build standards

Builds will be done on Solaris 8 x86 and Solaris 8 sparc, and the same binaries will be automatically provided for both Solaris 8 and Solaris 9 downloaders, unless there is need for a Solaris-9 specific binary. In which case, both Solaris 8 and Solaris 9 packages must be created.

Builds will be configured with whatever is equivalent to

   configure --prefix=/opt/sfw

All programs and libraries should be built with

   export LD_OPTIONS=-R/opt/sfw/lib
plus any other needed -R type dependancies. They should ONLY be linked against Solaris/Sun provided libraries, and libraries packaged under /opt/sfw

pkginfo definitions

At minimum, your pkginfo file should contain the following information:
NAME=long name (or "ShortName - Long name after dash")
CATEGORY=("application" or "system")
DESC=COMmunity build: pkgname x.y.z, pacakged by Your Name

depend definitions

If your package depends on certain shared libraries being installed, it should have a 'depend' file specified. "man depend" for format of the file. You will almost always need a depend file. Generally speaking, it will have entries like the following:
  P      SFWgtk  GTK - The GIMP Toolkit
  P      SFWglib GLIB - Library of useful routines for C programming
If any packages in the depend file do not begin with "SFW", "SUNW", or "COM", go and read the "Build standards" section of this document.

EVERY SINGLE DYNAMICALLY LINKED LIBRARY used by your package, must have an appropriate entry in your depend file.

How to create the package

The trivial almost automated way (AFTER you have created pkginfo and depend files)

# touch /tmp/timestamp
[make install, or whatever you do to install the program under /opt/sfw]
# find /opt/sfw -newer /tmp/timestamp |pkgproto >prototype.files
# (echo "i pkginfo"; echo "i depend" ; cat prototype.files) >prototype
# pkgmk -r / -a `uname -p`
# pkgtrans -s /var/spool/pkg /tmp/COMyourpkg-`uname -p`.pkg COMyourpkg

[ you might also want to do "rm -r /var/spool/pkg/COMyourpkg" now]

You should now have a shiney new package file to submit. Ideally, you will build both a Solaris 8 x86, and a Solaris 8 sparc version.

It is suggested that you keep around your pkginfo and depend files, and any build notes you may have, so that when it comes time to upgrade the package, you have an easier time of it.

If you are not willing to be the ongoing package maintainer for a package, do not submit one in the first place!

Note: We may not accept all packages for inclusion into the archive. Trivial stuff like "this is my favourite screensaver" will most likely NOT be accepted.

Thus, you should probably email Phil before you start making packages.

Written by: Philip Brown
Bolthole Top - Solaris Top - Search