%global python3_pkgversion 3.11 %global modname autocommand %global projname %{modname} #bcond_without tests Name: python-%{projname} Version: 2.2.2 Release: 2.ac16.py3.11%{?dist} Summary: Generate argparse parsers from function signatures License: LGPL-3.0-or-later URL: https://github.com/Lucretiel/%{projname} Source0: %{pypi_source %{projname}} # https://bugzilla.redhat.com/show_bug.cgi?id=2259644 Patch: %{url}/pull/31.patch#/001-setuptools-fix.patch BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel %if %{with tests} BuildRequires: python%{python3_pkgversion}-pytest %endif %global _description %{expand: A library to automatically generate and run simple argparse parsers from function signatures} %description %_description %package -n python%{python3_pkgversion}-%{projname} Summary: %{summary} %description -n python%{python3_pkgversion}-%{projname} %_description %prep %autosetup -n %{projname}-%{version} %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files %{modname} %check %if %{with tests} %pytest %else %pyproject_check_import %endif 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}-%{projname} -f %{pyproject_files} %license LICENSE %doc README.md %changelog * Thu May 16 2024 Ding-Yi Chen - 2.2.2-2.ac16.py3.11 - Cut corner packaging