For more details, see Application Packaging Developer's Guide
Here is the minimum number of actions required to create a Solaris package:
1. Generate file prototype that has information about package content:
# cd ~/pkg # pkgproto . > prototype
2. Create file pkginfo
# vi pkginfo ARCH=sparc CATEGORY=application NAME=My package Description PKG=CREApkg VERSION=1.2.3
3. Add the following line into prototype
i pkginfo=pkginfo
4. Run pkgmk in the same directory where prototype is or use -f <path_to_prototype> options. You may use -r option if you know where the packet is to be installed, otherwise, pkgadd will ask about the root directory.
# pkgmk -b ~/pkg -d ~ -o
5. Create an archive of the package in ~
# cd ~ # tar -cf CREApkg-1.2.3.tar CREApkg # gzip CREApkg-1.2.3.tar
6. To install the package
# gunzip CREApkg-1.2.3.tar.gz # tar -xf CREApkg-1.2.3.tar # pkadd -d . CREApkg