File python2-rpy2.spec of Package python2-rpy2

#
# spec file for package python2-rpy2
#
# Copyright (c) 2017 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

Name:           python2-rpy2
Version:        2.8.6
Release:        0
License:        LGPL-2.1+
Summary:        A very simple, yet robust, Python interface to the R Programming Language
Url:            https://bitbucket.org/rpy2/rpy2
Group:          Development/Libraries/Python
Source:         https://files.pythonhosted.org/packages/source/r/rpy2/rpy2-%{version}.tar.gz
BuildRequires:  -post-build-checks
BuildRequires:  R-base >= 3.2
BuildRequires:  R-base-devel >= 3.2
BuildRequires:  blas-devel
BuildRequires:  fdupes
BuildRequires:  lapack-devel
BuildRequires:  libbz2-devel
BuildRequires:  libicu-devel
BuildRequires:  openblas-devel
BuildRequires:  pcre-devel
BuildRequires:  python-devel
BuildRequires:  python-setuptools
BuildRequires:  python-numpy-devel
BuildRequires:  python-rpm-macros
BuildRequires:  readline-devel
BuildRequires:  texinfo
BuildRequires:  texlive-latex
BuildRequires:  xz-devel
BuildRequires:  zlib-devel
Requires:       R-base >= 2.12
Requires:       python-numpy
Requires:       readline
Provides:       python-rpy2 = %{version}
Obsoletes:      python-rpy2 < %{version}

%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
areconverted to Python exceptions. Any module installed for the R system can
be used from within Python.

This code is inspired by RSPython from the Omegahat project. The main goals of
RPy are:
 + to have a very robust interface for using R from Python
 + the interface should be as transparent and easy to use as possible
 + it should be usable for real scientific and statistical computations

%prep
%setup -qn rpy2-%{version}
sed -i 's/\r$//' README.rst

%build
export CFLAGS="%{optflags}"
%python2_build

%install
%python2_install
chmod a+x %{buildroot}%{python2_sitearch}/rpy2/tests.py
sed -i "s|^#!/usr/bin/env python$|#!%__python2|" %{buildroot}%{python2_sitearch}/rpy2/tests.py
python2 -m compileall -d %{python2_sitearch} %{buildroot}%{python2_sitearch}/rpy2/
python2 -O -m compileall -d %{python2_sitearch} %{buildroot}%{python2_sitearch}/rpy2/
%fdupes %{buildroot}%{python2_sitearch}

%files
%defattr(-,root,root)
%doc AUTHORS NEWS README.rst
%{python2_sitearch}/rpy2/
%{python2_sitearch}/rpy2-%{version}-py*.egg-info

%changelog
openSUSE Build Service is sponsored by