File boost1.66_python2.spec of Package boost1.66_python2
#
# spec file for package boost
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define ver 1.66.0
%define file_version 1_66_0
%define docs_version 1.56.0
%define short_version 1_56
%define lib_appendix 1_66_0
%bcond_with build_docs
%bcond_with package_pdf
%bcond_with build_quickbook
%bcond_with boost_devel
%define my_docdir %{_docdir}/boost-%{version}
%define build_base 0
%define name_suffix %nil
# Build with OpenMPI
%if 0%{?suse_version} >= 1330
# OpenMPI >= 2 is not available on ppc64be
%ifarch ppc64
%define mpi_implem openmpi
%else
%define mpi_implem openmpi2
%endif
%else
# Keep OpenMPI1 for older releases where OpenMPI2 is not available
%define mpi_implem openmpi
%endif
%ifarch ia64 hppa
%bcond_with build_mpi
%else
%bcond_without build_mpi
%endif
%bcond_with python3
%bcond_without python2
# 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
%else
%bcond_with build_context
%endif
# needs newer *default* GCC to compile runtime
%if %{with build_context} && 0%{?suse_version} > 1320
%bcond_without boost_fiber
%else
%bcond_with boost_fiber
%endif
%define package_prefix %{_prefix}
%define package_bindir %{_bindir}
%define package_libdir %{_libdir}
%define package_includedir %{_includedir}
%define base_name boost%{name_suffix}
%define package_python2_sitearch %python2_sitearch
%define package_python3_sitearch %python3_sitearch
Name: boost%name_suffix
%define package_name boost_1_66
Version: 1.66.0
Release: 0
Summary: Boost C++ Libraries
License: BSL-1.0
Group: Development/Libraries/C and C++
Url: http://www.boost.org
Source0: http://downloads.sourceforge.net/project/boost/boost/%{version}/boost_%{file_version}.tar.bz2
Source1: boost-rpmlintrc
Source3: http://downloads.sourceforge.net/project/boost/boost-docs/%{docs_version}/boost_%{short_version}_pdf.tar.bz2
Source4: existing_extra_docs
#Source5: NEWS
Source10: exception.objdump
Source11: __init__.py
Source100: baselibs.conf
Source101: symbol_diff.sh
Source102: README.boost-devel
Patch1: boost-thread.patch
Patch2: boost-no_type_punning.patch
Patch3: boost-no_segfault_in_Regex_filter.patch
Patch4: boost-pool_check_overflow.patch
Patch5: boost-strict_aliasing.patch
Patch6: boost-use_std_xml_catalog.patch
Patch7: boost-rpmoptflags-only.patch
Patch9: boost-aarch64-flags.patch
Patch10: boost-disable-pch-on-aarch64.patch
Patch13: boost-visibility.patch
Patch14: boost-1.57.0-python-libpython_dep.patch
Patch15: boost-1.57.0-python-abi_letters.patch
Patch16: boost-1.55.0-python-test-PyImport_AppendInittab.patch
Patch17: python_mpi.patch
Patch18: dynamic_linking.patch
Patch20: python_library_name.patch
Patch21: python_numpy_retfunc.patch
Patch22: libreoffice_compat_backports.patch
Patch23: variant.patch
BuildRequires: fdupes
BuildRequires: libbz2-devel
BuildRequires: libexpat-devel
BuildRequires: libicu-devel
BuildRequires: zlib-devel
BuildRequires: gcc-c++
BuildRequires: dos2unix
BuildRequires: python2-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?sle_version} == 150600
# avoid conflict with official boost update
Epoch: 1
%endif
%description
Boost provides free peer-reviewed portable C++ source libraries. The
emphasis is on libraries that work well with the C++ Standard Library.
One goal is to establish "existing practice" and provide reference
implementations so that the Boost libraries are suitable for eventual
standardization. Some of the libraries have already been proposed for
inclusion in the C++ Standards Committee's upcoming C++ Standard
Library Technical Report.
Although Boost was begun by members of the C++ Standards Committee
Library Working Group, membership has expanded to include nearly two
thousand members of the C++ community at large.
%package -n libboost_python-py2_7-%{lib_appendix}
Summary: Boost.Python runtime library
Group: System/Libraries
Requires: boost-license%{lib_appendix}
%if 0%{?sle_version} == 150600
# needed due to Epoch
Provides: libboost_python-py2_7-%{lib_appendix} = %{version}
%endif
%description -n libboost_python-py2_7-%{lib_appendix}
This package contains the Boost::Python runtime library for default
version of python.
%package -n libboost_python-py2_7-%{lib_appendix}-devel
Summary: Development headers for Boost.Python library
Group: Development/Libraries/C and C++
PreReq: libboost_headers%{lib_appendix}-devel = %{version}
Requires: libboost_python-py2_7-%{lib_appendix} = %{version}
Provides: libboost_python-devel = %{version}
Conflicts: otherproviders(libboost_python-devel)
Conflicts: boost-devel < 1.63
%description -n libboost_python-py2_7-%{lib_appendix}-devel
Development headers for Boost::Python library for the default version of
python.
%prep
%setup -q -n boost_%{lib_appendix} -b 3
#everything in the tarball has the executable flag set ...
find -type f ! \( -name \*.sh -o -name \*.py -o -name \*.pl \) -exec chmod -x {} +
%patch1 -p1
%patch2
%patch3
%patch4
%patch5
%patch6 -p1
%patch7
%patch9 -p1
%patch10 -p1
%patch13
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
%build
find . -type f -exec chmod u+w {} +
# General case
cat << EOF >user-config.jam
import os ;
local RPM_OPT_FLAGS = [ os.environ RPM_OPT_FLAGS ] ;
using gcc : : : <compileflags>\$(RPM_OPT_FLAGS) ;
project user-config ;
EOF
# Since boost build system is broken and incable of handling multiple python versions,
# we need to build boost piece by piece. First time to build all the non-python bits,
# then we build MPI and/or PYTHON modules for two python versions we need.
# MPI builds a python module.
cat << \EOF >.build
export PY_LIBRARIES_FLAGS="--with-python"
# Dummy entry to make sure we don't build everything
export LIBRARIES_FLAGS="--with-system"
EOF
# Need specific Boost Jam config files.
# 1. one all "normal" libraries
# 2. one for each python version for for python/mpi libraries
# use staging directories for MPI/PYTHON combinations.
# General case
# alias boost_python_alias : : <library>/boost/python//boost_python ;
cat << EOF >user-config.jam
EOF
# bootstrap b2
./bootstrap.sh \
--prefix=%{package_prefix} --exec-prefix=%{package_bindir} \
--libdir=%{package_libdir} --includedir=%{package_includedir} \
--with-toolset=gcc
# Read shared build instructions
. ./.build
# Build boost base PYTHON and MPI, installed in python staging
cp user-config.jam user-config-py.jam
cat << EOF >> user-config-py.jam
using python
: %{py_ver}
: %{_bindir}/python2
: %{_includedir}/python%{py_ver}
: %{_libdir}/python%{py_ver}
:
:
;
EOF
./b2 -d+2 -q --user-config=./user-config-py.jam \
--build-type=minimal --build-dir=./python-build \
--python-buildid=py2.7 \
--stagedir=./python-stage %{?_smp_mflags} \
$PY_LIBRARIES_FLAGS \
threading=multi link=shared runtime-link=shared stage
%install
# Read shared build instructions
. ./.build
./b2 -d+2 -q --user-config=./user-config-py.jam \
--build-type=minimal --build-dir=./python-build \
--python-buildid=py2.7 \
--prefix=%{buildroot}%{package_prefix} --exec-prefix=%{buildroot}%{package_bindir} \
--libdir=%{buildroot}%{package_libdir} --includedir=%{buildroot}%{package_includedir} \
--stagedir=./python-stage %{?_smp_mflags} \
$PY_LIBRARIES_FLAGS \
threading=multi link=shared runtime-link=shared install
ln -s libboost_python-py2_7.so %{buildroot}%{_libdir}/libboost_python.so
# Move Python libraries over to proper places
#mkdir -p %{buildroot}%{package_python2_sitearch}/boost/parallel/mpi/
#mv %{buildroot}/%{package_libdir}/mpi.so %{buildroot}%{package_python2_sitearch}/boost/parallel/mpi/
#install -m 0644 libs/mpi/build/__init__.py %{buildroot}%{package_python2_sitearch}/boost/parallel/mpi/
#install -m 0644 %{SOURCE11} %{buildroot}%{package_python2_sitearch}/boost/parallel
#install -m 0644 %{SOURCE11} %{buildroot}%{package_python2_sitearch}/boost
rm -r %{buildroot}%{package_includedir}/boost
%post -n libboost_python-py2_7-%{lib_appendix} -p /sbin/ldconfig
%postun -n libboost_python-py2_7-%{lib_appendix} -p /sbin/ldconfig
%files -n libboost_python-py2_7-%{lib_appendix}
%defattr(-, root, root, -)
%{_libdir}/libboost_python-py2_7.so.%{version}
%files -n libboost_python-py2_7-%{lib_appendix}-devel
%defattr(-, root, root, -)
%{_libdir}/libboost_python.so
%{_libdir}/libboost_python-py2_7.so
%changelog