--- /dev/null
+%define fversion %(echo %{version} |tr r -)
+%define modulename reshape2
+Summary: Flexibly reshape data: a reboot of the reshape package
+Name: R-cran-%{modulename}
+Version: 1.2.2
+Release: 1
+License: GPL v2
+Group: Applications/Math
+Source0: ftp://stat.ethz.ch/R-CRAN/src/contrib/%{modulename}_%{fversion}.tar.gz
+# Source0-md5: 4b13c53b2a184c0498b351608ff8a085
+URL: http://cran.fhcrc.org/web/packages/reshape2/index.html
+BuildRequires: R >= 2.8.1
+Requires(post,postun): R >= 2.8.1
+Requires(post,postun): perl-base
+Requires(post,postun): textutils
+Requires: R
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Reshape lets you flexibly restructure and aggregate data using just
+two functions: melt and cast.
+
+%prep
+%setup -q -c
+
+%build
+R CMD build %{modulename}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT%{_libdir}/R/library/
+R CMD INSTALL %{modulename} --library=$RPM_BUILD_ROOT%{_libdir}/R/library/
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc %{modulename}/DESCRIPTION
+%{_libdir}/R/library/%{modulename}