- Prev
- AppStream
- Next

# ⁠Chapter 2. Upstream Metadata

AppStream allows upstream projects to define metadata about the components they provide using small XML files, metainfo files, which get installed into locations on the client system and are used by distribuors to enhance their metadata.
A "component" is a piece of software, like an application, a library, a font or a codec. For several components, especially those which are shown in software-centers, we provide specialized metainfo files to define specific properties and data of these components. For example, applications and fonts support screenshots, while codecs don't.
All metainfo files need to contain a minimal amount of information, defined in the "Generic Component" section, which also describes some optional elements which can be used. Specialized components might require more information to be complete and valid.

## ⁠2.1. Generic Component

### ⁠2.1.1. Introduction

For a distribution, it is good to know more about the content of a package. Which public interfaces (libraries? Python modules?) does it provide? Does it contain codecs? Does it contain firmware? Fonts? An application? All of this information can be used to automatically install missing software or to offer users a choice on what they want to install from a software center.
To provide this information, we created the metainfo files, which allow upstream projects to describe the content of their software package. If a metainfo file provides a `<provides/>` tag, distributors must also ensure that the package providing the file contain all items referenced by that statement, or is installed by a metapackage depending on packages which provide these items. This gives upstream projects a (very light) way to influence distributor packaging. More information about that can be found below.
Several specialized component-metainfo files exist, for example for applications or fonts. These are all based on this generic component XML specification, and are described in the following chapters.

### ⁠2.1.2. Filesystem locations

Upstream projects can ship one or more metainfo files in `/usr/share/metainfo/%{id}.metainfo.xml`, where `id` is a unique identifier of this specific component.

Note

Applications are a special case here, because they are usually treated differently by software centers (and also for historical reasons). If your metainfo file covers only an application, as described in the AppData section, install it as `/usr/share/metainfo/%{id}.appdata.xml`.

Legacy Path

The `/usr/share/appdata/` path must be scanned by AppStream tools as well, to support legacy applications installing metadata there. For new software components, it is advised not to use this directory.

### ⁠2.1.3. XML Specification

The XML for a generic component definition starts with an `<component>` tag as root element. The `<component>` element must at least have an `id`, `name` and `releases` tag, a `provides` tag with appropriate children is highly recommended. All possible tags in the generic set are:

⁠<id/>
  The `<id>` tag is a short and unique identifier for this component. It must contain only ASCII characters, dots, hyphens and numbers, spaces are not allowed. Specialized metainfo types, such as application or fonts, may apply additional restrictions on the `id` tag value.
  A general pattern for a valid ID tag is to use a reverse URL scheme, consisting of `<tld>.<vendor>.<product>.<type>`, e.g. `org.kde.gwenview.desktop` or `com.hugski.ColorHug2.firmware`.
  Note that the value of this tag must be unique across all distributions. In case it is not, distributors are expected to reject the conflicting components from inclusion into their metadata.
⁠<metadata_license/>
  The `<metadata_license/>` tag indicates the content licence that you are releasing the one Metainfo XML file under. This is not typically the same as the project licence. Omitting the license value can result in your data not being incorporated into the distribution metadata (so this is a required tag).
  A permissive license ensures your data can be combined with arbitrary other data in one file. Primissive licence names include:
  - CC0-1.0
  - CC-BY-3.0
  - CC-BY-SA-3.0
  - GFDL-1.3
  - MIT
  The licence codes correspond to the identifiers found at the SPDX OpenSource License Registry. For instance, CC-BY-SA-3.0 corresponds to the license at creativecommons.org/licenses/by-sa/3.0.
⁠<name/>
  A human-readable name for this software component. For example, if the component id was "libc", its name might be "GNU Standard C Library".
⁠<summary/>
  A short summary of what this component does. If the component is "PackageKit", the summary could be "Provides a package-management abstraction layer".
⁠<description/>
  A long description of this component. Some markup can be used.
  Do not assume the format is HTML. Only paragraph (p), ordered list (ol) and unordered list (ul) are supported at this time.
  In metainfo files, this tag should be translated by-paragraph, meaning that in a translated file, each translated `<p/>` child has a language property.
