summaryrefslogtreecommitdiff
path: root/numpy_v2.4.3.spec
diff options
context:
space:
mode:
Diffstat (limited to 'numpy_v2.4.3.spec')
-rw-r--r--numpy_v2.4.3.spec118
1 files changed, 118 insertions, 0 deletions
diff --git a/numpy_v2.4.3.spec b/numpy_v2.4.3.spec
new file mode 100644
index 0000000..d8ec09e
--- /dev/null
+++ b/numpy_v2.4.3.spec
@@ -0,0 +1,118 @@
+%global pypi_name numpy
+
+# meson-python 在临时目录中编译,DWARF 记录的源码路径在构建结束后即被清理,
+# find-debuginfo 收集不到 debugsource(空清单会导致构建失败)。debuginfo 对
+# Python C 扩展没有实际用途,这里关闭。
+%global debug_package %{nil}
+
+# src-openeuler 中该项目的社区仓库是 `numpy`(spec 名 numpy.spec,Name: numpy),
+# 因此 SRPM 名沿用上游名而不是默认的 `python-` 前缀形式;二进制子包仍用
+# `python3-` 前缀(python3-numpy / python3-numpy-f2py),与社区既有仓库一致。
+Name: numpy
+Epoch: 1
+Version: 2.4.3
+Release: 1%{?dist}
+Summary: A fast multidimensional array facility for Python
+
+License: BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0
+URL: https://numpy.org/
+# topdir: numpy-2.4.3 (tarball 由 boostkit/numpy 的 v2.4.3.0-rc2 工作树打包,
+# 已包含 vendored-meson / highway / pocketfft 等 git submodule 内容)
+Source0: https://gitcode.com/boostkit/numpy/archive/v%{version}.0-rc2/numpy-%{version}.tar.gz
+
+BuildRequires: python3-devel
+BuildRequires: python3-pip
+BuildRequires: python3-setuptools
+BuildRequires: python3-wheel
+BuildRequires: pyproject-rpm-macros
+BuildRequires: python3-meson-python
+BuildRequires: python3-Cython
+BuildRequires: ninja-build
+BuildRequires: gcc
+BuildRequires: gcc-c++
+BuildRequires: pkgconf
+BuildRequires: openblas-devel
+BuildRequires: lapack-devel
+
+%description
+NumPy is the fundamental package for scientific computing with Python. It contains among other things:
+a powerful N-dimensional array object
+sophisticated (broadcasting) functions
+tools for integrating C/C++ and Fortran code
+useful linear algebra, Fourier transform, and random number capabilities
+Besides its obvious scientific uses, NumPy can also be used as an efficient multi-dimensional container of generic data. Arbitrary data-types can be defined. This allows NumPy to seamlessly and speedily integrate with a wide variety of databases.
+
+
+%package -n python3-numpy
+Summary: A fast multidimensional array facility for Python
+License: BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0
+%{?python_provide:%python_provide python3-numpy}
+Provides: python3-numpy-doc
+Provides: python3dist(%{pypi_name}) = %{version}
+
+%description -n python3-numpy
+NumPy is the fundamental package for scientific computing with Python. It contains among other things:
+a powerful N-dimensional array object
+sophisticated (broadcasting) functions
+tools for integrating C/C++ and Fortran code
+useful linear algebra, Fourier transform, and random number capabilities
+Besides its obvious scientific uses, NumPy can also be used as an efficient multi-dimensional container of generic data. Arbitrary data-types can be defined. This allows NumPy to seamlessly and speedily integrate with a wide variety of databases.
+
+
+%package -n python3-numpy-f2py
+Summary: f2py for numpy
+Requires: python3-numpy = %{epoch}:%{version}-%{release}
+Requires: python3-devel
+Requires: gcc-gfortran
+Provides: python3-f2py = %{version}-%{release}
+%{?python_provide:%python_provide python3-numpy-f2py}
+
+%description -n python3-numpy-f2py
+This package includes a version of f2py that works properly with NumPy.
+
+
+%prep
+%setup -q -n %{name}-%{version}
+
+# openEuler 24.03 SP4 官方源只提供 meson-python 0.15.0 / pyproject-metadata 0.7.1,
+# 后者不认识 numpy 2.4 采用的 PEP 639 字符串形式 license 字段(期望 PEP 621 的
+# 表形式)。改写成等价的旧式表形式,wheel 元数据内容不变,只是兼容可用的构建后端。
+sed -i 's|^license = .*$|license = {text = "BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0"}|' \
+ pyproject.toml
+
+
+%build
+# 用 pip wheel 直接产出到 ./build:openEuler 24.03 的 pyproject_install 宏从
+# ./build/*.whl 取包(macros.python),与 pyproject-rpm-macros 的 wheeldir 不一致。
+# TMPDIR/--no-clean 与 pyproject-rpm-macros 的 pyproject_wheel 保持一致,
+# 保留构建期源码目录供 debugsource 收集。
+mkdir -p "%{_pyproject_builddir}"
+TMPDIR="%{_pyproject_builddir}" %{__python3} -m pip wheel --no-build-isolation --no-deps \
+ --use-pep517 --no-clean --wheel-dir build \
+ --config-settings setup-args=-Dblas=openblas \
+ --config-settings setup-args=-Dlapack=openblas \
+ --config-settings setup-args=-Dallow-noblas=false \
+ .
+
+
+%install
+%pyproject_install
+
+
+%files -n python3-numpy
+%license LICENSE.txt
+%doc README.md THANKS.txt
+%{_bindir}/numpy-config
+%{python3_sitearch}/%{pypi_name}/
+%{python3_sitearch}/%{pypi_name}-*.dist-info/
+%exclude %{python3_sitearch}/%{pypi_name}/f2py/
+
+%files -n python3-numpy-f2py
+%{_bindir}/f2py
+%{python3_sitearch}/%{pypi_name}/f2py/
+
+
+%changelog
+* Fri Nov 27 2026 Python_Bot <Python_Bot@openeuler.org> - 1:2.4.3-1
+- Initial package for numpy 2.4.3 (BoostKit KML fork)
+- Build with meson-python against system OpenBLAS/LAPACK