Blame SPECS/python3.11-numpy.spec

c6a806
%global __python3 /usr/bin/python3.11
c6a806
%global python3_pkgversion 3.11
c6a806
c6a806
#uncomment next line for a release candidate or a beta
c6a806
#%%global relc rc1
c6a806
c6a806
# RHEL: Tests disabled due to missing dependencies
c6a806
%bcond_with tests
c6a806
c6a806
%if 0%{?fedora} >= 33 || 0%{?rhel} >= 9
c6a806
%global blaslib flexiblas
c6a806
%global blasvar %{nil}
c6a806
%else
c6a806
%global blaslib openblas
c6a806
%global blasvar p
c6a806
%endif
c6a806
c6a806
%global modname numpy
c6a806
c6a806
Name:           python%{python3_pkgversion}-numpy
c6a806
Version:        1.23.5
c6a806
Release:        1%{?dist}
c6a806
Summary:        A fast multidimensional array facility for Python
c6a806
c6a806
# Everything is BSD except for class SafeEval in numpy/lib/utils.py which is Python
c6a806
License:        BSD and Python and ASL 2.0
c6a806
URL:            http://www.numpy.org/
c6a806
Source0:        https://github.com/%{modname}/%{modname}/releases/download/v%{version}/%{modname}-%{version}.tar.gz
c6a806
c6a806
BuildRequires:  python%{python3_pkgversion}-devel
c6a806
BuildRequires:  python%{python3_pkgversion}-rpm-macros
c6a806
BuildRequires:  python%{python3_pkgversion}-setuptools
c6a806
BuildRequires:  python%{python3_pkgversion}-Cython
c6a806
BuildRequires:  gcc-gfortran gcc gcc-c++
c6a806
BuildRequires:  lapack-devel
c6a806
%if %{with tests}
c6a806
BuildRequires:  python%{python3_pkgversion}-hypothesis
c6a806
BuildRequires:  python%{python3_pkgversion}-pytest
c6a806
BuildRequires:  python%{python3_pkgversion}-test
c6a806
BuildRequires:  python%{python3_pkgversion}-typing-extensions
c6a806
%endif
c6a806
BuildRequires: %{blaslib}-devel
c6a806
BuildRequires: chrpath
c6a806
c6a806
%description
c6a806
NumPy is a general-purpose array-processing package designed to
c6a806
efficiently manipulate large multi-dimensional arrays of arbitrary
c6a806
records without sacrificing too much speed for small multi-dimensional
c6a806
arrays.  NumPy is built on the Numeric code base and adds features
c6a806
introduced by numarray as well as an extended C-API and the ability to
c6a806
create arrays of arbitrary type.
c6a806
c6a806
There are also basic facilities for discrete fourier transform,
c6a806
basic linear algebra and random number generation. Also included in
c6a806
this package is a version of f2py that works properly with NumPy.
c6a806
c6a806
c6a806
%package -n python%{python3_pkgversion}-numpy-f2py
c6a806
Summary:        f2py for numpy
c6a806
Requires:       python%{python3_pkgversion}-numpy%{?_isa} = %{version}-%{release}
c6a806
Requires:       python%{python3_pkgversion}-devel
c6a806
Provides:       python%{python3_pkgversion}-f2py = %{version}-%{release}
c6a806
c6a806
%description -n python%{python3_pkgversion}-numpy-f2py
c6a806
This package includes a version of f2py that works properly with NumPy.
c6a806
c6a806
%prep
c6a806
%autosetup -n %{modname}-%{version} -p1
c6a806
c6a806
# Force re-cythonization (ifed for PKG-INFO presence in setup.py)
c6a806
rm PKG-INFO
c6a806
c6a806
# openblas is provided by flexiblas by default; otherwise,
c6a806
# Use openblas pthreads as recommended by upstream (see comment in site.cfg.example)
c6a806
cat >> site.cfg <
c6a806
[openblas]
c6a806
libraries = %{blaslib}%{blasvar}
c6a806
library_dirs = %{_libdir}
c6a806
EOF
c6a806
c6a806
%build
c6a806
%set_build_flags
c6a806
c6a806
env OPENBLAS=%{_libdir} \
c6a806
    BLAS=%{_libdir} \
c6a806
    LAPACK=%{_libdir} CFLAGS="%{optflags}" \
c6a806
    %{__python3} setup.py build
c6a806
c6a806
%install
c6a806
#%%{__python3} setup.py install -O1 --skip-build --root %%{buildroot}
c6a806
# skip-build currently broken, this works around it for now
c6a806
env OPENBLAS=%{_libdir} \
c6a806
    FFTW=%{_libdir} BLAS=%{_libdir} \
c6a806
    LAPACK=%{_libdir} CFLAGS="%{optflags}" \
c6a806
    %{__python3} setup.py install --root %{buildroot} --prefix=%{_prefix}
