From 6da0d61f07b315c37583d787fcdb1cac21daf300 Mon Sep 17 00:00:00 2001 From: Mike Fleetwood Date: Wed, 24 Jan 2024 16:12:06 +0000 Subject: [PATCH] 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) https://gitlab.gnome.org/GNOME/gnome-system-monitor/-/commit/43dc0577712a6cd0979e4d85ec5196d507bd6e80 [5] [Evince] build: Install appstream metadata to non-deprecated location https://gitlab.gnome.org/GNOME/evince/-/commit/8cae24ea48deafc85265ce42adecb55aa2b57a6f Closes #241 - Move appstream metadata out of legacy path --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index f7074b2e..d9f58631 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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)