From 9a62c2463ba70770945fa3111681be068da9aa5e4c62c338a98a72c817965d5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Lie?= Date: Tue, 9 Jul 2019 06:29:01 +0000 Subject: [PATCH] Accepting request 714087 from home:dimstar:Factory - Add system-user-flatpak.conf: generate a flatpak user for the system helper (boo#1137537). OBS-URL: https://build.opensuse.org/request/show/714087 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/flatpak?expand=0&rev=84 --- flatpak.changes | 6 ++++++ flatpak.spec | 23 ++++++++++++++++++++++- system-user-flatpak.conf | 4 ++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 system-user-flatpak.conf diff --git a/flatpak.changes b/flatpak.changes index 025967e..046d474 100644 --- a/flatpak.changes +++ b/flatpak.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Jul 8 12:53:30 UTC 2019 - Dominique Leuenberger + +- Add system-user-flatpak.conf: generate a flatpak user for the + system helper (boo#1137537). + ------------------------------------------------------------------- Wed Jul 3 08:27:20 UTC 2019 - Antonio Larrosa diff --git a/flatpak.spec b/flatpak.spec index 3194701..86b09ce 100644 --- a/flatpak.spec +++ b/flatpak.spec @@ -38,7 +38,8 @@ Summary: OSTree based application bundles management License: LGPL-2.1-or-later Group: System/Packages URL: https://flatpak.github.io/ -Source: %{name}-%{version}.tar.xz +Source0: %{name}-%{version}.tar.xz +Source1: system-user-flatpak.conf Patch0: polkit_rules_usability.patch BuildRequires: bison BuildRequires: bubblewrap >= 0.2.1 @@ -50,6 +51,7 @@ BuildRequires: libdwarf-devel BuildRequires: libgpgme-devel >= 1.1.8 BuildRequires: libtool BuildRequires: pkgconfig +BuildRequires: sysuser-tools BuildRequires: xsltproc BuildRequires: pkgconfig(appstream-glib) BuildRequires: pkgconfig(dconf) @@ -72,6 +74,7 @@ Requires: %{libname} = %{version} Requires: bubblewrap >= 0.2.1 Requires: ostree >= 2018.7 Requires: xdg-desktop-portal >= 0.10 +Requires: user(flatpak) Recommends: %{name}-lang = %{version} # Remove after openSUSE Leap 42 is out of scope Provides: xdg-app = %{version} @@ -83,6 +86,15 @@ flatpak is a system for building, distributing and running sandboxed desktop applications on Linux. See https://wiki.gnome.org/Projects/SandboxedApps for more information. +%package -n system-user-flatpak +Summary: System user for the flatpak system helper +Group: System/Base +%sysusers_requires + +%description -n system-user-flatpak +System user for the flatpak system helper. + + %package -n %{libname} Summary: OSTree based application bundle management library Group: System/Libraries @@ -146,6 +158,7 @@ NOCONFIGURE=1 ./autogen.sh --with-priv-mode=none \ --with-dbus-config-dir=%{_dbusconfigdir} make %{?_smp_mflags} +%sysusers_generate_pre %{SOURCE1} system-user-flatpak %install %make_install @@ -159,12 +172,17 @@ ln -s service %{buildroot}%{_sbindir}/rcflatpak-system-helper # w/o password entry. mv %{buildroot}/%{_datadir}/polkit-1/rules.d/{,60-}org.freedesktop.Flatpak.rules +mkdir -p %{buildroot}%{_sysusersdir} +install -m 644 %{SOURCE1} %{buildroot}%{_sysusersdir}/system-user-flatpak.conf + %if !%{support_environment_generators} rm -Rf %{buildroot}%{_libexecdir}/systemd/user-environment-generators/ %endif %find_lang %{name} +%pre -n system-user-flatpak -f system-user-flatpak.pre + %post -n %{libname} -p /sbin/ldconfig %postun -n %{libname} -p /sbin/ldconfig %pre @@ -225,6 +243,9 @@ rm -Rf %{buildroot}%{_libexecdir}/systemd/user-environment-generators/ %{_libexecdir}/systemd/user-environment-generators/60-flatpak %endif +%files -n system-user-flatpak +%{_sysusersdir}/system-user-flatpak.conf + %files -n %{libname} %{_libdir}/libflatpak.so.* diff --git a/system-user-flatpak.conf b/system-user-flatpak.conf new file mode 100644 index 0000000..26b0ca9 --- /dev/null +++ b/system-user-flatpak.conf @@ -0,0 +1,4 @@ +# Type Name ID GECOS [HOME] + +u flatpak - "User for flatpak system helper" +