%global python3_pkgversion 3.11 %global srcname numcodecs Name: python-%{srcname} Version: 0.12.1 Release: 2.ac16.py3.11%{?dist} Summary: Buffer compression and transformation for data storage and communication License: MIT URL: https://github.com/alimanfoo/numcodecs Source0: %pypi_source %{srcname} # Fedora specific Patch: 0001-Unbundle-blosc.patch Patch: 0002-Unbundle-zstd.patch Patch: 0003-Unbundle-lz4.patch # Fedora is not missing Snappy support in Blosc. Patch: 0004-Re-add-Snappy-to-tests.patch # We don't need coverage reports. Patch: 0005-Remove-coverage-from-testing-requirements.patch BuildRequires: gcc BuildRequires: pkgconfig(blosc) BuildRequires: pkgconfig(liblz4) BuildRequires: pkgconfig(libzstd) BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}dist(cython) BuildRequires: python%{python3_pkgversion}dist(pytest) %description Numcodecs is a Python package providing buffer compression and transformation codecs for use in data storage and communication applications. %package -n python%{python3_pkgversion}-%{srcname} Summary: %{summary} %description -n python%{python3_pkgversion}-%{srcname} Numcodecs is a Python package providing buffer compression and transformation codecs for use in data storage and communication applications. %package -n python-%{srcname}-doc Summary: numcodecs documentation BuildArch: noarch BuildRequires: python%{python3_pkgversion}dist(numpydoc) BuildRequires: python%{python3_pkgversion}dist(sphinx) BuildRequires: python%{python3_pkgversion}dist(sphinx-issues) %description -n python-%{srcname}-doc Documentation for numcodecs %prep %autosetup -n %{srcname}-%{version} -p1 # Remove bundled blosc rm -rf c-blosc %generate_buildrequires %pyproject_buildrequires -x msgpack -x test_extras %build %pyproject_wheel # generate html docs PYTHONPATH="$PWD/build/lib.%{python3_platform}-cpython-%{python3_version_nodots}" sphinx-build-%{python3_pkgversion} docs html # remove the sphinx-build-%{python3_pkgversion} leftovers rm -rf html/.{doctrees,buildinfo} html/_static/donotdelete %install %pyproject_install %pyproject_save_files %{srcname} %check cd docs # Avoid using unbuilt existing copy. ln -s ../fixture %{pytest} --pyargs numcodecs 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}-%{srcname} -f %{pyproject_files} %doc README.rst %license LICENSE.txt %files -n python-%{srcname}-doc %doc html %license LICENSE.txt %changelog * Mon May 20 2024 Ding-Yi Chen - 0.12.1-2.ac16.py3.11 - Cut corner packaging