'\"macro stdmacro
.if n .pH g4.prototype @(#)prototype	40.16 of 2/2/90
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} prototype 4 "Essential Utilities" "\&"
.if \nX=1 .ds x} prototype 4 "Essential Utilities"
.if \nX=2 .ds x} prototype 4 "Essential Utilities" "\&"
.if \nX=3 .ds x} prototype "Essential Utilities" "\&"
.TH \*(x}
.SH NAME
\f4prototype\f1 \- package information file
.SH DESCRIPTION
\f4prototype\fP
is an
.SM ASCII
file used to specify package information.
Each entry in the file describes a single deliverable object.
An object may be a data file,
directory, source file, executable object, etc.
This file is generated by the package developer.
.P
Entries in a
\f4prototype\fP
file consist of several fields of information separated by white space.
Comment lines begin with a ``\f4\#\fP'' and are ignored.
The fields are described below and must appear in the order shown.
.TP 10
\f2part\f1
An optional field designating the part number in which
the object resides. A part is a collection of files, and is the
atomic unit by which a package is processed.
A developer can choose criteria for groupig files into a part
(e.g., based on class). If this field is not used,
part 1 is assumed.
.TP 10
\f2ftype\f1
A one-character field which indicates the file type.
Valid values are:
.RS 14
.TP 4
.PD 0
\f4f\f1
a standard executable or data file
.TP
\f4e\f1
a file to be edited upon installation or removal
.TP
\f4v\f1
volatile file (one whose contents are expected to change)
.TP
\f4d\f1
directory
.TP
\f4x\f1
an exclusive directory
.TP
\f4l\f1
linked file
.TP
\f4p\f1
named pipe
.TP
\f4c\f1
character special device
.TP
\f4b\f1
block special device
.TP
\f4i\f1
installation script or information file
.TP
\f4s\f1
symbolic link
.RE
.PD
.TP 10
\f2class\f1
The installation class to which the file belongs.
This name must contain only
alphanumeric characters and be no longer than 12 characters.
The field is not specified for installation scripts.
(\f4admin\f1 and all classes beginning with capital
letters are reserved class names.)
.TP 10
\f2pathname\f1
The pathname where the file will reside on the target machine, e.g., \f4/usr/bin/mail\f1
or \f4bin/ras_proc\f1.
Relative pathnames (those that do not begin with a slash)
indicate that the file is relocatable.
The form
.P
.RS 14
\f2path1\f4=\f2path2\f1
.RE
.IP "" 10
may be used for two purposes: to define a link and to define local 
pathnames.
.IP
For linked files,
\f2path1\f1
indicates the destination of the link and
\f2path2\f1
indicates the source file.
(This format is mandatory for linked files.)
.IP
For local pathnames,
\f2path1\f1
indicates the pathname an object should have on the machine where the entry is
to be installed and
\f2path2\f1
indicates either a relative or fixed pathname to a file on the host machine
which contains the actual contents.
.IP
A pathname may contain a variable specification, which will be resolved at the
time of installation.
This specification should have the form $[A-Z].
.TP 10
\f2major\f1
The major device number.
The field is only specified for block
or character special devices.
.TP 10
\f2minor\f1
The minor device number.
The field is only specified for block
or character special devices.
.TP 10
\f2mode\f1
The octal mode of the file (for example, 0664).
A question mark (\f4?\fP) indicates that the mode will be left unchanged, implying
that the file already exists on the target machine.
This field is not used for linked files or packaging information files.
.TP 10
\f2owner\f1
The owner of the file (for example, \f4bin\fP or \f4root\fP).
The field is limited to
14 characters in length.
A question mark (\f4?\fP) indicates that the owner will be left unchanged, implying
that the file already exists on the target machine.
This field is not used for linked files or
packaging information files.
.IP
Can be a variable specification in the form of \f4$[A-Z]\fP.
Will be resolved at installation time.
.TP 10
\f2group\f1
The group to which the file belongs (for example, \f4bin\fP or \f4sys\fP).
The field
is limited to 14 characters in length.
A question mark (\f4?\fP) indicates that the group will be left unchanged, implying
that the file already exists on the target machine.
This field is not used for linked files or
packaging information files.
.IP
Can be a variable specification in the form of $[A-Z].
Will be resolved at
installation time.
.PP
An exclamation point (\f4!\fP) at the beginning of a line indicates 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:
.TP 15
\f4search\f1
Specifies a list of directories (separated by white space) to search for when
looking for file contents on the host machine.
The basename of the \f2path\f1
field is appended to each directory in the ordered list until the file is
located.
.TP 15
\f4include\f1
Specifies a pathname which points to another prototype file to include.
Note that \f4search\f1 requests do not span \f4include\f1 files.
.TP 15
\f4default\f1
Specifies a list of attributes (mode, owner, and group) to be used by
default if attribute information is not provided for prototype entries which
require the information.
The defaults do not apply to entries in
\f4include\f1 prototype files.
.TP 15
\f2param\f4=\f2value\f1
Places the indicated parameter in the current environment.
.PP
The above commands may have variable substitutions embedded within
them, as demonstrated in the two example \f4prototype\fP files below.
.PP
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 (i.e, \f2ftype\f1 is \f4e\f1).
For files which meet this exception,
the existing version is linked to a temporary pathname, and the original
file is removed.
This allows processes which are executing during installation
to be overwritten.
.SH EXAMPLES
Example 1:
.P
.RS
.ft 4
.nf
!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\f1
\f4# the following specifies a link (dest=src)
l none /usr/wrap/src/addpkg=/usr/wrap/bin/rmpkg
! search $SRC
!default 644 root other
f 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
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
.fi
.ft 1
.RE
.PP
.br
.ne 2i
Example 2:
.PP
.RS
.nf
.ft 4
# 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
.ft 1
.fi
.RE
.SH SEE ALSO
\f4pkginfo\f1(4), \f4pkgmk\f1(1).
.SH NOTES
Normally, if a file is defined in the \f4prototype\f1 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 will not be
created.
For example, if the \f4prototype\f1 file has the following entry:
.PP
.RS
.nf
.ft 4
f none /usr/dev/bin/command\f1
.ft 1
.fi
.RE
.P
and that file does not exist, it will be created if the directory
\f4/usr/dev/bin\f1 already exists or if the \f4prototype\f1 also has an
entry defining the directory:
.PP
.RS
.nf
.ft 4
d none /usr/dev/bin\f1
.ft 1
.fi
.RE
.Ee
.\"	@(#)prototype.4	5.2 of 6/16/87
