From 7a17fb4808503cb65e60b30b4e061276ad7c0f3f Mon Sep 17 00:00:00 2001
From: importbot <releng@rockylinux.org>
Date: Fri, 7 Mar 2025 19:10:54 +0000
Subject: [PATCH] import gnome-kiosk-47.0-8.el10

---
 ...search-app-Add-systemd-session-files.patch | 68 +++++++++++++++++++
 ...-search-app-Use-firefox-from-flatpak.patch | 26 +++++--
 ...h-app-Update-desktop-file-definition.patch | 32 +++++++++
 SPECS/gnome-kiosk.spec                        | 23 +++++--
 4 files changed, 135 insertions(+), 14 deletions(-)
 create mode 100644 SOURCES/0001-search-app-Add-systemd-session-files.patch
 create mode 100644 SOURCES/0002-search-app-Update-desktop-file-definition.patch

diff --git a/SOURCES/0001-search-app-Add-systemd-session-files.patch b/SOURCES/0001-search-app-Add-systemd-session-files.patch
new file mode 100644
index 0000000..c849397
--- /dev/null
+++ b/SOURCES/0001-search-app-Add-systemd-session-files.patch
@@ -0,0 +1,68 @@
+From fea0d74ff155f05e9f1e8e0351562af6c7c15b3c Mon Sep 17 00:00:00 2001
+From: Olivier Fourdan <ofourdan@redhat.com>
+Date: Tue, 4 Mar 2025 16:21:30 +0100
+Subject: [PATCH 1/2] search-app: Add systemd session files
+
+The search appliance session would fail to start as a systemd session.
+
+Add the required systemd plumbing to fix the search appliance session.
+
+Part-of: <https://gitlab.gnome.org/GNOME/gnome-kiosk/-/merge_requests/66>
+
+(cherry picked from commit a40ac8d8dc132d9c94506419158ec4034eaaf2c8)
+---
+ meson.build                                          | 12 ++++++++++++
+ .../systemd/org.gnome.Kiosk.SearchApp.service.in     |  8 ++++++++
+ search-app/systemd/session.conf                      |  3 +++
+ 3 files changed, 23 insertions(+)
+ create mode 100644 search-app/systemd/org.gnome.Kiosk.SearchApp.service.in
+ create mode 100644 search-app/systemd/session.conf
+
+diff --git a/meson.build b/meson.build
+index fb9a76d..2024b76 100644
+--- a/meson.build
++++ b/meson.build
+@@ -350,5 +350,17 @@ i18n.merge_file(
+         type: 'desktop'
+ )
+ 
++configure_file(
++       input: 'search-app/systemd/org.gnome.Kiosk.SearchApp.service.in',
++       output: '@BASENAME@',
++       configuration: systemd_service_config_data,
++       install_dir: systemd_user_unit_dir
++)
++
++kiosk_search_appliance_systemd_target_dir = join_paths(systemd_user_unit_dir, 'gnome-session@org.gnome.Kiosk.SearchApp.target.d')
++install_data('search-app/systemd/session.conf',
++        install_dir: kiosk_search_appliance_systemd_target_dir
++)
++
+ test('check-format', find_program('scripts/check-format.sh'))
+ 
+diff --git a/search-app/systemd/org.gnome.Kiosk.SearchApp.service.in b/search-app/systemd/org.gnome.Kiosk.SearchApp.service.in
+new file mode 100644
+index 0000000..29ddcd8
+--- /dev/null
++++ b/search-app/systemd/org.gnome.Kiosk.SearchApp.service.in
+@@ -0,0 +1,8 @@
++[Unit]
++Description=Kiosk Search Appliance
++BindsTo=gnome-session.target
++After=gnome-session.target
++
++[Service]
++ExecStart=@bindir@/firefox --kiosk --private-window --new-instance  https://www.google.com
++Restart=always
+diff --git a/search-app/systemd/session.conf b/search-app/systemd/session.conf
+new file mode 100644
+index 0000000..1ab41da
+--- /dev/null
++++ b/search-app/systemd/session.conf
+@@ -0,0 +1,3 @@
++[Unit]
++Requires=org.gnome.Kiosk.target
++Requires=org.gnome.Kiosk.SearchApp.service
+-- 
+2.48.1
+
diff --git a/SOURCES/0001-search-app-Use-firefox-from-flatpak.patch b/SOURCES/0001-search-app-Use-firefox-from-flatpak.patch
index d9a9c95..e206d7c 100644
--- a/SOURCES/0001-search-app-Use-firefox-from-flatpak.patch
+++ b/SOURCES/0001-search-app-Use-firefox-from-flatpak.patch
@@ -1,4 +1,4 @@
-From fb932adc99bb0b73567674ff905782a642b9b12e Mon Sep 17 00:00:00 2001
+From bad81e556eca3acad1b97f6dbc00f3788e24d25f Mon Sep 17 00:00:00 2001
 From: Olivier Fourdan <ofourdan@redhat.com>
 Date: Thu, 12 Dec 2024 14:05:04 +0100
 Subject: [PATCH] search-app: Use firefox from flatpak
