1prototype(4)                     File Formats                     prototype(4)
2
3
4

NAME

6       prototype - package information file
7

DESCRIPTION

9       prototype  is  an  ASCII file used to specify package information. Each
10       entry in the file describes a single deliverable object. An object  can
11       be  a  data  file,  directory,  source  file, executable object, and so
12       forth. This file is generated by the package developer.
13
14
15       Entries in a prototype file consist of several  fields  of  information
16       separated  by  white  space.  Comment  lines begin with a ``#'' and are
17       ignored. The fields are described below and must appear  in  the  order
18       shown.
19
20       part        An  optional field designating the part number in which the
21                   object resides. A part is a collection of files and is  the
22                   atomic  unit  by  which a package is processed. A developer
23                   can choose criteria for grouping files  into  a  part  (for
24                   example, based on class). If this field is not used, part 1
25                   is assumed.
26
27
28       ftype       A one-character field that indicates the file  type.  Valid
29                   values are:
30
31                   b    block special device
32
33
34                   c    character special device
35
36
37                   d    directory
38
39
40                   e    a  file to be edited upon installation or removal (can
41                        be shared by several packages)
42
43
44                   f    a standard executable or data file
45
46
47                   i    installation script or information file
48
49
50                   l    linked file
51
52
53                   p    named pipe
54
55
56                   s    symbolic link
57
58
59                   v    volatile file (one  whose  contents  are  expected  to
60                        change, like a log file)
61
62
63                   x    an exclusive directory accessible only by this package
64
65
66
67       class       The installation class to which the file belongs. This name
68                   can be no longer than 64 characters. The field is not spec‐
69                   ified  for  installation  scripts.  (admin  and all classes
70                   beginning with capital letters are reserved class names.)
71
72
73       pathname    The pathname where the file resides on the target  machine,
74                   for  example, /usr/bin/mail or bin/ras/proc. Relative path‐
75                   names (those that do not begin with a slash) indicate  that
76                   the file is relocatable. The form
77
78                   path1=path2
79
80                   can  be  used  for  two  purposes:  to define a link and to
81                   define local pathnames.
82
83                   For linked files, path1 indicates the  destination  of  the
84                   link  and  path2 indicates the source file. (This format is
85                   mandatory for linked files.)
86
87                   For local pathnames, path1 indicates the pathname an object
88                   should  have  on  the  machine  where  the  entry  is to be
89                   installed and path2 indicates either a  relative  or  fixed
90                   pathname  to  a file on the host machine which contains the
91                   actual contents.
92
93                   A pathname can contain a variable specification of the form
94                   $variable.  If variable begins with a lower case letter, it
95                   is a build variable. If variable begins with an upper  case
96                   letter,  it  is  an  install  variable. Build variables are
97                   bound at build time. If an install  variable  is  known  at
98                   build  time, its definition is inserted into the pkginfo(4)
99                   file so that it is available at install time. If an install
100                   variable is not known at build time, it is bound at install
101                   time.
102
103
104       major       The major device number. The field is  only  specified  for
105                   block or character special devices.
106
107
108       minor       The  minor  device  number. The field is only specified for
109                   block or character special devices.
110
111
112       mode        The octal mode of the file (for example, 0664). A  question
113                   mark  (?) indicates that the mode is left unchanged, imply‐
114                   ing that the file already exists  on  the  target  machine.
115                   This field is not used for linked files or packaging infor‐
116                   mation files.
117
118                   The mode can be a variable specification of the form $vari‐
119                   able.  If variable begins with a lower case letter, it is a
120                   build variable. If variable begins with an upper case  let‐
121                   ter,  it  is an install variable. Build variables are bound
122                   at build time. If an install variable  is  known  at  build
123                   time,  its  definition is inserted into the pkginfo(4) file
124                   so that it is available at  install  time.  If  an  install
125                   variable is not known at build time, it is bound at install
126                   time.
127
128
129       owner       The owner of the file (for example, bin or root). The field
130                   is  limited to 14 characters in length. A question mark (?)
131                   indicates that the owner is left unchanged,  implying  that
132                   the  file  already exists on the target machine. This field
133                   is not used  for  linked  files  or  packaging  information
134                   files.
135
136                   The  owner  can  be  a  variable  specification of the form
137                   $variable. If variable begins with a lower case letter,  it
138                   is  a build variable. If variable begins with an upper case
139                   letter, it is an  install  variable.  Build  variables  are
140                   bound  at  build  time.  If an install variable is known at
141                   build time, its definition is inserted into the  pkginfo(4)
142                   file so that it is available at install time. If an install
143                   variable is not known at build time, it is bound at install
144                   time.
145
146
147       group       The  group  to  which the file belongs (for example, bin or
148                   sys). The field is limited to 14 characters  in  length.  A
149                   question   mark  (?)  indicates  that  the  group  is  left
150                   unchanged, implying that the file  already  exists  on  the
151                   target  machine. This field is not used for linked files or
152                   packaging information files.
153
154                   The group can be  a  variable  specification  of  the  form
155                   $variable.  If variable begins with a lower case letter, it
156                   is a build variable. If variable begins with an upper  case
157                   letter,  it  is  an  install  variable. Build variables are
158                   bound at build time. If an install  variable  is  known  at
159                   build  time, its definition is inserted into the pkginfo(4)
160                   file so that it is available at install time. If an install
161                   variable is not known at build time, it is bound at install
162                   time.
163
164
165
166       An exclamation point (!) at the beginning of a line indicates that  the
167       line  contains  a command. These commands are used to incorporate files
168       in other directories, to locate objects on a host machine, and  to  set
169       permanent defaults. The following commands are available:
170
171       search         Specifies  a  list  of  directories  (separated by white
172                      space) to search for when looking for file  contents  on
173                      the  host  machine.  The  base name of the path field is
174                      appended to each directory in the ordered list until the
175                      file is located. Searches are not recursive.
176
177
178       include        Specifies  a  pathname which points to another prototype
179                      file to include. Note that search requests do  not  span
180                      include files.
181
182
183       default        Specifies  a list of attributes (mode, owner, and group)
184                      to be used by default if attribute  information  is  not
185                      provided  for prototype entries which require the infor‐
186                      mation. The defaults do not apply to entries in  include
187                      prototype files.
188
189
190       param=value    Places  the  indicated parameter in the current environ‐
191                      ment. Spans to subsequent included prototype files.
192
193
194
195       The above commands can  have  variable  substitutions  embedded  within
196       them, as demonstrated in the two example prototype files below.
197
198
199       Before  files are overwritten during installation, they are copied to a
200       temporary pathname. The exception to this  rule  is  files  whose  mode
201       includes  execute  permission,  unless  the  file is editable (that is,
202       ftype is e). For files which meet this exception, the existing  version
203       is  linked  to  a temporary pathname, and the original file is removed.
204       This allows processes which are executing  during  installation  to  be
205       overwritten.
206

