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

FreeBSD Manual Pages

  
 
  

home | help
PKG_CREATE(3)		    Library Functions Manual		 PKG_CREATE(3)

NAME
       pkg_create,	pkg_create_i,	  pkg_create_new,     pkg_create_free,
       pkg_create_set_format,			     pkg_create_set_overwrite,
       pkg_create_set_compression_level,	       pkg_create_set_rootdir,
       pkg_create_set_output_dir,		     pkg_create_set_timestamp,
       pkg_create_set_compression_threads -- create packages

LIBRARY
       library "libpkg"

SYNOPSIS
       #include	<pkg.h>

       struct pkg_create *
       pkg_create_new();

       void
       pkg_create_free(struct pkg_create *);

       bool
       pkg_create_set_format(struct pkg_create *, const	char *);

       void
       pkg_create_set_compression_level(struct pkg_create *, int);

       void
       pkg_create_set_compression_threads(struct pkg_create *, int);

       void
       pkg_create_set_overwrite(struct pkg_create *, bool);

       void
       pkg_create_set_rootdir(struct pkg_create	*, const char *);

       void
       pkg_create_set_output_dir(struct	pkg_create *, const char *);

       void
       pkg_create_set_timestamp(struct pkg_create *, time_t);

       int
       pkg_create(struct pkg_create *, const char *, const char	*, bool);

       int
       pkg_create_i(struct pkg_create *, struct	pkg *, bool);

DESCRIPTION
       pkg_create_new()	 Allocates  a  new struct pkg_create * which should be
       freed by	the caller using pkg_create_free().

       pkg_create_set_format() will define the compression format to use.   By
       default "txz" except if specified otherwise in pkg.conf(5).  It returns
       false if	the compression	format is unknown and fallback the the default
       format.

       pkg_create_set_compression_level()  take	 a  int	arguments which	repre-
       sents the expect	compression level.  3 special values are accepted:

       INT_MIN	    Set	the fastest compression	format value

       0	    Set	the default (as	specified in libarchive)

       INT_MAX	    Set	the best compression ratio

       pkg_create_set_compression_threads() take a int arguments which	repre-
       sents   the  expected  numbers  of  threads  used  during  compression.
       pkg_create_set_overwrite() Accept a boolean to define the  default  be-
       haviour	when  creating a package and a local file already exists.  The
       default behaviour is to overwrite.

       pkg_create_set_rootdir()	Tells the program where	to find	the  root  di-
       rectory used for	packaging (it is also known as staging area).  If none
       is provided pkg will consider `/'.

       pkg_create_set_output_dir()  Tells  the program where to	create the new
       packages.  By default it	will consider the  current  directory  of  the
       running program.

       pkg_create_set_timestamp()  Define the timestamp	to use ad creation and
       modification time for the files to be packaged.	By default it will use
       the timestamp of	the files on the filesystem.

       pkg_create() create a package from scratch using	the metadata and plist
       as input.  The metadata can be either directly a	UCL manifest, or a di-
       rectory containing multiple files:

       +MANIFEST  The UCL manifest

       +DESC	  A textual description	(optional)

       shell scripts (optional):

		  +INSTALL	      Shell script that	 will  be  run	during
				      both  in	post  and  pre install (DEPRE-
				      CATED)

		  +PRE_INSTALL	      Shell script that	will be	run during pre
				      install phase

		  +POST_INSTALL	      Shell script that	 will  be  run	during
				      post install phase

		  +DEINSTALL	      Shell  script  that  will	 be run	during
				      both in post and pre  deinstall  (DEPRE-
				      CATED)

		  +PRE_DEINSTALL      Shell script that	will be	run during pre
				      deinstall	phase

		  +POST_DEINSTALL     Shell  script  that  will	 be run	during
				      post deinstall phase

		  pkg-install	      Shell script that	 will  be  run	during
				      both  in	post  and  pre install (DEPRE-
				      CATED)

		  pkg-pre-install     Shell script that	will be	run during pre
				      install phase

		  pkg-post-install    Shell script that	 will  be  run	during
				      post install phase

		  pkg-deinstall	      Shell  script  that  will	 be run	during
				      both in post and pre  deinstall  (DEPRE-
				      CATED)

		  pkg-pre-deinstall   Shell script that	will be	run during pre
				      deinstall	phase

		  pkg-post-deinstall  Shell  script  that  will	 be run	during
				      post deinstall phase

       lua scripts (optional):

		  pkg-pre-install.lua	  Lua script that will be  run	during
					  pre install phase

		  pkg-post-install.lua	  Lua  script  that will be run	during
					  post install phase

		  pkg-pre-deinstall.lua	  Lua script that will be  run	during
					  pre deinstall	phase

		  pkg-post-deinstall.lua  Lua  script  that will be run	during
					  post deinstall phase

       pkg_create_i() create a package for the	provided  installed  pkg.   If
       hash  is	 set  to  true	then  the  file	 name  will in the form: <pkg-
       name>-<pkgversion>-<shorthash>.<extention>     instead	  of	 <pkg-
       name>-<pkgversion>.<extension>.

FreeBSD	13.2			  May 3, 2024			 PKG_CREATE(3)

NAME | LIBRARY | SYNOPSIS | DESCRIPTION

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=pkg_create&manpath=FreeBSD+14.2-RELEASE+and+Ports>

home | help