@@ -8,11 +8,12 @@ appliance to use flatpak instead of invoking firefox directly.
 
 https://issues.redhat.com/browse/RHEL-36521
 ---
- search-app/org.gnome.Kiosk.SearchApp.desktop.in.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ search-app/org.gnome.Kiosk.SearchApp.desktop.in.in      | 2 +-
+ search-app/systemd/org.gnome.Kiosk.SearchApp.service.in | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/search-app/org.gnome.Kiosk.SearchApp.desktop.in.in b/search-app/org.gnome.Kiosk.SearchApp.desktop.in.in
-index 360e6df..4416353 100644
+index 478b328..ad142b8 100644
 --- a/search-app/org.gnome.Kiosk.SearchApp.desktop.in.in
 +++ b/search-app/org.gnome.Kiosk.SearchApp.desktop.in.in
 @@ -2,7 +2,7 @@
@@ -21,9 +22,20 @@ index 360e6df..4416353 100644
  Comment=Sample Search Appliance Application for GNOME Kiosk
 -Exec=@bindir@/firefox --kiosk --private-window --new-instance  https://www.google.com
 +Exec=@bindir@/flatpak run --command=firefox --file-forwarding org.mozilla.firefox --kiosk --private-window --new-instance https://www.google.com
- Categories=GNOME;GTK;Core;
- OnlyShowIn=GNOME;
+ Categories=Core;System;
  NoDisplay=true
+ X-GNOME-HiddenUnderSystemd=true
+diff --git a/search-app/systemd/org.gnome.Kiosk.SearchApp.service.in b/search-app/systemd/org.gnome.Kiosk.SearchApp.service.in
+index 29ddcd8..d4f5d0f 100644
+--- a/search-app/systemd/org.gnome.Kiosk.SearchApp.service.in
++++ b/search-app/systemd/org.gnome.Kiosk.SearchApp.service.in
+@@ -4,5 +4,5 @@ BindsTo=gnome-session.target
+ After=gnome-session.target
+ 
+ [Service]
+-ExecStart=@bindir@/firefox --kiosk --private-window --new-instance  https://www.google.com
++ExecStart=@bindir@/flatpak run --command=firefox --file-forwarding org.mozilla.firefox --kiosk --private-window --new-instance https://www.google.com
+ Restart=always
 -- 
-2.47.1
+2.48.1
 
