Blame python-ast-monitor.spec

83e5ef2
%bcond_without tests
83e5ef2
83e5ef2
# Sphinx-generated HTML documentation is not suitable for packaging; see
83e5ef2
# https://bugzilla.redhat.com/show_bug.cgi?id=2006555 for discussion.
83e5ef2
#
83e5ef2
# We can generate PDF documentation as a substitute.
83e5ef2
83e5ef2
# docs are still not ready for production in upstream's directory
83e5ef2
%bcond_with doc_pdf
83e5ef2
83e5ef2
%global pypi_name ast-monitor
83e5ef2
%global pretty_name AST-Monitor
83e5ef2
83e5ef2
%global _description %{expand:
83e5ef2
AST-monitor is a low-cost and efficient embedded device for monitoring the
83e5ef2
realization of sport training sessions that is dedicated to monitor cycling
83e5ef2
training sessions. AST-Monitor is a part of Artificial Sport Trainer (AST)
83e5ef2
system.}
83e5ef2
83e5ef2
Name:           python-%{pypi_name}
21e9edd
Version:        0.3.0
4fb6dbe
Release:        1%{?dist}
83e5ef2
Summary:        AST-Monitor is a wearable Raspberry Pi computer for cyclists
83e5ef2
83e5ef2
License:        MIT
83e5ef2
# if docs enabled, then use MIT and CC-BY-SA
83e5ef2
83e5ef2
URL:            https://github.com/firefly-cpp/%{pretty_name}
83e5ef2
Source0:        %{url}/archive/%{version}/%{pretty_name}-%{version}.tar.gz
83e5ef2
83e5ef2
BuildArch:      noarch
83e5ef2
83e5ef2
%description %_description
83e5ef2
83e5ef2
%package -n python3-%{pypi_name}
83e5ef2
Summary:        %{summary}
83e5ef2
83e5ef2
BuildRequires:  python3-devel
83e5ef2
BuildRequires:  %{py3_dist toml-adapt}
83e5ef2
83e5ef2
# optional dependency
83e5ef2
Recommends:     python3dist(openant)
83e5ef2
83e5ef2
%if %{with tests}
83e5ef2
BuildRequires:  %{py3_dist pytest}
83e5ef2
%endif
83e5ef2
83e5ef2
%description -n python3-%{pypi_name} %_description
83e5ef2
83e5ef2
%package doc
83e5ef2
Summary:        %{summary}
83e5ef2
83e5ef2
%if %{with doc_pdf}
83e5ef2
BuildRequires:  make
83e5ef2
BuildRequires:  python3-sphinx-latex
83e5ef2
BuildRequires:  latexmk
83e5ef2
BuildRequires:  %{py3_dist sphinx}
83e5ef2
%endif
83e5ef2
83e5ef2
%description doc
83e5ef2
Documentation for %{name}.
83e5ef2
83e5ef2
%prep
83e5ef2
%autosetup -n %{pretty_name}-%{version}
83e5ef2
rm -fv poetry.lock
83e5ef2
rm -rvf examples/.vscode
83e5ef2
83e5ef2
# Make deps consistent with Fedora deps
83e5ef2
toml-adapt -path pyproject.toml -a change -dep ALL -ver X
83e5ef2
83e5ef2
%generate_buildrequires
83e5ef2
%pyproject_buildrequires -r
83e5ef2
83e5ef2
%build
83e5ef2
%pyproject_wheel
83e5ef2
83e5ef2
%if %{with doc_pdf}
83e5ef2
%make_build -C docs latex SPHINXOPTS='%{?_smp_mflags}'
83e5ef2
%make_build -C docs/_build/latex LATEXMKOPTS='-quiet'
83e5ef2
%endif
83e5ef2
83e5ef2
%install
83e5ef2
%pyproject_install
83e5ef2
%pyproject_save_files ast_monitor
83e5ef2
83e5ef2
%check
83e5ef2
%if %{with tests}
15fdb77
%pytest
83e5ef2
%endif
83e5ef2
83e5ef2
%files -n python3-%{pypi_name} -f %{pyproject_files}
83e5ef2
%license LICENSE
44c7fff
%doc README.md CHANGELOG.md CITATION.cff
83e5ef2
83e5ef2
%files doc
83e5ef2
%license LICENSE
83e5ef2
%if %{with doc_pdf}
83e5ef2
%doc docs/_build/latex/%{pypi_name}.pdf
83e5ef2
%endif
83e5ef2
%doc examples/
83e5ef2
83e5ef2
%changelog
21e9edd
* Thu Sep 15 2022 Iztok Fister Jr. <iztokf AT fedoraproject DOT org> - 0.3.0-1
21e9edd
- Update to the latest release
21e9edd
4fb6dbe
* Fri Aug 19 2022 Iztok Fister Jr. <iztokf AT fedoraproject DOT org> - 0.2.1-1
4fb6dbe
- Update to the latest release
4fb6dbe
ec7aa74
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.4-2
ec7aa74
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
ec7aa74
44c7fff
* Tue Jun 7 2022 Iztok Fister Jr. <iztokf AT fedoraproject DOT org> - 0.1.4-1
44c7fff
- Update to the latest release
44c7fff
15fdb77
* Tue May 3 2022 Iztok Fister Jr. <iztokf AT fedoraproject DOT org> - 0.1.3-2
15fdb77
- Update to the latest release
15fdb77
15fdb77
* Tue May 3 2022 Iztok Fister Jr. <iztokf AT fedoraproject DOT org> - 0.1.3-1
161bef2
- Update to the latest release
161bef2
83e5ef2
* Tue Mar 1 2022 Iztok Fister Jr. <iztokf AT fedoraproject DOT org> - 0.1.2-1
83e5ef2
- Initial package