⁠<url/>
  Defines URLs for this component.There are several different URL types allowed:
  homepage
    Should be a link to the upstream homepage for the component.
  bugtracker
    Should point to the software's bug tracking system, for users to report new bugs.
  faq
    Should link a FAQ page for this software, to answer some of the most-asked questions in detail, something which you can not do in the component's description.
  help
    Should provide a link to an online user's reference, a software manual or help page.
  donation
    Links of this type should point to a webpage showing information on how to donate to the described software project.
⁠<releases/>
  The `<releases>` tag contains `<release/>` child tags which describe some metainformation about the current release of the described software. The `<release/>` tag may be present multiple times (for older releases), but a tag for the current version must always be present.
  A `release` tag can have the properties `version`, `date` and `timestamp`. The `date` property can have any time in ISO 8601 format as value and should be present for every release. The `timestamp` tag contains the release time in form of a UNIX epoch. This tag should not be used in metainfo files in newly written metadata, but will still be parsed in case it is present. The the `timestamp` property is mainly used in generated distro-meadata. In case both release-time tags are present, the `timestamp` tag will take precedence over `date`.
  Optionally, the `<release/>` tag may also have an `urgency` property, having one of the following values:
  - low
  - medium
  - high
  - critical
  The `urgency` defines how important it is to install the new release as an update. This is especially important for `type=firmware` components. If no urgency is defined, a `medium` urgency is implicitly assumed. The urgency defines how the update will be presented to the user, and sometimes if it will be installed automatically and immediately, or delayed.
  Each `release` tag may have a `description` tag as child, containing a brief description of what is new in the release. The `description` tag is structured as described in <description/>
  A `release` tag may also have one or multiple `size` tags as children, which define the installed and download size of this component release. This is useful in case the component does not have a corresponding native package in a distribution, for example if it is a Limba bundle or LVFS firmware. The size type is defined via a `type` property on the `size` tag, and may assume the value `download` or `installed`. The size itself is set as value and must be given in bytes.
  Examples for a valid releases tag:

      ​<releases>
      ​  <release version="1.2" date="2014-04-12" urgency="high">
      ​    <size type="download">12345678</size>
      ​    <size type="installed">42424242</size>
      ​  </release>
      ​  <release version="1.0" date="2012-08-26" />
      ​</releases>

⁠<provides/>
  The `provides` tag and it's children describe the public interfaces this application provides. A public interface can be anything which other applications, which are not part of the upstream project, can access or reference. This includes binaries and libraries. Private interfaces should never be added to a `provides` tag.
  A `provides` tag contain a number of children describing the type and name of the provided public interface items. It is suggested that the build-system auto-generates this tag and it's children. Currently allowed item types are listed below. If you miss something, file a bug against AppStream so we can add the new type.
  <library/>
    Contains the name of a shared library placed in a publicly accessible library path, such as `/usr/lib`, `/usr/lib/<triplet>` or `/lib`. For example, for the libappstream library, the value for `library` would be `libappstream.so.1`.
  <binary/>
    Name of a binary installed into a location in `PATH`.
  <font/>
    Name of a font provided by this component. For example `Linux Libertine O`. The tag must have a `file` property stating the filename of the referenced font.
    Example:

        ​<provides>
        ​  <font file="LinLibertine_R.otf">Linux Libertine O</font>
        ​</provides>

  <modalias/>
    A modalias glob representing the hardware types (for example USB, PCI, ACPI, DMI) this component handles. Useful for installing printer drivers or other USB protocol drivers for smartphones, firmware, kernel drivers which are not merged upstream yet or whatever else.
  <firmware/>
    This provided element is described in details for the `firmware` component type, where it is mandatory. Please see <provides/> ↪ <firmware/> for more information.
  <python2/>
    Name of a Python2 module this component provides.
  <python3/>
    Name of a Python3 module this component provides.
  <dbus/>
    Contains the name of a DBus service as property. The type of the service must be specified using the `type` property of this tag. Allowed values are `user` and `system`.
    Example:

        ​<provides>
        ​  <dbus type="system">org.freedesktop.PackageKit</dbus>
        ​</provides>

⁠<mimetypes/>
  This tag can contain one or more `<mimetype/>` children, describing the mime types this application supports. This tag is especially useful for generic components and addon-type components. For applications, the metadata will automatically be fetched from their .desktop files by the distribution's metadata generator. Example:

      ​
      ​<mimetypes>
      ​    <mimetype>text/html</mimetype>
      ​    <mimetype>image/jpeg</mimetype>
      ​    <mimetype>application/rss+xml</mimetype>
      ​ </mimetypes>

