File R-RWeka.spec of Package R-RWeka

#
# spec file for package R-RWeka
#
# 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  RWeka
%global rlibdir   %{_libdir}/R/library
%define tarver  0.4-39
Name:           R-%{packname}
Version:        %(echo %{tarver} | tr - .)
Release:        0
Summary:        R/Weka interface
License:        GPL-2.0-only
Group:          Development/Libraries/Other
URL:            https://cran.r-project.org/package=RWeka
Source0:        https://cran.r-project.org/src/contrib/%{packname}_%{tarver}.tar.gz
BuildRequires:  R-RWekajars
BuildRequires:  R-base-devel
BuildRequires:  R-base-java
BuildRequires:  R-rJava
BuildRequires:  fdupes
BuildRequires:  java >= 1.8
BuildRequires:  texinfo
BuildRequires:  texlive
Requires:       R-RWekajars
Requires:       R-base
Requires:       R-base-java
Requires:       R-rJava
Requires:       java >= 1.8
Provides:       %{name} = %{tarver}

%description
An R interface to Weka (Version 3.7.10). Weka is a collection of machine
learning algorithms for data mining tasks written in Java, containing
tools for data pre-processing, classification, regression, clustering,
association rules, and visualization.  Package RWeka contains the
interface code, the Weka jar is in a separate package RWekajars.  For more
information on Weka see <http://www.cs.waikato.ac.nz/~ml/weka/>.

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

%build

%install
# 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

mkdir -p %{buildroot}%{rlibdir}
%{_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

%files
%dir %{rlibdir}/%{packname}
%doc %{rlibdir}/%{packname}/doc
%doc %{rlibdir}/%{packname}/html
%doc %{rlibdir}/%{packname}/CITATION
%doc %{rlibdir}/%{packname}/DESCRIPTION
%{rlibdir}/%{packname}/INDEX
%{rlibdir}/%{packname}/NAMESPACE
%{rlibdir}/%{packname}/Meta
%{rlibdir}/%{packname}/R
%{rlibdir}/%{packname}/arff
%{rlibdir}/%{packname}/help
%{rlibdir}/%{packname}/java
%{rlibdir}/%{packname}/po

%changelog
openSUSE Build Service is sponsored by