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.2.0
Release:          1%{?dist}
Summary:          Prepare Reproducible Example Code via the Clipboard

License:          MIT
URL:              https://cran.r-project.org/web/packages/%{packname}/index.html
Source0:          https://cran.r-project.org/src/contrib/%{packname}_%{version}.tar.gz

# Here's the R view of the dependencies world:
# Depends:
# Imports:   R-callr >= 2.0.0, R-clipr >= 0.4.0, R-rlang, R-rmarkdown, R-tools, R-utils, R-whisker, R-withr
# Suggests:  R-covr, R-devtools, R-fortunes, R-knitr, R-miniUI, R-rprojroot, R-rstudioapi, R-shiny, R-styler, R-testthat >= 2.0.0
# LinkingTo:
# Enhances:

BuildArch:        noarch
Requires:         pandoc >= 1.12.3
Requires:         R-core
Requires:         R-callr >= 2.0.0
Requires:         R-clipr >= 0.4.0
Requires:         R-rlang
Requires:         R-rmarkdown
Requires:         R-tools
Requires:         R-utils
Requires:         R-whisker
Requires:         R-withr
Suggests:         R-devtools
Suggests:         R-fortunes
Suggests:         R-knitr
Suggests:         R-miniUI
Suggests:         R-rstudioapi
Suggests:         R-shiny
Suggests:         R-styler
BuildRequires:    R-devel
BuildRequires:    tex(latex)
BuildRequires:    pandoc >= 1.12.3
BuildRequires:    R-callr >= 2.0.0
BuildRequires:    R-clipr >= 0.4.0
BuildRequires:    R-rlang
BuildRequires:    R-rmarkdown
BuildRequires:    R-tools
BuildRequires:    R-utils
BuildRequires:    R-whisker
BuildRequires:    R-withr
%if %{fedora} > 27
BuildRequires:    R-testthat >= 2.0.0
%endif
%if %{with_suggests}
BuildRequires:    R-devtools
BuildRequires:    R-fortunes
BuildRequires:    R-knitr
BuildRequires:    R-miniUI
BuildRequires:    R-rstudioapi
BuildRequires:    R-shiny
BuildRequires:    R-styler
%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. The user's clipboard is the default
source of input code and the default target for rendered output. '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}

# Don't need coverage; it's not packaged either.
sed -i 's/covr, //g' %{packname}/DESCRIPTION


%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 %{fedora} > 27
export NOT_CRAN=true
%if %{with_suggests}
%{_bindir}/R CMD check %{packname}
%else
_R_CHECK_FORCE_SUGGESTS_=0 %{_bindir}/R CMD check %{packname}
%endif
%endif


%files
%dir %{rlibdir}/%{packname}
%doc %{rlibdir}/%{packname}/doc
%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}/addins
%{rlibdir}/%{packname}/rstudio
%{rlibdir}/%{packname}/templates


%changelog
* Sun Jul 01 2018 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.2.0-1
- Update to latest version
- Enable more tests

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