File protonup-qt.spec of Package protonup-qt

%{?sle15_python_module_pythons}
%define skip_python310 1
%define skip_python311 1
%define skip_python312 1

Name:          protonup-qt
Version:       2.14.0
Release:       0
Url:           https://github.com/DavidoTek/ProtonUp-Qt/
Summary:       Install and manage Proton-GE for Steam
Group:         System/GUI/Qt
License:       GPL-3.0
Source0:       %{name}-%{version}.tar.xz
Source1:       %{name}.png
BuildArch:     noarch
BuildRequires: desktop-file-utils
BuildRequires: hicolor-icon-theme
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module wheel}
BuildRequires: %{python_module py >= 1.4}
BuildRequires: python-rpm-macros
BuildRequires: fdupes
Requires:      %{python_module PySide6-Essentials}
Requires:      %{python_module pyxdg}
Requires:      %{python_module zstandard}
Requires:      %{python_module vdf}
Requires:      %{python_module inputs}
Requires:      %{python_module PyYAML}
Requires:      %{python_module steam}
Requires:      %{python_module requests}
BuildRoot:     %{_tmppath}/%{name}-%{version}-build

%description
Install and manage Proton-GE and Luxtorpeda for Steam and Wine-GE for Lutris with this graphical user interface.
Based on AUNaseef's ProtonUp, made with Python 3 and Qt 6.

%prep
%autosetup -n %{name}-%{version}

%build
%pyproject_wheel

%install
%pyproject_install

# Remove problematic bytecode to avoid mtime issues
find %{buildroot} -type f -name "*.pyc" -delete
find %{buildroot} -type d -name "__pycache__" -exec rmdir {} + 2>/dev/null || :

mkdir -p %{buildroot}/%{_datadir}/pixmaps/
install -D -m 644 %{SOURCE1} %{buildroot}/%{_datadir}/pixmaps/%{name}.png

mkdir -p %{buildroot}/%{_datadir}/applications/

# Create .desktop file
cat > %{buildroot}/%{_datadir}/applications/%{name}.desktop << EOM
[Desktop Entry]
Type=Application
Name=ProtonUp-Qt
GenericName=Install and manage GE-Proton and Wine-GE
Comment=Install and manage GE-Proton and Luxtorpeda for Steam and Wine-GE for Lutris
Icon=%{name}
TryExec=%{_bindir}/%{name}
Exec=%{_bindir}/%{name}
Terminal=false
Categories=Game;Utility;
Keywords=Steam;Proton-GE;
StartupWMClass=%{name}
EOM

# Deduplicate files to handle opt-1.pyc vs .pyc duplicates
%fdupes %{buildroot}%{python_sitelib}

%files
%defattr(-,root,root)
%{_bindir}/%{name}
%{_datadir}/pixmaps/%{name}.png
%{_datadir}/applications/%{name}.desktop
%{python_sitelib}/pupgui2
%{python_sitelib}/*.dist-info/

%changelog 
* Sun Nov 02 2025 itachi_re <itachi_re@protonmail.com>
- Remove explicit libgthread-2_0-0 dependency (let rpm auto-detect)
- Convert to #noarch package since only Python 3.13 is targeted
- Remove python_subpackages (conflicts with #noarch)
- Fix dist-info directory inclusion with proper wildcard pattern
- Add missing dependencies: PySide6-Essentials and requests
- Remove precompiled bytecode to avoid mtime issues
- Use fdupes to handle duplicate .pyc files
- Remove deprecated update-desktop-files BuildRequires
openSUSE Build Service is sponsored by