File R-rJava.spec of Package R-rJava
#
# spec file for package R-rJava
#
# Copyright (c) 2019 SUSE LINUX 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 https://bugs.opensuse.org/
#
%global packname rJava
%global rlibdir %{_libdir}/R/library
%define tarver 0.9-12
Name: R-%{packname}
Version: %(echo %{tarver} | tr - .)
Release: 0
Summary: Low-Level R to Java Interface
License: GPL-2.0-only
Group: Development/Libraries/Other
URL: https://CRAN.R-project.org/package=rJava
Source0: http://cran.r-project.org/src/contrib/%{packname}_%{tarver}.tar.gz
BuildRequires: R-base-devel >= 2.5.0
BuildRequires: R-base-java
BuildRequires: R-methods
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: libicu-devel
BuildRequires: pcre2-devel
BuildRequires: pkgconfig
BuildRequires: texinfo
BuildRequires: texlive
BuildRequires: pkgconfig(bzip2)
BuildRequires: pkgconfig(liblzma)
BuildRequires: pkgconfig(libpcre)
BuildRequires: pkgconfig(libzip)
BuildRequires: pkgconfig(zlib)
Requires: R-base >= 2.5.0
Requires: R-base-java
Requires: R-methods
Provides: %{name} = %{tarver}
%if 0%{?sle_version} >= 150000 || 0%{?is_opensuse}
BuildRequires: tex(inconsolata.sty)
%endif
%description
Low-level interface to Java VM very much like .C/.Call and friends. Allows
creation of objects, calling methods and accessing fields.
%prep
%setup -q -c -n %{packname}
%build
%install
mkdir -p %{buildroot}%{rlibdir}
# unset java env variables or build will fail
# https://stat.ethz.ch/pipermail/r-sig-debian/2010-March/001066.html
unset JAVA_HOME JAVA_ROOT JAVA_BINDIR
%{_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
%check
# TODO unit test fails in OBS VM environments
#%%{_bindir}/R CMD check %%{packname}
# No X11 DISPLAY variable was set, but this program performed an operation which requires it.
%files
%dir %{rlibdir}/%{packname}
%doc %{rlibdir}/%{packname}/javadoc/
%doc %{rlibdir}/%{packname}/html/
%doc %{rlibdir}/%{packname}/DESCRIPTION
%doc %{rlibdir}/%{packname}/NEWS
%{rlibdir}/%{packname}/INDEX
%{rlibdir}/%{packname}/NAMESPACE
%{rlibdir}/%{packname}/Meta/
%{rlibdir}/%{packname}/R/
%{rlibdir}/%{packname}/java/
%{rlibdir}/%{packname}/jri/
%{rlibdir}/%{packname}/libs/
%{rlibdir}/%{packname}/help/
%changelog