Skip to content

Instantly share code, notes, and snippets.

@moriyoshi
Created April 11, 2009 00:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moriyoshi/93372 to your computer and use it in GitHub Desktop.
Save moriyoshi/93372 to your computer and use it in GitHub Desktop.
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(True)")}
Name: python-rpy2
Version: 2.0.3
Release: 1%{?dist}
Summary: Python interface to the R programming language.
Group: Development/Libraries
License: BSD
URL: http://rpy.sourceforge.net/
Source0: http://downloads.sourceforge.net/sourceforge/rpy/rpy2-2.0.3.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: R
BuildRequires: python-devel R
%description
RPy is a very simple, yet robust, Python interface to the R Programming
Language. It can manage all kinds of R objects and can execute arbitrary R
functions (including the graphic functions). All errors from the R language
are converted to Python exceptions. Any module installed for the R system can
be used from within Python.
%prep
%setup -q -n rpy2-2.0.3
%build
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install --root $RPM_BUILD_ROOT
# Remove test, doc, and demo files.
rm -Rf ${RPM_BUILD_ROOT}%{python_sitelib}/rpy2/tests.py*
rm -Rf ${RPM_BUILD_ROOT}%{python_sitelib}/rpy2/tests_rpy_classic.py*
rm -Rf ${RPM_BUILD_ROOT}%{python_sitelib}/rpy2/rinterface/tests
rm -Rf ${RPM_BUILD_ROOT}%{python_sitelib}/rpy2/robjects/tests
rm -Rf ${RPM_BUILD_ROOT}%{python_sitelib}/rpy2/rlike/tests
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc README GPL_LICENSE LGPL_LICENSE MPL_LICENSE AUTHORS
%dir %{python_sitelib}/rpy2
%{python_sitelib}/rpy2
%{python_sitelib}/rpy2-*.egg-info
%changelog
* Sat Apr 11 2009 Moriyoshi Koizumi <mozo@mozo.jp> - 2.0.3-1
- Initial RPM build.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment