Wednesday, August 17, 2005

Solaris packages Creation

packages

The following are the steps I used to create a Solaris 2.6 package for
the Mutt e-mail client. Although these steps may be applied for other
software, please visit the excellent Sunfreeware.com Creating Packages
page for additional information on creating Solaris packages.

1. Uncompress the mutt source.
gunzip -cd mutt-1.4i.tar.gz | tar xvf -

2. Create an alternate destination directory for the package you will create.
mkdir /tmp/pkg

3. Change mutt's configure file to use /tmp/pkg as the destination directory.
cd mutt-1.4
vi configure

Change:
ac_default_prefix=/usr/local

To:
ac_default_prefix=/tmp/pkg

4. Build mutt in the alternate destination directory:
./configure && make && make install

5. Create a package prototype file containing a list of all files that
were just installed.
cd /tmp/pkg
find . -print | pkgproto > /tmp/pkg/prototype

6. Edit the package prototype and change your username and group to
bin. In this example, my username is hutchib and my group is nsm.
vi /tmp/pkg/prototype

Change username hutchib and group nsm to bin.
:%s/hutchib/bin/g
:%s/nsm/bin/g

7. Add the following line to the top of your prototype file.
i pkginfo=./pkginfo

8. Create a pkginfo file for your package.
vi /tmp/pkg/pkginfo

Add:
PKG="BHmutt"
NAME="mutt"
ARCH="sparc"
VERSION="1.4i"
CATEGORY="application"
VENDOR="mutt.org"
EMAIL="brandonhutchinson@hotmail.com"
PSTAMP="Brandon Hutchinson"
BASEDIR="/usr/local"
CLASSES="none"

Here are descriptions from Sunfreeware's page on what the fields mean:

PKG = the name you have chosen for the package directory
NAME = the program name
ARCH = the operating system version
VERSION = the version number for your program
CATEGORY = the program is an application
VENDOR = whoever wrote the software
EMAIL = an email contact
PSTAMP = the person who did the port perhaps
BASEDIR = the /usr/local directory where the files install
CLASSES = just put none here
9. Create the package in datastream format.
cd /tmp/pkg
pkgmk -r `pwd`

10. Translate the package into a file system format.
cd /var/spool/pkg
pkgtrans -s `pwd` /tmp/mutt-1.4i

11. Compress the package.
gzip /tmp/mutt-1.4i

You should now be able to install the package on the appropriate
platform using the pkgadd command.
# pkgadd -d ./mutt-1.4i

0 Comments:

Post a Comment

<< Home