| |
@@ -1,15 +1,15 @@
|
| |
= Packaging Guidelines for AppData Files
|
| |
- :last-reviewed: 2019-01-17
|
| |
+ :last-reviewed: 2021-01-18
|
| |
:toc:
|
| |
|
| |
If a package contains a GUI application,
|
| |
- then it SHOULD install a `+.appdata.xml+` file
|
| |
+ then it SHOULD install a `+.metainfo.xml+` file
|
| |
into `+%{_metainfodir}+`.
|
| |
- Installed `+.appdata.xml+` files MUST follow
|
| |
- the http://people.freedesktop.org/~hughsient/appdata/[AppData specification page].
|
| |
+ Installed `+.metainfo.xml+` files MUST follow
|
| |
+ the https://www.freedesktop.org/software/appstream/docs/chap-Quickstart.html#sect-Quickstart-DesktopApps[AppStream specification page].
|
| |
|
| |
If a package contains an add-on for GUI application,
|
| |
- then it SHOULD also install a `+.metainfo.xml+` file
|
| |
+ then it SHOULD install a `+.metainfo.xml+` file
|
| |
into `+%{_metainfodir}+`.
|
| |
Installed `+.metainfo.xml+` files MUST follow
|
| |
the http://www.freedesktop.org/software/appstream/docs/sect-Quickstart-Addons.html[AppStream add-ons specification].
|
| |
@@ -17,10 +17,15 @@
|
| |
The AppData files MUST correctly validate using
|
| |
`+appstream-util validate-relax+`.
|
| |
|
| |
- == .appdata.xml file creation
|
| |
+ .appdata.xml files
|
| |
+ NOTE: For historical reasons, AppStream specification also allows using
|
| |
+ extension `+.appdata.xml+` for GUI applications. If upstream provides metadata
|
| |
+ with `+.appdata.xml+` extension, it MAY be used instead of `+.metainfo.xml+`.
|
| |
+
|
| |
+ == .metainfo.xml file creation
|
| |
|
| |
If the package doesn't already include and install
|
| |
- its own `+.appdata.xml+` file,
|
| |
+ its own `+.metainfo.xml+` file,
|
| |
you can make your own and send it upstream.
|
| |
Some benefits of sending the file upstream are that
|
| |
upstream can translate the file using
|
| |
@@ -28,36 +33,28 @@
|
| |
and can also modify the screenshots and descriptions
|
| |
as the application changes over time.
|
| |
|
| |
- You may include an `+.appdata.xml+` file you create
|
| |
- as a Source: (e.g. `+Source3: %{name}.appdata.xml+`)
|
| |
+ You may include an `+.metainfo.xml+` file you create
|
| |
+ as a Source: (e.g. `+Source3: %{name}.metainfo.xml+`)
|
| |
or generate it in the spec file.
|
| |
|
| |
- Here is the contents of a sample `+.appdata.xml+` file
|
| |
- (comical.appdata.xml):
|
| |
+ Here are the contents of a sample application `+.metainfo.xml+` file
|
| |
+ (comical.metainfo.xml):
|
| |
|
| |
[source,xml]
|
| |
----
|
| |
- include::{examplesdir}/appdata.xml[]
|
| |
+ include::{examplesdir}/app.metainfo.xml[]
|
| |
----
|
| |
|
| |
- The AppData file MUST be named with the same root as the .desktop file,
|
| |
+ Application's AppData file MUST be named with the same root as the .desktop file,
|
| |
so if the .desktop file is named `+org.gnome.SomeApp.desktop+`
|
| |
- then the AppData file MUST be called `+org.gnome.SomeApp.appdata.xml+`.
|
| |
+ then the AppData file MUST be called `+org.gnome.SomeApp.metainfo.xml+`.
|
| |
|
| |
- == .metainfo.xml file creation
|
| |
-
|
| |
- If the add-on package doesn't already include and install
|
| |
- its own `+.metainfo.xml+` file,
|
| |
- you can make your own and send it upstream.
|
| |
- You can do this by including a `+.metainfo.xml+` file you create
|
| |
- as a Source: (e.g. `+Source4: %{name}.metainfo.xml+`)
|
| |
- or generating it in the spec file.
|
| |
- Here is the contents of a sample `+.metainfo.xml+` file
|
| |
+ Here are the contents of a sample addon `+.metainfo.xml+` file
|
| |
(gedit-bookmarks.metainfo.xml):
|
| |
|
| |
[source,xml]
|
| |
....
|
| |
- include::{examplesdir}/metainfo.xml[]
|
| |
+ include::{examplesdir}/addon.metainfo.xml[]
|
| |
....
|
| |
|
| |
You can use anything as the `+<id>+`
|
| |
@@ -66,8 +63,7 @@
|
| |
|
| |
== app-data-validate usage
|
| |
|
| |
- Although you can just include the .appdata.xml
|
| |
- or .metainfo.xml files in the package,
|
| |
+ Although you can just include the .metainfo.xml file in the package,
|
| |
you MUST run `+appstream-util validate-relax+`
|
| |
(in `+%check+` or `+%install+`)
|
| |
and have `+BuildRequires: libappstream-glib+`,
|
| |
@@ -76,5 +72,5 @@
|
| |
An example:
|
| |
|
| |
....
|
| |
- appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/*.appdata.xml
|
| |
+ appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/*.metainfo.xml
|
| |
....
|
| |
Current AppStream documentation instructs saving all AppStream metainfo with file extension metainfo.xml and mentions appdata.xml only as historical (though supported) format. Since metainfo.xml is now preferred, Fedora should use it for all AppData.
Using only metainfo.xml extension also makes the guidelines somewhat simpler, since less duplication is needed to cover two file extensions.
Relevant discussion:
1. https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/HYLVPAHS5WS5QZIDLTAXLT3XFH6SUBS2/
2. https://pagure.io/packaging-committee/issue/944
3. https://lists.fedoraproject.org/archives/list/packaging@lists.fedoraproject.org/thread/TPJPRPTGXNPK3R3BYGDVF3H3UNOR45J2/