%bcond_with pyproject %bcond_with python3 %bcond_with check %global sum() Build manual page from %* ArgumentParser object Name: argparse-manpage Version: 4 Release: %mkrel 1 Summary: %{sum Python} BuildArch: noarch License: ASL 2.0 URL: https://github.com/praiskup/%{name} Source0: https://github.com/praiskup/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz BuildRequires: python3-setuptools BuildRequires: python3-devel BuildRequires: pyproject-rpm-macros BuildRequires: python3-pytest Requires: python3-%{name} = %{version}-%{release} %description Generate manual page an automatic way from ArgumentParser object, so the manpage 1:1 corresponds to the automatically generated --help output. The manpage generator needs to known the location of the object, user can specify that by (a) the module name or corresponding python filename and (b) the object name or the function name which returns the object. There is a limited support for (deprecated) optparse objects, too. %package -n python3-%name Summary: %{sum Python 3} %description -n python3-%name %{desc} %if %{with pyproject} %pyproject_extras_subpkg -n python3-%{name} setuptools %endif %prep %setup -q %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %check %pytest %files %license LICENSE %{_bindir}/argparse-manpage %_mandir/man1/argparse-manpage.1.* %python3_sitelib/argparse_manpage/cli.py %files -n python3-%name %license LICENSE %python3_sitelib/build_manpages %python3_sitelib/argparse_manpage %python3_sitelib/argparse_manpage-*dist-info %exclude %python3_sitelib/argparse_manpage/cli.py