%global python3_pkgversion 3.11 Name: python-blosc Summary: Python wrapper for the Blosc high performance compressor Version: 1.11.1 Release: 2.ac16.py3.11%{?dist} License: BSD-3-Clause URL: https://github.com/Blosc/python-blosc Source0: https://github.com/Blosc/python-blosc/archive/v%{version}/blosc-%{version}.tar.gz Source1: https://raw.githubusercontent.com/Blosc/python-blosc/f3c5e341a2504a03c225f4f1d9066ccdf4bd31dd/setup.py BuildRequires: gcc BuildRequires: blosc-devel >= 1.16.0 BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: python%{python3_pkgversion}-numpy BuildRequires: python%{python3_pkgversion}-psutil BuildRequires: python%{python3_pkgversion}-cpuinfo %description %{summary}. %package -n python%{python3_pkgversion}-blosc Summary: Python wrapper for the blosc high performance compressor Requires: blosc%{_isa} >= 1.16.0 %{?python_provide:%python_provide python%{python3_pkgversion}-blosc} %{?fedora:Recommends: python%{python3_pkgversion}-numpy} %description -n python%{python3_pkgversion}-blosc %{summary}. %prep %autosetup -p1 # Overwrite setup.py with the last version that does not use skbuild and cmake cp %{SOURCE1} . %build export BLOSC_DIR=%{_libdir}/blosc CFLAGS="%{optflags}" export DISABLE_BLOSC_AVX2=1 %py3_build %install %py3_install %check cd / # avoid interference with build dir PYTHONPATH=%{buildroot}%{python3_sitearch} %__python3 -c 'import sys, blosc; sys.exit(blosc.test())' 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}-blosc %{python3_sitearch}/blosc/ %{python3_sitearch}/blosc-%{version}*-py*.egg-info %license LICENSE.txt %doc README.rst RELEASE_NOTES.rst %changelog * Fri May 17 2024 Ding-Yi Chen - 1.11.1-2.ac16.py3.11 - Cut corner packaging