wiki:Obsolete/MovedToTree/PackageManagement/BuildingPackages

Version 2 (modified by bonefish, 8 years ago) ( diff )

--

Building Packages

This page provides information regarding the package building process.

Haiku Package Files

The package file format is in specified in detail in a separate document. This section presents information from the perspective of how to build a package file.

A hpkg file is an archive file (just like tar or zip files) that additionally contains package meta information in a separate section of the file. When building a hpkg file via the package command the meta information must be provided via a .PackageInfo file. For convenience the file itself is added to the archive as well and can be extracted later, but it will be ignored by packagefs.

The .PackageInfo file must be located in the top directory that is archived. A package invocation usually looks like that:

package -C foo-4.5.26-1 foo-4.5.26-1.hpkg

The argument of the -C option specifies the directory whose contents to archive (by default the current directory), the remaining argument is the path of the package file to be built.

The contents of the .PackageInfo` contains name-value pairs, with the following simple grammar:

package_info	::= attribute*
attribute	::= name "=" value_list "\n"
value_list	::= value | ( "[" value* "]" )

name can be one of the attribute names defined below. value is either an unquoted string not containing any whitespace characters or a string enclosed in quotation marks (") which can contain whitespace and also escaped characters (using \).

The supported attributes are:

  • name: The name of the package, not including the package version. Must only contain <alphanum_underline> characters.
  • version: The version of the package. Must be a string of the following form:
    version	::= major [ "." minor [ "." micro ] ] "-" release
    major	::= alphanum_underline+
    minor	::= alphanum_underline+
    micro	::= alphanum_underline+
    release	::= integer_between_0_and_255
    
  • architecture: The system architecture the package has been built for. Can be either of:
    • any: Any architecture (e.g. a documentation package).
    • x86: Haiku x86, built with gcc 4.
    • x86_gcc2: Haiku x86, built with gcc 2.
  • summary: A short (one-line) description of the package.
  • description: A longer description of the package.
  • vendor: The name of the person/organization publishing this package.
  • packager: The name and e-mail address of person that created this package (e.g. "Peter Packman <peter.packman@…>").
  • copyright: The copyright applying to the software contained in this package.
  • copyrights: A list of copyrights applying to the software contained in this package.
  • licenses: A list of names of the licenses applying to the software contained in this package.
  • flags: A list of boolean flags applying to the package. Can contain any of the following:
    • approve_license: This package's license requires approval (i.e. must be shown to and acknowledged by user before installation).
    • system_package: This is a system package (i.e. lives under "/boot/system") .
  • provides: A list of entities provided by this package. The list elements must have the following format:
    entity		::= entity_name [ "=" version ]
    entity_name	::= [ entity_type ":" ] alphanum_underline+
    entity_type	::= alphanum_underline+
    
  • requires: A list of entities required by this package. The list elements must have the following format:
    required_entity		::= entity_name [ version_operator version ]
    version_operator	::= "<" | "<=" | "==" | "!=" | ">=" | ">"
    
  • supplements: A list of entities that are supplemented by this package (i.e. this package will automatically be selected for installation if the supplemented entities are already installed). The list elements must have the required_entity format.
  • conflicts: A list of entities that this package conflicts with (i.e. only one of both can be installed at any time). The list elements must have the required_entity format.
  • freshens: A list of entities that are being freshened by this package (i.e. this package will patch one or more files of the package(s) that provide this entity). The list elements must have the required_entity format.
  • replaces: A list of entities that are being replaced by this package (used if the name of a package changes, or if a package has been split). The list elements must have the entity_name format.
Note: See TracWiki for help on using the wiki.