From 664a298a51e0ce435323aa3065c4325d47cb0685 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Thu, 12 Oct 2023 20:06:57 -0400 Subject: [PATCH] Adapt flatpak conditionals for F39 Through Fedora 38, flatpaks were built as modules, which each Tracker-based app having their own build of tracker-miners with domain_ontology properly defined. As of Fedora 39, all /app builds use a common tag, and therefore there is only one tracker-miners build. Therefore, use a dummy app name (which must be different than org.freedesktop in order to trigger installation of the custom domain rule), and a script to handle the renaming which will need to be run during cleanup-commands in each app's container.yaml. --- flatpak-fixup.sh | 13 +++++++++++++ tracker-miners.spec | 15 +++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100755 flatpak-fixup.sh diff --git a/flatpak-fixup.sh b/flatpak-fixup.sh new file mode 100755 index 0000000..e58de1d --- /dev/null +++ b/flatpak-fixup.sh @@ -0,0 +1,13 @@ +#! /bin/sh + +set -eu + +app=$1 + +for srv in Extract Files Files.Control; do + sed -e "s|org.gnome.FlatpakApp|${app}|" -i /app/share/dbus-1/services/org.gnome.FlatpakApp.Tracker3.Miner.$srv.service ; + mv /app/share/dbus-1/services/{org.gnome.FlatpakApp,${app}}.Tracker3.Miner.$srv.service ; +done + +sed -e "s|org.gnome.FlatpakApp|${app}|" -i /app/share/tracker3/domain-ontologies/org.gnome.FlatpakApp.domain.rule +mv /app/share/tracker3/domain-ontologies/{org.gnome.FlatpakApp,${app}}.domain.rule diff --git a/tracker-miners.spec b/tracker-miners.spec index 87750c9..b7ae898 100644 --- a/tracker-miners.spec +++ b/tracker-miners.spec @@ -1,6 +1,11 @@ # This needs to be changed accordingly to the application for what tracker-miners is bundled, -# e.g. for gnome-books, it would be org.gnome.Books -%{!?domain_ontology: %global domain_ontology org.freedesktop} +# e.g. for gnome-books, it would be org.gnome.Books. For F39+ flatpaks, this is done +# in container.yaml cleanup-commands. +%if 0%{?flatpak} +%global domain_ontology org.gnome.FlatpakApp +%else +%global domain_ontology org.freedesktop +%endif %if 0%{?rhel} || 0%{?flatpak} %global with_enca 0 @@ -35,6 +40,7 @@ Summary: Tracker miners and metadata extractors License: GPL-2.0-or-later AND LGPL-2.1-or-later URL: https://gnome.pages.gitlab.gnome.org/tracker/ Source0: https://download.gnome.org/sources/%{name}/3.6/%{name}-%{tarball_version}.tar.xz +Source1: flatpak-fixup.sh BuildRequires: asciidoc BuildRequires: gcc @@ -127,6 +133,10 @@ This package contains various miners and metadata extractors for tracker. %install %meson_install +%if 0%{?flatpak} +install -D -m 0755 %{SOURCE1} %{buildroot}%{_bindir}/%{name}-flatpak-fixup.sh +%endif + %find_lang tracker3-miners @@ -160,6 +170,7 @@ This package contains various miners and metadata extractors for tracker. %endif %if 0%{?flatpak} %{_datadir}/tracker3/domain-ontologies/%{domain_ontology}.domain.rule +%{_bindir}/%{name}-flatpak-fixup.sh %endif