%global srcname cppy %global python3_pkgversion 3.11 Name: python-%{srcname} Version: 1.2.1 Release: 2.ac8.py3.11%{?dist} Summary: C++ headers for C extension development License: BSD-3-Clause URL: https://github.com/nucleic/cppy Source0: %pypi_source BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}dist(pytest) %description A small C++ header library which makes it easier to write Python extension modules. The primary feature is a PyObject smart pointer which automatically handles reference counting and provides convenience methods for performing common object operations. %package -n python%{python3_pkgversion}-%{srcname} Summary: %{summary} %description -n python%{python3_pkgversion}-%{srcname} A small C++ header library which makes it easier to write Python extension modules. The primary feature is a PyObject smart pointer which automatically handles reference counting and provides convenience methods for performing common object operations. %package -n python-%{srcname}-doc Summary: cppy documentation BuildRequires: python%{python3_pkgversion}dist(sphinx) BuildRequires: python%{python3_pkgversion}dist(sphinx-rtd-theme) %description -n python-%{srcname}-doc Documentation for cppy %prep %autosetup -n %{srcname}-%{version} %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel # generate html docs PYTHONPATH="%{pyproject_build_lib}" sphinx-build-%{python3_pkgversion} docs/source html # remove the sphinx-build leftovers rm -rf html/.{doctrees,buildinfo} %install %pyproject_install %pyproject_save_files %{srcname} %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 %{pytest} tests %files -n python%{python3_pkgversion}-%{srcname} -f %{pyproject_files} %doc README.rst %files -n python-%{srcname}-doc %doc html %license LICENSE %changelog * Thu Apr 04 2024 Ding-Yi Chen - 1.2.1-2.ac8.py3.11 - Cut corner packaging