.\" .\" CDDL HEADER START .\" .\" The contents of this file are subject to the terms of the .\" Common Development and Distribution License (the "License"). .\" You may not use this file except in compliance with the License. .\" .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE .\" or http://www.opensolaris.org/os/licensing. .\" See the License for the specific language governing permissions .\" and limitations under the License. .\" .\" When distributing Covered Code, include this CDDL HEADER in each .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE. .\" If applicable, add the following below this CDDL HEADER, with the .\" fields enclosed by brackets "[]" replaced with your own identifying .\" information: Portions Copyright [yyyy] [name of copyright owner] .\" .\" CDDL HEADER END .\" Copyright 1989 AT&T Copyright (c) 1996, Sun Microsystems, Inc. All Rights Reserved .\" Portions Copyright (c) 2007 Gunnar Ritter, Freiburg i. Br., Germany .\" .\" Sccsid @(#)prototype.5 1.8 (gritter) 2/25/07 .\" .\" from OpenSolaris prototype 4 "4 Oct 1996" "SunOS 5.11" "File Formats" .TH PROTOTYPE 5 "2/25/07" "Heirloom Packaging Tools" "File Formats" .SH NAME prototype \- package information file .SH DESCRIPTION \fBprototype\fR is an \fBASCII\fR 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, and so forth. This file is generated by the package developer. .PP Entries in a \fBprototype\fR file consist of several fields of information separated by white space. Comment lines begin with a ``\fB#\fR'' and are ignored. The fields are described below and must appear in the order shown. .TP 10 \fB\fIpart\fR 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 grouping files into a part (for example, based on class). If this field is not used, part 1 is assumed. .TP \fB\fIftype\fR A one-character field that indicates the file type. Valid values are: .RS 14 .TP 4 .B b block special device .PD 0 .TP .B c character special device .TP .B d directory .TP .B e a file to be edited upon installation or removal (may be shared by several packages) .TP .B f a standard executable or data file .TP .B i installation script or information file .TP .B l linked file .TP .B p named pipe .TP .B s symbolic link .TP .B v volatile file (one whose contents are expected to change, like a log file) .TP .B x an exclusive directory accessible only by this package .PD .RE .TP 10 \fB\fIclass\fR 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. (\fBadmin\fR and all classes beginning with capital letters are reserved class names.) .TP \fB\fIpathname\fR The pathname where the file will reside on the target machine, for example, \fB/usr/bin/mail\fR or \fBbin/ras/proc\fR. Relative pathnames (those that do not begin with a slash) indicate that the file is relocatable. The form .in +4 .sp \fIpath1\fR\fB=\fR\fIpath2\fR .sp .in -4 may be used for two purposes: to define a link and to define local pathnames. .IP For linked files, \fIpath1\fR indicates the destination of the link and \fIpath2\fR indicates the source file. (This format is mandatory for linked files.) .IP For local pathnames, \fIpath1\fR indicates the pathname an object should have on the machine where the entry is to be installed and \fIpath2\fR 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 of the form \fB$\fR\fIvariable.\fR If \fIvariable\fR begins with a lower case letter, it is a build variable. If \fIvariable\fR 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 .IR pkginfo (5) file so that it will be available at install time. If an install variable is not known at build time, it will be bound at install time. .TP \fB\fImajor\fR The major device number. The field is only specified for block or character special devices. .TP \fB\fIminor\fR The minor device number. The field is only specified for block or character special devices. .TP \fB\fImode\fR The octal mode of the file (for example, 0664). A question mark (\fB?\fR) 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. .IP The mode can be a variable specification of the form \fB$\fR\fIvariable.\fR If \fIvariable\fR begins with a lower case letter, it is a build variable. If \fIvariable\fR 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 .IR pkginfo (5) file so that it will be available at install time. If an install variable is not known at build time, it will be bound at install time. .TP \fB\fIowner\fR The owner of the file (for example, \fBbin\fR or \fBroot\fR). The field is limited to 14 characters in length. A question mark (\fB?\fR) 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 The owner can be a variable specification of the form \fB$\fR\fIvariable.\fR If \fIvariable\fR begins with a lower case letter, it is a build variable. If \fIvariable\fR 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 .IR pkginfo (5) file so that it will be available at install time. If an install variable is not known at build time, it will be bound at install time. .TP \fB\fIgroup\fR The group to which the file belongs (for example, \fBbin\fR or \fBsys\fR). The field is limited to 14 characters in length. A question mark (\fB?\fR) 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 The group can be a variable specification of the form \fB$\fR\fIvariable.\fR If \fIvariable\fR begins with a lower case letter, it is a build variable. If \fIvariable\fR 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 .IR pkginfo (5) file so that it will be available at install time. If an install variable is not known at build time, it will be bound at install time. .PP An exclamation point (\fB!\fR) 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 .B 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 \fIpath\fR field is appended to each directory in the ordered list until the file is located. Searches are not recursive. .TP .B include Specifies a pathname which points to another prototype file to include. Note that \fBsearch\fR requests do not span \fBinclude\fR files. .TP .B default 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 \fBinclude\fR prototype files. .TP \fB\fIparam\fR\fB=\fR\fIvalue\fR Places the indicated parameter in the current environment. Spans to subsequent included prototype files. .sp .RE .LP The above commands may have variable substitutions embedded within them, as demonstrated in the two example prototype 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 (that is, \fIftype\fR is \fBe\fR). 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. .sp .SH EXAMPLES Example1: .LP .RS .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 # 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 .RE .PP Example 2: .LP .RS .nf \fB# 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\fR .fi .RE .SH SEE ALSO .IR pkgmk (1), .IR pkginfo (5) .SH NOTES Normally, if a file is defined in the \fBprototype\fR 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 \fBprototype\fR file has the following entry: .PP .RS .nf .B "f none /usr/dev/bin/command" .fi .RE .PP and that file does not exist, it will be created if the directory \fB/usr/dev/bin\fR already exists or if the \fBprototype\fR also has an entry defining the directory: .PP .RS .nf .B "d none /usr/dev/bin" .fi .RE