Create solaris packages


This is a quick and simple way of creating solaris packages... there are more advanced things you can
do when making a package, such as post and pre installation scripts, but we won't cover those here.
If the files that will go into the package are in /pkg directory and we are creating the package in /tmp

        find /pkg -print > /tmp/files

NOTE: you might have to add entries in /tmp/files for any parent directory which the files exist under 
since pkgmk will complain about them.

        cat /tmp/files | pkgproto > /tmp/Prototype

now edit the Prototype file, and at the top, add the line

        i pkginfo

create a file called pkginfo in the same directory, and include the following (replace the values as needed): 
 

PKG="packagename"
NAME="GNU bison 1.24"
VERSION="1"
ARCH="sparc"
CLASSES="none"
CATEGORY="utility"
VENDOR="GNU"
PSTAMP="4thSep95"
EMAIL="email@foo.com"
BASEDIR="/"

NOTE: PKG doesnt take punctuation marks other than "-"   the description of the package should be put under NAME field.

After editing that file, do: 

        pkgmk -o -r / -d /tmp -f Prototype

this means your setting file location with / as root directory, and build the package in the /tmp directory. You can 
modify this to suit your environment.

after this you can either tar up the directory  by:

        cd /tmp
        tar -cf - packagename | gzip -9 -c > packagename.pkg.tar.gz

or convert it to a package by doing : 

        pkgtrans -n . name.pkg


and off you go, now you can install the package by using pkgadd.