!61 [sync] PR-60: extract common b2 configs into b2_config and utilize --no-cmake-config

Merge pull request !61 from openeuler-sync-bot/sync-pr60-openEuler-22.03-LTS-Next-to-master
This commit is contained in:
openeuler-ci-bot 2021-12-22 08:59:36 +00:00 committed by Gitee
commit 36ed8a7d22

View File

@ -9,7 +9,7 @@
Name: boost
Version: 1.78.0
Release: 2
Release: 3
Summary: The free peer-reviewed portable C++ source libraries
License: Boost Software License 1.0
URL: http://www.boost.org
@ -548,12 +548,14 @@ using python : %{python3_version} : /usr/bin/python3 : /usr/include/python%{pyth
EOF
./bootstrap.sh --with-toolset=gcc --with-icu
%define opt_build -d+2 -q %{?_smp_mflags} --no-cmake-config
%define opt_feature variant=release threading=multi debug-symbols=on pch=off
%define opt_python python=%{python3_version}
%define b2_options %{opt_build} %{opt_feature} %{opt_python}
echo ============================= build serial ==================
./b2 -d+2 -q %{?_smp_mflags} \
./b2 %{b2_options} \
--without-mpi --without-graph_parallel --build-dir=serial \
variant=release threading=multi debug-symbols=on pch=off \
python=%{python3_version} \
stage
%if %{with openmpi} || %{with mpich}
@ -564,10 +566,9 @@ module purge ||:
%{_openmpi_load}
echo ============================= build $MPI_COMPILER ==================
./b2 -d+2 -q %{?_smp_mflags} \
./b2 %{b2_options} \
--with-mpi --with-graph_parallel --build-dir=$MPI_COMPILER \
variant=release threading=multi debug-symbols=on pch=off \
python=%{python3_version} stage
stage
%{_openmpi_unload}
export PATH=/bin${PATH:+:}$PATH
@ -577,10 +578,9 @@ export PATH=/bin${PATH:+:}$PATH
%{_mpich_load}
echo ============================= build $MPI_COMPILER ==================
./b2 -d+2 -q %{?_smp_mflags} \
./b2 %{b2_options} \
--with-mpi --with-graph_parallel --build-dir=$MPI_COMPILER \
variant=release threading=multi debug-symbols=on pch=off \
python=%{python3_version} stage
stage
%{_mpich_unload}
export PATH=/bin${PATH:+:}$PATH
@ -603,11 +603,10 @@ module purge ||:
%{_openmpi_load}
echo ============================= install $MPI_COMPILER ==================
./b2 -q %{?_smp_mflags} \
./b2 %{b2_options} \
--with-mpi --with-graph_parallel --build-dir=$MPI_COMPILER \
--stagedir=${RPM_BUILD_ROOT}${MPI_HOME} \
variant=release threading=multi debug-symbols=on pch=off \
python=%{python3_version} stage
install
mkdir -p ${RPM_BUILD_ROOT}%{python3_sitearch}/openmpi/boost
touch ${RPM_BUILD_ROOT}%{python3_sitearch}/openmpi/boost/__init__.py
@ -616,7 +615,6 @@ mv ${RPM_BUILD_ROOT}${MPI_HOME}/lib/boost-python%{python3_version}/mpi.so \
rm -f ${RPM_BUILD_ROOT}${MPI_HOME}/lib/libboost_{python,{w,}serialization}*
rm -f ${RPM_BUILD_ROOT}${MPI_HOME}/lib/libboost_numpy*
rm -r ${RPM_BUILD_ROOT}${MPI_HOME}/lib/cmake
%{_openmpi_unload}
export PATH=/bin${PATH:+:}$PATH
@ -626,11 +624,10 @@ export PATH=/bin${PATH:+:}$PATH
%{_mpich_load}
echo ============================= install $MPI_COMPILER ==================
./b2 -q %{?_smp_mflags} \
./b2 %{b2_options} \
--with-mpi --with-graph_parallel --build-dir=$MPI_COMPILER \
--stagedir=${RPM_BUILD_ROOT}${MPI_HOME} \
variant=release threading=multi debug-symbols=on pch=off \
python=%{python3_version} stage
install
mkdir -p ${RPM_BUILD_ROOT}%{python3_sitearch}/mpich/boost
touch ${RPM_BUILD_ROOT}%{python3_sitearch}/mpich/boost/__init__.py
@ -639,23 +636,18 @@ mv ${RPM_BUILD_ROOT}${MPI_HOME}/lib/boost-python%{python3_version}/mpi.so \
rm -f ${RPM_BUILD_ROOT}${MPI_HOME}/lib/libboost_{python,{w,}serialization}*
rm -f ${RPM_BUILD_ROOT}${MPI_HOME}/lib/libboost_numpy*
rm -r ${RPM_BUILD_ROOT}${MPI_HOME}/lib/cmake
%{_mpich_unload}
export PATH=/bin${PATH:+:}$PATH
%endif
echo ============================= install serial ==================
./b2 -d+2 -q %{?_smp_mflags} \
./b2 %{b2_options} \
--without-mpi --without-graph_parallel --build-dir=serial \
--prefix=$RPM_BUILD_ROOT%{_prefix} \
--libdir=$RPM_BUILD_ROOT%{_libdir} \
variant=release threading=multi debug-symbols=on pch=off \
python=%{python3_version} \
install
rm -r $RPM_BUILD_ROOT/%{_libdir}/cmake
version=%{version}
echo ============================= install Boost.Build ==================
@ -964,6 +956,9 @@ fi
%{_mandir}/man1/bjam.1*
%changelog
* Sun Dec 19 2021 sdlzx <sdlzx@163.com> - 1.78.0-3
- Simplify spec: extract common b2 configs into b2_config
* Fri Dec 10 2021 sdlzx <sdlzx@163.com> - 1.78.0-2
- Simplify spec: remove useless bcond