Accepting request 486233 from devel:languages:python

1

OBS-URL: https://build.opensuse.org/request/show/486233
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-numpy?expand=0&rev=53
This commit is contained in:
2017-04-19 16:08:20 +00:00
committed by Git OBS Bridge
parent a2ad4c1467
commit 524c18cc07
6 changed files with 121 additions and 142 deletions

View File

@@ -15,6 +15,7 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%if 0%{?is_opensuse} == 0
%bcond_with openblas
%else
@@ -37,8 +38,10 @@
%endif
%endif
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-numpy
Version: 1.12.0
Version: 1.12.1
Release: 0
Summary: NumPy array processing for numbers, strings, records and objects
License: BSD-3-Clause
@@ -50,29 +53,21 @@ Patch0: numpy-buildfix.patch
# PATCH-FIX-OPENSUSE numpy-1.9.0-remove-__declspec.patch -- fix for spurious compiler warnings that cause build failure
Patch1: numpy-1.9.0-remove-__declspec.patch
BuildRequires: blas-devel
BuildRequires: fdupes
BuildRequires: gcc-fortran
BuildRequires: lapack-devel
BuildRequires: unzip
BuildRequires: python-rpm-macros
BuildRequires: %{python_module Cython}
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
%if %{with openblas}
BuildRequires: openblas-devel
%endif
BuildRequires: python-devel >= 2.6
BuildRequires: python-setuptools
%if 0%{?suse_version} <= 1110
%{!?python_sitearch: %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%endif
%if 0%{?suse_version}
BuildRequires: fdupes
BuildRequires: gcc-fortran
%else
BuildRequires: gcc-gfortran
%endif
%if ! 0%{?fedora_version}
Provides: python-numeric = %{version}
Obsoletes: python-numeric < %{version}
%endif
Provides: numpy = %{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%python_subpackages
%description
NumPy is a general-purpose array-processing package designed to
efficiently manipulate large multi-dimensional arrays of arbitrary
@@ -85,25 +80,23 @@ interfacing with general-purpose data-base applications.
There are also basic facilities for discrete fourier transform,
basic linear algebra and random number generation.
%package devel
Summary: Development files for numpy applications
Group: Development/Libraries/Python
Requires: %{name} = %{version}
Requires: blas-devel
Requires: lapack-devel
Requires: python-devel >= %{py_ver}
%if %{with openblas}
BuildRequires: openblas-devel
%endif
%if 0%{?suse_version}
Requires: gcc-fortran
%else
Requires: gcc-gfortran
Requires: lapack-devel
Requires: python-devel
%if %{with openblas}
Requires: openblas-devel
%endif
%description devel
This package contains files for developing applications using numpy.
%prep
%setup -q -n numpy-%{version}
%patch0 -p1
@@ -111,20 +104,23 @@ This package contains files for developing applications using numpy.
# Fix non-executable scripts
sed -i "1d" numpy/{compat/setup,distutils/{conv_template,cpuinfo,exec_command,from_template,setup,system_info},f2py/{__init__,auxfuncs,capi_maps,cb_rules,cfuncs,common_rules,crackfortran,diagnose,f2py2e,f90mod_rules,func2subr,rules,setup,use_rules},ma/setup,matrixlib/setup,setup,testing/{print_coercion_tables,setup}}.py
%build
CFLAGS="%{optflags} -fno-strict-aliasing" python setup.py build
export CFLAGS="%{optflags} -fno-strict-aliasing"
%python_build
%install
python setup.py install --root=%{buildroot} --prefix="%{_prefix}"
rm -rf %{buildroot}%{python_sitearch}/numpy/{,core,distutils,f2py,fft,lib,linalg,ma,matrixlib,oldnumeric,polynomial,random,testing}/tests # Don't package testsuite
%if 0%{?suse_version}
%fdupes -s %{buildroot}%{_prefix}
%endif
%python_exec setup.py install --prefix=%{_prefix} --root=%{buildroot}
%python_expand rm -rf %{buildroot}%{$python_sitearch}/numpy/{,core,distutils,f2py,fft,lib,linalg,ma,matrixlib,oldnumeric,polynomial,random,testing}/tests # Don't package testsuite
%fdupes %{buildroot}%{prefix}
%files
%files %{python_files}
%defattr(-,root,root)
%doc *.txt
%{_bindir}/f2py
%python2_only %{_bindir}/f2py2
%python3_only %{_bindir}/f2py3
%{python_sitearch}/numpy/
%{python_sitearch}/numpy-%{version}-py*.egg-info
%exclude %{python_sitearch}/numpy/*/*/*.c
@@ -133,8 +129,10 @@ rm -rf %{buildroot}%{python_sitearch}/numpy/{,core,distutils,f2py,fft,lib,linalg
%exclude %{python_sitearch}/numpy/*/*/*/*.h
%exclude %{python_sitearch}/numpy/core/lib/libnpymath.a
%files devel
%files %{python_files devel}
%defattr(-,root,root)
%doc LICENSE.txt
%{python_sitearch}/numpy/*/*/*.c
%{python_sitearch}/numpy/*/*.h
%{python_sitearch}/numpy/*/*/*.h