pkgmk - 生产可安装的软件包
pkgmk [-o] [-a arch] [-b base_src_dir] [-d device] [-f prototype] [-l limit] [-p pstamp] [-r root_path] [-v version] [variable=value]... [pkginst]
pkgmk 实用程序会生成可安装的软件包以用作 pkgadd(8) 命令的输入。软件包内容是目录结构格式。
命令将软件包 prototype(5) 文件作为输入,创建 pkgmap(5) 文件。prototype 文件中每个条目的内容将复制到相应的输出位置。有关内容(校验和、文件大小、修改日期)的信息都在 pkgmap 文件中计算和存储,还包括在 prototype 文件中指定的信息。
pkgmk searches for the files listed in the prototype(5) file as described in the following conditions.注意:如果样例文件包含文件的显式位置以包括在软件包中,则以下搜索说明不适用。
If neither –b nor –r options are specified, the file name component of each file path listed in the prototype(5) file is expected to be found in the same directory as the prototype(5) file
If –b is specified as a relative path (without a leading “/”), then base_src_dir is prepended to the relative file paths from the prototype(5) file.将在 root_path 目录中搜索生成的路径。如果未指定 root_path,它缺省为 "/"。
If –b is specified as an absolute path (with a leading “/”), then base_src_dir is prepended to the relative paths from the prototype(5) file and the result is the location of the file. root_path is not searched.
If –r is specified, then full file paths are used from the prototype(5) file.相对路径前面都有 base_src_dir。如果未指定 base_src_dir,它缺省为 ""。在 root_path 的每个目录中搜索生成的路径。
If you created your prototype file using "pkgproto a/relative/path" or "pkgproto a/relative/path=install/path", you should use the –r root_path option to specify the location of a/relative/path so that pkgmk can correctly locate your source files.
在当前实现中,pkgadd(8)、pkgtrans(1) 和其他软件包命令可以处理最大 4 GB 的数据流。
支持以下选项:
使用 arch 覆盖 pkginfo(5) 文件中提供的体系结构信息。
在前面添加指定的 base_src_dir,来定位源计算机上的可重定位目标文件。使用此选项搜索样例文件中的所有目标文件。pkgmk 应分别在 /base_src_dir 中查找目标文件,或者使用 –b 和 –r 选项定位目标文件。
在 device 上创建软件包。device 可以是可移除磁盘的绝对目录路径名或标识符。缺省设备是安装假脱机目录 (/var/spool/pkg)。
使用 prototype 文件作为命令的输入。缺省的 prototype 文件名是 [Pp]rototype。
将输出设备的 512 字节块的最大大小指定为 limit。缺省情况下,如果输出文件是一个目录或可挂载设备,pkgmk 使用 df(8) 命令动态地计算输出设备中的可用空间容量。此选项在与 pkgtrans(1)结合使用时可用来创建数据流格式的软件包。
覆盖相同的实例;已存在的软件包实例会被覆盖。
使用 pstamp 覆盖 pkginfo(5) 文件中的生产标记定义。
使用附加了源路径名的指定 root_path 来定位源计算机上的目标文件,可以用逗号 (,) 作为路径元素的分隔符。如果指定了此选项,在指定的每个目录中搜索全目标路径。如果 –b 或 –r 选项都未指定,则在当前目录中搜索叶文件名。
使用 version 覆盖 pkginfo(5) 文件中提供的版本信息。
将指定的变量放在软件包环境中。(有关变量规范的定义,请参见 prototype(5)。)
支持下列操作数:
按软件包实例指定软件包。实例可以是软件包缩写或特定的实例(例如,inst.1 或 inst.2)。可以通过 inst.* 请求软件包的所有实例。星号字符 (*) 对于某些 shell 来说是特殊字符,可能需要转义。在 C-Shell 中, * 必须由单引号 (') 括起来或者在前面加反斜杠 (\)。
将返回以下退出值:
成功完成。
出现错误。
有关下列属性的说明,请参见 attributes(7):
|
pkgparam(1)、pkgproto(1)、pkgtrans(1)、uname(1)、pkginfo(5)、pkgmap(5)、prototype(5)、attributes(7)、df(8)、pkgadd(8)
体系结构信息在命令行中通过 –a 选项提供,或在 prototype(5) 文件中提供。如果没有提供体系结构信息, pkgmk 使用 uname –m 的输出。(请参见 uname(1))。
版本信息在命令行中通过 –v 选项提供,或在 pkginfo(5) 文件中提供。如果没有提供版本信息,将提供基于当前日期的缺省信息。
体系结构和版本的命令行定义将覆盖 prototype(5) 的定义。
如果使用以下区域相关参数的无效组合之一,pkgmk 将失败。
SUNW_PKG_ALLZONES 和 SUNW_PKG_THISZONE 都设置为 TRUE。
SUNW_PKG_HOLLOW 设置为 TRUE,且 SUNW_PKG_ALLZONES 设置为 FALSE。
软件包包含请求脚本,且 SUNW_PKG_THISZONE 设置为 TRUE。
有关这些参数的其他信息,请参见 pkginfo(5)。