ed6bb34
%global packname  rmarkdown
ed6bb34
%global rlibdir  %{_datadir}/R/library
ed6bb34
5c19597
%global __suggests_exclude ^R\\((dygraphs)\\)
5c19597
ed6bb34
# Recursive dependencies.
ed6bb34
%global with_suggests 0
ed6bb34
ed6bb34
Name:             R-%{packname}
7e73a88
Version:          2.0
2873f8a
Release:          2%{?dist}
ed6bb34
Summary:          Dynamic Documents for R
ed6bb34
ed6bb34
# Main is GPLv3; see bundled Provides below for others.
ed6bb34
License:          GPLv3 and ASL 2.0 and BSD and MIT and OFL and W3C
0235f30
URL:              https://CRAN.R-project.org/package=%{packname}
ed6bb34
Source0:          https://cran.r-project.org/src/contrib/%{packname}_%{version}.tar.gz
d488963
Patch0001:        0001-Remove-unused-minified-ioslides-files.patch
d488963
Patch0002:        0002-Unbundle-fonts-in-ioslides.patch
d488963
Patch0004:        0004-Unbundle-jquery.patch
d488963
Patch0005:        0005-Unbundle-highlight.js.patch
c11c233
Patch0006:        0006-Add-original-non-minified-Bootswatch-themes.patch
c11c233
Patch0007:        0007-Unbundle-fonts-from-bootstrap.patch
d488963
Patch0008:        0008-Add-source-for-code-prettify.patch
d488963
Patch0009:        0009-Skip-shiny-tests.patch
ed6bb34
ed6bb34
# Here's the R view of the dependencies world:
ed6bb34
# Depends:
99d52e8
# Imports:   R-tools, R-utils, R-knitr >= 1.22, R-yaml >= 2.1.19, R-htmltools >= 0.3.5, R-evaluate >= 0.13, R-base64enc, R-jsonlite, R-mime, R-tinytex >= 0.11, R-xfun, R-methods, R-stringr >= 1.2.0
7581e31
# Suggests:  R-shiny >= 0.11, R-tufte, R-testthat, R-digest, R-dygraphs, R-tibble, R-fs, R-pkgdown, R-callr >= 2.0.0
ed6bb34
# LinkingTo:
ed6bb34
# Enhances:
ed6bb34
ed6bb34
BuildArch:        noarch
ed6bb34
Requires:         pandoc >= 1.12.3
ed6bb34
Requires:         pandoc-citeproc
ed6bb34
d488963
BuildRequires:    git-core
ed6bb34
BuildRequires:    R-devel
ed6bb34
BuildRequires:    tex(latex)
ed6bb34
BuildRequires:    pandoc >= 1.12.3
ed6bb34
BuildRequires:    pandoc-citeproc
15819c7
BuildRequires:    ycssmin
4733758
BuildRequires:    R-tools
4733758
BuildRequires:    R-utils
ed0aff6
BuildRequires:    R-knitr >= 1.22
7a110e6
BuildRequires:    R-yaml >= 2.1.19
ed6bb34
BuildRequires:    R-htmltools >= 0.3.5
ed0aff6
BuildRequires:    R-evaluate >= 0.13
4733758
BuildRequires:    R-base64enc
ed6bb34
BuildRequires:    R-jsonlite
4733758
BuildRequires:    R-mime
ed0aff6
BuildRequires:    R-tinytex >= 0.11
99d52e8
BuildRequires:    R-xfun
4733758
BuildRequires:    R-methods
ed6bb34
BuildRequires:    R-stringr >= 1.2.0
ed6bb34
BuildRequires:    R-testthat
4733758
BuildRequires:    R-digest
ed0aff6
BuildRequires:    R-fs
7a110e6
BuildRequires:    R-callr >= 2.0.0
ed6bb34
%if %{with_suggests}
ed6bb34
BuildRequires:    R-shiny >= 0.11
ed6bb34
BuildRequires:    R-tufte
4733758
BuildRequires:    R-dygraphs
4733758
BuildRequires:    R-tibble
7581e31
BuildRequires:    R-pkgdown
ed6bb34
%endif
ed6bb34
4733758
#BuildRequires:    fontawesome-fonts = 4.7.0
4733758
#BuildRequires:    fontawesome-fonts-web = 4.7.0
291f640
#Recommends:       fontawesome-fonts = 4.7.0
291f640
#Recommends:       fontawesome-fonts-web = 4.7.0
7a110e6
Provides:         bundled(fontawesome-fonts) = 5.1.0
7a110e6
Provides:         bundled(fontawesome-fonts-web) = 5.1.0
ed6bb34
ed6bb34
# These are not all packaged, but should *probably* be the names if they are.
ed6bb34
7a110e6
# MIT; inst/rmd/h/bootstrap/
ed6bb34
# https://github.com/twbs/bootstrap/releases/tag/v3.3.5
ed6bb34
Provides:         bundled(xstatic-bootstrap-common) = 3.3.5
ed6bb34
BuildRequires:    adobe-source-sans-pro-fonts
291f640
Recommends:       adobe-source-sans-pro-fonts
ed6bb34
BuildRequires:    glyphicons-halflings-fonts
291f640
Recommends:       glyphicons-halflings-fonts
ed6bb34
BuildRequires:    google-roboto-fonts
291f640
Recommends:       google-roboto-fonts
ed6bb34
BuildRequires:    impallari-raleway-fonts
291f640
Recommends:       impallari-raleway-fonts
ed6bb34
BuildRequires:    lato-fonts
291f640
Recommends:       lato-fonts
7a110e6
# OFL; inst/rmd/h/bootstrap/css/fonts/NewsCycle*.ttf
ed6bb34
Provides:         bundled(glyphography-news-cycle-fonts) = 0.4
ed6bb34
bedc8dc
# BSD; inst/rmd/h/highlightjs/ (unbundled)
bedc8dc
BuildRequires:    js-highlight
bedc8dc
Requires:         js-highlight
bedc8dc
7a110e6
# MIT; inst/rmd/h/ionicons/
ed6bb34
# http://ionicons.com/
ed6bb34
Provides:         bundled(ionicons-fonts) = 2.0.1
ed6bb34
7a110e6
# MIT; inst/rmd/h/jquery/ (unbundled)
6469d38
BuildRequires:    js-jquery1 = 1.12.4
6469d38
Requires:         js-jquery1 = 1.12.4
a8aa921
7a110e6
# MIT; inst/rmd/h/jqueryui (outdated in Fedora)
ed6bb34
Provides:         bundled(xstatic-jquery-ui-common) = 1.11.4
ed6bb34
ed6bb34
# MIT; inst/rmd/h/navigation-1.1/tabsets.js
ed6bb34
# https://github.com/aidanlister/jquery-stickytabs (partially)
ed6bb34
Provides:         bundled(js-jquery-stickytabs) = 1.2.4
ed6bb34
7a110e6
# MIT; inst/rmd/h/tocify/
ed6bb34
# http://gregfranko.com/jquery.tocify.js/
ed6bb34
Provides:         bundled(js-jquery-tocify) = 1.9.1
ed6bb34
ed6bb34
# ASL 2.0; inst/rmd/ioslides/ioslides-13.5.1/
ed6bb34
Provides:         bundled(js-ioslides) = 13.5.1
ed6bb34
# MIT; inst/rmd/ioslides/ioslides-13.5.1/js/hammer.js
ed6bb34
# https://hammerjs.github.io/
ed6bb34
Provides:         bundled(js-hammer) = 0.4
ed6bb34
# MIT & BSD; inst/rmd/ioslides/ioslides-13.5.1/js/modernizr.custom.45394.js
ed6bb34
# https://modernizr.com/
ed6bb34
Provides:         bundled(js-modernizr) = 2.5.3
ed6bb34
# ASL 2.0; inst/rmd/ioslides/ioslides-13.5.1/js/prettify/
ed6bb34
# https://github.com/google/code-prettify
ed6bb34
Provides:         bundled(js-code-prettify) = 20130304
ed6bb34
BuildRequires:    open-sans-fonts
291f640
Recommends:       open-sans-fonts
ed6bb34
BuildRequires:    adobe-source-code-pro-fonts
291f640
Recommends:       adobe-source-code-pro-fonts
ed6bb34
ed6bb34
# W3C; inst/rmd/slidy/Slidy2/
ed6bb34
# https://www.w3.org/Talks/Tools/Slidy2/
ed6bb34
Provides:         bundled(js-slidy) = 2
ed6bb34
ed6bb34
%description
ed6bb34
Convert R Markdown documents into a variety of formats.
ed6bb34
ed6bb34
ed6bb34
%prep
ed6bb34
%setup -q -c -n %{packname}
d488963
%autosetup -D -T -n %{packname}/%{packname} -S git
ed6bb34
ed6bb34
# Must be removed: https://bugzilla.redhat.com/show_bug.cgi?id=961642#c4
7a110e6
rm inst/rmd/h/bootstrap/css/fonts/Ubuntu.ttf
ed6bb34
ed6bb34
# Fix executable bits
7a110e6
chmod -x inst/rmd/h/ionicons/{LICENSE,css/*.css,fonts/*.ttf}
ed6bb34
chmod -x inst/rmd/ioslides/ioslides-13.5.1/js/hammer.js
d488963
d488963
# This does nothing but reset the -n path.
d488963
%setup -q -D -T -n %{packname}
ed6bb34
ed6bb34
ed6bb34
%build
15819c7
pushd %{packname}/inst/rmd/h/bootstrap/css/
15819c7
for file in bootstrap bootstrap-theme cerulean cosmo darkly flatly journal lumen paper readable sandstone simplex spacelab united yeti; do
15819c7
    cssmin ${file}.css > ${file}.min.css
15819c7
done
15819c7
popd
ed6bb34
ed6bb34
ed6bb34
%install
ed6bb34
mkdir -p %{buildroot}%{rlibdir}
ed6bb34
%{_bindir}/R CMD INSTALL -l %{buildroot}%{rlibdir} %{packname}
ed6bb34
test -d %{packname}/src && (cd %{packname}/src; rm -f *.o *.so)
ed6bb34
rm -f %{buildroot}%{rlibdir}/R.css
ed6bb34
6469d38
# Replace fonts by system fonts (note that this cannot be done in prep because
6469d38
# R CMD INSTALL copies symlink targets.)
6469d38
pushd %{buildroot}%{rlibdir}/%{packname}
6469d38
# Remove bundled fonts in ioslides.
6469d38
rm rmd/ioslides/ioslides-13.5.1/fonts/OpenSans*.ttf
6469d38
for f in OpenSans-Regular OpenSans-Italic OpenSans-Semibold OpenSans-SemiboldItalic; do
6469d38
    ln -s /usr/share/fonts/open-sans/${f}.ttf rmd/ioslides/ioslides-13.5.1/fonts/${f}.ttf
6469d38
done
d488963
ln -sf /usr/share/fonts/adobe-source-code-pro/SourceCodePro-Regular.otf rmd/ioslides/ioslides-13.5.1/fonts/SourceCodePro-Regular.otf
6469d38
# Remove bundled FontAwesome. (too new to remove)
7a110e6
#rm -r rmd/h/fontawesome/*
7a110e6
#ln -s /usr/share/font-awesome-web/css rmd/h/fontawesome/css
7a110e6
#ln -s /usr/share/fonts/fontawesome rmd/h/fontawesome/fonts
6469d38
# Remove bundled fonts from bootstrap.
7a110e6
ln -sf /usr/share/fonts/lato/Lato-Regular.ttf rmd/h/bootstrap/css/fonts/Lato.ttf
7a110e6
ln -sf /usr/share/fonts/lato/Lato-Bold.ttf rmd/h/bootstrap/css/fonts/LatoBold.ttf
7a110e6
ln -sf /usr/share/fonts/lato/Lato-Italic.ttf rmd/h/bootstrap/css/fonts/LatoItalic.ttf
7a110e6
ln -sf /usr/share/fonts/open-sans/OpenSans-Regular.ttf rmd/h/bootstrap/css/fonts/OpenSans.ttf
6469d38
for f in Bold BoldItalic Italic Light LightItalic; do
7a110e6
    ln -sf /usr/share/fonts/open-sans/OpenSans-${f}.ttf rmd/h/bootstrap/css/fonts/OpenSans${f}.ttf
6469d38
done
6469d38
for f in Regular Bold; do
d488963
    ln -sf /usr/share/fonts/impallari-raleway/Raleway-${f}.otf rmd/h/bootstrap/css/fonts/Raleway-${f}.otf
6469d38
done
d488963
ln -sf /usr/share/fonts/google-roboto/Roboto-Regular.ttf rmd/h/bootstrap/css/fonts/Roboto.ttf
6469d38
for f in Light Medium Bold; do
d488963
    ln -sf /usr/share/fonts/google-roboto/Roboto-${f}.ttf rmd/h/bootstrap/css/fonts/Roboto${f}.ttf
6469d38
done
6469d38
for f in Bold It Light Regular; do
d488963
    ln -sf /usr/share/fonts/source-sans-pro/SourceSansPro-${f}.otf rmd/h/bootstrap/css/fonts/SourceSansPro-${f}.otf
6469d38
done
d488963
ln -sf /usr/share/fonts/glyphicons-halflings/glyphicons-halflings-regular.ttf rmd/h/bootstrap/fonts/glyphicons-halflings-regular.ttf
6469d38
popd
6469d38
ed6bb34
ed6bb34
%check
ed6bb34
%if %{with_suggests}
ed6bb34
%{_bindir}/R CMD check %{packname}
ed6bb34
%else
ed6bb34
_R_CHECK_FORCE_SUGGESTS_=0 %{_bindir}/R CMD check %{packname}
ed6bb34
%endif
ed6bb34
ed6bb34
ed6bb34
%files
ed6bb34
%dir %{rlibdir}/%{packname}
7581e31
%doc %{rlibdir}/%{packname}/doc
ed6bb34
%doc %{rlibdir}/%{packname}/html
ed6bb34
%{rlibdir}/%{packname}/DESCRIPTION
ed6bb34
%license %{rlibdir}/%{packname}/COPYING
ed6bb34
%license %{rlibdir}/%{packname}/NOTICE
7a110e6
%doc %{rlibdir}/%{packname}/NEWS.md
7a110e6
%doc %{rlibdir}/%{packname}/CITATION
ed6bb34
%{rlibdir}/%{packname}/INDEX
ed6bb34
%{rlibdir}/%{packname}/NAMESPACE
ed6bb34
%{rlibdir}/%{packname}/Meta
ed6bb34
%{rlibdir}/%{packname}/R
ed6bb34
%{rlibdir}/%{packname}/help
ed6bb34
%{rlibdir}/%{packname}/rmarkdown
ed6bb34
%dir %{rlibdir}/%{packname}/rmd
ed6bb34
%{rlibdir}/%{packname}/rmd/fragment
ed6bb34
%dir %{rlibdir}/%{packname}/rmd/h
ed6bb34
%{rlibdir}/%{packname}/rmd/h/_navbar.html
ed6bb34
%{rlibdir}/%{packname}/rmd/h/default.html
7a110e6
%{rlibdir}/%{packname}/rmd/h/bootstrap
4733758
%{rlibdir}/%{packname}/rmd/h/fontawesome
7a110e6
%{rlibdir}/%{packname}/rmd/h/ionicons
7a110e6
%{rlibdir}/%{packname}/rmd/h/jqueryui
ed6bb34
%{rlibdir}/%{packname}/rmd/h/jqueryui-AUTHORS.txt
ed6bb34
%{rlibdir}/%{packname}/rmd/h/navigation-1.1
ed6bb34
%{rlibdir}/%{packname}/rmd/h/pagedtable-1.1
7e73a88
%{rlibdir}/%{packname}/rmd/h/pandoc
ed6bb34
%{rlibdir}/%{packname}/rmd/h/rmarkdown
ed6bb34
%{rlibdir}/%{packname}/rmd/h/rsiframe-1.1
7a110e6
%{rlibdir}/%{packname}/rmd/h/tocify
ed6bb34
%{rlibdir}/%{packname}/rmd/ioslides
ed6bb34
%{rlibdir}/%{packname}/rmd/latex
a6da889
%{rlibdir}/%{packname}/rmd/lua
7a110e6
%{rlibdir}/%{packname}/rmd/site
7a110e6
%{rlibdir}/%{packname}/rmd/slidy
7a110e6
%{rlibdir}/%{packname}/rstudio
ed6bb34
ed6bb34
ed6bb34
%changelog
2873f8a
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.0-2
2873f8a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
2873f8a
7e73a88
* Tue Jan 07 2020 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 2.0-1
7e73a88
- Update to latest version
7e73a88
b233690
* Wed Nov 27 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 1.18-1
b233690
- Update to latest version
b233690
7c72e9d
* Wed Nov 13 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 1.17-1
7c72e9d
- Update to latest version
7c72e9d
a6da889
* Wed Oct 02 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 1.16-1
a6da889
- Update to latest version
a6da889
a055e65
* Sun Aug 25 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 1.15-1
a055e65
- Update to latest version
a055e65
7581e31
* Sat Aug 17 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 1.14-1
7581e31
- Update to latest version
7581e31
fa603d7
* Sun Aug 11 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 1.13-4
fa603d7
- Remove explicit dependencies provided by automatic dependency generator
fa603d7
ebcf0d4
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.13-3
ebcf0d4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
ebcf0d4
15819c7
* Sat Jun 01 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 1.13-2
d488963
- Switch to git autosetup instead of manual patches
15819c7
- Update bootstrap unbundling and re-compress CSS
d488963
99d52e8
* Wed May 22 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 1.13-1
99d52e8
- Update to latest version
99d52e8
ed0aff6
* Thu Mar 14 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 1.12-1
ed0aff6
- Update to latest version
ed0aff6
7a110e6
* Mon Mar 04 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 1.11-1
7a110e6
- Update to latest version
7a110e6
- Fix unbundling of highlightjs
7a110e6
- Move dependencies from Suggests to Recommends to work better out-of-the-box
7a110e6
44da022
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.10-5
44da022
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
44da022
6469d38
* Sun Sep 23 2018 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 1.10-4
6469d38
- Fix unbundling of fonts
6469d38
a8aa921
* Sat Sep 22 2018 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 1.10-3
a8aa921
- Add missing jquery Requires
a8aa921
17b04bb
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.10-2
17b04bb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
17b04bb
4733758
* Fri Jun 22 2018 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 1.10-1
4733758
- Update to latest version
4733758
ed6bb34
* Sun Apr 22 2018 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 1.9-1
ed6bb34
- initial package for Fedora