How to create IPS packages for OpenSolaris
Posted by abhiitechie on May 14, 2009
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
vikas said
please change the link of CBE download to http://dlc.sun.com/osol/jds/downloads/cbe/test/
abhiitechie said
Done 🙂
vikas said
>>> $ ./configure –prefix=/opt/dtbld/
Why i have to use prefix???
abhiitechie said
prefix specifies the location where the installed files are to be placed like it is by default /usr/local so using the –prefix=%{prefix} where the variable prefix contains /usr we specify the directory to be /usr
vikas said
Thanks and please edit
>>$ pfexec make install Set the build environment
line.
vikas said
after using the command
svn co svn+ssh://anon@svn.opensolaris.org/svn/jds/spec-files/trunk spec-files-trunk
and after ‘make’
m not getting any SFEjoe.spec file.
why so???
Tai Bounds said
I am not certain where you’re getting your info, but great topic. I needs to spend a while learning more or figuring out more. Thanks for excellent information I used to be in search of this info for my mission.
Joseph Glines said
Hi there! I’m at work browsing your blog from my new iphone 3gs! Just wanted to say I love reading your blog and look forward to all your posts! Carry on the superb work!
thank you :D said
thank you :D…
[…]How to create IPS packages for OpenSolaris « Abhishek Gupta[…]…
Civilization 5 Trainer said
Write more, thats all I have to say. Literally, it
seems as though you relied on the video to make your point.
You definitely know what youre talking about, why throw away your
intelligence on just posting videos to your weblog when you could be
giving us something enlightening to read?