[packages/python-pypar] - build with python-numpy - rel 8

baggins baggins at pld-linux.org
Mon Mar 6 19:03:52 CET 2017


commit c615d5708d2f6122830ce0a5a8b7e06686c4a6bd
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Mon Mar 6 19:03:29 2017 +0100

    - build with python-numpy
    - rel 8

 numpy.patch       | 38 ++++++++++++++++++++++++++++++++++++++
 python-pypar.spec | 20 +++++++++-----------
 2 files changed, 47 insertions(+), 11 deletions(-)
---
diff --git a/python-pypar.spec b/python-pypar.spec
index 879aa60..6aae2d8 100644
--- a/python-pypar.spec
+++ b/python-pypar.spec
@@ -1,22 +1,22 @@
 
-%define 	module	pypar
-
+%define		module	pypar
 Summary:	pypar - Parallel Programming in the spirit of Python!
 Summary(pl.UTF-8):	pypar - programowanie równoległe w duchu Pythona
 Name:		python-%{module}
 Version:	1.9.3
-Release:	7
+Release:	8
 License:	GPL
 Group:		Libraries/Python
 Source0:	http://datamining.anu.edu.au/~ole/pypar/%{module}_%{version}.tgz
 # Source0-md5:	7039dc549acd1db9806e7510c8eb93dc
 Patch0:		%{name}-build.patch
+Patch1:		numpy.patch
 URL:		http://datamining.anu.edu.au/~ole/pypar/
 BuildRequires:	rpmbuild(macros) >= 1.710
 BuildRequires:	mpi
-BuildRequires:	python-Numeric-devel
 BuildRequires:	python-devel >= 1:2.5
 BuildRequires:	python-numarray-devel
+BuildRequires:	python-numpy-devel
 BuildRequires:	rpm-pythonprov
 %pyrequires_eq	python-libs
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -50,21 +50,19 @@ Pakiet zawierający programy przykładowe dla modułu Pythona pypar.
 %prep
 %setup -q -n %{module}_%{version}
 %patch0 -p1
+%patch1 -p1
 
 %build
-CFLAGS="%{rpmcflags}"
-export CFLAGS
-python setup.py build_ext
+export CFLAGS="%{rpmcflags}"
+%py_build %{?with_tests:test}
 
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{%{py_sitedir},%{_examplesdir}/%{name}-%{version}}
 
-%py_install \
-	--install-lib=%{py_sitedir} \
-	--optimize=2
+%py_install
 
-find $RPM_BUILD_ROOT%{py_sitedir} -name \*.py -exec rm {} \;
+%py_postclean
 
 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
 
diff --git a/numpy.patch b/numpy.patch
new file mode 100644
index 0000000..fae5b27
--- /dev/null
+++ b/numpy.patch
@@ -0,0 +1,38 @@
+--- pypar_1.9.3/setup.py.orig	2006-08-08 08:28:00.000000000 +0200
++++ pypar_1.9.3/setup.py	2017-03-06 18:53:41.295502420 +0100
+@@ -122,10 +122,15 @@
+             'def_macros': def_macros, 'undef_macros': undef_macros}
+ 
+ 
++def _get_numpy_include_dir():
++    import numpy
++    return numpy.get_include()
++
+ if __name__ == "__main__":
+     setup_compiler()
+ 
+     mpi_flags = get_mpi_flags()
++    numpy_include_dir = _get_numpy_include_dir()
+ 
+ 
+     # FIXME: It would be good to set specific compiler flags, e.g.
+@@ -152,7 +157,7 @@
+           packages  = ['pypar'],
+           ext_modules = [Extension('pypar.mpiext',
+                                    ['lib/pypar/mpiext.c'],
+-                                   include_dirs=mpi_flags['inc_dirs'],
++                                   include_dirs=[mpi_flags['inc_dirs'],numpy_include_dir],
+                                    library_dirs=mpi_flags['lib_dirs'],
+                                    libraries=mpi_flags['libs'],
+                                    define_macros=mpi_flags['def_macros'],
+--- pypar_1.9.3/lib/pypar/mpiext.c~	2006-08-08 08:28:00.000000000 +0200
++++ pypar_1.9.3/lib/pypar/mpiext.c	2017-03-06 07:59:26.935464626 +0100
+@@ -30,7 +30,7 @@
+ #include "Python.h"
+ #include "mpi.h"
+ #include "math.h"
+-#include "Numeric/arrayobject.h"
++#include "numpy/arrayobject.h"
+ 
+ /* to handle MPI constants export (shamelessly stolen from _cursesmodule.c)*/
+ #define SetDictInt(string,ch) \
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-pypar.git/commitdiff/c615d5708d2f6122830ce0a5a8b7e06686c4a6bd



More information about the pld-cvs-commit mailing list