|
| 1 | +%global pip_module_name argparse_manpage |
| 2 | + |
| 3 | +Name: argparse-manpage |
| 4 | +Version: 4.7 |
| 5 | +Release: 1%{?dist} |
| 6 | +Summary: Build manual page from Python ArgumentParser object |
| 7 | +BuildArch: noarch |
| 8 | + |
| 9 | +License: Apache-2.0 |
| 10 | +URL: https://github.com/praiskup/%{name} |
| 11 | +Vendor: Microsoft Corporation |
| 12 | +Distribution: Azure Linux |
| 13 | +Source0: %{pypi_source %{pip_module_name}} |
| 14 | + |
| 15 | +BuildRequires: python3-devel |
| 16 | +BuildRequires: pyproject-rpm-macros |
| 17 | +BuildRequires: python3-pip |
| 18 | +BuildRequires: python3-wheel |
| 19 | +BuildRequires: python3-tomli |
| 20 | +BuildRequires: python3-pytest |
| 21 | + |
| 22 | +Requires: python3-%{name} = %{version}-%{release} |
| 23 | + |
| 24 | +%description |
| 25 | +Generate manual page an automatic way from ArgumentParser object, so the |
| 26 | +manpage 1:1 corresponds to the automatically generated --help output. The |
| 27 | +manpage generator needs to known the location of the object, user can |
| 28 | +specify that by (a) the module name or corresponding python filename and |
| 29 | +(b) the object name or the function name which returns the object. |
| 30 | +There is a limited support for (deprecated) optparse objects, too. |
| 31 | + |
| 32 | + |
| 33 | +%package -n python3-%{name} |
| 34 | +Summary: Build manual page from Python 3 ArgumentParser object |
| 35 | + |
| 36 | +%description -n python3-%{name} |
| 37 | +Generate manual page an automatic way from ArgumentParser object, so the |
| 38 | +manpage 1:1 corresponds to the automatically generated --help output. The |
| 39 | +manpage generator needs to known the location of the object, user can |
| 40 | +specify that by (a) the module name or corresponding python filename and |
| 41 | +(b) the object name or the function name which returns the object. |
| 42 | +There is a limited support for (deprecated) optparse objects, too. |
| 43 | + |
| 44 | + |
| 45 | +%pyproject_extras_subpkg -n python3-%{name} setuptools |
| 46 | + |
| 47 | + |
| 48 | +%prep |
| 49 | +%autosetup -n %{pip_module_name}-%{version} |
| 50 | + |
| 51 | +%generate_buildrequires |
| 52 | +%pyproject_buildrequires |
| 53 | + |
| 54 | + |
| 55 | +%build |
| 56 | +%pyproject_wheel |
| 57 | + |
| 58 | + |
| 59 | +%install |
| 60 | +%pyproject_install |
| 61 | + |
| 62 | + |
| 63 | +%check |
| 64 | +# Disable pip build isolation to make the tests work in offline environment |
| 65 | +# Fixes https://bugzilla.redhat.com/2417959 |
| 66 | +export PIP_NO_BUILD_ISOLATION=0 |
| 67 | +%pytest -vv |
| 68 | + |
| 69 | + |
| 70 | +%files |
| 71 | +%license LICENSE |
| 72 | +%{_bindir}/argparse-manpage |
| 73 | +%{_mandir}/man1/argparse-manpage.1.* |
| 74 | +%{python3_sitelib}/argparse_manpage/cli.py |
| 75 | + |
| 76 | + |
| 77 | +%files -n python3-%{name} |
| 78 | +%license LICENSE |
| 79 | +%{python3_sitelib}/build_manpages |
| 80 | +%{python3_sitelib}/argparse_manpage |
| 81 | +%{python3_sitelib}/argparse_manpage-*dist-info |
| 82 | +%exclude %{python3_sitelib}/argparse_manpage/cli.py |
| 83 | + |
| 84 | + |
| 85 | +%changelog |
| 86 | +* Fri May 08 2026 Sandeep Karambelkar <skarambelkar@microsoft.com> - 4.7-1 |
| 87 | +- Initial Azure Linux import from Fedora 44 (license: MIT) |
| 88 | +- License Verified |
0 commit comments