#bcond_without tests %global pypi_name wcwidth %global python3_pkgversion 3.11 Name: python-%{pypi_name} Version: 0.2.6 Release: %autorelease Summary: Measures number of Terminal column cells of wide-character codes # part of the code is under HPND-Markus-Kuhn License: MIT AND HPND-Markus-Kuhn URL: https://github.com/jquast/wcwidth Source0: %pypi_source BuildArch: noarch %description This API is mainly for Terminal Emulator implementors, or those writing programs that expect to interpreted by a terminal emulator and wish to determine the printable width of a string on a Terminal. %package -n python%{python3_pkgversion}-%{pypi_name} Summary: %{summary} BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools %if %{with tests} BuildRequires: python%{python3_pkgversion}-pytest %endif %{?python_provide:%python_provide python3-%{pypi_name}} %description -n python%{python3_pkgversion}-%{pypi_name} This API is mainly for Terminal Emulator implementors, or those writing programs that expect to interpreted by a terminal emulator and wish to determine the printable width of a string on a Terminal. %prep %setup -q -n %{pypi_name}-%{version} %build %py3_build %install %py3_install %if %{with tests} %check for m in $(find %{buildroot}%{_datadir}/locale/* -type f) ; do mv "$m" $(sed -re "s/(.*).mo$/\1%{python3_pkgversion}.mo/"<<<"$m"); done for m in $(find %{buildroot}%{_mandir}/ -type f) ; do mv "$m" $(sed -re "s/(.*).([1-8]([^.]+)?)$/\1%{python3_pkgversion}.\2/"<<<"$m"); done for b in $(find %{buildroot}%{_bindir}/ -type f) ; do mv "$b" $(sed -re "s/(.*)$/\1%{python3_pkgversion}/"<<<"$b"); done %{__python3} -m pytest -v %endif %files -n python%{python3_pkgversion}-%{pypi_name} %doc README.rst %license LICENSE %{python3_sitelib}/%{pypi_name} %{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info %changelog * Tue Mar 26 2024 Ding-Yi Chen - 0.2.6-2.ac5 - Cut corner packaging