Blob Blame History Raw
%global packname  reprex
%global rlibdir  %{_datadir}/R/library

# Not all available yet.
%global with_suggests 0

Name:             R-%{packname}
Version:          0.1.2
Release:          1%{?dist}
Summary:          Prepare Reproducible Example Code for Sharing

License:          MIT
URL:              http://cran.r-project.org/web/packages/%{packname}/index.html
Source0:          http://cran.r-project.org/src/contrib/%{packname}_%{version}.tar.gz
# Skip a broken test that's also skipped in upstream master.
Patch0001:        Skip-broken-test.patch

# Here's the R view of the dependencies world:
# Depends:
# Imports:   R-callr, R-knitr, R-rmarkdown, R-tools, R-utils, R-whisker
# Suggests:  R-covr, R-devtools, R-formatR, R-fortunes, R-miniUI, R-rstudioapi, R-shiny, R-shinyjs, R-testthat
# LinkingTo:
# Enhances:

BuildArch:        noarch
Requires:         R-core
Requires:         R-callr
Requires:         R-knitr
Requires:         R-rmarkdown
Requires:         R-tools
Requires:         R-utils
Requires:         R-whisker
Suggests:         R-covr
Suggests:         R-devtools
Suggests:         R-formatR
Suggests:         R-fortunes
Suggests:         R-miniUI
Suggests:         R-rstudioapi
Suggests:         R-shiny
Suggests:         R-shinyjs
Suggests:         R-testthat
BuildRequires:    R-devel
BuildRequires:    tex(latex)
BuildRequires:    R-callr
BuildRequires:    R-knitr
BuildRequires:    R-rmarkdown
BuildRequires:    R-tools
BuildRequires:    R-utils
BuildRequires:    R-whisker
BuildRequires:    R-testthat
%if %{with_suggests}
BuildRequires:    R-devtools
BuildRequires:    R-formatR
BuildRequires:    R-fortunes
BuildRequires:    R-miniUI
BuildRequires:    R-rstudioapi
BuildRequires:    R-shiny
BuildRequires:    R-shinyjs
%endif

%description
Convenience wrapper that uses the 'rmarkdown' package to render small
snippets of code to target formats that include both code and output. The
goal is to encourage the sharing of small, reproducible, and runnable
examples on code-oriented websites, such as <https://stackoverflow.com> and
<https://github.com>, or in email. 'reprex' also extracts clean, runnable
R code from various common formats, such as copy/paste from an R session.


%prep
%setup -q -c -n %{packname}

pushd %{packname}
%patch0001 -p1
popd


%build


%install
mkdir -p %{buildroot}%{rlibdir}
%{_bindir}/R CMD INSTALL -l %{buildroot}%{rlibdir} %{packname}
test -d %{packname}/src && (cd %{packname}/src; rm -f *.o *.so)
rm -f %{buildroot}%{rlibdir}/R.css


%check
%if %{with_suggests}
%{_bindir}/R CMD check %{packname}
%else
_R_CHECK_FORCE_SUGGESTS_=0 %{_bindir}/R CMD check %{packname}
%endif


%files
%dir %{rlibdir}/%{packname}
%doc %{rlibdir}/%{packname}/html
%{rlibdir}/%{packname}/DESCRIPTION
%doc %{rlibdir}/%{packname}/NEWS.md
%license %{rlibdir}/%{packname}/LICENSE
%{rlibdir}/%{packname}/INDEX
%{rlibdir}/%{packname}/NAMESPACE
%{rlibdir}/%{packname}/Meta
%{rlibdir}/%{packname}/R
%{rlibdir}/%{packname}/help
%{rlibdir}/%{packname}/rstudio
%{rlibdir}/%{packname}/templates


%changelog
* Tue Apr 24 2018 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.1.2-1
- initial package for Fedora