File m64py.spec of Package m64py

#
# spec file for package m64py
#
# 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/
#

%define _name mupen64plus-ui-python
Name:           m64py
Version:        0.2.5+37~git20231227.90093ce
Release:        0
Summary:        A frontend for Mupen64Plus
License:        GPL-3.0-only
Group:          System/Emulators/Other
URL:            http://m64py.sourceforge.net/
Source:         %{_name}-%{version}.tar.xz
# PATCH-FIX-OPENSUSE m64py-0.2.5_xdg.patch -- use correct paths for icons
Patch0:         m64py-0.2.5_xdg.patch

BuildArch:      noarch
BuildRequires:  fdupes
BuildRequires:  python3-qt5-devel
# Fix dependency resolution
BuildRequires:  python3-sip-devel
BuildRequires:  python3-setuptools
BuildRequires:  update-desktop-files

Requires:       libmupen64plus2 >= 2.0
Requires:       mupen64plus-plugin-audio
Requires:       mupen64plus-plugin-input
Requires:       mupen64plus-plugin-rsp
Requires:       mupen64plus-plugin-video
Requires:       python3-PySDL2
Requires:       python3-qt5
Requires(post): hicolor-icon-theme
Requires(postun):hicolor-icon-theme

Provides:       mupen64plus-ui

%description
M64Py is a Qt5 front-end (GUI) for Mupen64Plus 2.0, a cross-platform plugin-based Nintendo 64 emulator.
Front-end is written in Python and it provides a user-friendly interface over Mupen64Plus shared library.

%prep
%setup -q -n %{_name}-%{version}
%patch0

%build
%python3_build

%install
%python3_install -O1

# Use correct category in desktop file
%suse_update_desktop_file -r %{name} "System;Emulator"

# fdupes
%fdupes %{buildroot}%{python3_sitelib}/%{name}/
%fdupes %{buildroot}%{_datadir}/icons/hicolor/96x96/

%files
%license COPYING
%doc AUTHORS CHANGELOG LICENSES README.rst
%{python3_sitelib}/*
%{_bindir}/m64py
%{_datadir}/applications/m64py.desktop
%{_datadir}/icons/hicolor/96x96/apps/m64py.png

%changelog
openSUSE Build Service is sponsored by