File Formats prototype(4)
NAME
prototype - package information file
DESCRIPTION
prototype is an ASCII file used to specify package informa-
tion. Each entry in the file describes a single deliverable object. An object can be a data file, directory, sourcefile, executable object, and so forth. This file is gen-
erated by the package developer.Entries in a prototype file consist of several fields of
information separated by white space. Comment lines beginwith a ``#'' and are ignored. The fields are described below
and must appear in the order shown. part An optional field designating the part number in which the object resides. A part is a collectionof files and is the atomic unit by which a pack-
age is processed. A developer can choose cri-
teria for grouping files into a part (for exam-
ple, based on class). If this field is not used, part 1 is assumed.ftype A one-character field that indicates the file
type. Valid values are: b block special device c character special device d directory e a file to be edited upon installation or removal (can be shared by several packages) f a standard executable or data file i installation script or information file l linked file p named pipeSunOS 5.11 Last change: 3 May 2008 1
File Formats prototype(4)
s symbolic link v volatile file (one whose contents are expected to change, like a log file) x an exclusive directory accessible only by this package class The installation class to which the file belongs. This name can be no longer than 64characters. The field is not specified for ins-
tallation scripts. (admin and all classes begin-
ning with capital letters are reserved class names.)pathname The pathname where the file resides on the tar-
get machine, for example, /usr/bin/mail or bin/ras/proc. Relative pathnames (those that do not begin with a slash) indicate that the file is relocatable. The form path1=path2 can be used for two purposes: to define a link and to define local pathnames.For linked files, path1 indicates the destina-
tion of the link and path2 indicates the source file. (This format is mandatory for linked files.)For local pathnames, path1 indicates the path-
name an object should have on the machine where the entry is to be installed and path2 indicates either a relative or fixed pathname to a file onthe host machine which contains the actual con-
tents. A pathname can contain a variable specificationof the form $variable. If variable begins with a
lower case letter, it is a build variable. If variable begins with an upper case letter, it is an install variable. Build variables are bound at build time. If an install variable is known at build time, its definition is inserted into the pkginfo(4) file so that it is available at install time. If an install variable is notSunOS 5.11 Last change: 3 May 2008 2
File Formats prototype(4)
known at build time, it is bound at install time. major The major device number. The field is onlyspecified for block or character special dev-
ices. minor The minor device number. The field is onlyspecified for block or character special dev-
ices. mode The octal mode of the file (for example, 0664). A question mark (?) indicates that the mode is left unchanged, implying that the file already exists on the target machine. This field is not used for linked files or packaging information files. The mode can be a variable specification of theform $variable. If variable begins with a lower
case letter, it is a build variable. If variable begins with an upper case letter, it is an install variable. Build variables are bound at build time. If an install variable is known at build time, its definition is inserted into the pkginfo(4) file so that it is available at install time. If an install variable is not known at build time, it is bound at install time. owner The owner of the file (for example, bin or root). The field is limited to 14 characters in length. A question mark (?) indicates that the owner is left unchanged, implying that the file already exists on the target machine. This fieldis not used for linked files or packaging infor-
mation files. The owner can be a variable specification of theform $variable. If variable begins with a lower
case letter, it is a build variable. If variable begins with an upper case letter, it is an install variable. Build variables are bound at build time. If an install variable is known at build time, its definition is inserted into the pkginfo(4) file so that it is available at install time. If an install variable is not known at build time, it is bound at installSunOS 5.11 Last change: 3 May 2008 3
File Formats prototype(4)
time.group The group to which the file belongs (for exam-
ple, bin or sys). The field is limited to 14characters in length. A question mark (?) indi-
cates that the group is left unchanged, implying that the file already exists on the target machine. This field is not used for linked files or packaging information files. The group can be a variable specification of theform $variable. If variable begins with a lower
case letter, it is a build variable. If variable begins with an upper case letter, it is an install variable. Build variables are bound at build time. If an install variable is known at build time, its definition is inserted into the pkginfo(4) file so that it is available at install time. If an install variable is not known at build time, it is bound at install time.An exclamation point (!) at the beginning of a line indi-
cates that the line contains a command. These commands are used to incorporate files in other directories, to locate objects on a host machine, and to set permanent defaults. The following commands are available: search Specifies a list of directories (separated by white space) to search for when looking for file contents on the host machine. The base name of the path field is appended to each directory in the ordered list until the file is located. Searches are not recursive. include Specifies a pathname which points to anotherprototype file to include. Note that search
requests do not span include files. default Specifies a list of attributes (mode, owner, and group) to be used by default if attributeinformation is not provided for prototype
entries which require the information. The defaults do not apply to entries in includeprototype files.
SunOS 5.11 Last change: 3 May 2008 4
File Formats prototype(4)
param=value Places the indicated parameter in the current environment. Spans to subsequent includedprototype files.
The above commands can have variable substitutions embeddedwithin them, as demonstrated in the two example prototype
files below. Before files are overwritten during installation, they are copied to a temporary pathname. The exception to this rule is files whose mode includes execute permission, unless the file is editable (that is, ftype is e). For files which meetthis exception, the existing version is linked to a tem-
porary pathname, and the original file is removed. This allows processes which are executing during installation to be overwritten.EXAMPLES
Example 1 Example 1: !PROJDIR=/usr/proj!BIN=$PROJDIR/bin
!CFG=$PROJDIR/cfg
!LIB=$PROJDIR/lib
!HDRS=$PROJDIR/hdrs
!search /usr/myname/usr/bin /usr/myname/src /usr/myname/hdrs i pkginfo=/usr/myname/wrap/pkginfo i depend=/usr/myname/wrap/depend i version=/usr/myname/wrap/version d none /usr/wrap 0755 root bin d none /usr/wrap/usr/bin 0755 root bin! search $BIN
f none /usr/wrap/bin/INSTALL 0755 root bin
f none /usr/wrap/bin/REMOVE 0755 root bin f none /usr/wrap/bin/addpkg 0755 root bin !default 755 root bin f none /usr/wrap/bin/audit f none /usr/wrap/bin/listpkg f none /usr/wrap/bin/pkgmk
# the following file starts out zero length but grows
v none /usr/wrap/logfile=/dev/null 0644 root bin# the following specifies a link (dest=src)
l none /usr/wrap/src/addpkg=/usr/wrap/bin/rmpkg! search $SRC
!default 644 root otherf src /usr/wrap/src/INSTALL.sh
f src /usr/wrap/src/REMOVE.sh f src /usr/wrap/src/addpkg.c f src /usr/wrap/src/audit.c
SunOS 5.11 Last change: 3 May 2008 5
File Formats prototype(4)
f src /usr/wrap/src/listpkg.c f src /usr/wrap/src/pkgmk.c d none /usr/wrap/data 0755 root bin d none /usr/wrap/save 0755 root bin d none /usr/wrap/spool 0755 root bin d none /usr/wrap/tmp 0755 root bin d src /usr/wrap/src 0755 root bin Example 2 Example 2:# this prototype is generated by 'pkgproto' to refer
# to all prototypes in my src directory
!PROJDIR=/usr/dew/projx!include $PROJDIR/src/cmd/prototype
!include $PROJDIR/src/cmd/audmerg/protofile
!include $PROJDIR/src/lib/proto
SEE ALSO
pkgmk(1), pkginfo(4) Application Packaging Developer's Guide NOTESNormally, if a file is defined in the prototype file but
does not exist, that file is created at the time of package installation. However, if the file pathname includes a directory that does not exist, the file is not created. Forexample, if the prototype file has the following entry:
f none /usr/dev/bin/command and that file does not exist, it is created if the directory/usr/dev/bin already exists or if the prototype also has an
entry defining the directory: d none /usr/dev/binSunOS 5.11 Last change: 3 May 2008 6