- make python-numpy optional build dependency

- fix building of mpi python3 plugin

OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/boost?expand=0&rev=196
This commit is contained in:
Adam Majer 2017-05-08 11:35:23 +00:00 committed by Git OBS Bridge
parent e1c5a89560
commit d6d4311bb4
2 changed files with 39 additions and 3 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon May 8 11:31:17 UTC 2017 - adam.majer@suse.de
- make python-numpy optional build dependency
- fix building of mpi python3 plugin
-------------------------------------------------------------------
Thu Apr 20 13:52:20 EST 2017 - adam.majer@suse.de

View File

@ -39,6 +39,14 @@
%bcond_without python3
%endif
# Python NumPy library is only available on Leap 42.1 OpenSUSE onward
# and is not availble in SLE
%if 0%{?suse_version} >= 1330 || 0%{?is_opensuse}
%bcond_without python_numpy
%else
%bcond_with python_numpy
%endif
# context hasn't been ported to most architectures yet
%ifarch %ix86 x86_64 %arm aarch64 mips ppc ppc64 ppc64le
%bcond_without build_context
@ -112,11 +120,15 @@ BuildRequires: libbz2-devel
BuildRequires: libexpat-devel
BuildRequires: libicu-devel
BuildRequires: python-devel
%if %{with python_numpy}
BuildRequires: python-numpy-devel
%endif
%if %{with python3}
BuildRequires: python3-devel
%if %{with python_numpy}
BuildRequires: python3-numpy-devel
%endif
%endif # numpy
%endif # python3
#!BuildIgnore: python
BuildRequires: zlib-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -712,6 +724,7 @@ Conflicts: boost-devel < 1.63
Development headers for Boost::Python library for the default version of
python.
%if %{with python_numpy}
%package -n libboost_numpy-py2_7-%{lib_appendix}
Summary: Boost.Python.NumPy runtime library
Group: System/Libraries
@ -733,6 +746,7 @@ Conflicts: boost-devel < 1.63
%description -n libboost_numpy-py2_7-%{lib_appendix}-devel
Development headers for Boost::Python::NumPy library for the default version of
python.
%endif
%if %{with python3}
%package -n libboost_python-py3-%{lib_appendix}
@ -757,6 +771,7 @@ Conflicts: boost-devel < 1.63
Development headers for Boost.Python library. This package contains
library for python3 development for boost.
%if %{with python_numpy}
%package -n libboost_numpy-py3-%{lib_appendix}
Summary: Boost.Python.NumPy runtime library
Group: System/Libraries
@ -778,6 +793,7 @@ Conflicts: boost-devel < 1.63
%description -n libboost_numpy-py3-%{lib_appendix}-devel
Development headers for Boost.Python.NumPy library. This package contains
library for python3 development for boost.
%endif # with numpy
%endif # with python3
@ -1130,7 +1146,9 @@ EOF
%if %{with python3}
cp user-config.jam user-config-py3.jam
# sed -i -e 's#//boost_python#//boost_python3#' ./user-config-py3.jam
%{?!py3_abiflags:%define py3_abiflags m}
%{?!py3_abiflags: %define py3_abiflags m}
%{?!python3_version: %define python3_version %py3_ver }
cat << EOF >> user-config-py3.jam
using python
: %{python3_version}
@ -1267,7 +1285,7 @@ install -m 0644 %{SOURCE11} %{buildroot}%{py_sitedir}/boost
%if %{with python3}
mkdir -p %{buildroot}%{python3_sitearch}/boost/parallel/mpi/
mv %{buildroot}/%{_libdir}/mpi.%{py3_soflags}.so %{buildroot}%{python3_sitearch}/boost/parallel/mpi/
mv %{buildroot}/%{_libdir}/mpi.*so %{buildroot}%{python3_sitearch}/boost/parallel/mpi/mpi.%{py3_soflags}.so
install -m 0644 libs/mpi/build/__init__.py %{buildroot}%{python3_sitearch}/boost/parallel/mpi/
install -m 0644 %{SOURCE11} %{buildroot}%{python3_sitearch}/boost/parallel
install -m 0644 %{SOURCE11} %{buildroot}%{python3_sitearch}/boost
@ -1349,13 +1367,17 @@ rm -r %{buildroot}%{_includedir}/boost/context
%post -n libboost_python-py2_7-%{lib_appendix} -p /sbin/ldconfig
%if %{with python_numpy}
%post -n libboost_numpy-py2_7-%{lib_appendix} -p /sbin/ldconfig
%endif
%if %{with python3}
%post -n libboost_python-py3-%{lib_appendix} -p /sbin/ldconfig
%if %{with python_numpy}
%post -n libboost_numpy-py3-%{lib_appendix} -p /sbin/ldconfig
%endif
%endif
%post -n libboost_regex%{lib_appendix} -p /sbin/ldconfig
@ -1418,13 +1440,17 @@ rm -r %{buildroot}%{_includedir}/boost/context
%postun -n libboost_python-py2_7-%{lib_appendix} -p /sbin/ldconfig
%if %{with python_numpy}
%postun -n libboost_numpy-py2_7-%{lib_appendix} -p /sbin/ldconfig
%endif
%if %{with python3}
%postun -n libboost_python-py3-%{lib_appendix} -p /sbin/ldconfig
%if %{with python_numpy}
%postun -n libboost_numpy-py3-%{lib_appendix} -p /sbin/ldconfig
%endif
%endif
%postun -n libboost_regex%{lib_appendix} -p /sbin/ldconfig
@ -1668,6 +1694,7 @@ rm -r %{buildroot}%{_includedir}/boost/context
%{_libdir}/libboost_python.so
%{_libdir}/libboost_python-py2_7.so
%if %{with python_numpy}
%files -n libboost_numpy-py2_7-%{lib_appendix}
%defattr(-, root, root, -)
%{_libdir}/libboost_numpy-py2_7.so.%{version}
@ -1675,6 +1702,7 @@ rm -r %{buildroot}%{_includedir}/boost/context
%files -n libboost_numpy-py2_7-%{lib_appendix}-devel
%defattr(-, root, root, -)
%{_libdir}/libboost_numpy-py2_7.so
%endif
%if %{with python3}
%files -n libboost_python-py3-%{lib_appendix}
@ -1686,6 +1714,7 @@ rm -r %{buildroot}%{_includedir}/boost/context
%{_libdir}/libboost_python3.so
%{_libdir}/libboost_python-py3.so
%if %{with python_numpy}
%files -n libboost_numpy-py3-%{lib_appendix}
%defattr(-, root, root, -)
%{_libdir}/libboost_numpy-py3.so.%{version}
@ -1694,6 +1723,7 @@ rm -r %{buildroot}%{_includedir}/boost/context
%defattr(-, root, root, -)
%{_libdir}/libboost_numpy-py3.so
%endif # with numpy
%endif # with python3
%files -n libboost_serialization%{lib_appendix}