c6a806
pushd %{buildroot}%{_bindir} &> /dev/null
c6a806
# Remove unversioned binaries
c6a806
rm f2py
c6a806
rm f2py3
c6a806
popd &> /dev/null
c6a806
c6a806
c6a806
# distutils from setuptools don't have the patch that was created to avoid standard runpath here
c6a806
# we strip it manually instead
c6a806
# ERROR   0001: file '...' contains a standard runpath '/usr/lib64' in [/usr/lib64]
c6a806
chrpath --delete %{buildroot}%{python3_sitearch}/%{modname}/core/_multiarray_umath.*.so
c6a806
chrpath --delete %{buildroot}%{python3_sitearch}/%{modname}/linalg/lapack_lite.*.so
c6a806
chrpath --delete %{buildroot}%{python3_sitearch}/%{modname}/linalg/_umath_linalg.*.so
c6a806
c6a806
%check
c6a806
%if %{with tests}
c6a806
export PYTHONPATH=%{buildroot}%{python3_sitearch}
c6a806
# test_ppc64_ibm_double_double128 is unnecessary now that ppc64le has switched long doubles to IEEE format.
c6a806
# https://github.com/numpy/numpy/issues/21094
c6a806
%ifarch %{ix86}
c6a806
# Weird RuntimeWarnings on i686, similar to https://github.com/numpy/numpy/issues/13173
c6a806
# Some tests also overflow on 32bit
c6a806
%global ix86_k and not test_vector_matrix_values and not test_matrix_vector_values and not test_identityless_reduction_huge_array and not (TestKind and test_all)
c6a806
%endif
c6a806
%{__python3} runtests.py -v --no-build -- -ra -k 'not test_ppc64_ibm_double_double128 %{?ix86_k}'
c6a806
%endif
c6a806
c6a806
c6a806
%files -n python%{python3_pkgversion}-numpy
c6a806
%license LICENSE.txt
c6a806
%doc THANKS.txt site.cfg.example
c6a806
%{python3_sitearch}/%{modname}/__pycache__/
c6a806
%dir %{python3_sitearch}/%{modname}
c6a806
%{python3_sitearch}/%{modname}/*.py*
c6a806
%{python3_sitearch}/%{modname}/core
c6a806
%{python3_sitearch}/%{modname}/distutils
c6a806
%{python3_sitearch}/%{modname}/doc
c6a806
%{python3_sitearch}/%{modname}/fft
c6a806
%{python3_sitearch}/%{modname}/lib
c6a806
%{python3_sitearch}/%{modname}/linalg
c6a806
%{python3_sitearch}/%{modname}/ma
c6a806
%{python3_sitearch}/%{modname}/random
c6a806
%{python3_sitearch}/%{modname}/testing
c6a806
%{python3_sitearch}/%{modname}/tests
c6a806
%{python3_sitearch}/%{modname}/compat
c6a806
%{python3_sitearch}/%{modname}/matrixlib
c6a806
%{python3_sitearch}/%{modname}/polynomial
c6a806
%{python3_sitearch}/%{modname}-*.egg-info
c6a806
%exclude %{python3_sitearch}/%{modname}/LICENSE.txt
c6a806
%{python3_sitearch}/%{modname}/__init__.pxd
c6a806
%{python3_sitearch}/%{modname}/__init__.cython-30.pxd
c6a806
%{python3_sitearch}/%{modname}/py.typed
c6a806
%{python3_sitearch}/%{modname}/typing/
c6a806
%{python3_sitearch}/%{modname}/array_api/
c6a806
%{python3_sitearch}/%{modname}/_pyinstaller/
c6a806
%{python3_sitearch}/%{modname}/_typing/
c6a806
c6a806
%files -n python%{python3_pkgversion}-numpy-f2py
c6a806
%{_bindir}/f2py%{python3_pkgversion}
c6a806
%{python3_sitearch}/%{modname}/f2py
c6a806
c6a806
c6a806
%changelog
c6a806
* Fri Dec 02 2022 Charalampos Stratakis <cstratak@redhat.com> - 1.23.5-1
c6a806
- Initial package
c6a806
- Fedora contributions by:
c6a806
      Bill Nottingham <notting@fedoraproject.org>
c6a806
      Charalampos Stratakis <cstratak@redhat.com>
c6a806
      Christian Dersch <lupinix@mailbox.org>
c6a806
      Dan Horák <sharkcz@fedoraproject.org>
c6a806
      David Malcolm <dmalcolm@redhat.com>
c6a806
      David Tardon <dtardon@redhat.com>
c6a806
      Deji Akingunola <deji@fedoraproject.org>
c6a806
      Dennis Gilmore <dennis@ausil.us>
c6a806
      Elliott Sales de Andrade <quantum.analyst@gmail.com>
c6a806
      Gwyn Ciesla <limburgher@gmail.com>
c6a806
      Ignacio Vazquez-Abrams <ivazquez@fedoraproject.org>
c6a806
      Iñaki Úcar <iucar@fedoraproject.org>
c6a806
      Iryna Shcherbina <shcherbina.iryna@gmail.com>
c6a806
      Jarod Wilson <jwilson@fedoraproject.org>
c6a806
      Jaromir Capik <jcapik@redhat.com>
c6a806
      Jef Spaleta <jspaleta@fedoraproject.org>
c6a806
      Jesse Keating <jkeating@fedoraproject.org>
c6a806
      Jon Ciesla <limb@fedoraproject.org>
c6a806
      Kalev Lember <klember@redhat.com>
c6a806
      Karolina Surma <ksurma@redhat.com>
c6a806
      Lumir Balhar <lbalhar@redhat.com>
c6a806
      Merlin Mathesius <mmathesi@redhat.com>
c6a806
      Miro Hrončok <miro@hroncok.cz>
c6a806
      Nikola Forró <nforro@redhat.com>
c6a806
      Orion Poplawski <orion@nwra.com>
c6a806
      Pavel Šimovec <psimovec@redhat.com>
c6a806
      Peter Robinson <pbrobinson@fedoraproject.org>
c6a806
      Robert Kuska <rkuska@redhat.com>
c6a806
      Simone Caronni <negativo17@gmail.com>
c6a806
      Thomas Spura <tomspur@fedoraproject.org>
c6a806
      Tomáš Hrnčiar <thrnciar@redhat.com>
c6a806
      Tomas Orsava <torsava@redhat.com>
c6a806
      Tomas Tomecek <ttomecek@redhat.com>
c6a806
      Ville Skyttä <scop@fedoraproject.org>