diff --git a/SOURCES/0002-search-app-Update-desktop-file-definition.patch b/SOURCES/0002-search-app-Update-desktop-file-definition.patch
new file mode 100644
index 0000000..95be95f
--- /dev/null
+++ b/SOURCES/0002-search-app-Update-desktop-file-definition.patch
@@ -0,0 +1,32 @@
+From 30d48384d2b98dc6ba9534ef41ce445f6da41d7f Mon Sep 17 00:00:00 2001
+From: Olivier Fourdan <ofourdan@redhat.com>
+Date: Wed, 5 Mar 2025 14:23:49 +0100
+Subject: [PATCH 2/2] search-app: Update desktop file definition
+
+Firefox itself has nothing to do with neither Gtk or GNOME, no need to
+list those in the categories.
+
+Part-of: <https://gitlab.gnome.org/GNOME/gnome-kiosk/-/merge_requests/66>
+
+(cherry picked from commit 5441999573a07c3513eeda5150683448bdd71c50)
+---
+ search-app/org.gnome.Kiosk.SearchApp.desktop.in.in | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/search-app/org.gnome.Kiosk.SearchApp.desktop.in.in b/search-app/org.gnome.Kiosk.SearchApp.desktop.in.in
+index 360e6df..478b328 100644
+--- a/search-app/org.gnome.Kiosk.SearchApp.desktop.in.in
++++ b/search-app/org.gnome.Kiosk.SearchApp.desktop.in.in
+@@ -3,7 +3,6 @@ Type=Application
+ Name=Search Appliance
+ Comment=Sample Search Appliance Application for GNOME Kiosk
+ Exec=@bindir@/firefox --kiosk --private-window --new-instance  https://www.google.com
+-Categories=GNOME;GTK;Core;
+-OnlyShowIn=GNOME;
++Categories=Core;System;
+ NoDisplay=true
+-X-GNOME-AutoRestart=true
++X-GNOME-HiddenUnderSystemd=true
+-- 
+2.48.1
+
diff --git a/SPECS/gnome-kiosk.spec b/SPECS/gnome-kiosk.spec
index 85177fd..3e8acdf 100644
--- a/SPECS/gnome-kiosk.spec
+++ b/SPECS/gnome-kiosk.spec
@@ -2,7 +2,7 @@
 ## (rpmautospec version 0.7.3)
 ## RPMAUTOSPEC: autorelease, autochangelog
 %define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
-    release_number = 7;
+    release_number = 8;
     base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
     print(release_number + base_release_number - 1);
 }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
@@ -51,14 +51,18 @@ BuildRequires:  pkgconfig(gdk-pixbuf-2.0)
 Requires:       gnome-settings-daemon%{?_isa} >= %{gnome_settings_daemon_version}
 Requires:       gsettings-desktop-schemas%{?_isa} >= %{gsettings_desktop_schemas_version}
 
-Patch0: 0001-kiosk-app-Do-not-add-the-window-in-kiosk_app_new_for.patch
-# https://issues.redhat.com/browse/RHEL-36521
-Patch1: 0001-search-app-Use-firefox-from-flatpak.patch
+Patch: 0001-kiosk-app-Do-not-add-the-window-in-kiosk_app_new_for.patch
 # https://issues.redhat.com/browse/RHEL-71757
-Patch2: 0001-kiosk-script-Copy-and-run-the-script-from-XDG_RUNTIM.patch
+Patch: 0001-kiosk-script-Copy-and-run-the-script-from-XDG_RUNTIM.patch
 # https://issues.redhat.com/browse/RHEL-62420
-Patch3: 0001-compositor-Add-screenshot-utilities.patch
-Patch4: 0002-compositor-Add-Shell-Screenshot-support.patch
+Patch: 0001-compositor-Add-screenshot-utilities.patch
+Patch: 0002-compositor-Add-Shell-Screenshot-support.patch
+# https://issues.redhat.com/browse/RHEL-82250
+# https://issues.redhat.com/browse/RHEL-82404
+Patch: 0001-search-app-Add-systemd-session-files.patch
+Patch: 0002-search-app-Update-desktop-file-definition.patch
+# https://issues.redhat.com/browse/RHEL-36521
+Patch: 0001-search-app-Use-firefox-from-flatpak.patch
 
 %description
 GNOME Kiosk provides a desktop enviroment suitable for fixed purpose, or
@@ -111,6 +115,8 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.gnome.Kiosk.Searc
 %{_userunitdir}/org.gnome.Kiosk@x11.service
 
 %files -n gnome-kiosk-search-appliance
+%{_userunitdir}/gnome-session@org.gnome.Kiosk.SearchApp.target.d/session.conf
+%{_userunitdir}/org.gnome.Kiosk.SearchApp.service
 %{_datadir}/applications/org.gnome.Kiosk.SearchApp.desktop
 %{_datadir}/gnome-session/sessions/org.gnome.Kiosk.SearchApp.session
 %{_datadir}/xsessions/org.gnome.Kiosk.SearchApp.Session.desktop
@@ -127,6 +133,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.gnome.Kiosk.Searc
 
 %changelog
 ## START: Generated by rpmautospec
+* Thu Mar 06 2025 Olivier Fourdan <ofourdan@redhat.com> - 47.0-8
+- search-app: Add systemd session files
+
 * Thu Feb 13 2025 Olivier Fourdan <ofourdan@redhat.com> - 47.0-7
 - Enable screenshots support
 
-- 
GitLab