Hello, world ! Welcome to the weblog of Kristof Willen. This is the place where I publish some weird and interesting links I encountered during my dwellings in cyberspace. Apart from that, you can find some useful/useless information about myself.

(File under : 6yo stuff that I finally integrated into my blog)
Since I became a Unix system administrator, I had the opportunity to create some Solaris packages. We all know how important decent package management is on Unix systems, and I have a decent experience in packaging software with my Debian box at home. Apt-build and such are excellent tools under Debian, so I was a bit surprised that package management seemed so primitive under Solaris.
There are some scripts out there which do the job for you, but as it is the habit with scripts, you don't know what these things are doing on your machine. If you want to know all the tidbits about packaging on Solaris, you're on the right place here.
So here is a HOWTO about creating Solaris packages based on my experience.
/export/home/youruser ! +--- pkg ! +--- src ! +--- usr ! +--- local
We will extract and build our software in the ~/src dir. Installation will happen in the ~/pkg/usr/local dir. So you really don't need to setup a chrooted environment as you see so many times explained in other places.
$ ./configure --exec-prefix=/export/home/youruser/pkg/usr/local --prefix=/export/home/youruser/pkg/usr/local.
$ make && make install
$ cd /export/home/youruser/pkg/usr/local/
$ find . -print |pkgproto > prototype
i pkginfo=./pkginfo
d none lib 0755 kristof users
f none lib/libslang.a 0644 kristof users
d none include 0755 kristof users
f none include/slang.h 0644 kristof users
f none include/slcurses.h 0644 kristof users
i pkginfo=./pkginfo
d none lib 0755 bin bin
f none lib/libslang.a 0644 bin bin
d none include 0755 bin bin
f none include/slang.h 0644 bin bin
f none include/slcurses.h 0644 bin bin
You should add pre- and postinstall scripts with a line like the pkginfo one.
PKG="SCprog"
NAME="prog"
ARCH="intel"
VERSION="1.00"
CATEGORY="application"
VENDOR="Foo, Inc."
EMAIL="foo@net.net"
PSTAMP="Mr Pink"
BASEDIR="/usr/local"
CLASSES="none"
The most important entry is the BASEDIR line - it will specify where your software will be installed.
$ pkgmkg -r `pwd`
$ cd /var/spool/pkg
$ pkgtrans -s `pwd` ~/pkg/foo-0.1
$ pkgadd -d foo-0.1
$ rm -rf ~/pkg/usr/local/ && mkdir -p ~/pkg/usr/local/
That's it ! Your package has been created !
Comments
See also
See also the Sun application packaging developper's guide.
handy
Thanks for the guide!
This will certainly come in handy!