Share static data in doc package

Fonts add unnecessary size to doc package. Instead of local copy, link
to theme package static directory and reuse data already installed.
This commit is contained in:
Petr Menšík 2020-09-14 17:08:06 +02:00
parent 89421c0410
commit ef5c71f941

View File

@ -69,7 +69,7 @@ Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) serv
Name: bind
License: MPLv2.0
Version: 9.16.6
Release: 1%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist}
Release: 2%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist}
Epoch: 32
Url: https://www.isc.org/downloads/bind/
#
@ -428,6 +428,7 @@ This package provides a module which allows commands to be sent to rndc directly
%package doc
Summary: Documentation for BIND
Requires: bind-license = %{epoch}:%{version}-%{release}
Requires: python3-sphinx_rtd_theme
BuildArch: noarch
%description doc
@ -817,8 +818,18 @@ popd
%if %{with DOC}
mkdir -p ${RPM_BUILD_ROOT}%{_pkgdocdir}
cp -a build/doc/arm/_build/html ${RPM_BUILD_ROOT}%{_pkgdocdir}
cp -a build/doc/man/_build/html ${RPM_BUILD_ROOT}%{_pkgdocdir}/html/man
rm -rf ${RPM_BUILD_ROOT}%{_pkgdocdir}/html{,/man}/.{buildinfo,doctrees}
rm -rf ${RPM_BUILD_ROOT}%{_pkgdocdir}/html/.{buildinfo,doctrees}
# Share static data from original sphinx package
THEMEDIR=$(rpm -ql python3-sphinx_rtd_theme | grep 'sphinx_rtd_theme/static$')
for DIR in "$THEMEDIR"/*
do
BASE=$(basename -- "$DIR")
BINDTHEMEDIR="${RPM_BUILD_ROOT}%{_pkgdocdir}/html/_static/$BASE"
if [ -d "$BINDTHEMEDIR" ]; then
rm -rf "$BINDTHEMEDIR"
ln -s "$DIR" "$BINDTHEMEDIR"
fi
done
%endif
%if %{with DOCPDF}
cp -a build/doc/arm/Bv9ARM.pdf ${RPM_BUILD_ROOT}%{_pkgdocdir}
@ -1227,6 +1238,9 @@ fi;
%endif
%changelog
* Mon Sep 14 2020 Petr Menšík <pemensik@redhat.com> - 32:9.16.6-2
- Share static data in doc package
* Sat Aug 22 2020 Petr Menšík <pemensik@redhat.com> - 32:9.16.6-1
- Update to 9.16.6