Add python macros to allow OHPC-style builds of multiple python flavored packages from a single spec
@@ -59,6 +59,7 @@ BuildRequires: ohpc-buildroot
%{!?compiler_family: %global compiler_family gnu7}
%{!?mpi_family: %global mpi_family openmpi3}
+%{!?python_family: %global python_family python3}
# Compiler dependencies
%if 0%{?ohpc_compiler_dependent} == 1
@@ -115,9 +116,32 @@ Requires: openmpi3-%{compiler_family}%{PROJ_DELIM}
%endif
%endif
+# Python dependencies and macros
+%if 0%{?ohpc_python_dependent} == 1
+%if "%{python_family}" == "python3"
+%global __python %__python3
+%global python_lib_dir python3.4
+%if "%{rhel_version}" == "700"
+%global python_prefix python34
+%endif
+%if 0%{?suse_version}
+%global python_prefix python3
+%endif
+%endif
+%if "%{python_family}" == "python2"
+%global python_lib_dir python2.7
+%global python_prefix python
+%endif
+BuildRequires: %{python_prefix}-devel
+BuildRequires: %{python_prefix}-setuptools
+BuildRequires: python-rpm-macros
+Requires: %{python_prefix}
+%endif
+
%global ohpc_setup_compiler %{expand:\
. %{OHPC_ADMIN}/ohpc/OHPC_setup_compiler %{compiler_family} \
%if 0%{?ohpc_mpi_dependent} == 1 \
. %{OHPC_ADMIN}/ohpc/OHPC_setup_mpi %{mpi_family} \
%endif \
}
+
