%global desc %{expand: M2R2 converts a markdown file including reStructuredText (rst) markups to a valid rst format.} %bcond_without check Name: python-m2r2 Version: 0.3.3 Release: %autorelease Summary: Markdown to reStructuredText converter License: MIT URL: https://github.com/CrossNox/m2r2 Source0: %{pypi_source m2r2} # https://github.com/CrossNox/m2r2/pull/22 Patch0: fix-setup-self-import.patch BuildArch: noarch BuildRequires: make BuildRequires: python%{python3_pkgversion}-devel %if %{with check} BuildRequires: python%{python3_pkgversion}-pygments BuildRequires: python%{python3_pkgversion}-pytest BuildRequires: python%{python3_pkgversion}-six %endif %description %{desc} %package -n python%{python3_pkgversion}-m2r2 Summary: %{summary} %description -n python%{python3_pkgversion}-m2r2 %{desc} %prep %autosetup -p1 -n m2r2-%{version} # Remove shebang sed -i '1{\@^#!/usr/bin/env python@d}' m2r2.py %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files m2r2 %if %{with check} %check %pytest %endif %files -n python%{python3_pkgversion}-m2r2 -f %{pyproject_files} %doc README.md %{_bindir}/m2r2 %changelog %autochangelog