File R-knitr.spec of Package R-knitr

%global packname  knitr
%global rlibdir   %{_libdir}/R/library

Name:           R-%{packname}
Version:        1.16
Release:        1
Summary:        A general-purpose package for dynamic report generation in R

Group:          Development/Libraries/Other
License:        GPL
URL:            http://cran.r-project.org/web/packages/%{packname}/index.html
Source0:        knitr_%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires:       R-base
Requires:       R-evaluate >= 0.10
Requires:       R-digest
Requires:       R-yaml
Requires:       R-highr
Requires:       R-markdown
Requires:       R-stringr >= 0.6

# Package suggestions
#Requires:         R-testit R-rgl R-codetools R-XML R-RCurl 
BuildRequires:  texlive
BuildRequires:  texinfo
BuildRequires:  fdupes
#
%if 0%{?suse_version} <= 1220 && 0%{?suse_version} != 1110
BuildRequires:  texlive-fonts-extra
%endif

BuildRequires:    R-base-devel 
BuildRequires:       R-evaluate >= 0.10
BuildRequires:       R-digest
BuildRequires:       R-yaml
BuildRequires:       R-highr
BuildRequires:       R-markdown
BuildRequires:       R-stringr >= 0.6
# Package suggestions, not required to build
#BuildRequires: R-testit R-rgl R-codetools R-XML R-RCurl

%description
This package provides a general-purpose tool for dynamic report generation
in R, which can be used to deal with any type of (plain text) files,
including Sweave, HTML, Markdown, reStructuredText and AsciiDoc. The
patterns of code chunks and inline R expressions can be customized. R code
is evaluated as if it were copied and pasted in an R terminal thanks to
the evaluate package (e.g. we do not need to explicitly print() plots from
ggplot2 or lattice). R code can be reformatted by the formatR package so
that long lines are automatically wrapped, with indent and spaces being
added, and comments being preserved. A simple caching mechanism is
provided to cache results from computations for the first time and the
computations will be skipped the next time. Almost all common graphics
devices, including those in base R and add-on packages like Cairo,
cairoDevice and tikzDevice, are built-in with this package and it is
straightforward to switch between devices without writing any special
functions. The width and height as well as alignment of plots in the
output document can be specified in chunk options (the size of plots for
graphics devices is still supported as usual). Multiple plots can be
recorded in a single code chunk, and it is also allowed to rearrange plots
to the end of a chunk or just keep the last plot. Warnings, messages and
errors are written in the output document by default (can be turned off).
Currently LaTeX, HTML, Markdown and reST are supported, and other output
formats can be supported by hook functions. The large collection of hooks
in this package makes it possible for the user to control almost
everything in the R code input and output. Hooks can be used either to
format the output or to run a specified R code fragment before or after a
code chunk. The language in code chunks is not restricted to R only (there
is simple support to Python and Awk, etc). Many features are borrowed from
or inspired by Sweave, cacheSweave, pgfSweave, brew and decumar.

%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


%files
%defattr(-, root, root, -)
%dir %{rlibdir}/%{packname}
%doc %{rlibdir}/%{packname}/doc
%doc %{rlibdir}/%{packname}/demo
%doc %{rlibdir}/%{packname}/examples
%doc %{rlibdir}/%{packname}/shiny
%doc %{rlibdir}/%{packname}/themes
%doc %{rlibdir}/%{packname}/misc
%doc %{rlibdir}/%{packname}/html
%doc %{rlibdir}/%{packname}/opencpu
%doc %{rlibdir}/%{packname}/CITATION
%doc %{rlibdir}/%{packname}/DESCRIPTION
%doc %{rlibdir}/%{packname}/NEWS.Rd
%{rlibdir}/%{packname}/INDEX
%{rlibdir}/%{packname}/NAMESPACE
%{rlibdir}/%{packname}/Meta
%{rlibdir}/%{packname}/R
%{rlibdir}/%{packname}/help
%{rlibdir}/%{packname}/bin


%changelog