Fix unbundling of fonts.

This commit is contained in:
Elliott Sales de Andrade 2018-09-23 01:40:43 -04:00
parent a8aa92147a
commit 6469d38061
1 changed files with 47 additions and 38 deletions

View File

@ -6,7 +6,7 @@
Name: R-%{packname}
Version: 1.10
Release: 3%{?dist}
Release: 4%{?dist}
Summary: Dynamic Documents for R
# Main is GPLv3; see bundled Provides below for others.
@ -103,7 +103,8 @@ Provides: bundled(glyphography-news-cycle-fonts) = 0.4
Provides: bundled(ionicons-fonts) = 2.0.1
# MIT; inst/rmd/h/jquery-1.11.3/ (unbundled)
Requires: js-jquery1
BuildRequires: js-jquery1 = 1.12.4
Requires: js-jquery1 = 1.12.4
# MIT; inst/rmd/h/jqueryui-1.11.4/ (outdated in Fedora)
Provides: bundled(xstatic-jquery-ui-common) = 1.11.4
@ -147,45 +148,10 @@ pushd %{packname}
# Remove minified things that are unused.
rm inst/rmd/ioslides/ioslides-13.5.1/js/{order,require-1.0.8.min}.js
rm -r inst/rmd/ioslides/ioslides-13.5.1/js/polyfills/
# Remove bundled fonts in ioslides.
rm inst/rmd/ioslides/ioslides-13.5.1/fonts/OpenSans*.ttf
for f in OpenSans-Regular OpenSans-Italic OpenSans-Semibold OpenSans-SemiboldItalic; do
ln -s /usr/share/fonts/open-sans/${f}.ttf inst/rmd/ioslides/ioslides-13.5.1/fonts/${f}.ttf
done
rm inst/rmd/ioslides/ioslides-13.5.1/fonts/SourceCodePro.ttf
ln -s /usr/share/fonts/adobe-source-code-pro/SourceCodePro-Regular.otf inst/rmd/ioslides/ioslides-13.5.1/fonts/SourceCodePro-Regular.otf
# Remove bundled jquery.
rm -r inst/rmd/h/jquery-1.11.3 inst/rmd/h/jquery-AUTHORS.txt
# Remove bundled FontAwesome. (too new to remove)
#rm -r inst/rmd/h/font-awesome-4.5.0
#mkdir inst/rmd/h/font-awesome-4.7.0
#ln -s /usr/share/font-awesome-web/css inst/rmd/h/font-awesome-4.7.0/css
#ln -s /usr/share/fonts/fontawesome inst/rmd/h/font-awesome-4.7.0/fonts
# Remove bundled highlight.js.
rm -r inst/rmd/h/highlightjs
# Remove bundled fonts from bootstrap.
ln -sf /usr/share/fonts/lato/Lato-Regular.ttf inst/rmd/h/bootstrap-3.3.5/css/fonts/Lato.ttf
ln -sf /usr/share/fonts/lato/Lato-Bold.ttf inst/rmd/h/bootstrap-3.3.5/css/fonts/LatoBold.ttf
ln -sf /usr/share/fonts/lato/Lato-Italic.ttf inst/rmd/h/bootstrap-3.3.5/css/fonts/LatoItalic.ttf
ln -sf /usr/share/fonts/open-sans/OpenSans-Regular.ttf inst/rmd/h/bootstrap-3.3.5/css/fonts/OpenSans.ttf
for f in Bold BoldItalic Italic Light LightItalic; do
ln -sf /usr/share/fonts/open-sans/OpenSans-${f}.ttf inst/rmd/h/bootstrap-3.3.5/css/fonts/OpenSans${f}.ttf
done
rm inst/rmd/h/bootstrap-3.3.5/css/fonts/Raleway*.ttf
for f in Regular Bold; do
ln -s /usr/share/fonts/impallari-raleway/Raleway-${f}.otf inst/rmd/h/bootstrap-3.3.5/css/fonts/
done
rm inst/rmd/h/bootstrap-3.3.5/css/fonts/Roboto*.ttf
ln -s /usr/share/fonts/google-roboto/Roboto-Regular.ttf inst/rmd/h/bootstrap-3.3.5/css/fonts/Roboto.ttf
for f in Light Medium Bold; do
ln -s /usr/share/fonts/google-roboto/Roboto-${f}.ttf inst/rmd/h/bootstrap-3.3.5/css/fonts/Roboto${f}.ttf
done
rm inst/rmd/h/bootstrap-3.3.5/css/fonts/SourceSansPro*.ttf
for f in Bold It Light Regular; do
ln -s /usr/share/fonts/source-sans-pro/SourceSansPro-${f}.otf inst/rmd/h/bootstrap-3.3.5/css/fonts/
done
rm inst/rmd/h/bootstrap-3.3.5/fonts/glyphicons-halflings-regular.*
ln -s /usr/share/fonts/glyphicons-halflings/glyphicons-halflings-regular.ttf inst/rmd/h/bootstrap-3.3.5/fonts/glyphicons-halflings-regular.ttf
# Must be removed: https://bugzilla.redhat.com/show_bug.cgi?id=961642#c4
rm inst/rmd/h/bootstrap-3.3.5/css/fonts/Ubuntu.ttf
@ -202,7 +168,7 @@ rm inst/rmd/h/bootstrap-3.3.5/css/fonts/Ubuntu.ttf
%endif
# Fix executable bits
chmod -x inst/rmd/h/ionicons-2.0.1/{LICENSE,css/*.css}
chmod -x inst/rmd/h/ionicons-2.0.1/{LICENSE,css/*.css,fonts/*.ttf}
chmod -x inst/rmd/ioslides/ioslides-13.5.1/js/hammer.js
popd
@ -216,6 +182,46 @@ mkdir -p %{buildroot}%{rlibdir}
test -d %{packname}/src && (cd %{packname}/src; rm -f *.o *.so)
rm -f %{buildroot}%{rlibdir}/R.css
# Replace fonts by system fonts (note that this cannot be done in prep because
# R CMD INSTALL copies symlink targets.)
pushd %{buildroot}%{rlibdir}/%{packname}
# Remove bundled fonts in ioslides.
rm rmd/ioslides/ioslides-13.5.1/fonts/OpenSans*.ttf
for f in OpenSans-Regular OpenSans-Italic OpenSans-Semibold OpenSans-SemiboldItalic; do
ln -s /usr/share/fonts/open-sans/${f}.ttf rmd/ioslides/ioslides-13.5.1/fonts/${f}.ttf
done
rm rmd/ioslides/ioslides-13.5.1/fonts/SourceCodePro.ttf
ln -s /usr/share/fonts/adobe-source-code-pro/SourceCodePro-Regular.otf rmd/ioslides/ioslides-13.5.1/fonts/SourceCodePro-Regular.otf
# Remove bundled FontAwesome. (too new to remove)
#rm -r rmd/h/font-awesome-4.5.0
#mkdir rmd/h/font-awesome-4.7.0
#ln -s /usr/share/font-awesome-web/css rmd/h/font-awesome-4.7.0/css
#ln -s /usr/share/fonts/fontawesome rmd/h/font-awesome-4.7.0/fonts
# Remove bundled fonts from bootstrap.
ln -sf /usr/share/fonts/lato/Lato-Regular.ttf rmd/h/bootstrap-3.3.5/css/fonts/Lato.ttf
ln -sf /usr/share/fonts/lato/Lato-Bold.ttf rmd/h/bootstrap-3.3.5/css/fonts/LatoBold.ttf
ln -sf /usr/share/fonts/lato/Lato-Italic.ttf rmd/h/bootstrap-3.3.5/css/fonts/LatoItalic.ttf
ln -sf /usr/share/fonts/open-sans/OpenSans-Regular.ttf rmd/h/bootstrap-3.3.5/css/fonts/OpenSans.ttf
for f in Bold BoldItalic Italic Light LightItalic; do
ln -sf /usr/share/fonts/open-sans/OpenSans-${f}.ttf rmd/h/bootstrap-3.3.5/css/fonts/OpenSans${f}.ttf
done
rm rmd/h/bootstrap-3.3.5/css/fonts/Raleway*.ttf
for f in Regular Bold; do
ln -s /usr/share/fonts/impallari-raleway/Raleway-${f}.otf rmd/h/bootstrap-3.3.5/css/fonts/
done
rm rmd/h/bootstrap-3.3.5/css/fonts/Roboto*.ttf
ln -s /usr/share/fonts/google-roboto/Roboto-Regular.ttf rmd/h/bootstrap-3.3.5/css/fonts/Roboto.ttf
for f in Light Medium Bold; do
ln -s /usr/share/fonts/google-roboto/Roboto-${f}.ttf rmd/h/bootstrap-3.3.5/css/fonts/Roboto${f}.ttf
done
rm rmd/h/bootstrap-3.3.5/css/fonts/SourceSansPro*.ttf
for f in Bold It Light Regular; do
ln -s /usr/share/fonts/source-sans-pro/SourceSansPro-${f}.otf rmd/h/bootstrap-3.3.5/css/fonts/
done
rm rmd/h/bootstrap-3.3.5/fonts/glyphicons-halflings-regular.*
ln -s /usr/share/fonts/glyphicons-halflings/glyphicons-halflings-regular.ttf rmd/h/bootstrap-3.3.5/fonts/glyphicons-halflings-regular.ttf
popd
%check
%if %{with_suggests}
@ -259,6 +265,9 @@ _R_CHECK_FORCE_SUGGESTS_=0 %{_bindir}/R CMD check %{packname}
%changelog
* Sun Sep 23 2018 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 1.10-4
- Fix unbundling of fonts
* Sat Sep 22 2018 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 1.10-3
- Add missing jquery Requires