SUNW packages in an OpenCSW-format catalog

OpenCSW provides a software stack which allows to build catalogs with Solaris packages, and use a utility, such as pkg-get or pkgutil to download and install packages together with all the dependencies.  It works very nice for OpenCSW packages, but what if one wants to install a SUNW, that is, a Sun-provided package?  Solaris DVDs are not in the OpenCSW format and pkgutil can’t use them directly.

I wrote a tool which converts a collection of Sun packages in the directory format (they’re distributed this way) into a set of gzipped srv4 format files (.pkg.gz) which can be served over http or ftp and downloaded via pkgutil.

To get started:

  1. Install pkgutil and pkgutilplus from OpenCSW
  2. Check out the OpenCSW utilities:
    svn co https://opencsw.svn.sourceforge.net/svnroot/opencsw/utilities/
  3. Have a Solaris DVD available in your filesystem
  4. Patch /opt/csw/bin/bldcat if necessary (the patch is there at the end of this post)
  5. Run the package converter:
    ./build_sun_catalog.py -p “/somewhere/Solaris_10/Product” -c “/target/directory/sparc/5.10″
  6. Run bldcat and create the catalog:
    (cd /target/directory/sparc/5.10; bldcat .)
  7. Server the target directory via http under, say http://packages.example.com/solaris-10u5
  8. From your Solaris machine, use the following command to install a package together with all the dependencies:
    pkgutil -t http://packages.example.com/solaris-10u5 -i SUNWfoo

A word of warning though: upgrading SUNW packages can break your system! If you attempt to upgrade a core Solaris package such as SUNWcakr or SUNWkvm.  If pkgutil tries to do that, use the -x option to filter out those packages. For example:

pkgutil -t http://packages.example.com/solaris-10u5 -i SUNWfoo -x SUNWcakr -x SUNWcar -x SUNWkvm

--- bldcat.orig 2009-11-23 13:45:58.436220417 +0000
+++ bldcat      2009-11-23 13:42:27.098746854 +0000
@@ -100,3 +100,3 @@
foreach (glob "$tmpdir/*") {
-    ($pkgname) = (/([\w\+-]+)$/) if (-d);
+    ($pkgname) = (/([\w\+-\.]+)$/) if (-d);
}

2 Responses to “SUNW packages in an OpenCSW-format catalog”

  1. pavan Says:

    why every package start with the name of sunw in solaris?

  2. automatthias Says:

    It’s a naming convention that packages in Solaris start with the 3 or 4-letter stock ticker. Sun’s ticker is SUNW. Other packages, e.g. OpenCSW packages start with CSW, for example CSWvim.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.