## START: Set by rpmautospec
## (rpmautospec version 0.7.3)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 11;
    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:           mygnuhealth
Version:        1.0.5
Release:        %autorelease
Summary:        The GNU Health Personal Health Record (PHR)

# Automatically converted from old format: GPLv3+ - review is highly recommended.
License:        GPL-3.0-or-later
URL:            https://www.gnuhealth.org 
Source:         https://ftp.gnu.org/gnu/health/mygnuhealth/mygnuhealth-%{version}.tar.gz
# https://lists.gnu.org/archive/html/health/2022-01/msg00008.html
Patch0:         metainfo.patch

BuildRequires:  python3-devel
BuildRequires:  desktop-file-utils
BuildRequires:  libappstream-glib

Requires:       kf5-kirigami2
Requires:       python3-pyside2

Provides:       python3-mygnuhealth

BuildArch:      noarch

%description
MyGNUHealth is a desktop and mobile application that helps you to take
control of your health. As a Personal Health Record, you will be able
to record, assess and proactively take action upon the determinants of
the main health spheres (bio-psycho-social).
MyGNUHealth will be your health companion. You will be able to connect
with your health professionals, and share the health data you wish to
share with them in real time.
MyGNUHealth puts you in the driver's seat, as an active member of the
system of health.

%package doc
Summary:        Additional documentation files for %{name}
BuildArch:      noarch

%description doc
%{summary}.

%prep
%autosetup

%generate_buildrequires
%pyproject_buildrequires

%build
%pyproject_wheel

%install
%pyproject_install
%pyproject_save_files mygnuhealth

# Proposed upstream to change the name
# https://lists.gnu.org/archive/html/health/2022-01/msg00008.html
mv %{buildroot}%{_datadir}/applications/org.kde.mygnuhealth.desktop \
   %{buildroot}%{_datadir}/applications/org.gnuhealth.mygnuhealth.desktop
mv %{buildroot}%{_metainfodir}/org.kde.mygnuhealth.metainfo.xml \
   %{buildroot}%{_metainfodir}/org.gnuhealth.mygnuhealth.metainfo.xml

%check
desktop-file-validate %{buildroot}%{_datadir}/applications/org.gnuhealth.mygnuhealth.desktop
appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/org.gnuhealth.mygnuhealth.metainfo.xml

%files -f %{pyproject_files}
%license LICENSE COPYRIGHT
%doc Changelog README.rst
%{_bindir}/mygnuhealth
%{_datadir}/applications/org.gnuhealth.mygnuhealth.desktop
%{_datadir}/icons/hicolor/scalable/apps/mygnuhealth.svg
%{_metainfodir}/org.gnuhealth.mygnuhealth.metainfo.xml

%files doc
%doc %{_docdir}/mygnuhealth

%changelog
## START: Generated by rpmautospec
* Thu Jul 25 2024 Miroslav Suchý <msuchy@redhat.com> - 1.0.5-11
- convert GPLv3+ license to SPDX

* Thu Jul 18 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.5-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild

* Sat Jun 08 2024 Python Maint <python-maint@redhat.com> - 1.0.5-9
- Rebuilt for Python 3.13

* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.5-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.5-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.5-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

* Tue Jun 27 2023 Python Maint <python-maint@redhat.com> - 1.0.5-5
- Rebuilt for Python 3.12

* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.5-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.5-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

* Wed Jun 15 2022 Python Maint <python-maint@redhat.com> - 1.0.5-2
- Rebuilt for Python 3.11

* Thu Feb 03 2022 alciregi <alciregi@fedoraproject.org> - 1.0.5-1
- Initial import (fedora#2038734).
## END: Generated by rpmautospec