%global python3_pkgversion 3.11 Name: python-tabulate Version: 0.9.0 Release: 2.ac14.py3.11%{?dist} Summary: Pretty-print tabular data in Python, a library and a command-line utility # SPDX License: MIT URL: https://github.com/astanin/python-tabulate Source0: %{pypi_source tabulate} # Hand-written for Fedora based on --help output using groff_man(7) format Source1: tabulate.1 BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel # Additional test deps; see tox.ini, not in the sdist BuildRequires: python%{python3_pkgversion}dist(pytest) BuildRequires: python%{python3_pkgversion}dist(numpy) %if ! 0%{?el9} # The pandas backport is not finished yet in EPEL 9. See BZ 2032550. # The BR is needed only for Pandas integration tests. BuildRequires: python%{python3_pkgversion}dist(pandas) %endif %global _description %{expand: The main use cases of the library are: • printing small tables without hassle: just one function call, formatting is guided by the data itself • authoring tabular data for lightweight plain-text markup: multiple output formats suitable for further editing or transformation • readable presentation of mixed textual and numeric data: smart column alignment, configurable number formatting, alignment by a decimal point} %description %{_description} %package -n python%{python3_pkgversion}-tabulate Summary: %{summary} Recommends: python3-tabulate+widechars %description -n python%{python3_pkgversion}-tabulate %{_description} %pyproject_extras_subpkg -n python3-tabulate widechars %prep %autosetup -n tabulate-%{version} %generate_buildrequires %pyproject_buildrequires -x widechars %build %pyproject_wheel %install %pyproject_install %pyproject_save_files tabulate install -t '%{buildroot}%{_mandir}/man1' -D -m 0644 -p '%{SOURCE1}' %check %pytest --doctest-modules --ignore benchmark.py for b in $(find %{buildroot}%{_bindir}/ -type f) ; do mv "$b" $(sed -re "s|(.*)$|\1-%{python3_pkgversion}|"<<<"$b"); done for m in $(find %{buildroot}%{_mandir}/ -type f) ; do mv "$m" $(sed -re "s|(.*).([1-8])(.*)$|\1-%{python3_pkgversion}.\2\3|"<<<"$m"); done for m in $(find %{buildroot}%{_datadir}/locale/* -type f) ; do mv "$m" $(sed -re "s|(.*).mo$|\1-%{python3_pkgversion}.mo|"<<<"$m"); done for l in $(find %{buildroot}/usr/lib64/lib* -type f -o -type l) ; do mv "$l" $(sed -re "s|(.*).so(.*)$|\1-py%{python3_pkgversion}.so\2|"<<<"$l"); done for p in $(find %{buildroot}/usr/lib64/pkgconfig/* -type f) ; do mv "$p" $(sed -re "s|(.*).pc$|\1-py%{python3_pkgversion}.pc|"<<<"$p"); done %files -n python%{python3_pkgversion}-tabulate -f %{pyproject_files} %doc CHANGELOG %doc README.md %{_bindir}/tabulate-%{python3_pkgversion} %{_mandir}/man1/tabulate-%{python3_pkgversion}.1* %changelog * Thu Apr 18 2024 Ding-Yi Chen - 0.9.0-2.ac14.py3.11 - Cut corner packaging