%global python3_pkgversion 3.11 #bcond_without tests %global _description %{expand: A simple package with utils to check whether versions number match PEP 440.} Name: python-pep440 Version: 0.1.2 Release: 2.ac17.py3.11%{?dist} Summary: A simple package with utils to check whether versions number match Pep 440 License: MIT URL: https://pypi.org/pypi/pep440 Source0: %{pypi_source pep440} BuildArch: noarch %description %_description %package -n python%{python3_pkgversion}-pep440 Summary: %{summary} BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-pytest %description -n python%{python3_pkgversion}-pep440 %_description %prep %autosetup -n pep440-%{version} %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files pep440 %check %if %{with tests} # skip test_cli test as they depend on pytest-console-scripts, which # is not yet packaged to Fedora %{pytest} -svv -k "not test_cli" %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}-pep440 -f %{pyproject_files} %doc readme.md %{_bindir}/pep440-%{python3_pkgversion} %license LICENSE %changelog * Thu May 23 2024 Ding-Yi Chen - 0.1.2-2.ac17.py3.11 - Cut corner packaging