File umu-launcher.spec of Package umu-launcher

#
# spec file for package umu-launcher
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%global apparmor_profile_name bwrap-userns-restrict
%if %{pkg_vcmp apparmor-profiles >= 4}
%bcond_with    apparmor4
%else
%bcond_with    apparmor4
%endif
Name:           umu-launcher
Version:        1.1.2
Release:        0
Summary:        A tool for launching non-steam games with proton
License:        GPL-3.0-only
URL:            https://github.com/Open-Wine-Components/umu-launcher
Source0:        %{name}-%{version}.tar.zst
Source1:        _service
Source2:        _servicedata
Source3:        umu-launcher.obsinfo
Source4:        series
Patch1:         no-git-for-version.patch
BuildRequires:  %{primary_python}-build
BuildRequires:  %{primary_python}-devel
BuildRequires:  %{primary_python}-filelock
BuildRequires:  %{primary_python}-hatchling
BuildRequires:  %{primary_python}-installer
BuildRequires:  %{primary_python}-xlib
BuildRequires:  apparmor-profiles
BuildRequires:  apparmor-rpm-macros
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  man
BuildRequires:  meson >= 0.54.0
BuildRequires:  ninja
BuildRequires:  python-rpm-macros
BuildRequires:  python3
BuildRequires:  scdoc
BuildRequires:  zstd
Requires:       %{primary_python}
Requires:       %{primary_python}-filelock
Requires:       %{primary_python}-xlib
%if %{with apparmor4}
Requires:       apparmor-profiles
%endif
BuildArch:      noarch

%description
This is a unified launcher for Windows games on Linux. It is essentially a copy
of the Steam Runtime Tools and Steam Linux Runtime that Valve uses for Proton,
with some modifications made so that it can be used outside of Steam.

%prep
%autosetup -p1

%build
./configure.sh --prefix=%{_prefix}
%make_build UMU_VERSION=%{version}

%install
%make_install PYTHONDIR=%{python3_sitelib} UMU_VERSION=%{version}
%{python3_fix_shebang}
%python3_fix_shebang_path %{buildroot}%{python3_sitelib}/umu/umu_run.py

%if %{with apparmor4}
# install -D -m 0644 packaging/deb/debian/apparmor/bwrap %{buildroot}%{apparmor_profilesdir}/%{apparmor_profile_name}
install -D -d -m 0755 %{buildroot}%{apparmor_profilesdir}/
ln -s /usr/share/apparmor/extra-profiles/bwrap-userns-restrict %{buildroot}%{apparmor_profilesdir}/%{apparmor_profile_name}

%pre
%apparmor_reload %{apparmor_profilesdir}/%{apparmor_profile_name}
%endif

%files
%license LICENSE
%doc README.md
%if %{with apparmor4}
%config %{apparmor_profilesdir}/%{apparmor_profile_name}
%endif
%{_bindir}/umu-run
%{_mandir}/man*/umu*
%{python3_sitelib}/umu/
%{python3_sitelib}/umu_launcher-%{version}.dist-info
# TODO: should ensure it uses the same values as the steam package?
%dir %{_datadir}/steam/
%dir %{_datadir}/steam/compatibilitytools.d/
#/ TODO
%{_datadir}/steam/compatibilitytools.d/umu-launcher/

%changelog
openSUSE Build Service is sponsored by