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").
Example--Specifying Different Source Directories for Information Files and Package Objects
If you put package information files (such as pkginfo and prototype) and the package objects in two different directories, you can create your package by using the -b base-src-dir and -r rootpath options to the pkgmk command. If you have your package objects in a directory called /product/pkgbin and the other package information files in a directory called /product/pkgsrc, you could use the following command to place the package in the /var/spool/pkg directory:
$ pkgmk -b /product/pkgbin -r /product/pkgsrc -f /product/pkgsrc/prototype |
Optionally, you could use this command to do the same:
$ cd /product/pkgsrc $ pkgmk -o -b /product/pkgbin |
In this example, the pkgmk command uses the current working directory to find the remaining parts of the package (like the prototype and pkginfo information files).