%bcond_without bootstrap

%global packname pillar
%global packver  1.6.2
%global rlibdir  %{_datadir}/R/library

Name:             R-%{packname}
Version:          1.6.2
Release:          1
Summary:          Coloured Formatting for Columns

License:          MIT
URL:              https://CRAN.R-project.org/package=%{packname}
Source0:          https://cran.r-project.org/src/contrib/%{packname}_%{packver}.tar.gz

BuildArch:        noarch
BuildRequires:    R-devel
BuildRequires:    tex(latex)
BuildRequires:    R-cli
BuildRequires:    R-crayon >= 1.3.4
BuildRequires:    R-ellipsis >= 0.3.2
BuildRequires:    R-fansi
BuildRequires:    R-lifecycle
BuildRequires:    R-rlang >= 0.3.0
BuildRequires:    R-utf8 >= 1.1.0
BuildRequires:    R-utils
BuildRequires:    R-vctrs >= 0.3.8
%if %{without bootstrap}
BuildRequires:    R-bit64
BuildRequires:    R-debugme
BuildRequires:    R-DiagrammeR
BuildRequires:    R-dplyr
BuildRequires:    R-formattable
BuildRequires:    R-ggplot2
BuildRequires:    R-knitr
BuildRequires:    R-lubridate
BuildRequires:    R-nycflights13
BuildRequires:    R-palmerpenguins
BuildRequires:    R-rmarkdown
BuildRequires:    R-scales
BuildRequires:    R-stringi
BuildRequires:    R-survival
BuildRequires:    R-testthat >= 3.0.2
BuildRequires:    R-tibble
BuildRequires:    R-units >= 0.7.2
BuildRequires:    R-withr
%endif

%description
Provides 'pillar' and 'colonnade' generics designed for formatting columns
of data using the full range of colours provided by modern terminals.


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


%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 %{without bootstrap}
export LANG=C.UTF-8
%{_bindir}/R CMD check %{packname}
%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}/WORDLIST


%changelog
* Tue Jun 14 2022 misaka00251 <misaka00251@misakanet.cn> - 1.6.2-1
- Init package (Thanks to fedora team)
