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:
parent
9980260d15
commit
f9fa8bee1e
86
boost.spec
86
boost.spec
@ -1,10 +1,8 @@
|
|||||||
%global boost_docdir __tmp_docdir
|
|
||||||
%global boost_examplesdir __tmp_examplesdir
|
|
||||||
%global version_enc 1_78_0
|
%global version_enc 1_78_0
|
||||||
|
|
||||||
Name: boost
|
Name: boost
|
||||||
Version: 1.78.0
|
Version: 1.78.0
|
||||||
Release: 6
|
Release: 7
|
||||||
Summary: The free peer-reviewed portable C++ source libraries
|
Summary: The free peer-reviewed portable C++ source libraries
|
||||||
License: Boost Software License 1.0
|
License: Boost Software License 1.0
|
||||||
URL: http://www.boost.org
|
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.
|
Boost C++ libraries distributed with boost.
|
||||||
|
|
||||||
%package help
|
%package help
|
||||||
Summary: HTML documentation for the Boost C++ libraries
|
Summary: HTML documentation and source code example 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
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
Requires: boost-devel = %{version}-%{release}
|
Requires: boost-devel = %{version}-%{release}
|
||||||
|
|
||||||
%description examples
|
%description help
|
||||||
This package contains example source files distributed with boost.
|
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
|
%prep
|
||||||
%autosetup -p1 -n %{name}_%{version_enc}
|
%autosetup -p1 -n %{name}_%{version_enc}
|
||||||
@ -300,62 +291,16 @@ EOF
|
|||||||
:
|
:
|
||||||
|
|
||||||
%install
|
%install
|
||||||
echo ============================= install libraries ==================
|
|
||||||
./b2 %{b2_options} \
|
./b2 %{b2_options} \
|
||||||
--without-mpi --without-graph_parallel \
|
--without-mpi --without-graph_parallel \
|
||||||
--prefix=$RPM_BUILD_ROOT%{_prefix} \
|
--prefix=$RPM_BUILD_ROOT%{_prefix} \
|
||||||
--libdir=$RPM_BUILD_ROOT%{_libdir} \
|
--libdir=$RPM_BUILD_ROOT%{_libdir} \
|
||||||
install
|
install
|
||||||
|
|
||||||
version=%{version}
|
mkdir boost-doc boost-example
|
||||||
|
find libs doc more -regex '.*\.\(html?\|css\|png\|gif\)' -exec cp {} boost-doc --parents -r \;
|
||||||
echo ============================= install documentation ==================
|
cp index.html boost.png rst.css boost.css boost-doc
|
||||||
rm -rf %{boost_docdir} && %{__mkdir_p} %{boost_docdir}/html
|
find . -name example -exec cp {} boost-example --parents -r \;
|
||||||
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
|
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%license LICENSE_1_0.txt
|
%license LICENSE_1_0.txt
|
||||||
@ -474,7 +419,8 @@ rm -f tmp-doc-directories
|
|||||||
%{_libdir}/libboost_wave.so.%{version}
|
%{_libdir}/libboost_wave.so.%{version}
|
||||||
|
|
||||||
%files help
|
%files help
|
||||||
%doc %{boost_docdir}/*
|
%license LICENSE_1_0.txt
|
||||||
|
%doc boost-doc boost-example
|
||||||
|
|
||||||
%files devel
|
%files devel
|
||||||
%license LICENSE_1_0.txt
|
%license LICENSE_1_0.txt
|
||||||
@ -482,11 +428,11 @@ rm -f tmp-doc-directories
|
|||||||
%{_libdir}/*.so
|
%{_libdir}/*.so
|
||||||
%{_libdir}/*.a
|
%{_libdir}/*.a
|
||||||
|
|
||||||
%files examples
|
|
||||||
%doc %{boost_examplesdir}/*
|
|
||||||
|
|
||||||
%changelog
|
%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
|
- Don't package boost build tools
|
||||||
|
|
||||||
* Mon Dec 27 2021 sdlzx <sdlzx@163.com> - 1.78.0-5
|
* Mon Dec 27 2021 sdlzx <sdlzx@163.com> - 1.78.0-5
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user