1 .\" $NetBSD: pkg_create.1,v 1.21 2009/11/05 16:22:32 joerg Exp $
3 .\" FreeBSD install - a package for the installation and maintenance
4 .\" of non-core utilities.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
19 .\" from FreeBSD Id: pkg_create.1,v 1.19 1997/05/02 22:00:05 max Exp
21 .\" hacked up by John Kohl for NetBSD--fixed a few bugs, extended keywords,
22 .\" added dependency tracking, etc.
24 .\" [jkh] Took John's changes back and made some additional extensions for
25 .\" better integration with FreeBSD's new ports collection.
32 .Nd a utility for creating software package distributions
37 .Op Fl B Ar build-info-file
40 .Op Fl b Ar build-version-file
46 .Op Fl D Ar displayfile
49 .Op Fl F Ar compression
55 .Op Fl I Ar realprefix
67 .Op Fl n Ar preserve-file
79 .Op Fl S Ar size-all-file
82 .Op Fl s Ar size-pkg-file
103 command is used to create packages that will subsequently be fed to
104 one of the package extraction/info utilities.
105 The input description and command line arguments for the creation of a
106 package are not really meant to be human-generated, though it is easy
108 It is more expected that you will use a front-end tool for
109 the job rather than muddling through it yourself.
110 Nonetheless, a short description of the input syntax is included in this
113 The following command line options are supported:
114 .Bl -tag -width indent
115 .It Fl B Ar build-info-file
118 so that users of binary packages can see what
121 were used to control the build when creating the
123 This allows various build definitions to be retained in a binary package
124 and viewed wherever it is installed, using
126 .It Fl b Ar build-version-file
128 .Ar build-version-file
129 so that users of binary packages can see what versions of
130 the files used to control the build were used when creating the
132 This allows some fine-grained version control information to be retained
133 in a binary package and viewed wherever it is installed, using
136 Set the initial package conflict list to
138 This is assumed to be a whitespace separated list of package names
139 and is meant as a convenient shorthand for specifying multiple
141 directives in the packing list (see PACKING LIST DETAILS section below).
144 .Pq one line description
150 This string should also give some idea of which version of the product
151 (if any) the package represents.
152 .It Fl D Ar displayfile
153 Display the file after installing the package.
154 Useful for things like legal notices on almost-free software, etc.
156 Fetch long description for package from file
162 Add an empty views file to the package.
163 .It Fl F Ar compression
166 as compression algorithm.
167 This overrides the heuristic to guess the compression type from the
169 Currently supported values are bzip2, gzip and none.
173 for package from the file
185 the default group ownership instead of extracting it from the file system.
186 .It Fl I Ar realprefix
187 Provide the real prefix, as opposed to the staging prefix, for use in
188 staged installations of packages.
192 to be the install procedure for the package.
193 This can be any executable program (or shell script).
194 It will be invoked automatically when the package is later installed.
195 .It Fl K Ar pkg_dbdir
198 as the package database directory.
199 If this option isn't specified, then the package database directory is
200 taken from the value of the environment variable
202 if it's set, otherwise it defaults to
207 to be the de-install procedure for the package.
208 This can be any executable program (or shell script).
209 It will be invoked automatically
210 when the package is later (if ever) de-installed.
212 Check that any symbolic links which are to be placed in the package are
213 relative to the current prefix.
218 to remove and re-link
219 any symbolic links which are targeted at full path names.
220 .It Fl n Ar preserve-file
221 The file is used to denote that the package should not be deleted.
222 This is intended for use where the deletion of packages may present
226 .Pq packing list only
230 operations when a package is installed.
231 In such cases, it is necessary to know what the final, adjusted packing
234 Set the initial package dependency list to
236 This is assumed to be a whitespace separated list of package names
237 and is meant as a convenient shorthand for specifying multiple
239 directives in the packing list (see PACKING LIST DETAILS section below).
240 In addition, the exact versions of the packages referred to in the
242 list will be added to the packing list in the form of
245 .It Fl T Ar buildpkgs
246 The exact versions of the packages referred to in the
248 list will be added to the packing list in the form of
251 This directives are stored after those created by the
255 is assumed to be a whitespace separated list of package names.
259 as the initial directory
261 to start from in selecting files for
263 .It Fl S Ar size-all-file
264 Store the given file for later querying with the
268 The file is expected to contain the size (in bytes) of all files of
269 this package plus any required packages added up and stored as a
270 ASCII string, terminated by a newline.
271 .It Fl s Ar size-pkg-file
272 Store the given file for later querying with the
276 The file is expected to contain the size (in bytes) of all files of
277 this package added up and stored as a ASCII string, terminated by a newline.
283 By default, this is the string
284 .Pa /tmp/instmp.XXXXXX ,
285 but it may be necessary to override it in the situation where
288 directory is limited.
289 Be sure to leave some number of
293 to fill in with a unique ID.
295 Do not update the package file database with any file information.
299 the default owner instead of extracting it from the file system.
301 Print version number and exit.
303 Turn on verbose output.
305 .Sh PACKING LIST DETAILS
310 is fairly simple, being
311 nothing more than a single column of filenames to include in the
313 However, since absolute pathnames are generally a bad idea
314 for a package that could be installed potentially anywhere, there is
315 another method of specifying where things are supposed to go
316 and, optionally, what ownership and mode information they should be
318 This is done by embedding specialized command sequences
320 Briefly described, these sequences are:
321 .Bl -tag -width indent -compact
322 .It Cm @cwd Ar directory
323 Set the internal directory pointer to point to
325 All subsequent filenames will be assumed relative to this directory.
328 is also an alias for this command.
329 .It Cm @src Ar directory
330 This command is supported for compatibility only.
331 It was formerly used to override
333 during package creation.
334 .It Cm @exec Ar command
337 as part of the unpacking process.
340 contains any of the following sequences somewhere in it, they will
342 For the following examples, assume that
346 and the last extracted file was
348 .Bl -tag -width indent -compact
350 Expands to the last filename extracted (as specified), in the example case
353 Expand to the current directory prefix, as set with
360 of the fully qualified filename, that
361 is the current directory prefix, plus the last filespec, minus
362 the trailing filename.
363 In the example case, that would be
368 part of the fully qualified name, or
371 being in the example case,
374 .It Cm @unexec Ar command
377 as part of the deinstallation process.
380 sequences is the same as for
382 This command is not executed during the package add, as
384 is, but rather when the package is deleted.
385 This is useful for deleting links and other ancillary files that were created
386 as a result of adding the package, but not directly known to the package's
387 table of contents (and hence not automatically removable).
388 The advantage of using
390 over a deinstallation script is that you can use the
391 .Pq special sequence expansion
392 to get at files regardless of where they've
393 been potentially redirected (see
396 Set default permission for all subsequently extracted files to
398 Format is the same as that used by the
400 command (well, considering that it's later handed off to it, that's
402 Use without an arg to set back to default (extraction) permissions.
403 .It Cm @option Ar option
404 Set internal package options, the only currently supported one
407 which tells pkg_add to move any existing files out of the way,
408 preserving the previous contents (which are also resurrected on
409 pkg_delete, so caveat emptor).
410 .It Cm @owner Ar user
411 Set default ownership for all subsequently extracted files to
413 Use without an arg to set back to default (extraction)
415 .It Cm @group Ar group
416 Set default group ownership for all subsequently extracted files to
418 Use without an arg to set back to default (extraction)
420 .It Cm @comment Ar string
421 Embed a comment in the packing list.
422 Useful in trying to document some particularly hairy sequence that
423 may trip someone up later.
425 Used internally to tell extraction to ignore the next file (don't
426 copy it anywhere), as it's used for some special purpose.
428 Set the name of the package.
429 This is mandatory and is usually put at the top.
430 This name is potentially different than the name of the file it came in,
431 and is used when keeping track of the package for later deinstallation.
434 will derive this field from the
436 and add it automatically if none is given.
437 .It Cm @pkgdir Ar name
441 If it does not exist at installation time, it is created.
442 If this directory is no longer referenced by packages and the last
443 file or directory in it is deleted, the directory is removed as well.
444 .It Cm @dirrm Ar name
445 This command is supported for compatibility only.
448 exists, it will be deleted at deinstall time.
449 .It Cm @display Ar name
452 as the file to be displayed at install time (see
455 .It Cm @pkgdep Ar pkgname
456 Declare a dependency on the
461 package must be installed before this package may be
462 installed, and this package must be deinstalled before the
464 package is deinstalled.
467 directives may be used if the package depends on multiple other packages.
468 .It Cm @blddep Ar pkgname
469 Declare that this package was built with the exact version
474 directive may contain wildcards or relational
475 package version information).
476 .It Cm @pkgcfl Ar pkgcflname
477 Declare a conflict with the
479 package, as the two packages contain references to the same files,
480 and so cannot co-exist on the same system.
492 command first appeared in
495 .Bl -tag -width indent -compact
503 wildcard dependency processing, pkgdb, pkg size recording etc.