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);
}
Advertisements

Author: automatthias

You won't believe what a skeptic I am.

4 thoughts on “SUNW packages in an OpenCSW-format catalog”

  1. 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.

  2. I’ve attempted to follow your instructions to convert and existing packages that I’ve built to be compatible with OpenCSW. Howeve at step 5 I receive error:

    File “./build_sun_catalog.py”, line 16, in
    import opencsw
    File “/build/cswpy/utilities/opencsw.py”, line 24, in
    import sharedlib_utils as su
    ImportError: No module named sharedlib_utils

    I’ve looked for sharelib_utils and I can’t find it. From what I’ve read leads me to believe it’s part of GAR maybe? Does anyone know where I can find it?

Comments are closed.