/usr/share/doc/appstream-doc/html/chap-Metadata.html is in appstream-doc 0.7.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 2. Upstream Metadata</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta name="generator" content="publican 3.2.1" /><meta name="package" content="AppStream-AppStream-0.7-en-US-0.0-0" /><link rel="home" href="index.html" title="AppStream" /><link rel="up" href="index.html" title="AppStream" /><link rel="prev" href="chap-AppStream-About.html" title="Chapter 1. About AppStream" /><link rel="next" href="sect-Metadata-Application.html" title="2.2. Desktop Applications" /></head><body><p id="title"><a class="left" href="http://www.freedesktop.org/wiki/Distributions/AppStream/"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="http://www.freedesktop.org/software/appstream/docs/"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="chap-AppStream-About.html"><strong>Prev</strong></a></li><li class="home">AppStream</li><li class="next"><a accesskey="n" href="sect-Metadata-Application.html"><strong>Next</strong></a></li></ul><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a id="chap-Metadata"></a>Chapter 2. Upstream Metadata</h1></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="chap-Metadata.html#sect-Metadata-GenericComponent">2.1. Generic Component</a></span></dt><dt><span class="section"><a href="sect-Metadata-Application.html">2.2. Desktop Applications</a></span></dt><dt><span class="section"><a href="sect-Metadata-Addon.html">2.3. Addons</a></span></dt><dt><span class="section"><a href="sect-Metadata-Codec.html">2.4. Codecs</a></span></dt><dt><span class="section"><a href="sect-Metadata-InputMethod.html">2.5. Input Methods</a></span></dt></dl></div><div class="para">
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.
</div><div class="para">
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.
</div><div class="para">
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.
</div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="sect-Metadata-GenericComponent"></a>2.1. Generic Component</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="spec-component-introduction"></a>2.1.1. Introduction</h3></div></div></div><div class="para">
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.
</div><div class="para">
To provide this information, we created the <span class="italic italic">metainfo</span> files, which allow <span class="bold bold"><strong>upstream projects</strong></span> to describe the content of their software package. If a metainfo file provides a <code class="literal"><provides/></code> 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.
</div><div class="para">
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.
</div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="spec-component-location"></a>2.1.2. Filesystem locations</h3></div></div></div><div class="para">
Upstream projects can ship one or more metainfo files in <code class="filename">/usr/share/appdata/%{id}.metainfo.xml</code>, where <code class="literal">id</code> is a unique identifier of this specific component.
</div><div class="note"><div class="admonition_header"><p><strong>Note</strong></p></div><div class="admonition"><div class="para">
Applications are a special case here, because they are special in some ways (and also for historical reasons). If your metainfo file covers only an application, as described in the AppData section, install it as <code class="filename">/usr/share/appdata/%{id}.appdata.xml</code>.
</div></div></div><div class="para">
Please note that the <code class="filename">/usr/share/appdata/symbols</code> directory is reserved for a possible future use for storing upstream-generated symbols files for libraries.
</div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="spec-component-filespec"></a>2.1.3. XML Specification</h3></div></div></div><div class="para">
The XML for a generic component definition starts with an <code class="code"><component>
</code> tag as root element. The <code class="code"><component>
</code> element must at least have an <code class="literal">id</code>, <code class="literal">name</code> and <code class="literal">releases</code> tag, a <code class="literal">provides</code> tag with appropriate children is highly recommended. All possible tags in the generic set are:
</div><div class="variablelist"><dl class="variablelist"><dt><a id="tag-id-generic"></a><span class="term"><id/></span></dt><dd><div class="para">
The <code class="code"><id>
</code> 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 <code class="literal">id</code> tag value.
</div><div class="para">
Note that the value of this tag must be <span class="emphasis"><em>unique</em></span> across all distributions. In case it is not, distributors are expected to reject the conflicting components from inclusion into their metadata.
</div></dd><dt><a id="tag-metadata_license"></a><span class="term"><metadata_license/></span></dt><dd><div class="para">
The <code class="code"><metadata_license/></code> tag is indicating the content licence that you are releasing the one Metainfo XML file as. This is not typically the same as the project licence. By ommitting the licence value would probably mean your data would not be incorporated into the distribution metadata (so this is a required tag). Permissible licence codes include:
</div><div class="itemizedlist"><ul><li class="listitem"><div class="para">
CC0-1.0
</div></li><li class="listitem"><div class="para">
CC-BY-3.0
</div></li><li class="listitem"><div class="para">
CC-BY-SA-3.0
</div></li><li class="listitem"><div class="para">
GFDL-1.3
</div></li><li class="listitem"><div class="para">
MIT
</div></li></ul></div><div class="para">
The licence codes correspond to the identifiers found at the <a href="http://spdx.org/licenses/">SPDX OpenSource License Registry</a>. For instance, CC-BY-SA-3.0 corresponds to http://creativecommons.org/licenses/by-sa/3.0/
</div></dd><dt><a id="tag-name"></a><span class="term"><name/></span></dt><dd><div class="para">
A human-readable name for this software component. For example, if the component id was "libc", it's name might be "GNU Standard C Library".
</div></dd><dt><a id="tag-summary"></a><span class="term"><summary/></span></dt><dd><div class="para">
A short summary of what this component does. If the component is "PackageKit", the summary could be "Provides a package-management abstraction layer".
</div></dd><dt><a id="tag-description"></a><span class="term"><description/></span></dt><dd><div class="para">
A long description of this component. Some markup can be used.
</div><div class="para">
Do not assume the format is HTML. Only paragraph (p), ordered list (ol) and unordered list (ul) are supported at this time.
</div><div class="para">
In metainfo files, this tag should be translated by-paragraph, meaning that in a translated file, each translated <code class="literal"><p/></code> child has a language property.
</div></dd><dt><a id="tag-url"></a><span class="term"><url/></span></dt><dd><div class="para">
Defines URLs for this component.There are several different URL types allowed:
</div><div class="variablelist"><dl class="variablelist"><dt><span class="term">homepage</span></dt><dd><div class="para">
Should be a link to the upstream homepage for the component.
</div></dd><dt><span class="term">bugtracker</span></dt><dd><div class="para">
Should point to the software's bug tracking system, for users to report new bugs.
</div></dd><dt><span class="term">faq</span></dt><dd><div class="para">
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.
</div></dd><dt><span class="term">help</span></dt><dd><div class="para">
Should provide a link to an online user's reference, a software manual or help page.
</div></dd><dt><span class="term">donation</span></dt><dd><div class="para">
Links of this type should point to a webpage showing information on how to donate to the described software project.
</div></dd></dl></div></dd><dt><a id="tag-releases"></a><span class="term"><releases/></span></dt><dd><div class="para">
The <code class="code"><releases>
</code> tag contains <code class="code"><release/></code> child tags which describe some metainformation about the current release of the described software. The <code class="code"><release/></code> tag may be present multiple times (for older releases), but a tag for the current version must always be present. A <code class="literal">release</code> tag can have the properties <code class="literal">version</code> and <code class="literal">timestamp</code> which contain the version number and a release timestamp in form of a UNIX epoch.
</div><div class="para">
Examples for a valid releases tag:
</div><pre class="programlisting">
<span class="perl_Keyword"><releases></span>
<span class="perl_Keyword"><release</span><span class="perl_Others"> version=</span><span class="perl_String">"1.2"</span><span class="perl_Others"> timestamp=</span><span class="perl_String">"1397253600"</span> <span class="perl_Keyword">/></span>
<span class="perl_Keyword"><release</span><span class="perl_Others"> version=</span><span class="perl_String">"1.0"</span><span class="perl_Others"> timestamp=</span><span class="perl_String">"1345932000"</span> <span class="perl_Keyword">/></span>
<span class="perl_Keyword"></releases></span>
</pre></dd><dt><a id="tag-provides"></a><span class="term"><provides/></span></dt><dd><div class="para">
The <code class="literal">provides</code> 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 <code class="literal">provides</code> tag.
</div><div class="para">
A <code class="literal">provides</code> 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.
</div><div class="variablelist"><dl class="variablelist"><dt><span class="term"><library/></span></dt><dd><div class="para">
Contains the name of a shared library placed in a publicly accessible library path, such as <code class="filename">/usr/lib</code>, <code class="filename">/usr/lib/<triplet></code> or <code class="filename">/lib</code>. For example, for the libappstream library, the value for <code class="literal">library</code> would be <strong class="userinput"><code>libappstream.so.1</code></strong>.
</div></dd><dt><span class="term"><binary/></span></dt><dd><div class="para">
Name of a binary installed into a location in <code class="envar">PATH</code>.
</div></dd><dt><span class="term"><font/></span></dt><dd><div class="para">
Name of a font provided by this component. For example <strong class="userinput"><code>Linux Libertine O</code></strong>. The tag must have a <code class="literal">file</code> property stating the filename of the referenced font.
</div><div class="para">
Example:
</div><pre class="programlisting"><span class="perl_Keyword"><provides></span>
<span class="perl_Keyword"><font</span><span class="perl_Others"> file=</span><span class="perl_String">"LinLibertine_R.otf"</span><span class="perl_Keyword">></span>Linux Libertine O<span class="perl_Keyword"></font></span>
<span class="perl_Keyword"></provides></span>
</pre></dd><dt><span class="term"><modalias/></span></dt><dd><div class="para">
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.
</div></dd><dt><span class="term"><firmware/></span></dt><dd><div class="para">
Name of the firmware this component provides, to make it possible to find the right firmware package to install for a given kernel driver. The value is the path below /lib/firmware to the firmware file in question, like the firmware value exported from Linux kernel modules.
</div><div class="para">
Example:
</div><pre class="programlisting"><span class="perl_Keyword"><provides></span>
<span class="perl_Keyword"><firmware></span>ipw2200-bss.fw<span class="perl_Keyword"></firmware></span>
<span class="perl_Keyword"></provides></span>
</pre></dd><dt><span class="term"><python2/></span></dt><dd><div class="para">
Name of a Python2 module this component provides.
</div></dd><dt><span class="term"><python3/></span></dt><dd><div class="para">
Name of a Python3 module this component provides.
</div></dd><dt><span class="term"><dbus/></span></dt><dd><div class="para">
Contains the name of a DBus service as property. The type of the service must be specified using the <code class="literal">type</code> property of this tag. Allowed values are <code class="code">session</code> and <code class="code">system</code>.
</div><div class="para">
Example:
</div><pre class="programlisting"><span class="perl_Keyword"><provides></span>
<span class="perl_Keyword"><dbus</span><span class="perl_Others"> type=</span><span class="perl_String">"system"</span><span class="perl_Keyword">></span>org.freedesktop.PackageKit<span class="perl_Keyword"></dbus></span>
<span class="perl_Keyword"></provides></span>
</pre></dd></dl></div></dd><dt><a id="tag-mimetypes"></a><span class="term"><mimetypes/></span></dt><dd><div class="para">
This tag can contain one or more <code class="code"><mimetype/></code> 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:
</div><pre class="programlisting">
<span class="perl_Keyword"><mimetypes></span>
<span class="perl_Keyword"><mimetype></span>text/html<span class="perl_Keyword"></mimetype></span>
<span class="perl_Keyword"><mimetype></span>image/jpeg<span class="perl_Keyword"></mimetype></span>
<span class="perl_Keyword"><mimetype></span>application/rss+xml<span class="perl_Keyword"></mimetype></span>
<span class="perl_Keyword"></mimetypes></span>
</pre></dd><dt><a id="tag-project_group"></a><span class="term"><project_group/></span></dt><dd><div class="para">
If you include the <code class="code"><project_group/></code> 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.
</div><div class="note"><div class="admonition_header"><p><strong>Note</strong></p></div><div class="admonition"><div class="para">
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.
</div></div></div></dd><dt><a id="tag-project_license"></a><span class="term"><project_license/></span></dt><dd><div class="para">
The <code class="code"><project_license/></code> 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 <span class="emphasis"><em>and</em></span> and <span class="emphasis"><em>or</em></span> logic. Possible values include:
<div class="itemizedlist"><ul><li class="listitem"><div class="para">
GPL-2.0
</div></li><li class="listitem"><div class="para">
LGPL-3.0+ and GPL-3.0+
</div></li><li class="listitem"><div class="para">
MIT
</div></li><li class="listitem"><div class="para">
CC-BY-SA-2.0
</div></li><li class="listitem"><div class="para">
...
</div></li></ul></div>
A full list of recognized licenses and their identifiers can be found at the <a href="http://spdx.org/licenses/">SPDX OpenSource License Registry</a>.
</div><div class="para">
Although the <code class="literal">project_license</code> tag is not mandatory, it is recommended to include it.
</div></dd><dt><a id="tag-developer_name"></a><span class="term"><developer_name/></span></dt><dd><div class="para">
The <code class="code"><developer_name/></code> tag is designed to represent the developers or project responsible for development of the project described in the metadata.
</div><div class="para">
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 <a class="xref" href="chap-Metadata.html#tag-url"><url/></a>-tag instead.
</div><div class="para">
This tag is translatable.
</div></dd><dt><a id="tag-screenshots"></a><span class="term"><screenshots/></span></dt><dd><div class="para">
Visual components (like fonts or graphical applications) may choose to add one or multiple screenshots to their metadata.
</div><div class="para">
The <code class="code"><screenshots/></code> tag contains multiple <code class="code"><screenshot/></code> children, where at least one of them must have the property <code class="code">type="default"</code> to indicate the application's primary screenshot. Every <code class="code"><screenshot/></code> tag must have at least one <code class="code"><image/></code> child, which should define the width and height of the referenced image in it's properties. The value of the <code class="code"><image/></code> tag is a direct URL to a screenshot uploaded to a public location on the web.
</div><div class="para">
Optionally, a <code class="code"><screenshot/></code> tag may have a <code class="code"><caption/></code> child, defining a short (not more then 255 characters!) description of what the user can see on the referenced screenshot.
</div><div class="para">
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.
</div></dd><dt><a id="tag-update_contact"></a><span class="term"><update_contact/></span></dt><dd><div class="para">
The <code class="code"><update_contact/></code> 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.
</div><div class="para">
The <code class="code"><update_contact/></code> tag must <span class="emphasis"><em>only be used by distributors</em></span>. It is not included in the distribution-provided AppStream XML file, and therefore not exposed to the end user via any kind of UI.
</div><div class="para">
Upstream authors might decide to add an email address in cleartext, but spam protection using <code class="code">_AT_</code> is also valid.
</div><div class="para">
Example:
</div><pre class="programlisting"><span class="perl_Keyword"><update_contact></span>developer_AT_example.com<span class="perl_Keyword"></update_contact></span>
</pre></dd></dl></div><div class="para">
An example for a very basic component file could look like this:
</div><pre class="programlisting">
<span class="perl_Keyword"><?xml</span> version="1.0" encoding="UTF-8"<span class="perl_Keyword">?></span>
<span class="perl_Keyword"><component></span>
<span class="perl_Keyword"><id></span>foobar<span class="perl_Keyword"></id></span>
<span class="perl_Keyword"><name></span>Foo Bar<span class="perl_Keyword"></name></span>
<span class="perl_Keyword"><summary></span>A foo-ish bar<span class="perl_Keyword"></summary></span>
<span class="perl_Keyword"><url</span><span class="perl_Others"> type=</span><span class="perl_String">"homepage"</span><span class="perl_Keyword">></span>http://www.example.org<span class="perl_Keyword"></url></span>
<span class="perl_Keyword"><metadata_license></span>CC0<span class="perl_Keyword"></metadata_license></span>
<span class="perl_Keyword"><provides></span>
<span class="perl_Keyword"><library></span>libfoobar.so.2<span class="perl_Keyword"></library></span>
<span class="perl_Keyword"><font></span>foo.ttf<span class="perl_Keyword"></font></span>
<span class="perl_Keyword"><binary></span>foobar<span class="perl_Keyword"></binary></span>
<span class="perl_Keyword"></provides></span>
<span class="perl_Keyword"><releases></span>
<span class="perl_Keyword"><release</span><span class="perl_Others"> version=</span><span class="perl_String">"1.2"</span><span class="perl_Others"> timestamp=</span><span class="perl_String">"1365768000"</span> <span class="perl_Keyword">/></span>
<span class="perl_Keyword"></releases></span>
<span class="perl_Keyword"><developer_name></span>FooBar Team<span class="perl_Keyword"></developer_name></span>
<span class="perl_Keyword"></component></span>
</pre></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="chap-AppStream-About.html"><strong>Prev</strong>Chapter 1. About AppStream</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="sect-Metadata-Application.html"><strong>Next</strong>2.2. Desktop Applications</a></li></ul></body></html>
|