Creating IPS packages for Opensolaris consists of four important steps :
- Building the package using common method like, make, make install and figure out the dependencies.
- We need to have a build environment (CBE) [ one time step ]
- We need to write a spec file
- We will use pkgtool to generate IPS
- Building the environment for development
Prerequisites:
Install sunstudio compiler using the command
pfexec pkg install ss-dev
Install the following required packages similarly
- SUNWgnome-common-devel
- SUNWperl-xml-parser
- SUNWgnome-xml-root
- SUNWgnome-xml
- SUNWgnome-xml-share
- SUNWdoxygen (optional)
Installing the Common Build Environment
Download the CBE(Common Build Environment) from :
http://dlc.sun.com/osol/jds/downloads/cbe/test/
Ensure you select the correct architecture. Once downloaded, extract the contents from the tarball. To install run cbe-install. This needs to be run by a user with Primary Administrator privileges. Users wishing to run and CBE once installed successfully should have at least Software Installation privileges. Privilages are easy enough to add, by either manually editing the /etc/user_attr file or using usermod(1) with the -P CLI option.
Download latest pkgbuild from here :
http://pkgbuild.sourceforge.net/download.php (version >= 1.3.98, for generating IPS packages)
CBE 1.7+ includes a version of pkgbuild which at the moment does not generate IPS packages. If you just want to compile packages and generate SVR4 packages then there is no need to perform this step. Use the installed CBE to build the downloaded latest pkgbuild package
$ cd pkgbuild-1.3.98
$ ./configure –prefix=/opt/dtbld/
$ make
$ pfexec make install Set the build environment
$ . /opt/dtbld/bin/env.sh
Get existing spec files to play around with: svn co svn+ssh://anon@svn.opensolaris.org/svn/jds/spec-files/trunk spec-files-trunk
set the build environment by sunning the following script.
$ . /opt/dtbld/bin/env.sh
Building the package and Generating IPS
pkgtool –download –ips build-only SFEjoe.spec
Before executing the above command the local repository must be setup to run at localhost:80 using
svcadm enable pkg/server
for IPS repo on http://localhost:80 )
Creating Spec files
How to write a spec file: http://jucr.opensolaris.org/help/spec_file
Base spec file:
http://jucr.opensolaris.org/help/base.spec
Source Juicer:
http://jucr.opensolaris.org/home