%global pypi_name pywaffle %global pypi_version 0.6.3 %global githubname PyWaffle %global commit 0857baee54a6f4aae4cc8ac7bd2618f6a3e142ab %global shortcommit %(c=%{commit}; echo ${c:0:7}) Name: python-%{pypi_name} Version: %{pypi_version} Release: %{autorelease -s 20210728git%{shortcommit}} Summary: Python package for plotting waffle charts License: MIT URL: https://github.com/gyli/%{githubname} # Can't use PyPI because it excludes tests and examples Source0: %{URL}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz # debundle fontawesome Patch0: python-pywaffle-0.6.3-debundle-fontawesome.patch # regenerate mapping for system fontawesome Patch1: python-pywaffle-0.6.3-local-fontawesome_mapping.patch # un-break the script (will file upstream bug) Patch2: python-pywaffle-0.6.3-no-uppercase-fontawesome_mapping.patch BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3dist(pytest) BuildRequires: fontawesome5-fonts %global _description %{expand: PyWaffle is an open source, MIT-licensed Python package for plotting waffle charts. It provides a `Figure` constructor class `Waffle`, which can be passed to `matplotlib.pyplot.figure` to generate a matplotlib `Figure` object. Note that the Fedora package has been modified to use the system version of FontAwesome.} %description %_description %package -n python3-%{pypi_name} Summary: %{summary} Provides: %{githubname} %{?python_provide:%python_provide python3-%{pypi_name}} Requires: fontawesome5-free-fonts, fontawesome5-brands-fonts %description -n python3-%{pypi_name} %_description %prep %autosetup -n %{githubname}-%{commit} -p1 %generate_buildrequires -r %pyproject_buildrequires -r %build # remove bundled fonts -- we're using the system version rm pywaffle/fontawesome/*.otf # regenerate the fontawesome mapping from system # fontawesome icons.json python3 pywaffle/scripts/get_fontawesome.py # and then also not really useful to ship this rm -rf pywaffle/scripts %pyproject_wheel %install %pyproject_install %pyproject_save_files %{pypi_name} %check %pytest %files -n python3-%{pypi_name} -f %{pyproject_files} %license LICENSE %doc README.md %changelog %{autochangelog}