Refactor boost-help

Merge HTML documents and code examples into boost-help.
Also simplify install scripts.

Signed-off-by: Liu Zixian <liuzixian4@huawei.com>
(cherry picked from commit dca39bd27b32d928677339024c48d4378105d702)
This commit is contained in:
Liu Zixian 2022-01-23 11:13:31 +08:00 committed by openeuler-sync-bot
parent 9980260d15
commit f9fa8bee1e

View File

@ -1,10 +1,8 @@
%global boost_docdir __tmp_docdir
%global boost_examplesdir __tmp_examplesdir
%global version_enc 1_78_0
Name: boost
Version: 1.78.0
Release: 6
Release: 7
Summary: The free peer-reviewed portable C++ source libraries
License: Boost Software License 1.0
URL: http://www.boost.org
@ -249,21 +247,14 @@ Headers shared object symbolic links for the Boost C++ libraries and static
Boost C++ libraries distributed with boost.
%package help
Summary: HTML documentation for the Boost C++ libraries
BuildArch: noarch
%description help
This package contains the documentation in the HTML format of the Boost C++
libraries. The documentation provides the same content as that on the Boost
web page (http://www.boost.org/doc/libs/%{version_enc}).
%package examples
Summary: Source examples for the Boost C++ libraries
Summary: HTML documentation and source code example for the Boost C++ libraries
BuildArch: noarch
Requires: boost-devel = %{version}-%{release}
%description examples
This package contains example source files distributed with boost.
%description help
This package contains the documentation in the HTML format and source code examples
of the Boost C++ libraries. The documentation provides the same content
as that on the Boost web page (http://www.boost.org/doc/libs/%{version_enc}).
%prep
%autosetup -p1 -n %{name}_%{version_enc}
@ -300,62 +291,16 @@ EOF
:
%install
echo ============================= install libraries ==================
./b2 %{b2_options} \
--without-mpi --without-graph_parallel \
--prefix=$RPM_BUILD_ROOT%{_prefix} \
--libdir=$RPM_BUILD_ROOT%{_libdir} \
install
version=%{version}
echo ============================= install documentation ==================
rm -rf %{boost_docdir} && %{__mkdir_p} %{boost_docdir}/html
DOCPATH=%{boost_docdir}
DOCREGEX='.*\.\(html?\|css\|png\|gif\)'
find libs doc more -type f -regex $DOCREGEX | sed -n '/\//{s,/[^/]*$,,;p}' | sort -u > tmp-doc-directories
sed "s:^:$DOCPATH/:" tmp-doc-directories | xargs -P 0 --no-run-if-empty %{__install} -d
cat tmp-doc-directories | while read tobeinstalleddocdir; do
find $tobeinstalleddocdir -mindepth 1 -maxdepth 1 -regex $DOCREGEX -print0 \
| xargs -P 0 -0 %{__install} -p -m 644 -t $DOCPATH/$tobeinstalleddocdir
done
rm -f tmp-doc-directories
%{__install} -p -m 644 -t $DOCPATH LICENSE_1_0.txt index.htm index.html boost.png rst.css boost.css
echo ============================= install examples ==================
sed -i -e 's/\r//g' libs/geometry/example/ml02_distance_strategy.cpp
for tmp_doc_file in flyweight/example/Jamfile.v2 \
format/example/sample_new_features.cpp multi_index/example/Jamfile.v2 \
multi_index/example/hashed.cpp serialization/example/demo_output.txt
do
mv libs/${tmp_doc_file} libs/${tmp_doc_file}.iso8859
iconv -f ISO8859-1 -t UTF8 < libs/${tmp_doc_file}.iso8859 > libs/${tmp_doc_file}
touch -r libs/${tmp_doc_file}.iso8859 libs/${tmp_doc_file}
rm -f libs/${tmp_doc_file}.iso8859
done
rm -rf %{boost_examplesdir} && mkdir -p %{boost_examplesdir}/html
EXAMPLESPATH=%{boost_examplesdir}
find libs -type d -name example -exec find {} -type f \; | sed -n '/\//{s,/[^/]*$,,;p}' | sort -u > tmp-doc-directories
sed "s:^:$EXAMPLESPATH/:" tmp-doc-directories | xargs -P 0 --no-run-if-empty %{__install} -d
rm -f tmp-doc-files-to-be-installed && touch tmp-doc-files-to-be-installed
cat tmp-doc-directories | while read tobeinstalleddocdir
do
find $tobeinstalleddocdir -mindepth 1 -maxdepth 1 -type f >> tmp-doc-files-to-be-installed
done
cat tmp-doc-files-to-be-installed | while read tobeinstalledfiles
do
if test -s $tobeinstalledfiles; then
tobeinstalleddocdir=`dirname $tobeinstalledfiles`
%{__install} -p -m 644 -t $EXAMPLESPATH/$tobeinstalleddocdir $tobeinstalledfiles
fi
done
rm -f tmp-doc-files-to-be-installed
rm -f tmp-doc-directories
%{__install} -p -m 644 -t $EXAMPLESPATH LICENSE_1_0.txt
mkdir boost-doc boost-example
find libs doc more -regex '.*\.\(html?\|css\|png\|gif\)' -exec cp {} boost-doc --parents -r \;
cp index.html boost.png rst.css boost.css boost-doc
find . -name example -exec cp {} boost-example --parents -r \;
%files
%license LICENSE_1_0.txt
@ -474,7 +419,8 @@ rm -f tmp-doc-directories
%{_libdir}/libboost_wave.so.%{version}
%files help
%doc %{boost_docdir}/*
%license LICENSE_1_0.txt
%doc boost-doc boost-example
%files devel
%license LICENSE_1_0.txt
@ -482,11 +428,11 @@ rm -f tmp-doc-directories
%{_libdir}/*.so
%{_libdir}/*.a
%files examples
%doc %{boost_examplesdir}/*
%changelog
* Mon Dec 31 2021 sdlzx <sdlzx@163.com> - 1.78.0-6
* Sun Jan 23 2022 Liu Zixian <liuzixian4@huawei.com> - 1.78.0-7
- refactor boost-help
* Fri Dec 31 2021 sdlzx <sdlzx@163.com> - 1.78.0-6
- Don't package boost build tools
* Mon Dec 27 2021 sdlzx <sdlzx@163.com> - 1.78.0-5