dev-tools/mpi4py: pivot to python3 only build
%define pname mpi4py
%define PNAME %(echo %{pname} | tr [a-z] [A-Z])
-Name: python-%{pname}-%{compiler_family}-%{mpi_family}%{PROJ_DELIM}
+%if 0%{?sles_version} || 0%{?suse_version}
+%define python3_prefix python3
+%else
+%define python3_prefix python34
+%endif
+
+Name: %{python3_prefix}-%{pname}-%{compiler_family}-%{mpi_family}%{PROJ_DELIM}
Version: 3.0.0
Release: 1%{?dist}
Summary: Python bindings for the Message Passing Interface (MPI) standard.
@@ -31,11 +37,11 @@ Group: %{PROJ_NAME}/dev-tools
Url: https://bitbucket.org/mpi4py/mpi4py
Source0: https://bitbucket.org/mpi4py/mpi4py/downloads/%{pname}-%{version}.tar.gz
Source1: OHPC_macros
-BuildRequires: python-devel
-BuildRequires: python-setuptools
+BuildRequires: %{python3_prefix}-devel
+BuildRequires: %{python3_prefix}-setuptools
#BuildRequires: python-Cython
Requires: lmod%{PROJ_DELIM} >= 7.6.1
-Requires: python
+Requires: %{python3_prefix}
# Default library install path
%define install_path %{OHPC_LIBS}/%{compiler_family}/%{mpi_family}/%{pname}/%version
@@ -56,13 +62,13 @@ find . -type f -name "*.py" -exec sed -i "s|#!/usr/bin/env python||" {} \;
# OpenHPC compiler/mpi designation
%ohpc_setup_compiler
-python setup.py build
+%__python3 setup.py build
%install
# OpenHPC compiler/mpi designation
%ohpc_setup_compiler
-python setup.py install --prefix=%{install_path} --root=%{buildroot}
+%__python3 setup.py install --prefix=%{install_path} --root=%{buildroot}
# OpenHPC module file
%{__mkdir_p} %{buildroot}%{OHPC_MODULEDEPS}/%{compiler_family}-%{mpi_family}/%{pname}
@@ -72,12 +78,12 @@ python setup.py install --prefix=%{install_path} --root=%{buildroot}
proc ModulesHelp { } {
puts stderr " "
-puts stderr "This module loads the %{pname} library built with the %{compiler_family} compiler"
+puts stderr "This module loads the %{python3_prefix}-%{pname} library built with the %{compiler_family} compiler"
puts stderr "toolchain and the %{mpi_family} MPI library."
puts stderr "\nVersion %{version}\n"
}
-module-whatis "Name: %{pname} built with %{compiler_family} compiler and %{mpi_family}"
+module-whatis "Name: %{python3_prefix}-%{pname} built with %{compiler_family} compiler and %{mpi_family}"
module-whatis "Version: %{version}"
module-whatis "Category: python module"
module-whatis "Description: %{summary}"
@@ -85,7 +91,7 @@ module-whatis "URL %{url}"
set version %{version}
-prepend-path PYTHONPATH %{install_path}/lib64/python2.7/site-packages
+prepend-path PYTHONPATH %{install_path}/lib64/python3.4/site-packages
setenv %{PNAME}_DIR %{install_path}