⁠<project_group/>
  If you include the `<project_group/>` tag then this identifies your project with a specific upstream umbrella project. Known values include GNOME, KDE, XFCE, MATE and LXDE, although other umbrella projects like Yorba or Mozilla make sense too.

  Note

  You should only identify with an umbrella project if you use all their infrastructure and policies, for instance string freezes dates, bugtracker and source control instance.
⁠<project_license/>
  The `<project_license/>` tag is indicating the license of the component (application/library/addon/font/etc.) described in the metadata document. It should be a string in SPDX format. Licenses may be combined using and and or logic. Possible values include:
  - GPL-2.0
  - LGPL-3.0+ and GPL-3.0+
  - MIT
  - CC-BY-SA-2.0
  - ...
  A full list of recognized licenses and their identifiers can be found at the SPDX OpenSource License Registry.
  Although the `project_license` tag is not mandatory, it is recommended to include it.
⁠<developer_name/>
  The `<developer_name/>` tag is designed to represent the developers or project responsible for development of the project described in the metadata.
  Values might be for example "The GNOME Foundation" or "The KDE Community". You must not include hyperlinks or emails in this field, if you want to link to the developer's homepage, use the <url/>-tag instead.
  This tag is translatable.
⁠<screenshots/>
  Visual components (like fonts or graphical applications) may choose to add one or multiple screenshots to their metadata.
  The `<screenshots/>` tag contains multiple `<screenshot/>` children, where at least one of them must have the property `type="default"` to indicate the application's primary screenshot. Every `<screenshot/>` tag must have at least one `<image/>` child, which should define the width and height of the referenced image in it's properties. The value of the `<image/>` tag is a direct URL to a screenshot uploaded to a public location on the web.
  Optionally, a `<screenshot/>` tag may have a `<caption/>` child, defining a short (not more then 255 characters!) description of what the user can see on the referenced screenshot.
  Ideally, all screenshots should have a 16:9 aspect ratio, and should have a width that is no smaller than 620px. They should also be in be in PNG or JPEG format. PNG is the preferred format; JPEG should only be used when screenshots include large photographs or other images where a lossy format like JPEG may compress better.
⁠<update_contact/>
  The `<update_contact/>` tag is an optional tag which can be added to provide an email address distributors can use to contact the project about invalid or incomplete metadata, or in case the specification has changed, about old metadata. It can also be used to ask general questions in case of an update of the component described in the metadata file.
  The `<update_contact/>` tag must only be used by distributors. It is not included in the distribution-provided AppStream XML file, and therefore not exposed to the end user via any kind of UI.
  Upstream authors might decide to add an email address in cleartext, but spam protection using `_AT_` is also valid.
  Example:

      ​<update_contact>developer_AT_example.com</update_contact>

⁠<translation/>
  The `<translation/>` tag is an optional tag which can be added to specify the translation domain used for this software component. It may be used by the AppStream distro metadata generator to determine the translation status of the respective software.
  The tag must have a `type` property, assuming the value of the translation system which is used. Right now, allowed trabslation systems and values for `type` are:
  - gettext
  - qt
  In case a software components gets its translation from multiple translation domains, the `<translation/>` tag may be defined more than once.
  Example:

      ​<translation type="gettext">foobar</translation>

An example for a very basic component file could look like this:

    ​
    ​<?xml version="1.0" encoding="UTF-8"?>
    ​<component>
    ​  <id>foobar</id>
    ​  <name>Foo Bar</name>
    ​  <summary>A foo-ish bar</summary>
    ​  <url type="homepage">http://www.example.org</url>
    ​  <metadata_license>CC0-1.0</metadata_license>
    ​
    ​  <provides>
    ​    <library>libfoobar.so.2</library>
    ​    <font>foo.ttf</font>
    ​    <binary>foobar</binary>
    ​  </provides>
    ​  <releases>
    ​    <release version="1.2" date="2015-02-16" />
    ​  </releases>
    ​  <developer_name>FooBar Team</developer_name>
    ​</component>

For a component of type `generic`, the minimal amount of required tags is: <id/>, <name/>, <summary/>, <metadata_license/>.

- PrevChapter 1. About AppStream
- Up
- Home
- Next2.2. Desktop Applications