PageRenderTime 129ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/usr/src/man/man4/prototype.4

https://bitbucket.org/illumos/illumos-gate/
Forth | 426 lines | 398 code | 28 blank | 0 comment | 20 complexity | 12d82bde11b8b009e9c95ee50798ecf7 MD5 | raw file
Possible License(s): LGPL-3.0, LGPL-2.0, BSD-3-Clause-No-Nuclear-License-2014, AGPL-1.0, AGPL-3.0, BSD-3-Clause, GPL-3.0, LGPL-2.1, BSD-2-Clause, MPL-2.0-no-copyleft-exception, GPL-2.0, 0BSD
  1. '\" te
  2. .\" Copyright (c) 1996, Sun Microsystems, Inc. All Rights Reserved
  3. .\" Copyright 1989 AT&T
  4. .\" 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.
  5. .\" 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.
  6. .\" 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]
  7. .TH PROTOTYPE 4 "May 3, 2008"
  8. .SH NAME
  9. prototype \- package information file
  10. .SH DESCRIPTION
  11. .sp
  12. .LP
  13. \fBprototype\fR is an \fBASCII\fR file used to specify package information.
  14. Each entry in the file describes a single deliverable object. An object can be
  15. a data file, directory, source file, executable object, and so forth. This file
  16. is generated by the package developer.
  17. .sp
  18. .LP
  19. Entries in a \fBprototype\fR file consist of several fields of information
  20. separated by white space. Comment lines begin with a ``\fB#\fR'' and are
  21. ignored. The fields are described below and must appear in the order shown.
  22. .sp
  23. .ne 2
  24. .na
  25. \fB\fIpart\fR\fR
  26. .ad
  27. .RS 12n
  28. An optional field designating the part number in which the object resides. A
  29. part is a collection of files and is the atomic unit by which a package is
  30. processed. A developer can choose criteria for grouping files into a part (for
  31. example, based on class). If this field is not used, part 1 is assumed.
  32. .RE
  33. .sp
  34. .ne 2
  35. .na
  36. \fB\fIftype\fR\fR
  37. .ad
  38. .RS 12n
  39. A one-character field that indicates the file type. Valid values are:
  40. .sp
  41. .ne 2
  42. .na
  43. \fB\fBb\fR\fR
  44. .ad
  45. .RS 5n
  46. block special device
  47. .RE
  48. .sp
  49. .ne 2
  50. .na
  51. \fB\fBc\fR\fR
  52. .ad
  53. .RS 5n
  54. character special device
  55. .RE
  56. .sp
  57. .ne 2
  58. .na
  59. \fB\fBd\fR\fR
  60. .ad
  61. .RS 5n
  62. directory
  63. .RE
  64. .sp
  65. .ne 2
  66. .na
  67. \fB\fBe\fR\fR
  68. .ad
  69. .RS 5n
  70. a file to be edited upon installation or removal (can be shared by several
  71. packages)
  72. .RE
  73. .sp
  74. .ne 2
  75. .na
  76. \fB\fBf\fR\fR
  77. .ad
  78. .RS 5n
  79. a standard executable or data file
  80. .RE
  81. .sp
  82. .ne 2
  83. .na
  84. \fB\fBi\fR\fR
  85. .ad
  86. .RS 5n
  87. installation script or information file
  88. .RE
  89. .sp
  90. .ne 2
  91. .na
  92. \fB\fBl\fR\fR
  93. .ad
  94. .RS 5n
  95. linked file
  96. .RE
  97. .sp
  98. .ne 2
  99. .na
  100. \fB\fBp\fR\fR
  101. .ad
  102. .RS 5n
  103. named pipe
  104. .RE
  105. .sp
  106. .ne 2
  107. .na
  108. \fB\fBs\fR\fR
  109. .ad
  110. .RS 5n
  111. symbolic link
  112. .RE
  113. .sp
  114. .ne 2
  115. .na
  116. \fB\fBv\fR\fR
  117. .ad
  118. .RS 5n
  119. volatile file (one whose contents are expected to change, like a log file)
  120. .RE
  121. .sp
  122. .ne 2
  123. .na
  124. \fB\fBx\fR\fR
  125. .ad
  126. .RS 5n
  127. an exclusive directory accessible only by this package
  128. .RE
  129. .RE
  130. .sp
  131. .ne 2
  132. .na
  133. \fB\fIclass\fR\fR
  134. .ad
  135. .RS 12n
  136. The installation class to which the file belongs. This name can be no longer
  137. than 64 characters. The field is not specified for installation scripts.
  138. (\fBadmin\fR and all classes beginning with capital letters are reserved class
  139. names.)
  140. .RE
  141. .sp
  142. .ne 2
  143. .na
  144. \fB\fIpathname\fR\fR
  145. .ad
  146. .RS 12n
  147. The pathname where the file resides on the target machine, for example,
  148. \fB/usr/bin/mail\fR or \fBbin/ras/proc\fR. Relative pathnames (those that do
  149. not begin with a slash) indicate that the file is relocatable. The form
  150. .sp
  151. \fIpath1\fR\fB=\fR\fIpath2\fR
  152. .sp
  153. can be used for two purposes: to define a link and to define local pathnames.
  154. .sp
  155. For linked files, \fIpath1\fR indicates the destination of the link and
  156. \fIpath2\fR indicates the source file. (This format is mandatory for linked
  157. files.)
  158. .sp
  159. For local pathnames, \fIpath1\fR indicates the pathname an object should have
  160. on the machine where the entry is to be installed and \fIpath2\fR indicates
  161. either a relative or fixed pathname to a file on the host machine which
  162. contains the actual contents.
  163. .sp
  164. A pathname can contain a variable specification of the form
  165. \fB$\fR\fIvariable.\fR If \fIvariable\fR begins with a lower case letter, it is
  166. a build variable. If \fIvariable\fR begins with an upper case letter, it is an
  167. install variable. Build variables are bound at build time. If an install
  168. variable is known at build time, its definition is inserted into the
  169. \fBpkginfo\fR(4) file so that it is available at install time. If an install
  170. variable is not known at build time, it is bound at install time.
  171. .RE
  172. .sp
  173. .ne 2
  174. .na
  175. \fB\fImajor\fR\fR
  176. .ad
  177. .RS 12n
  178. The major device number. The field is only specified for block or character
  179. special devices.
  180. .RE
  181. .sp
  182. .ne 2
  183. .na
  184. \fB\fIminor\fR\fR
  185. .ad
  186. .RS 12n
  187. The minor device number. The field is only specified for block or character
  188. special devices.
  189. .RE
  190. .sp
  191. .ne 2
  192. .na
  193. \fB\fImode\fR\fR
  194. .ad
  195. .RS 12n
  196. The octal mode of the file (for example, 0664). A question mark (\fB?\fR)
  197. indicates that the mode is left unchanged, implying that the file already
  198. exists on the target machine. This field is not used for linked files or
  199. packaging information files.
  200. .sp
  201. The mode can be a variable specification of the form \fB$\fR\fIvariable.\fR If
  202. \fIvariable\fR begins with a lower case letter, it is a build variable. If
  203. \fIvariable\fR begins with an upper case letter, it is an install variable.
  204. Build variables are bound at build time. If an install variable is known at
  205. build time, its definition is inserted into the \fBpkginfo\fR(4) file so that
  206. it is available at install time. If an install variable is not known at build
  207. time, it is bound at install time.
  208. .RE
  209. .sp
  210. .ne 2
  211. .na
  212. \fB\fIowner\fR\fR
  213. .ad
  214. .RS 12n
  215. The owner of the file (for example, \fBbin\fR or \fBroot\fR). The field is
  216. limited to 14 characters in length. A question mark (\fB?\fR) indicates that
  217. the owner is left unchanged, implying that the file already exists on the
  218. target machine. This field is not used for linked files or packaging
  219. information files.
  220. .sp
  221. The owner can be a variable specification of the form \fB$\fR\fIvariable.\fR If
  222. \fIvariable\fR begins with a lower case letter, it is a build variable. If
  223. \fIvariable\fR begins with an upper case letter, it is an install variable.
  224. Build variables are bound at build time. If an install variable is known at
  225. build time, its definition is inserted into the \fBpkginfo\fR(4) file so that
  226. it is available at install time. If an install variable is not known at build
  227. time, it is bound at install time.
  228. .RE
  229. .sp
  230. .ne 2
  231. .na
  232. \fB\fIgroup\fR\fR
  233. .ad
  234. .RS 12n
  235. The group to which the file belongs (for example, \fBbin\fR or \fBsys\fR). The
  236. field is limited to 14 characters in length. A question mark (\fB?\fR)
  237. indicates that the group is left unchanged, implying that the file already
  238. exists on the target machine. This field is not used for linked files or
  239. packaging information files.
  240. .sp
  241. The group can be a variable specification of the form \fB$\fR\fIvariable.\fR If
  242. \fIvariable\fR begins with a lower case letter, it is a build variable. If
  243. \fIvariable\fR begins with an upper case letter, it is an install variable.
  244. Build variables are bound at build time. If an install variable is known at
  245. build time, its definition is inserted into the \fBpkginfo\fR(4) file so that
  246. it is available at install time. If an install variable is not known at build
  247. time, it is bound at install time.
  248. .RE
  249. .sp
  250. .LP
  251. An exclamation point (\fB!\fR) at the beginning of a line indicates that the
  252. line contains a command. These commands are used to incorporate files in other
  253. directories, to locate objects on a host machine, and to set permanent
  254. defaults. The following commands are available:
  255. .sp
  256. .ne 2
  257. .na
  258. \fB\fBsearch\fR\fR
  259. .ad
  260. .RS 15n
  261. Specifies a list of directories (separated by white space) to search for when
  262. looking for file contents on the host machine. The base name of the \fIpath\fR
  263. field is appended to each directory in the ordered list until the file is
  264. located. Searches are not recursive.
  265. .RE
  266. .sp
  267. .ne 2
  268. .na
  269. \fB\fBinclude\fR\fR
  270. .ad
  271. .RS 15n
  272. Specifies a pathname which points to another prototype file to include. Note
  273. that \fBsearch\fR requests do not span \fBinclude\fR files.
  274. .RE
  275. .sp
  276. .ne 2
  277. .na
  278. \fB\fBdefault\fR\fR
  279. .ad
  280. .RS 15n
  281. Specifies a list of attributes (mode, owner, and group) to be used by default
  282. if attribute information is not provided for prototype entries which require
  283. the information. The defaults do not apply to entries in \fBinclude\fR
  284. prototype files.
  285. .RE
  286. .sp
  287. .ne 2
  288. .na
  289. \fB\fIparam\fR\fB=\fR\fIvalue\fR\fR
  290. .ad
  291. .RS 15n
  292. Places the indicated parameter in the current environment. Spans to subsequent
  293. included prototype files.
  294. .RE
  295. .sp
  296. .LP
  297. The above commands can have variable substitutions embedded within them, as
  298. demonstrated in the two example prototype files below.
  299. .sp
  300. .LP
  301. Before files are overwritten during installation, they are copied to a
  302. temporary pathname. The exception to this rule is files whose mode includes
  303. execute permission, unless the file is editable (that is, \fIftype\fR is
  304. \fBe\fR). For files which meet this exception, the existing version is linked
  305. to a temporary pathname, and the original file is removed. This allows
  306. processes which are executing during installation to be overwritten.
  307. .SH EXAMPLES
  308. .LP
  309. \fBExample 1 \fRExample 1:
  310. .sp
  311. .in +2
  312. .nf
  313. !PROJDIR=/usr/proj
  314. !BIN=$PROJDIR/bin
  315. !CFG=$PROJDIR/cfg
  316. !LIB=$PROJDIR/lib
  317. !HDRS=$PROJDIR/hdrs
  318. !search /usr/myname/usr/bin /usr/myname/src /usr/myname/hdrs
  319. i pkginfo=/usr/myname/wrap/pkginfo
  320. i depend=/usr/myname/wrap/depend
  321. i version=/usr/myname/wrap/version
  322. d none /usr/wrap 0755 root bin
  323. d none /usr/wrap/usr/bin 0755 root bin
  324. ! search $BIN
  325. f none /usr/wrap/bin/INSTALL 0755 root bin
  326. f none /usr/wrap/bin/REMOVE 0755 root bin
  327. f none /usr/wrap/bin/addpkg 0755 root bin
  328. !default 755 root bin
  329. f none /usr/wrap/bin/audit
  330. f none /usr/wrap/bin/listpkg
  331. f none /usr/wrap/bin/pkgmk
  332. # the following file starts out zero length but grows
  333. v none /usr/wrap/logfile=/dev/null 0644 root bin
  334. # the following specifies a link (dest=src)
  335. l none /usr/wrap/src/addpkg=/usr/wrap/bin/rmpkg
  336. ! search $SRC
  337. !default 644 root other
  338. f src /usr/wrap/src/INSTALL.sh
  339. f src /usr/wrap/src/REMOVE.sh
  340. f src /usr/wrap/src/addpkg.c
  341. f src /usr/wrap/src/audit.c
  342. f src /usr/wrap/src/listpkg.c
  343. f src /usr/wrap/src/pkgmk.c
  344. d none /usr/wrap/data 0755 root bin
  345. d none /usr/wrap/save 0755 root bin
  346. d none /usr/wrap/spool 0755 root bin
  347. d none /usr/wrap/tmp 0755 root bin
  348. d src /usr/wrap/src 0755 root bin
  349. .fi
  350. .in -2
  351. .sp
  352. .LP
  353. \fBExample 2 \fRExample 2:
  354. .sp
  355. .in +2
  356. .nf
  357. \fB# this prototype is generated by 'pkgproto' to refer
  358. # to all prototypes in my src directory
  359. !PROJDIR=/usr/dew/projx
  360. !include $PROJDIR/src/cmd/prototype
  361. !include $PROJDIR/src/cmd/audmerg/protofile
  362. !include $PROJDIR/src/lib/proto\fR
  363. .fi
  364. .in -2
  365. .sp
  366. .SH SEE ALSO
  367. .sp
  368. .LP
  369. \fBpkgmk\fR(1), \fBpkginfo\fR(4)
  370. .sp
  371. .LP
  372. \fIApplication Packaging Developer\&'s Guide\fR
  373. .SH NOTES
  374. .sp
  375. .LP
  376. Normally, if a file is defined in the \fBprototype\fR file but does not exist,
  377. that file is created at the time of package installation. However, if the file
  378. pathname includes a directory that does not exist, the file is not created. For
  379. example, if the \fBprototype\fR file has the following entry:
  380. .sp
  381. .in +2
  382. .nf
  383. \fBf none /usr/dev/bin/command\fR
  384. .fi
  385. .in -2
  386. .sp
  387. .sp
  388. .LP
  389. and that file does not exist, it is created if the directory \fB/usr/dev/bin\fR
  390. already exists or if the \fBprototype\fR also has an entry defining the
  391. directory:
  392. .sp
  393. .in +2
  394. .nf
  395. \fBd none /usr/dev/bin\fR
  396. .fi
  397. .in -2
  398. .sp