# Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. # Allow for some fuzz %global _default_patch_fuzz 2 # Disable build id note requirement for now %undefine _missing_build_ids_terminate_build # Force special prefix for Vespa %define _prefix /opt/vespa-deps # Version %define ver_major 1 %define ver_minor 76 %define ver_patch 0 %define ver_release 1 Name: vespa-boost Version: %{ver_major}.%{ver_minor}.%{ver_patch} Release: %{ver_release}%{?dist} Summary: The free peer-reviewed portable C++ source libraries. Built for Vespa. URL: http://www.boost.org Group: System Environment/Libraries License: Boost and MIT and Python Source: https://sourceforge.net/projects/boost/files/boost/%{ver_major}.%{ver_minor}.%{ver_patch}/boost_%{ver_major}_%{ver_minor}_%{ver_patch}.tar.bz2 Requires: bzip2%{?_isa} Requires: zlib%{?_isa} Requires: libicu%{?_isa} BuildRequires: m4 BuildRequires: bzip2-devel%{?_isa} BuildRequires: zlib-devel%{?_isa} BuildRequires: libicu-devel%{?_isa} %if 0%{?el7} %if 0%{?amzn2} BuildRequires: gcc10-c++%{?_isa} %else BuildRequires: devtoolset-10-gcc-c++%{?_isa} %define _devtoolset_enable /opt/rh/devtoolset-10/enable %endif %endif %if 0%{?el8} BuildRequires: gcc-toolset-10-gcc-c++ BuildRequires: gcc-toolset-10-binutils %define _devtoolset_enable /opt/rh/gcc-toolset-10/enable BuildRequires: make %endif %description Boost provides free peer-reviewed portable C++ source libraries. The emphasis is on libraries which work well with the C++ Standard Library, in the hopes of establishing "existing practice" for extensions and providing reference implementations so that the Boost libraries are suitable for eventual standardization. (Some of the libraries have already been included in the C++ 2011 standard and others have been proposed to the C++ Standards Committee for inclusion in future standards.) This distribution contains the necessary libraries needed for Vespa. The original boost distribution has been patched with the included patches. %package devel Summary: Headers and libraries for building apps that use vspa-boost Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel Contains develompemnt headers and static libraries for vespa-boost. %prep %setup -q -n boost_%{ver_major}_%{ver_minor}_%{ver_patch} %define _cxxflags '-std=c++2a -DNOT_BOOST_SPIRIT_THREADSAFE=1 -DNOT_PHOENIX_THREADSAFE=1 -DBOOST_NO_AUTO_PTR=1' %build %if 0%{?_devtoolset_enable:1} source %{_devtoolset_enable} || true %endif export BOOST_LIBS="iostreams,filesystem,program_options,regex,serialization,system,test,thread,timer,chrono" export CXXFLAGS="-std=c++2a -DNOT_BOOST_SPIRIT_THREADSAFE=1 -DNOT_PHOENIX_THREADSAFE=1 -DBOOST_NO_AUTO_PTR=1" %if 0%{?el7} && 0%{?amzn2} mkdir -p gcc-wrap echo -e '#!/bin/sh\nexec gcc10-gcc "$@"' > gcc-wrap/gcc echo -e '#!/bin/sh\nexec gcc10-g++ "$@"' > gcc-wrap/g++ chmod 755 gcc-wrap/gcc gcc-wrap/g++ export PATH=$(pwd)/gcc-wrap:$PATH %endif ./bootstrap.sh --with-libraries=$BOOST_LIBS --prefix=%{buildroot}/%{_prefix} --libdir=%{buildroot}/%{_prefix}/lib64 ./b2 -d+2 %{_smp_mflags} variant=release debug-symbols=on threading=multi link=shared runtime-link=shared dll-path=%{_prefix}/lib64 cxxflags=%{_cxxflags} --layout=versioned --prefix=%{buildroot}/%{_prefix} --libdir=%{buildroot}/%{_prefix}/lib64 %install rm -rf $RPM_BUILD_ROOT %if 0%{?_devtoolset_enable:1} source %{_devtoolset_enable} || true %endif %if 0%{?el7} && 0%{?amzn2} export PATH=$(pwd)/gcc-wrap:$PATH %endif ./b2 -d+2 %{_smp_mflags} variant=release debug-symbols=on threading=multi link=shared runtime-link=shared dll-path=%{_prefix}/lib64 cxxflags=%{_cxxflags} install --layout=versioned --prefix=%{buildroot}/%{_prefix} --libdir=%{buildroot}/%{_prefix}/lib64 --no-cmake-config cd %{buildroot}/%{_includedir} mv boost-%{ver_major}_%{ver_minor}/boost . rm -rf boost-%{ver_major}_%{ver_mainor} cd %{buildroot}/%{_prefix}/lib64 for i in $(ls *.so); do lnk=$(echo $i | sed "s/-gcc[0-9]*-/-/" | sed "s/-%{ver_major}_%{ver_minor}//"); ln -s $i $lnk; done for f in $(ls *\-mt.so); do ln -s "$f" "${f%.*}-d.so"; done %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %license LICENSE_1_0.txt %doc %{_prefix}/lib64/*.so* %files devel %defattr(-,root,root,-) %license LICENSE_1_0.txt %{_includedir}/boost %{_prefix}/lib64/*.a %changelog