Install AppStream file into ${datadir}/metainfo (#241)

AppData files always were a subset of the AppStream specification
[1][2].  AppStream 0.12 specification [3] onwards says the metainfo
files will be found when placed in /usr/share/metainfo/ *AND* that
/usr/share/appdata/ is a legacy location *AND* a future release of
AppStream will likely drop support for it [4].

Debian 10, RHEL 7 and Ubuntu 18.04 LTS distributions all have the
/usr/share/metainfo/ directory containing application .appdata.xml and
.metainfo.xml files.  Ubuntu 16.04 LTS does not have the directory
despite the AppStream specification [3] claiming it does.  As old
supported distributions do have the directory, unconditionally update
this.

For reference are these commits in projects GNOME System Monitor [4] and
Evince [5] from 2017 making the same change.

[1] AppData Specification [circa 2016]
    https://web.archive.org/web/20160903181519/https://people.freedesktop.org/~hughsient/appdata/
    "Rather than create a new schema from scratch, we'll be using a
    subset of the AppStream metadata proposal.

    Applications wishing to have long descriptions, screenshots and
    other useful things are required to ship one or more files in
    /usr/share/appdata/%{id}.appdata.xml.
    "
[2] AppStream 0.4, 2.2 AppData XML files [circa 2013]
    https://web.archive.org/web/20131204004054/http://www.freedesktop.org/software/appstream/docs/sect-AppStream-Metadata-AppData.html
[3] AppStream 0.12, 2.1.2 Filesystem locations [circa 2020]
    https://web.archive.org/web/20200615042130/https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#spec-component-location
    "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
    Component metadata of type desktop-application as described in
    Section 2.2, "Desktop Applications" can be installed with an
    .appdata.xml extension as well for historical reasons.  AppStream
    implementations will read the XML files as long as they end up in
    the right location on the filesystem.

    (!) Important: Legacy Path
    AppStream tools scan the /usr/share/appdata/ path for legacy
    compatibility as well.  It should not be used anymore by new
    software though, even on older Linux distributions (like RHEL 7 and
    Ubuntu 16.04 LTS) the metainfo path is well supported.  Support for
    the legacy path will likely be dropped completely with a future
    AppStream 1.0 release.
    "
[4] [GNOME System Monitor] Install appdata to the new location
    (bgo#790146)
    43dc057771
[5] [Evince] build: Install appstream metadata to non-deprecated
    location
    8cae24ea48

Closes #241 - Move appstream metadata out of legacy path
This commit is contained in:
Mike Fleetwood 2024-01-24 16:12:06 +00:00 committed by Curtis Gedak
parent b602a73e59
commit 6da0d61f07
1 changed files with 1 additions and 1 deletions

View File

@ -18,7 +18,7 @@ $(DESKTOP_FILES): $(DESKTOP_IN_FILES)
APPDATA_IN_FILES = gparted.appdata.xml.in
APPDATA_FILES =$(APPDATA_IN_FILES:.xml.in=.xml)
appdatadir = $(datadir)/appdata
appdatadir = $(datadir)/metainfo
appdata_DATA = $(APPDATA_FILES)
$(APPDATA_FILES): $(APPDATA_IN_FILES)