#global commit 16191801a53eddae8ca9380a28988c3b5b263c5e %{?gitcommit:%global gitcommitshort %(c=%{gitcommit}; echo ${c:0:7})} # Use the same directory of the main package for subpackage licence and docs %global _docdir_fmt %{name} Summary: HDF5 support in Python %global python3_pkgversion 3.11 Name: python-tables Version: 3.9.2 Release: 2.ac14.py3.11%{?dist} #Source0: https://github.com/PyTables/PyTables/archive/%{commit}/PyTables-%{commit}.tar.gz Source0: https://github.com/PyTables/PyTables/archive/v%{version}/python-tables-%{version}.tar.gz # sometimes it doesn't get updated %global manual_version 3.3.0 %bcond tests 0 Source1: https://github.com/PyTables/PyTables/releases/download/v%{manual_version}/pytablesmanual-%{manual_version}.pdf Patch1: 0001-Skip-tests-that-fail-on-s390x.patch License: BSD URL: https://www.pytables.org BuildRequires: python%{python3_pkgversion}-packaging BuildRequires: hdf5-devel >= 1.8 BuildRequires: bzip2-devel BuildRequires: lzo-devel BuildRequires: blosc-devel BuildRequires: blosc2-devel BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: python%{python3_pkgversion}-blosc2 BuildRequires: python%{python3_pkgversion}-Cython >= 0.13 BuildRequires: python%{python3_pkgversion}-numpy BuildRequires: python%{python3_pkgversion}-numexpr >= 2.4 BuildRequires: python%{python3_pkgversion}-six ExcludeArch: %{ix86} %global _description %{expand: PyTables is a package for managing hierarchical datasets and designed to efficiently and easily cope with extremely large amounts of data.} %description %_description %package -n python%{python3_pkgversion}-tables Summary: %{summary} Requires: python%{python3_pkgversion}-numpy Requires: python%{python3_pkgversion}-six Requires: python%{python3_pkgversion}-numexpr >= 2.4 %{?python_provide:%python_provide python%{python3_pkgversion}-tables} %description -n python%{python3_pkgversion}-tables %_description %package doc Summary: Documentation for PyTables BuildArch: noarch %description doc The %{name}-doc package contains the documentation for %{name}. %prep %setup -n PyTables-%{version} -q # https://github.com/PyTables/PyTables/issues/735 %ifarch s390x %patch 1 -p1 %endif cp -a %{SOURCE1} pytablesmanual.pdf # Make sure we are not using anything from the bundled blosc by mistake find c-blosc -mindepth 1 -maxdepth 1 -name hdf5 -prune -o -exec rm -r {} + # circumvent the broken attempt to detect library location sed -r -i \ '/def get_blosc2_directories\(\):/a \ \ \ \ return Path("%{_includedir}"),Path("%{_libdir}"),None' \ setup.py %build %py3_build %install chmod -x examples/check_examples.sh sed -i 's|bin/env |bin/|' utils/* %py3_install %check %if %{with tests} %ifarch %{ix86} s390x skip=true %else skip=false %endif cd / PYTHONPATH=%{buildroot}%{python3_sitearch} %{python3} -m tables.tests.test_all -v || $skip %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}-tables %license LICENSE.txt LICENSES %{_bindir}/ptdump-%{python3_pkgversion} %{_bindir}/ptrepack-%{python3_pkgversion} %{_bindir}/pt2to3-%{python3_pkgversion} %{_bindir}/pttree-%{python3_pkgversion} %{python3_sitearch}/tables/ %{python3_sitearch}/tables-%{version}*.egg-info/ %files doc %license LICENSE.txt LICENSES %doc pytablesmanual.pdf %doc [A-KM-Za-z]*.txt %doc examples/ %changelog * Thu Apr 18 2024 Ding-Yi Chen - 3.9.2-2.ac14.py3.11 - Cut corner packaging