'\"macro stdmacro
.if n .pH g1a.installf @(#)installf	40.10 of 10/10/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} installf 1M "Essential Utilities" "\&"
.if \nX=1 .ds x} installf 1M "Essential Utilities"
.if \nX=2 .ds x} installf 1M "Essential Utilities" "\&"
.if \nX=3 .ds x} installf "Essential Utilities" "\&"
.TH \*(x}
.SH NAME
\f4installf\f1 \- add a file to the software installation database
.SH SYNOPSIS
.nf
.ft CW
installf \f1[\f(CW\-c \f2class\f(CW\f1]\f(CW \f2pkginst pathname\f(CW \f1[\f(CW\f2ftype\f(CW \f1[\f(CW\|\f1[\f(CW\f2major minor\f(CW\f1]\f(CW
	[\f2mode owner group\f(CW\f1]\f(CW\|\f1]\f(CW
.sp .5
installf \f1[\f(CW\-c \f2class\f(CW\f1]\f(CW \f2pkginst\f(CW \-
.sp .5
installf \-f \f(CW\f1[\f(CW\-c \f2class\f(CW\f1]\f(CW \f2pkginst\f(CW
.fi
.SH DESCRIPTION
\f(CWinstallf\f1 informs the system that
a pathname not listed in the \f4pkgmap\fP file is being created or modified.
It should be invoked before any file modifications have occurred. 
.P
When the second synopsis is used, the pathname descriptions will be read
from standard input.
These descriptions are the same as would be given in
the first synopsis but the information is given in the form of a list.
(The descriptions should be in the form:
\f2pathname \f(CW[\f2ftype\f(CW [\|[\f2major minor\f(CW]
[\f2mode owner group\f(CW]]\f1.)
.PP
After all files have been appropriately created and/or modified,
\f(CWinstallf\f1
should be invoked with the \f(CW\-f\f1 synopsis to indicate that installation
is final.
Links will be created at this time and,
if attribute information for a pathname was not specified during the 
original invocation of \f(CWinstallf\f1
or was not already stored on the system,
the current attribute values for the pathname will be stored.
Otherwise,
\f(CWinstallf\f1 verifies that attribute values match those given on the command
line, making
corrections as necessary.
In all cases, the current content information
is calculated and stored appropriately.
.TP 10
\f(CW\-c\f1 \f2class\f1
Class to which installed objects should be associated.
Default class is \f(CWnone\f1.
.P
.TP 10
\f2pkginst\f1
Name of package instance with which the pathname should be associated.
.P
.TP 10
\f2pathname\f1
Pathname that is being created or modified.
.TP 10
\f2ftype\f1
A one-character field that indicates the file type.
Possible file types include:
.P
.in 1.37i
\f(CWf\f1
.sp -1
.in 1.8i
a standard executable or data file
.in 1.37i
\f(CWe\f1
.sp -1
.in 1.8i
a file to be edited upon installation or removal
.in 1.37i
\f(CWv\f1
.sp -1
.in 1.8i
volatile file (one whose contents are expected to change)
.in 1.37i
\f(CWd\f1
.sp -1
.in 1.8i
directory
.in 1.37i
\f(CWx\f1
.sp -1
.in 1.8i
an exclusive directory
.in 1.37i
\f(CWl\f1
.sp -1
.in 1.8i
linked file
.in 1.37i
\f(CWp\f1
.sp -1
.in 1.8i
named pipe
.in 1.37i
\f(CWc\f1
.sp -1
.in 1.8i
character special device
.in 1.37i
\f(CWb\f1
.sp -1
.in 1.8i
block special device
.in 1.37i
\f(CWs\f1
.sp -1
.in 1.8i
symbolic link
.sp 
.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 (\f(CW?\f1)
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 or symbolically linked files.
.TP 10
\f2owner\f1
The owner of the file (for example, \f(CWbin\f1 or \f(CWroot\f1).
The field is limited to
14 characters in length. 
A question mark (\f(CW?\f1)
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 or symbolically linked files.
.TP 10 
\f4group\fP
The group to which the file belongs (for example, \f(CWbin\f1 or \f(CWsys\f1).
The field is limited to 14 characters in length.
A question mark (?) 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 or symbolically linked files.
.TP 10
\f(CW\-f\f1
Indicates that installation is complete.
This option is used with the final invocation of \f(CWinstallf\f1
(for all files of a given class).
.SH NOTES
When \f2ftype\f1 is specified,
all applicable fields,
as shown below, must be defined:
.sp
.TS
cfI cfI
lfCW lfCW.
ftype	Required Fields
p x d f v \f1or\f(CW e	mode owner group
c \f1or\f(CW b	major minor mode owner group
.TE
.sp
.ig
.P
.tr ~
.PD 0
.TP 10
FTYPE
REQUIRED FIELDS
.P
.TP 10
p, x, d
\f(CWmode  owner  group\f1
.TP 10
f, v, or e
~
.P
.TP 10
c  or  b
\f(CWmajor  minor\f1
.TP 10
~
\f(CWmode  owner  group\f1
.PD
..
.P
The \f(CWinstallf\f1 command will create directories, named pipes and special
devices on the original invocation.
Links are created
when \f(CWinstallf\f1 is invoked with the \f(CW\-f\f1 option to indicate
installation is complete.
.P
Links should be specified as \f2path1\f(CW=\f2path2\f1.
\f2path1\f1 indicates the destination and \f2path2\f1 indicates the source file.
.P
Files installed with \f(CWinstallf\f1 will be placed
in the class \f2none\f1, unless a
class is defined with the command.
Subsequently, they will be removed
when the associated package is deleted.
If this file should not be deleted
at the same time as the package, be certain to assign it to a class which is
ignored at removal time.
If special action is
required for the file before removal, a class must be defined with
the command and an appropriate class action script delivered with the package.
.P
When classes are used, \f(CWinstallf\f1 must be used as follows:
.in 5
.ft CW
.nf
installf -c class1 ...
installf -f -c class1 ...
installf -c class2 ...
installf -f -c class2 ...
.fi
.ft 1
.in 0
.SH EXAMPLE
The following example shows the use of \f4installf\fP invoked from
an optional preinstall or postinstall script:
.P
.tr ?*
.nf
.ft CW
.S -2
#create /dev/xt directory
#(needs to be done before drvinstall)
installf $PKGINST /dev/xt d 755 root sys ||
	exit 2
majno=`/usr/sbin/drvinstall \-m /etc/master.d/xt
     \-d $BASEDIR/data/xt.o \-v1.0` ||
	exit 2
i=00
while [ $i \-lt $limit ]
do
\ \ \ \ for j in 0 1 2 3 4 5 6 7
\ \ \ \ do
\ \ \ \ \ \ \ \ echo /dev/xt$i$j c $majno `expr $i ? 8 + $j` 
\ \ \ \ \ \ \ \ \ \ \ \ \ 644 root sys |
\ \ \ \ \ \ \ \ echo /dev/xt$i$j=/dev/xt/$i$j 
\ \ \ \ done
\ \ \ \ i=`expr $i + 1`
\ \ \ \ [ $i \-le 9 ] && i="0$i" #add leading zero
done | installf $PKGINST - || exit 2
# finalized installation, create links
installf \-f $PKGINST || exit 2
.S +2
.ft 1
.fi
.tr ??
.Ee
.SH SEE ALSO
.na
\f4pkgadd\fP(1M),
\f4pkgask\fP(1M),
\f4pkgchk\fP(1),
\f4pkginfo\fP(1),
\f4pkgmk\fP(1),
\f4pkgparam\fP(1),
\f4pkgproto\fP(1),
\f4pkgtrans\fP(1),
\f4pkgrm\fP(1M),
\f4removef\fP(1M).
.ad