EXAMPLES

208       Example 1 Example 1:
209
210         !PROJDIR=/usr/proj
211         !BIN=$PROJDIR/bin
212         !CFG=$PROJDIR/cfg
213         !LIB=$PROJDIR/lib
214         !HDRS=$PROJDIR/hdrs
215         !search /usr/myname/usr/bin /usr/myname/src /usr/myname/hdrs
216         i pkginfo=/usr/myname/wrap/pkginfo
217         i depend=/usr/myname/wrap/depend
218         i version=/usr/myname/wrap/version
219         d none /usr/wrap 0755 root bin
220         d none /usr/wrap/usr/bin 0755 root bin
221         ! search $BIN
222         f none /usr/wrap/bin/INSTALL 0755 root bin
223         f none /usr/wrap/bin/REMOVE 0755 root bin
224         f none /usr/wrap/bin/addpkg 0755 root bin
225         !default 755 root bin
226         f none /usr/wrap/bin/audit
227         f none /usr/wrap/bin/listpkg
228         f none /usr/wrap/bin/pkgmk
229         # the following file starts out zero length but grows
230         v none /usr/wrap/logfile=/dev/null 0644 root bin
231         # the following specifies a link (dest=src)
232         l none /usr/wrap/src/addpkg=/usr/wrap/bin/rmpkg
233         ! search $SRC
234         !default 644 root other
235         f src /usr/wrap/src/INSTALL.sh
236         f src /usr/wrap/src/REMOVE.sh
237         f src /usr/wrap/src/addpkg.c
238         f src /usr/wrap/src/audit.c
239         f src /usr/wrap/src/listpkg.c
240         f src /usr/wrap/src/pkgmk.c
241         d none /usr/wrap/data 0755 root bin
242         d none /usr/wrap/save 0755 root bin
243         d none /usr/wrap/spool 0755 root bin
244         d none /usr/wrap/tmp 0755 root bin
245         d src /usr/wrap/src 0755 root bin
246
247
248
249       Example 2 Example 2:
250
251         # this prototype is generated by 'pkgproto' to refer
252         # to all prototypes in my src directory
253         !PROJDIR=/usr/dew/projx
254         !include $PROJDIR/src/cmd/prototype
255         !include $PROJDIR/src/cmd/audmerg/protofile
256         !include $PROJDIR/src/lib/proto
257
258
259

SEE ALSO

261       pkgmk(1), pkginfo(4)
262
263
264       Application Packaging Developer's Guide
265

NOTES

267       Normally,  if  a  file  is  defined  in the prototype file but does not
268       exist, that file is created at the time of package  installation.  How‐
269       ever,  if  the  file pathname includes a directory that does not exist,
270       the file is not created. For example, if the  prototype  file  has  the
271       following entry:
272
273         f none /usr/dev/bin/command
274
275
276
277
278       and  that  file  does  not  exist,  it  is  created  if  the  directory
279       /usr/dev/bin already exists or if  the  prototype  also  has  an  entry
280       defining the directory:
281
282         d none /usr/dev/bin
283
284
285
286
287
288SunOS 5.11                        3 May 2008                      prototype(4)
Impressum