How to make a Solaris package of existing binaries
This page assumes you have existing binaries, rather than a source tree,
and you want to encapsulate them in a SysV package.
It also assumes you have a directory that only holds the binaries you care
about. (eg: /export/home/yourapp). Otherwise you'll have to do more work
Compared to my other pages, this is a quick-n-dirty job. This will make a
package that is NOT relocatable.
lets assume you want to "hypothetically speaking", package up
/export/home/OpenOffice. You would do the following steps, assuming you
have enough room in /tmp to hold 2*space of binaries --
Dont forget to rm -r /tmp/YOURpkgname, and mv newfile.pkg somewhere else
- cd /tmp
- echo 'i pkginfo' >prototype
- pkgproto /export/home/OpenOffice >>prototype
(If this is a shared dir like /usr/local, you should trim the
prototype file after it is auto-generated)
- Create the file 'pkginfo' with the following fields:
ARCH=(sparc or i386 here)
NAME=Short Description here
- pkgmk -d /tmp -r /
- pkgtrans -s /tmp YOURpkgname.pkg
You now have a file /tmp/$PKGNAME.pkg suitable for use with
pkgadd -d $PKGNAME.pkg
See the other makeapackage pages for information on dependancies.
FYI: the 'pkgmk -r /' was because we specify full, absolute paths. it is also
possible to run the pkgproto from /export/home, making the starting
directory in the prototype file be 'OpenOffice'.
In this case, you would use
"pkgmk -d /tmp -b /export/home BASEDIR=/export/home", rather than "pkgmk -r /"
If you also want your package gzipped, but you're in a hurry, you can also
pkgtrans -s /tmp /dev/fd/1 YOURpkgname | gzip >/tmp/YOURpkgname.pkg.gz
Written by: Philip Brown