|PACKAGE(5)||File Formats Manual||PACKAGE(5)|
package — format
for OpenBSD binary packages
Package names always end in “.tgz”; the file name itself should conform to packages-specs(7).
Note that the base distribution tarballs of OpenBSD (e.g. baseXX.tgz, compXX.tgz, ...) are not binary packages fit for pkg_add(1).
All types of archive contents can be present in a package, including files, directories, hardlinks, symlinks, fifos, block and character devices.
In order to allow just-in-time extraction, packages always begin with a table of contents, named +CONTENTS. This table of contents can be read using the API described in OpenBSD::PackingList(3p).
All the remaining information in the archive should be referenced in the packing-list, including all relevant information: symlinks destinations, special permissions, and file owners (pkg_create(1) and pkg_add(1) actually enforce this). See pkg_create(1) for annotation details.
This table of contents is always followed by a few special files, some of which are optional: the package description (+DESC), a display message (+DISPLAY), etc.
The basic ustar format has some limitations with respect to file names. Packages now use the "extended record specification" (header type x) for long links and long file names. Other extended ustar headers are currently recognized, but not supported.
Starting with OpenBSD 5.5, the compressed archive may be composed of several gzip(1) archives concatenated together. gzip(1) doesn't mind, and tar(1) is happy as long as the uncompressed stream is sane. This allows for faster signing and better rsync properties.
Starting with OpenBSD 5.6, tarballs are stored "out-of-order": each archive entry will match an entry in the packing-list (and all file-like entries will be matched), but the order will be adjusted so that most recently changed files come first, in order to allow faster updates.
User annotations are described in pkg_create(1). The following annotations are automatically inserted during package creation and installations:
-Aarches of pkg_create(1)
@comment pkgpath=path cdrom=yes/no ftp=yes/no
-DFTP arguments to pkg_create(1).
packageto record that the entry is actually a hard link.
All information within a package is checksummed, using SHA256 since OpenBSD 4.4. During creation and installation, meta-information, such as file owners and permissions, are also checked: any important stuff that isn't recorded in the packing-list is an error.
Packing-lists can be signed. If a signature is found, then it will be checked during installation, and failure to verify will prevent the package from installing correctly. Currently, signify(1) and X.509-style signatures are supported. X.509 signatures rely on a certificate authority file being present as /etc/ssl/pkgca.pem and all signatures will be checked against it. Once the packing-list signature is checked, all individual packing elements will be checksummed, resulting in a ‘just-in-time’ signature checking.
Fat packages were removed in OpenBSD 5.1, since no practical application was found.
Packages are valid gzip'ed ustar archives that can be extracted using tar(1). In particular, hardlink names should be valid, and all items will extract to different names. However, it may be a bit difficult to make sense of the package contents without peeking at the packing-list.
|September 10, 2015||OpenBSD-6.0|