## START: Set by rpmautospec
## (rpmautospec version 0.6.0)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 3;
    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
    print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec

Name:           NiaAML-GUI
Version:        0.3.1
Release:        %autorelease
Summary:        GUI for NiaAML Python package

# SPDX
License:        MIT
URL:            https://github.com/firefly-cpp/NiaAML-GUI
# Also distributed via PyPI (https://pypi.org/project/niaaml-gui/) but without
# tests and other auxiliary files.
Source:         %{url}/archive/%{version}/NiaAML-GUI-%{version}.tar.gz

BuildArch:      noarch

# https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
ExcludeArch:    %{ix86}
 
BuildRequires:  python3-devel
BuildRequires:  desktop-file-utils
BuildRequires:  libappstream-glib

# pyproject.toml: [tool.poetry.dev-dependencies]
# pytest = "^7.4.3"
# Version specification loosened to allow newer versions
BuildRequires:  python3dist(pytest) >= 7.4.3

Requires:       hicolor-icon-theme

%global app_id io.github.firefly-cpp.niaaml_gui

%global common_description %{expand:
This is a basic graphical user interface intended for users of the NiaAML
Python package.}

%description %{common_description}


%prep
%autosetup


%generate_buildrequires
%pyproject_buildrequires


%build
%pyproject_wheel


%install
%pyproject_install
%pyproject_save_files niaaml_gui

desktop-file-install --dir='%{buildroot}%{_datadir}/applications' \
    AppData/%{app_id}.desktop
install -t '%{buildroot}%{_metainfodir}' -p -m 0644 -D \
    AppData/%{app_id}.metainfo.xml
install -t '%{buildroot}%{_datadir}/icons/hicolor/256x256/apps' -p -m 0644 -D \
    AppData/niaaml-gui.png


%check
appstream-util validate-relax --nonet \
    '%{buildroot}%{_metainfodir}/%{app_id}.metainfo.xml'

%pytest


%files -f %{pyproject_files}
%license LICENSE
%doc CITATION.cff
%doc README.md

%{_bindir}/NiaAML-GUI
# There is no need for a man page, since this is a pure GUI application with no
# useful command-line options.

%{_datadir}/applications/%{app_id}.desktop
%{_metainfodir}/%{app_id}.metainfo.xml
%{_datadir}/icons/hicolor/256x256/apps/niaaml-gui.png


%changelog
## START: Generated by rpmautospec
* Wed Jul 17 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild

* Sun Jun 09 2024 Python Maint <python-maint@redhat.com> - 0.3.1-2
- Rebuilt for Python 3.13

* Sat Jun 01 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 0.3.1-1
- Update to 0.3.1 (close RHBZ#2284186)

* Thu May 02 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 0.3.0-1
- Update to 0.3.0 (close RHBZ#2278098)

* Tue Apr 09 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 0.2.1-1
- Update to 0.2.1 (close RHBZ#2250208)

* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.13-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Fri Jan 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.13-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.13-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

* Tue Jul 04 2023 Python Maint <python-maint@redhat.com> - 0.1.13-5
- Rebuilt for Python 3.12

* Mon Feb 20 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.1.13-3
- Leaf package: remove i686 support

* Wed Jan 18 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.13-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

* Sun Oct 23 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 0.1.13-1
- Update to 0.1.13 (close RHBZ#2137087)

* Wed Oct 19 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 0.1.11^20211203gitfff3dd3-1
- Use a post-release snapshot instead of a large number of patches
- Drop CODE_OF_CONDUCT.md from the package, as it is mostly relevant for
  upstream development.
- Add new CITATION.cff to the package.

* Wed Oct 19 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 0.1.11-5
- Clarify that License is SPDX MIT

* Wed Jul 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.11-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

* Mon Jul 04 2022 Python Maint <python-maint@redhat.com> - 0.1.11-3
- Rebuilt for Python 3.11

* Wed Jan 19 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.11-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

* Tue Nov 23 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 0.1.11-1
- Initial package
## END: Generated by rpmautospec