File legendary.spec of Package legendary

#
# spec file for package legendary
#
# Copyright (c) 2022 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/
#

%define skip_python38 1

%if 0%{?suse_version} > 1500
%bcond_without libalternatives
%else
%bcond_with libalternatives
%endif

Name:           legendary
Version:        0.20.31
Release:        0
Summary:        Free and open-source replacement for the Epic Games Launcher application
License:        GPL-3.0
URL:            https://github.com/derrod/legendary
Source:         %{name}-%{version}.tar.xz
BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module setuptools}
# SECTION test requirements
BuildRequires:  %{python_module requests < 3.0}
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module wheel}
# /SECTION
BuildRequires:  fdupes
Requires:       python-requests < 3.0
Requires:       python-setuptools
Requires:       python-wheel
Requires:       python-filelock
Suggests:       python-pywebview >= 3.4
Suggests:       python-PyGObject
%if %{with libalternatives}
Requires:       alts
BuildRequires:  alts
%else
Requires(post): update-alternatives
Requires(postun):update-alternatives
%endif
BuildArch:      noarch
%python_subpackages


%description
Legendary is an open-source game launcher that can download and install games from the Epic Games platform on Linux, macOS, and Windows.

%prep
%setup -q -n legendary-%{version}

%build
%python_build

%install
%python_install
%python_clone -a %{buildroot}%{_bindir}/legendary
%python_expand %fdupes %{buildroot}%{$python_sitelib}

%post
%python_install_alternative legendary

%postun
%python_uninstall_alternative legendary

%files %{python_files}
%doc README.md
%license LICENSE
%python_alternative %{_bindir}/legendary
%{python_sitelib}/legendary
%{python_sitelib}/legendary_gl-*-info

%changelog
openSUSE Build Service is sponsored by