Accepting request 121373 from devel:languages:python

Fix rpmlint warnings (forwarded request 121372 from TheBlackCat)

OBS-URL: https://build.opensuse.org/request/show/121373
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-numpy?expand=0&rev=19
This commit is contained in:
Stephan Kulow
2012-05-21 06:07:34 +00:00
committed by Git OBS Bridge
parent 5612cc4c1e
commit 57a7e676e3
4 changed files with 73 additions and 54 deletions

View File

@@ -15,14 +15,15 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: python3-numpy
%define modname numpy
Name: python3-%{modname}
Version: 1.6.1
Release: 0
Url: http://sourceforge.net/projects/numpy
Summary: NumPy array processing for numbers, strings, records and objects
License: BSD-3-Clause
Group: Development/Libraries/Python
Source: numpy-%{version}.tar.gz
Source: %{modname}-%{version}.tar.gz
Patch1: numpy-buildfix.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: python3
@@ -32,6 +33,7 @@ BuildRequires: blas-devel
BuildRequires: lapack-devel
%if 0%{?suse_version} <= 1140
%{!?python3_sitearch: %global python3_sitearch %(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%{!?py3_ver: %global py3_ver %(python3 -c "import sys; version=str(sys.version_info[0]) + '.' + str(sys.version_info[1]); print(version)" 2>/dev/null || echo PYTHON-NOT-FOUND)}
%endif
%if 0%{?suse_version}
BuildRequires: gcc-fortran
@@ -54,9 +56,12 @@ There are also basic facilities for discrete fourier transform,
basic linear algebra and random number generation.
%package devel
Summary: Development files for numpy applications
Summary: Development files for %{modname} applications
Group: Development/Libraries/Python
Requires: %{name} = %{version}
Requires: python3 >= %{py3_ver}
Requires: python3-devel >= %{py3_ver}
Requires: python(abi) >= %{py3_ver}
%if 0%{?suse_version} > 1130
Requires: blas-devel
Requires: lapack-devel
@@ -64,29 +69,26 @@ Requires: lapack-devel
Requires: blas
Requires: lapack
%endif
Requires: python3 >= %{py3_ver}
Requires: python3-devel >= %{py3_ver}
%if 0%{?suse_version}
Requires: gcc-fortran
%else
Requires: gcc-gfortran
Requires: gcc-gfortran
%endif
%description devel
This package contains files for developing applications using numpy.
This package contains files for developing applications using %{modname}.
%prep
%setup -q -n numpy-%{version}
%setup -q -n %{modname}-%{version}
%patch1 -p0
sed -i "1d" numpy/{compat/setup{,scons},distutils/{conv_template,cpuinfo,exec_command,from_template,setup,setupscons,system_info},f2py/{auxfuncs,capi_maps,cb_rules,cfuncs,common_rules,crackfortran,diagnose,docs/usersguide/setup_example,f2py2e,f90mod_rules,func2subr,__init__,rules,setup,setupscons,use_rules},ma/setup{,scons},matrixlib/setup{,scons},setup,setupscons,testing/print_coercion_tables,testing/setup{,scons}}.py # Fix non-executable scripts
sed -i "1d" %{modname}/{compat/setup{,scons},distutils/{conv_template,cpuinfo,exec_command,from_template,setup,setupscons,system_info},f2py/{auxfuncs,capi_maps,cb_rules,cfuncs,common_rules,crackfortran,diagnose,docs/usersguide/setup_example,f2py2e,f90mod_rules,func2subr,__init__,rules,setup,setupscons,use_rules},ma/setup{,scons},matrixlib/setup{,scons},setup,setupscons,testing/print_coercion_tables,testing/setup{,scons}}.py # Fix non-executable scripts
%build
CFLAGS="%{optflags} -fno-strict-aliasing" python3 setup.py build
%install
python3 setup.py install --root="%{buildroot}" --prefix="%{_prefix}"
rm -rf %{buildroot}%{python3_sitearch}/numpy/{,core,distutils,f2py,fft,ma,matrixlib,oldnumeric,polynomial,random,testing}/tests # Don't package testsuite
mv %{buildroot}%{_bindir}/f2py3 %{buildroot}%{_bindir}/f2py3-python3
rm -rf %{buildroot}%{python3_sitearch}/%{modname}/{,core,distutils,f2py,fft,ma,matrixlib,oldnumeric,polynomial,random,testing}/tests # Don't package testsuite
%if 0%{?suse_version}
%fdupes -s %{buildroot}%{_prefix}
%endif
@@ -94,20 +96,21 @@ mv %{buildroot}%{_bindir}/f2py3 %{buildroot}%{_bindir}/f2py3-python3
%files
%defattr(-,root,root)
%doc *.txt
%{_bindir}/f2py3-python3
%{python3_sitearch}/*
%exclude %{python3_sitearch}/numpy/*/*/*.c
%exclude %{python3_sitearch}/numpy/*/*.h
%exclude %{python3_sitearch}/numpy/*/*/*.h
%exclude %{python3_sitearch}/numpy/*/*/*/*.h
%exclude %{python3_sitearch}/numpy/core/lib/libnpymath.a
%{_bindir}/f2py3
%{python3_sitearch}/%{modname}/
%{python3_sitearch}/%{modname}-%{version}-py%{py3_ver}.egg-info
%exclude %{python3_sitearch}/%{modname}/*/*/*.c
%exclude %{python3_sitearch}/%{modname}/*/*.h
%exclude %{python3_sitearch}/%{modname}/*/*/*.h
%exclude %{python3_sitearch}/%{modname}/*/*/*/*.h
%exclude %{python3_sitearch}/%{modname}/core/lib/libnpymath.a
%files devel
%defattr(-,root,root)
%{python3_sitearch}/numpy/*/*/*.c
%{python3_sitearch}/numpy/*/*.h
%{python3_sitearch}/numpy/*/*/*.h
%{python3_sitearch}/numpy/*/*/*/*.h
%{python3_sitearch}/numpy/core/lib/libnpymath.a
%{python3_sitearch}/%{modname}/*/*/*.c
%{python3_sitearch}/%{modname}/*/*.h
%{python3_sitearch}/%{modname}/*/*/*.h
%{python3_sitearch}/%{modname}/*/*/*/*.h
%{python3_sitearch}/%{modname}/core/lib/libnpymath.a
%changelog