Application Packaging Developer's Guide

Example--Specifying a Source Directory for Relocatable Files

If your package contains relocatable files, you can use the -b base-src-dir option to the pkgmk command to specify a path name to be added to the beginning of the relocatable path names while the package is being created. This is useful if you haven't used the path1=path2 format for relocatable files or specified a search path with the !search command in the prototype file.

For example, to build a package using the sample prototype file created by the pkgproto command (see "Creating a prototype File With the pkgproto Command"), without modifying the path fields, and just adding an entry for the pkginfo file, the pkgmk command is:


$ cd /home/jane/InfoFiles
$ pkgmk -o -b /home/jane
## Building pkgmap from package prototype file.
## Processing pkginfo file.
WARNING: parameter  set to "system960716102636"
WARNING: parameter  set to "none"
## Attempting to volumize 13 entries in pkgmap.
part  1 -- 3170 blocks, 17 entries
## Packaging one part.
/var/spool/pkg/SUNWcadap/pkgmap
/var/spool/pkg/SUNWcadap/pkginfo
/var/spool/pkg/SUNWcadap/reloc/SUNWcadap/demo/file1
/var/spool/pkg/SUNWcadap/reloc/SUNWcadap/lib/file2
/var/spool/pkg/SUNWcadap/reloc/SUNWcadap/man/man1/file3.1
/var/spool/pkg/SUNWcadap/reloc/SUNWcadap/man/man1/file4.1
/var/spool/pkg/SUNWcadap/reloc/SUNWcadap/man/windex
/var/spool/pkg/SUNWcadap/reloc/SUNWcadap/srcfiles/file5
/var/spool/pkg/SUNWcadap/reloc/SUNWcadap/srcfiles/file6
## Validating control scripts.
## Packaging complete.

In this example, the package is built in the default directory, /var/spool/pkg, by specifying the -o option (to overwrite the package we created in "Example--Building a Package").