1 .\" $NetBSD: pkg_create.1,v 1.2 2015/10/10 10:08:12 mbalmer 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, none and xz.
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
196 Override the value of the
198 configuration option with the value
203 to be the de-install procedure for the package.
204 This can be any executable program (or shell script).
205 It will be invoked automatically
206 when the package is later (if ever) de-installed.
208 Check that any symbolic links which are to be placed in the package are
209 relative to the current prefix.
214 to remove and re-link
215 any symbolic links which are targeted at full path names.
216 .It Fl n Ar preserve-file
217 The file is used to denote that the package should not be deleted.
218 This is intended for use where the deletion of packages may present
222 .Pq packing list only
226 operations when a package is installed.
227 In such cases, it is necessary to know what the final, adjusted packing
230 Set the initial package dependency list to
232 This is assumed to be a whitespace separated list of package names
233 and is meant as a convenient shorthand for specifying multiple
235 directives in the packing list (see PACKING LIST DETAILS section below).
236 In addition, the exact versions of the packages referred to in the
238 list will be added to the packing list in the form of
241 .It Fl T Ar buildpkgs
242 The exact versions of the packages referred to in the
244 list will be added to the packing list in the form of
247 This directives are stored after those created by the
251 is assumed to be a whitespace separated list of package names.
255 as the initial directory
257 to start from in selecting files for
259 .It Fl S Ar size-all-file
260 Store the given file for later querying with the
264 The file is expected to contain the size (in bytes) of all files of
265 this package plus any required packages added up and stored as a
266 ASCII string, terminated by a newline.
267 .It Fl s Ar size-pkg-file
268 Store the given file for later querying with the
272 The file is expected to contain the size (in bytes) of all files of
273 this package added up and stored as a ASCII string, terminated by a newline.
279 By default, this is the string
280 .Pa /tmp/instmp.XXXXXX ,
281 but it may be necessary to override it in the situation where
284 directory is limited.
285 Be sure to leave some number of
289 to fill in with a unique ID.
291 Do not update the package file database with any file information.
295 the default owner instead of extracting it from the file system.
297 Print version number and exit.
299 Turn on verbose output.
301 .Sh PACKING LIST DETAILS
306 is fairly simple, being
307 nothing more than a single column of filenames to include in the
309 However, since absolute pathnames are generally a bad idea
310 for a package that could be installed potentially anywhere, there is
311 another method of specifying where things are supposed to go
312 and, optionally, what ownership and mode information they should be
314 This is done by embedding specialized command sequences
316 Briefly described, these sequences are:
317 .Bl -tag -width indent -compact
318 .It Cm @cwd Ar directory
319 Set the internal directory pointer to point to
321 All subsequent filenames will be assumed relative to this directory.
324 is also an alias for this command.
325 .It Cm @src Ar directory
326 This command is supported for compatibility only.
327 It was formerly used to override
329 during package creation.
330 .It Cm @exec Ar command
333 as part of the unpacking process.
336 contains any of the following sequences somewhere in it, they will
338 For the following examples, assume that
342 and the last extracted file was
344 .Bl -tag -width indent -compact
346 Expands to the last filename extracted (as specified), in the example case
349 Expand to the current directory prefix, as set with
356 of the fully qualified filename, that
357 is the current directory prefix, plus the last filespec, minus
358 the trailing filename.
359 In the example case, that would be
364 part of the fully qualified name, or
367 being in the example case,
370 .It Cm @unexec Ar command
373 as part of the deinstallation process.
376 sequences is the same as for
378 This command is not executed during the package add, as
380 is, but rather when the package is deleted.
381 This is useful for deleting links and other ancillary files that were created
382 as a result of adding the package, but not directly known to the package's
383 table of contents (and hence not automatically removable).
384 The advantage of using
386 over a deinstallation script is that you can use the
387 .Pq special sequence expansion
388 to get at files regardless of where they've
389 been potentially redirected (see
392 Set default permission for all subsequently extracted files to
394 Format is the same as that used by the
396 command (well, considering that it's later handed off to it, that's
398 Use without an arg to set back to default (extraction) permissions.
399 .It Cm @option Ar option
400 Set internal package options, the only currently supported one
403 which tells pkg_add to move any existing files out of the way,
404 preserving the previous contents (which are also resurrected on
405 pkg_delete, so caveat emptor).
406 .It Cm @owner Ar user
407 Set default ownership for all subsequently extracted files to
409 Use without an arg to set back to default (extraction)
411 .It Cm @group Ar group
412 Set default group ownership for all subsequently extracted files to
414 Use without an arg to set back to default (extraction)
416 .It Cm @comment Ar string
417 Embed a comment in the packing list.
418 Useful in trying to document some particularly hairy sequence that
419 may trip someone up later.
421 Used internally to tell extraction to ignore the next file (don't
422 copy it anywhere), as it's used for some special purpose.
424 Set the name of the package.
425 This is mandatory and is usually put at the top.
426 This name is potentially different than the name of the file it came in,
427 and is used when keeping track of the package for later deinstallation.
430 will derive this field from the
432 and add it automatically if none is given.
433 .It Cm @pkgdir Ar name
437 If it does not exist at installation time, it is created.
438 If this directory is no longer referenced by packages and the last
439 file or directory in it is deleted, the directory is removed as well.
440 .It Cm @dirrm Ar name
441 This command is supported for compatibility only.
444 exists, it will be deleted at deinstall time.
445 .It Cm @display Ar name
448 as the file to be displayed at install time (see
451 .It Cm @pkgdep Ar pkgname
452 Declare a dependency on the
457 package must be installed before this package may be
458 installed, and this package must be deinstalled before the
460 package is deinstalled.
463 directives may be used if the package depends on multiple other packages.
464 .It Cm @blddep Ar pkgname
465 Declare that this package was built with the exact version
470 directive may contain wildcards or relational
471 package version information).
472 .It Cm @pkgcfl Ar pkgcflname
473 Declare a conflict with the
475 package, as the two packages contain references to the same files,
476 and so cannot co-exist on the same system.
480 .Xr pkg_install.conf 5
481 for options, that can also be specified using the environment.
487 .Xr pkg_install.conf 5
492 command first appeared in
495 .Bl -tag -width indent -compact
497 did most of the work.
504 wildcard dependency processing, pkgdb, pkg size recording etc.