%define packname 

Name:           R-%{packname}
Version:        
Release:        1%{?dist}
Summary:        
Summary(fr):    

Group:         Applications/Productivity 
License:        
URL:            
Source0:         
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  R 

%description

%description -l fr

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

%build

%install
%{__rm} -rf %{buildroot}


cd ..;
mkdir -p %{buildroot}%{_libdir}/R/library ; R CMD INSTALL %{packname} -l %{buildroot}%{_libdir}/R/library
%{__rm} -rf %{buildroot}%{_libdir}/R/library/R.css

%check
cd ..;%{_bindir}/R CMD check %{packname}

%clean
%{__rm} -rf %{buildroot}

%post
%{__cat} %{_libdir}/R/library/*/CONTENTS > %{_libdir}/R/doc/html/search/index.txt

%postun
%{__cat} %{_libdir}/R/library/*/CONTENTS > %{_libdir}/R/doc/html/search/index.txt

%files
%defattr(-, root, root, -)
%{_libdir}/R/library/%{packname}
%doc 


%changelog

