Tags:
create new tag
view all tags

KeyWords: SysAdmin, Solaris

Notes on Creating Solaris packages

I make this note as a reminder of the correct incantation of the Solaris 10 commands to make a package in datastream (i.e., file) format.

Follow the instructions in Creating Solaris Packages to prepare the files required by the pkgmk command to actually build the software package.

The actual package is built with the command:

  pkgmk -o -r `pwd` -d /tmp/ -f prototype 
Caveat:
  • The -r `pwd` switch tells pkgmk to use the base directory `pwd` for resolving any relative pathname in the prototype file; that is, the files included in the package will be those under the `pwd` tree. This is the behaviour you expect if you are used to Linux software packaging. Using -r / as advised by Solaris packaging guides will include in the package the files that are actually copied from the / filesystem, i.e., the live running system!
  • The -d /tmp switch tells pkgmk to put the generated package directory in /tmp. If you have your package sources (the files to be packaged) under /tmp/packagename, then you are asking for trouble.

Solaris packages come in two formats: the filesystem format (all files in the package are grouped in a directory tree), and the datastream format (all files are packed into an archive file, similarly to what is customary in Linux). The pkgtrans command is used to convert from one format to the other.

The pkgmk utility will generate packages in filesystem format; the correct incantation to convert it to datastream format is as follows:

  pkgtrans -n -s /tmp /tmp/CSCSsmf-cfengine-1.1.3.pkg CSCSsmf-cfengine
Caveat:
  • Option -s specifies that pkgtrans converts to a datastream package
  • Option -n specifies that the destination file is created if it does not exist.
  • First argument /tmp specified the directory the source package(s) should be searched for in.
  • Second argument (/tmp/CSCSsmf-cfengine-1.1.3.pkg) specifies the destination package datastream
  • Third (and following, if any) arguments specify the source package names, which are searched for in the directory specified as first argument.

-- RiccardoMurri - 05 Nov 2008

References

Readers' comments

 
Topic revision: r1 - 2008-11-05 - RiccardoMurri
 
This site is powered by the TWiki collaboration platform Powered by Perl This site is powered by the TWiki collaboration platformCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback