Skip site navigation (1)Skip section navigation (2)

FreeBSD Man Pages

Man Page or Keyword Search:
Man Architecture
Apropos Keyword Search (all sections) Output format
home | help
PKG-CREATE(8)		FreeBSD	System Manager's Manual		 PKG-CREATE(8)

NAME
     pkg create	-- a utility for creating software package distributions

SYNOPSIS
     pkg create	[-n] [-f format] [-o outdir] [-p plist]	[-r rootdir] -m
	 manifestdir
     pkg create	[-gnx] [-f format] [-o outdir] [-r rootdir] pkg-name ...
     pkg create	[-n] [-f format] [-o outdir] [-r rootdir] -a

DESCRIPTION
     pkg create	is used	to create packages from	binaries or other files
     installed on your computer.  Package tarballs can created from the	files
     of	a previously installed package using metadata from the local package
     database.	Any number of packages may be created in one invocation	of
     this style.

     Alternatively, a single package can be created from an arbitrary selec-
     tion of files on your system, but this requires a manifestdir and option-
     ally plist	to be supplied.	 The package name will be derived from the
     +MANIFEST file which must be contained within the manifestdir.

     Packages thus created can be distributed and subsequently installed on
     other machines using the pkg add command.

OPTIONS
     The following options are supported by pkg	create:

     -a		     Create package tarballs from all packages installed on
		     your system.  This	option is incompatible with the	-g, -x
		     or	-m manifestdir options.

     -g		     Interpret pkg-name	as a shell glob	pattern	and create
		     package only for installed	binaries whose name match this
		     pattern.  This option is incompatible with	the -a,	-x or
		     -m	manifestdir options.

     -x		     Like -g, but interpret pkg-name as	a regular expression
		     using the "modern"	or "extended" syntax described in
		     re_format(7).  This option	is incompatible	with the -a,
		     -g	or -m manifestdir options.

     -f	format	     Set format	as the package output format.  It can be one
		     of	txz, tbz, tgz or tar which are currently the only sup-
		     ported format.  If	an invalid or no format	is specified
		     txz is assumed.

     -m	manifestdir  Specify the directory containing the package manifest,
		     +MANIFEST and optionally three other files; one contain-
		     ing a message to be displayed on package installation,
		     +DISPLAY.	Another	containing the description for the
		     packages, +DESC.  The last	containing an mtree specifica-
		     tion, +MTREE_DIRS,	for the	directory tree the package
		     will use.	See mtree(5) for the format of the mtree file.
		     If	specified, only	a single package will be created.
		     +DISPLAY ,	+MTREE_DIRS , and +DESC	are not	required; the
		     +MANIFEST file can	contain	all the	required information
		     needed to build a package.	 This option is	incompatible
		     with the -a, -g or	-x options.

     -n		     Do	not overwrite already existing packages

     -o	outdir	     Set outdir	as the output directory.  If this option is
		     not given,	all created packages will be saved in the cur-
		     rent directory.

     -p	plist	     Specify some package metadata using the legacy plist for-
		     mat from pkg_add(1), commonly found in pkg-plist files in
		     the ports tree.  Metadata from the	G.Ar plist file, if
		     specified,	will take precedence over any equivalents from
		     the manifestdir.  Only has	any effect when	used with
		     manifestdir.  See PLIST FORMAT for	details

     -r	rootdir	     rootdir specifies the top-level directory to be treated
		     as	the root of the	filesystem hierarchy containing	the
		     package files.  File paths	in generated packages will be
		     relative to rootdir.  This	allows a package to be gener-
		     ated from content offset from its intended	final loca-
		     tion, which allows	a package building without disturbing
		     similar content already on	the system.  If	unspecified,
		     the default is effectively	/, the actual root directory.

MANIFEST FILE DETAILS
     name pkg-name
	  This entry sets the package's	name to	pkg-name.  Among other things,
	  this name is used - with the version and the origin of the concerned
	  package - to identify	a dependency.

     version pkg-version
	  This entry sets the package's	version	to pkg-version.

     origin pkg-origin
	  This entry sets the package's	origin to pkg-origin.  This is a
	  string of the	form category/port-dir which designate the port	this
	  package was built from.

     comment comment-string
	  comment-string is a one-line description of this package.  It	is the
	  equivalent of	the COMMENT variable for a port, not a way to put com-
	  ments	in a +MANIFEST file.

     arch cpu-type
	  The architecture of the machine the package was built	on.  cpu-type
	  takes	values like x86, amd64...

     www url
	  The software's official website.

     maintainer	mail-address
	  The maintainer's mail	address.

     prefix path-prefix
	  The path where the files contained in	this package are installed
	  (usually /usr/local).

     flatsize size
	  The size that	the files contained in this package will occupy	on
	  your system once uncompressed.  This value does not take into
	  account files	stored in the package database.

     dep dep-name dep-origin dep-version
	  Declare a dependency on the package which name, origin and version
	  match	dep-name, dep-origin and dep-version respectively.

     conflict pkg-glob
	  Flag this package as incompatible with the one designated by
	  pkg-glob.  Conflicting packages cannot be installed on the same sys-
	  tem as they may contain references to	the sames files.

     option option-name	option-value
	  Set the option option-name to	the value option-value.

     file sha256-hash path
	  file entries list files included in the package.  If the file	is a
	  regular one, such an entry contains its sha256 digest	along with its
	  path.	 If a packaged file is a link, you must	use this entry's other
	  form,	as described below.

     file - path
	  Same as above	but for	file links.  The sha256	hash is	replaced with
	  a - (dash).

     dir path
	  Mimics the file entry	but for	directories.

PLIST FORMAT
     The following describes the plist format:

     The plist is a sequential list of lines which can have keywords
     prepended.	 A keyword starts with an `@'.	Lines not starting with	a key-
     word are considered as paths to a file.  If started with a	`/' then it is
     considered	an absolute path.  Otherwise the file is considered as rela-
     tive to PREFIX.

     Keyword lines are formed as follows: @keyword line

     Available keywords	are the	following:

     @cwd [directory]
	     Set the internal directory	pointer	to point to directory.	All
	     subsequent	filenames will be assumed relative to this directory.
     @exec command (deprecated)
	     Execute command as	part of	the unpacking process.	If command
	     contains any of the following sequences somewhere in it, they
	     will be expanded inline.  For the following examples, assume that
	     @cwd is set to /usr/local and the last extracted file was
	     bin/emacs.
	     %F	     Expands to	the last filename extracted (as	specified), in
		     the example case bin/emacs
	     %D	     Expand to the current directory prefix, as	set with @cwd,
		     in	the example case /usr/local.
	     %B	     Expand to the ``basename''	of the fully qualified file-
		     name, that	is the current directory prefix, plus the last
		     filespec, minus the trailing filename.  In	the example
		     case, that	would be /usr/local/bin.
	     %f	     Expand to the filename part of the	fully qualified	name,
		     or	the converse of	%B, being in the example case, emacs.
     @unexec command (deprecated)
	     Execute command as	part of	the deinstallation process.  Expansion
	     of	special	% sequences is the same	as for @exec.  This command is
	     not executed during the package add, as @exec is, but rather when
	     the package is deleted.  This is useful for deleting links	and
	     other ancillary files that	were created as	a result of adding the
	     package, but not directly known to	the package's table of con-
	     tents (and	hence not automatically	removable).
     @mode mode
	     Set default permission for	all subsequently extracted files to
	     mode.  Format is the same as that used by the chmod command.  Use
	     without an	arg to set back	to default (mode of the	file while
	     being packed) permissions.
     @owner user
	     Set default ownership for all subsequently	files to user.	Use
	     without an	arg to set back	to default (root) ownership.
     @group group
	     Set default group ownership for all subsequently files to group.
	     Use without an arg	to set back to default (wheel) group owner-
	     ship.
     @comment string
	     The line will be ignored when packing
     @dirrm name
	     Declare directory name to be deleted at deinstall time.  By
	     default, directories created by a package installation are	not
	     deleted when the package is deinstalled.  This provides an
	     explicit directory	cleanup	method.	 These directives should
	     appear at the end of the package list.  If	the directory is not
	     empty a warning will be printed, and the directory	will not be
	     removed.
     @dirrmtry name
	     Declare directory name to be removed, as for @dirrm, but does not
	     issue a warning if	the directory cannot be	removed.

ENVIRONMENT
     The following environment variables affect	the execution of pkg create.
     See pkg.conf(5) for further description.

     PKG_DBDIR

     PLIST_KEYWORDS_DIR

     PORTSDIR

FILES
     See pkg.conf(5).

EXAMPLES
     Create package files for installed	packages:
	   % pkg create	-a -o /usr/ports/packages/All

     Create package file for pkg:
	   % pkg create	-o /usr/ports/packages/All pkg

SEE ALSO
     pkg.conf(5), pkg(8), pkg-add(8), pkg-annotate(8), pkg-audit(8),
     pkg-autoremove(8),	pkg-backup(8), pkg-check(8), pkg-clean(8),
     pkg-config(8), pkg-convert(8), pkg-delete(8), pkg-fetch(8), pkg-info(8),
     pkg-install(8), pkg-lock(8), pkg-query(8),	pkg-register(8), pkg-repo(8),
     pkg-rquery(8), pkg-search(8), pkg-set(8), pkg-shell(8), pkg-shlib(8),
     pkg-stats(8), pkg-update(8), pkg-updating(8), pkg-upgrade(8),
     pkg-version(8), pkg-which(8)

FreeBSD	10.1		       November	29, 2013		  FreeBSD 10.1

NAME | SYNOPSIS | DESCRIPTION | OPTIONS | MANIFEST FILE DETAILS | PLIST FORMAT | ENVIRONMENT | FILES | EXAMPLES | SEE ALSO

Want to link to this manual page? Use this URL:
<http://www.freebsd.org/cgi/man.cgi?query=pkg-create&sektion=8&manpath=FreeBSD+10.0-RELEASE>

home | help