## START: Set by rpmautospec ## (rpmautospec version 0.3.0) %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 5; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec # Sphinx-generated HTML documentation is not suitable for packaging; see # https://bugzilla.redhat.com/show_bug.cgi?id=2006555 for discussion. # # We can generate PDF documentation as a substitute. %bcond_without doc_pdf Name: python-plac Version: 1.3.5 Release: %autorelease Summary: The smartest command line arguments parser in the world License: BSD-2-Clause URL: https://github.com/ialbert/plac # GitHub archive contains full documentation sources; PyPI sdist does not Source0: %{url}/archive/v%{version}/plac-%{version}.tar.gz # Man page written for Fedora in groff_man(7) format based on --help output Source1: plac_runner.py.1 # Python 3.10: asyncore/asynchat are deprecated in favour of asyncio # https://github.com/ialbert/plac/issues/65 Patch: 0001-Remove-server-functionality.patch BuildArch: noarch BuildRequires: python3-devel %if %{with doc_pdf} BuildRequires: make BuildRequires: python3dist(sphinx) BuildRequires: python3dist(sphinx-rtd-theme) BuildRequires: python3-sphinx-latex BuildRequires: latexmk %endif %global common_description %{expand: plac is a Python package that can generate command line parameters from function signatures. plac works on Python 2.6 through all versions of Python 3. plac has no dependencies beyond modules already present in the Python standard library. plac implements most of its functionality in a single file that may be included in your source code.} %description %{common_description} %package -n python3-plac Summary: %{summary} %description -n python3-plac %{common_description} %package doc Summary: Documentation for plac %description doc %{common_description} %prep %autosetup -n plac-%{version} -N # This can be simplified once Python 3.12+ and F39+ are synonymous. %if v"%{python3_version}" >= v"3.12" %autopatch -p1 %endif %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %if %{with doc_pdf} PYTHONPATH="${PWD}" \ sphinx-build -b latex %{?_smp_mflags} doc %{_vpath_builddir}/_latex %make_build -C %{_vpath_builddir}/_latex LATEXMKOPTS='-quiet' %endif %install %pyproject_install %pyproject_save_files plac_core plac_ext plac_tk plac install -t '%{buildroot}%{_mandir}/man1' -m 0644 -p -D '%{SOURCE1}' %check PYTHONPATH='%{buildroot}%{python3_sitelib}' '%{python3}' doc/test_plac.py %files -n python3-plac -f %{pyproject_files} # pyproject-rpm-macros takes care of LICENSE.txt; verify with “rpm -qL -p …” %{_bindir}/plac_runner.py %{_mandir}/man1/plac_runner.py.1* %files doc %license LICENSE.txt %doc CHANGES.md %doc README.md %doc RELEASE.md %if %{with doc_pdf} %doc %{_vpath_builddir}/_latex/plac.pdf %endif %changelog * Fri Jan 20 2023 Fedora Release Engineering 1.3.5-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild * Thu Dec 22 2022 Benjamin A. Beasley 1.3.5-4 - Remove server functionality when Python ≥ 3.12 (fix RHBZ#2155450) - Works around asyncore/asynchat removal from std. lib. * Fri Nov 25 2022 Benjamin A. Beasley 1.3.5-3 - Update License to SPDX * Mon Aug 22 2022 Benjamin A. Beasley 1.3.5-2 - Parallelize sphinx-build * Mon Jul 25 2022 Benjamin A. Beasley 1.3.5-1 - Initial package (close RHBZ#2107915)