%global         java_arch               %{_arch}
%ifarch x86_64
%global         java_arch               amd64
%endif
%global         major_version           4
%global         minor_version           0
%global         patch_version           5

Name:           R
Version:        %{major_version}.%{minor_version}.%{patch_version}
Release:        3
Summary:        A language for data analysis and graphics
License:        AGPL-3.0 and Artistic-2.0 and BSD-2-Clause and BSD-3-Clause and GPL-2.0 and GPL-3.0 and LGPL-2.1 and LGPL-3.0 and MIT and CC-BY-SA-4.0
URL:            http://www.r-project.org
Source0:        https://cran.r-project.org/src/base/R-4/R-%{version}.tar.gz
Patch0:         allow-libcurl-v8.patch

BuildRequires:  gcc-gfortran gcc-c++ texinfo-tex libpng-devel libjpeg-devel readline-devel libicu-devel less tcl-devel 
BuildRequires:  ncurses-devel pcre-devel zlib-devel pcre2-devel libcurl-devel valgrind-devel java-openjdk tk-devel
BuildRequires:  tre-devel autoconf automake libtool openblas-devel pango-devel xz-devel libSM-devel libX11-devel libICE-devel
BuildRequires:  libXt-devel bzip2-devel libXmu-devel cairo-devel libtiff-devel tex(inconsolata.sty) tex(upquote.sty) tex(latex)

Requires:       R-devel         = %{version}-%{release}
Requires:       R-java          = %{version}-%{release}
Requires:       libRmath-devel  = %{version}-%{release}


%description
This is a metapackage that provides both core R userspace and all R development
components.

R is a language and environment for statistical computing and graphics. R is similar
to the award-winning S system, which was developed at Bell Laboratories by
John Chambers et al. It provides a wide variety of statistical and graphical
techniques (linear and nonlinear modelling, statistical tests, time series analysis,
classification, clustering, ...).

R is designed as a true computer language with control-flow constructions for
iteration and alternation, and it allows users to add additional functionality
by defining new functions. For computationally intensive tasks, C, C++ and
Fortran code can be linked and called at run time.


%package        core
Summary:        The minimal R components necessary for a functional runtime
Requires:       xdg-utils %{_vendor}-rpm-config tex(dvips) vi perl sed gawk tex(latex) less make unzip
Requires:       libRmath%{?_isa} = %{version}-%{release}
Recommends:     cups
Provides:       R(ABI) = %{major_version}.%{minor_version}

# These are the submodules that R-core provides. Sometimes R modules say they
# depend on one of these submodules rather than just R. These are provided for
# packager convenience.
%define add_submodule() %{lua:
    local name = rpm.expand("%1")
    local version = rpm.expand("%2")
    local rpm_version = string.gsub(version, "-", ".")
    print("Provides: R-" .. name .. " = " .. rpm_version .. "\\n")
    print("Provides: R(" .. name .. ") = " .. rpm_version)
}
%add_submodule  base            %{version}
%add_submodule  boot            1.3-27
%add_submodule  class           7.3-18
%add_submodule  cluster         2.1.1
%add_submodule  codetools       0.2-18
%add_submodule  compiler        %{version}
%add_submodule  datasets        %{version}
%add_submodule  foreign         0.8-81
%add_submodule  graphics        %{version}
%add_submodule  grDevices       %{version}
%add_submodule  grid            %{version}
%add_submodule  KernSmooth      2.23-18
%add_submodule  lattice         0.20-41
%add_submodule  MASS            7.3-53.1
%add_submodule  Matrix          1.3-2
%add_submodule  methods         %{version}
%add_submodule  mgcv            1.8-34
%add_submodule  nlme            3.1-152
%add_submodule  nnet            7.3-15
%add_submodule  parallel        %{version}
%add_submodule  rpart           4.1-15
%add_submodule  spatial         7.3-13
%add_submodule  splines         %{version}
%add_submodule  stats           %{version}
%add_submodule  stats4          %{version}
%add_submodule  survival        3.2-10
%add_submodule  tcltk           %{version}
%add_submodule  tools           %{version}
%add_submodule  translations    %{version}
%add_submodule  utils           %{version}
Obsoletes:      R-Matrix        < 0.999375-7

%description    core
A language and environment for statistical computing and graphics. R is similar
to the award-winning S system, which was developed at Bell Laboratories by
John Chambers et al. It provides a wide variety of statistical and graphical
techniques (linear and nonlinear modelling, statistical tests, time series analysis,
classification, clustering, ...).

R is designed as a true computer language with control-flow constructions for
iteration and alternation, and it allows users to add additional functionality
by defining new functions. For computationally intensive tasks, C, C++ and
Fortran code can be linked and called at run time.


%package        core-devel
Summary:        Core files for development of R packages (no Java)
Requires:       R-core = %{version}-%{release}
Requires:       gcc-c++ gcc-gfortran tex(latex) texinfo-tex bzip2-devel libX11-devel zlib-devel
Requires:       tcl-devel tk-devel pkgconfig xz-devel pcre2-devel openblas-devel libicu-devel tre-devel
Requires:       tex(ecrm1000.tfm) tex(inconsolata.sty) tex(ptmr8t.tfm) tex(ptmb8t.tfm) tex(pcrr8t.tfm)
Requires:       tex(phvr8t.tfm) tex(ptmri8t.tfm) tex(ptmro8t.tfm) tex(cm-super-ts1.enc) qpdf
Provides:       R-Matrix-devel = 1.3.2
Obsoletes:      R-Matrix-devel < 0.999375-7

%description    core-devel
Install R-core-devel if you are going to develop or compile R packages. This package
does not configure the R environment for Java, install R-java-devel if you want this.


%package        devel
Summary:        Full R development environment metapackage
Requires:       R-rpm-macros
Requires:       R-core-devel = %{version}-%{release}
Requires:       R-java-devel = %{version}-%{release}

%description    devel
This is a metapackage to install a complete (with Java) R development environment.


%package        java
Summary:        R with Fedora provided Java Runtime Environment
Requires(post): R-core = %{version}-%{release}
Requires:       java-openjdk

%description java
A language and environment for statistical computing and graphics. R is similar
to the award-winning S system, which was developed at Bell Laboratories by
John Chambers et al. It provides a wide variety of statistical and graphical
techniques (linear and nonlinear modelling, statistical tests, time series analysis,
classification, clustering, ...).

R is designed as a true computer language with control-flow constructions for
iteration and alternation, and it allows users to add additional functionality
by defining new functions. For computationally intensive tasks, C, C++ and
Fortran code can be linked and called at run time.


%package        java-devel
Summary:        Development package for use with Java enabled R components
Requires(post): R-core-devel = %{version}-%{release}
Requires(post): java-devel

%description    java-devel
Install R-java-devel if you are going to develop or compile R packages that assume
java is present and configured on the system.


%package        -n libRmath
Summary:        Standalone math library from the R project

%description    -n libRmath
A standalone library of mathematical and statistical functions derived from the
R project. This package provides the shared libRmath library.


%package        -n libRmath-devel
Summary:        Headers from the R Standalone math library
Requires:       libRmath = %{version}-%{release}, pkgconfig

%description    -n libRmath-devel
A standalone library of mathematical and statistical functions derived from the
R project. This package provides the libRmath header files.


%package        -n libRmath-static
Summary:        Static R Standalone math library
Requires:       libRmath-devel = %{version}-%{release}

%description    -n libRmath-static
A standalone library of mathematical and statistical functions derived from the
R project. This package provides the static libRmath library.


%prep
%autosetup -n %{name}-%{version} -p1
# Filter false positive provides.
cat <<EOF > %{name}-prov
#!/bin/sh
%{__perl_provides} | grep -v 'File::Copy::Recursive' | grep -v 'Text::DelimMatch'
EOF

%global __perl_provides %{_builddir}/R-%{version}/%{name}-prov
chmod +x %{__perl_provides}

# Filter unwanted Requires:
cat << \EOF > %{name}-req
#!/bin/sh
%{__perl_requires} | grep -v 'perl(Text::DelimMatch)'
EOF
%global __perl_requires %{_builddir}/R-%{version}/%{name}-req
chmod +x %{__perl_requires}


%build
# Add PATHS to Renviron for R_LIBS_SITE
echo 'R_LIBS_SITE=${R_LIBS_SITE-'"'/usr/local/lib/R/site-library:/usr/local/lib/R/library:%{_libdir}/R/library:%{_datadir}/R/library'"'}' >> etc/Renviron.in
sed -i 's|inconsolata,||g' etc/Renviron.in

export R_RD4PDF="times,hyper"
export R_PDFVIEWER="%{_bindir}/xdg-open"
export R_BROWSER="%{_bindir}/xdg-open"
export R_PRINTCMD="lpr"

case "%{_target_cpu}" in
    x86_64)
        export CC="gcc -m64"
        export CXX="g++ -m64"
        export F77="gfortran -m64"
        export FC="gfortran -m64"
    ;;
    aarch64)
        export CC="gcc"
        export CXX="g++"
        export F77="gfortran"
        export FC="gfortran"
    ;;
    *)
        export CC="gcc"
        export CXX="g++"
        export F77="gfortran"
        export FC="gfortran"
    ;;
esac

export FCFLAGS="%{optflags}"

(%configure \
    --with-system-tre \
    --with-system-valgrind-headers \
    --with-lapack \
    --with-blas \
    --with-tcl-config=%{_libdir}/tclConfig.sh \
    --with-tk-config=%{_libdir}/tkConfig.sh \
    --enable-R-shlib \
    --enable-prebuilt-html \
    --enable-R-profiling \
    --enable-memory-profiling \
    MAKEINFO=texi2any \
    rdocdir=%{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}} \
    rincludedir=%{_includedir}/R \
    rsharedir=%{_datadir}/R) | tee CONFIGURE.log
cat CONFIGURE.log | grep -A30 'R is now' - > CAPABILITIES

make V=1

(cd src/nmath/standalone; make)
#make check-all
make pdf
make MAKEINFO=texi2any info

for i in doc/manual/R-intro.info doc/manual/R-FAQ.info doc/FAQ doc/manual/R-admin.info doc/manual/R-exts.info-1; do
    iconv -f iso-8859-1 -t utf-8 -o $i{.utf8,}
    mv $i{.utf8,}
done


%install
make DESTDIR=%{buildroot} install install-info
make DESTDIR=%{buildroot} install-pdf
rm -rf %{buildroot}%{_infodir}/dir %{buildroot}%{_infodir}/dir.old
mkdir -p %{buildroot}%{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}}
install -p CAPABILITIES %{buildroot}%{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}}
#Install libRmath files
(cd src/nmath/standalone; make install DESTDIR=%{buildroot})

mkdir -p %{buildroot}/etc/ld.so.conf.d
echo "%{_libdir}/R/lib" > %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.conf

mkdir -p %{buildroot}%{_datadir}/R/library

# Fix multilib
touch -r README %{buildroot}%{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}}/CAPABILITIES
touch -r README doc/manual/*.pdf
touch -r README %{buildroot}%{_bindir}/R

# Fix html/packages.html
# We can safely use RHOME here, because all of these are system packages.
sed -i 's|\..\/\..|%{_libdir}/R|g' %{buildroot}%{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}}/html/packages.html

for i in %{buildroot}%{_libdir}/R/library/*/html/*.html; do
    sed -i 's|\..\/\..\/..\/doc|%{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}}|g' $i
done

# Fix exec bits
chmod +x %{buildroot}%{_datadir}/R/sh/echo.sh
chmod +x %{buildroot}%{_libdir}/R/bin/*
chmod -x %{buildroot}%{_libdir}/R/library/mgcv/CITATION %{buildroot}%{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}}/CAPABILITIES

# Symbolic link for convenience
if [ ! -d "%{buildroot}%{_libdir}/R/include" ]; then
	pushd %{buildroot}%{_libdir}/R || exit 1
	ln -s ../../include/R include
	popd
fi

# Symbolic link for LaTeX
if [ ! -d "%{buildroot}%{_datadir}/texmf/tex/latex/R" ]; then
	mkdir -p %{buildroot}%{_datadir}/texmf/tex/latex
	pushd %{buildroot}%{_datadir}/texmf/tex/latex  || exit 1
	ln -s %{_datadir}/R/texmf/tex/latex R
	popd
fi


%check
%ifnarch aarch64 riscv64
    ulimit -s 16384
    TZ="Europe/Paris" make check
%endif


%post           core
/sbin/ldconfig
R CMD javareconf \
    JAVA_HOME=%{_jvmdir}/jre \
    JAVA_CPPFLAGS='-I%{_jvmdir}/java/include\ -I%{_jvmdir}/java/include/linux' \
    JAVA_LIBS='-L%{_jvmdir}/jre/lib/%{java_arch}/server \
    -L%{_jvmdir}/jre/lib/%{java_arch}\ -L%{_jvmdir}/java/lib/%{java_arch}\ -L%{_jvmdir}/jre/lib/server \
    -L/usr/java/packages/lib/%{java_arch}\ -L/lib\ -L/usr/lib\ -ljvm' \
    JAVA_LD_LIBRARY_PATH=%{_jvmdir}/jre/lib/%{java_arch}/server:%{_jvmdir}/jre/lib/%{java_arch}:%{_jvmdir}/java/lib/%{java_arch}:%{_jvmdir}/jre/lib/server:/usr/java/packages/lib/%{java_arch}:/lib:/usr/lib \
    > /dev/null 2>&1 || exit 0


%postun         core
/sbin/ldconfig
if [ $1 -eq 0 ] ; then
    /usr/bin/mktexlsr %{_datadir}/texmf &>/dev/null || :
fi


%posttrans      core
/usr/bin/mktexlsr %{_datadir}/texmf &>/dev/null || :


%post           java
R CMD javareconf \
    JAVA_HOME=%{_jvmdir}/jre \
    JAVA_CPPFLAGS='-I%{_jvmdir}/java/include\ -I%{_jvmdir}/java/include/linux' \
    JAVA_LIBS='-L%{_jvmdir}/jre/lib/%{java_arch}/server \
    -L%{_jvmdir}/jre/lib/%{java_arch}\ -L%{_jvmdir}/java/lib/%{java_arch}\ -L%{_jvmdir}/jre/lib/server \
    -L/usr/java/packages/lib/%{java_arch}\ -L/lib\ -L/usr/lib\ -ljvm' \
    JAVA_LD_LIBRARY_PATH=%{_jvmdir}/jre/lib/%{java_arch}/server:%{_jvmdir}/jre/lib/%{java_arch}:%{_jvmdir}/java/lib/%{java_arch}:%{_jvmdir}/jre/lib/server:/usr/java/packages/lib/%{java_arch}:/lib:/usr/lib \
    > /dev/null 2>&1 || exit 0


%post           java-devel
R CMD javareconf \
    JAVA_HOME=%{_jvmdir}/jre \
    JAVA_CPPFLAGS='-I%{_jvmdir}/java/include\ -I%{_jvmdir}/java/include/linux' \
    JAVA_LIBS='-L%{_jvmdir}/jre/lib/%{java_arch}/server \
    -L%{_jvmdir}/jre/lib/%{java_arch}\ -L%{_jvmdir}/java/lib/%{java_arch}\ -L%{_jvmdir}/jre/lib/server \
    -L/usr/java/packages/lib/%{java_arch}\ -L/lib\ -L/usr/lib\ -ljvm' \
    JAVA_LD_LIBRARY_PATH=%{_jvmdir}/jre/lib/%{java_arch}/server:%{_jvmdir}/jre/lib/%{java_arch}:%{_jvmdir}/java/lib/%{java_arch}:%{_jvmdir}/jre/lib/server:/usr/java/packages/lib/%{java_arch}:/lib:/usr/lib \
    > /dev/null 2>&1 || exit 0


%ldconfig_scriptlets -n libRmath


%files
# files provided by package devel


%files  core
%{_bindir}/R
%{_bindir}/Rscript
%{_datadir}/R/
%{_datadir}/texmf/tex/latex/R
# Have to break this out for the translations
%dir %{_libdir}/R/
%{_libdir}/R/bin/
%dir %{_libdir}/R/etc
%config %{_libdir}/R/etc/Makeconf
%config(noreplace) %{_libdir}/R/etc/Renviron
%config(noreplace) %{_libdir}/R/etc/javaconf
%config(noreplace) %{_libdir}/R/etc/ldpaths
%config(noreplace) %{_libdir}/R/etc/repositories
%{_libdir}/R/lib/
%dir %{_libdir}/R/library/
%dir %{_libdir}/R/library/translations/
%{_libdir}/R/library/translations/DESCRIPTION
%lang(da) %{_libdir}/R/library/translations/da/
%lang(de) %{_libdir}/R/library/translations/de/
%lang(en) %{_libdir}/R/library/translations/en*/
%lang(es) %{_libdir}/R/library/translations/es/
%lang(fa) %{_libdir}/R/library/translations/fa/
%lang(fr) %{_libdir}/R/library/translations/fr/
%lang(it) %{_libdir}/R/library/translations/it/
%lang(ja) %{_libdir}/R/library/translations/ja/
%lang(ko) %{_libdir}/R/library/translations/ko/
%lang(nn) %{_libdir}/R/library/translations/nn/
%lang(pl) %{_libdir}/R/library/translations/pl/
%lang(pt) %{_libdir}/R/library/translations/pt*/
%lang(ru) %{_libdir}/R/library/translations/ru/
%lang(tr) %{_libdir}/R/library/translations/tr/
%lang(zh) %{_libdir}/R/library/translations/zh*/
# base
%{_libdir}/R/library/base/
# boot
%dir %{_libdir}/R/library/boot/
%{_libdir}/R/library/boot/bd.q
%{_libdir}/R/library/boot/CITATION
%{_libdir}/R/library/boot/data/
%{_libdir}/R/library/boot/DESCRIPTION
%{_libdir}/R/library/boot/help/
%{_libdir}/R/library/boot/html/
%{_libdir}/R/library/boot/INDEX
%{_libdir}/R/library/boot/Meta/
%{_libdir}/R/library/boot/NAMESPACE
%dir %{_libdir}/R/library/boot/po/
%lang(de) %{_libdir}/R/library/boot/po/de/
%lang(en) %{_libdir}/R/library/boot/po/en*/
%lang(fr) %{_libdir}/R/library/boot/po/fr/
%lang(it) %{_libdir}/R/library/boot/po/it/
%lang(ko) %{_libdir}/R/library/boot/po/ko/
%lang(pl) %{_libdir}/R/library/boot/po/pl/
%lang(ru) %{_libdir}/R/library/boot/po/ru/
%{_libdir}/R/library/boot/R/
# class
%dir %{_libdir}/R/library/class/
%{_libdir}/R/library/class/CITATION
%{_libdir}/R/library/class/DESCRIPTION
%{_libdir}/R/library/class/help/
%{_libdir}/R/library/class/html/
%{_libdir}/R/library/class/INDEX
%{_libdir}/R/library/class/libs/
%{_libdir}/R/library/class/Meta/
%{_libdir}/R/library/class/NAMESPACE
%{_libdir}/R/library/class/NEWS
%dir %{_libdir}/R/library/class/po/
%lang(de) %{_libdir}/R/library/class/po/de/
%lang(en) %{_libdir}/R/library/class/po/en*/
%lang(fr) %{_libdir}/R/library/class/po/fr/
%lang(it) %{_libdir}/R/library/class/po/it/
%lang(ko) %{_libdir}/R/library/class/po/ko/
%lang(pl) %{_libdir}/R/library/class/po/pl/
%{_libdir}/R/library/class/R/
# cluster
%dir %{_libdir}/R/library/cluster/
%{_libdir}/R/library/cluster/CITATION
%{_libdir}/R/library/cluster/data/
%{_libdir}/R/library/cluster/DESCRIPTION
%{_libdir}/R/library/cluster/help/
%{_libdir}/R/library/cluster/html/
%{_libdir}/R/library/cluster/INDEX
%{_libdir}/R/library/cluster/libs/
%{_libdir}/R/library/cluster/Meta/
%{_libdir}/R/library/cluster/NAMESPACE
%{_libdir}/R/library/cluster/NEWS.Rd
%{_libdir}/R/library/cluster/R/
%{_libdir}/R/library/cluster/test-tools.R
%dir %{_libdir}/R/library/cluster/po/
%lang(de) %{_libdir}/R/library/cluster/po/de/
%lang(en) %{_libdir}/R/library/cluster/po/en*/
%lang(fr) %{_libdir}/R/library/cluster/po/fr/
%lang(it) %{_libdir}/R/library/cluster/po/it/
%lang(ko) %{_libdir}/R/library/cluster/po/ko/
%lang(pl) %{_libdir}/R/library/cluster/po/pl/
# codetools
%dir %{_libdir}/R/library/codetools/
%{_libdir}/R/library/codetools/DESCRIPTION
%{_libdir}/R/library/codetools/help/
%{_libdir}/R/library/codetools/html/
%{_libdir}/R/library/codetools/INDEX
%{_libdir}/R/library/codetools/Meta/
%{_libdir}/R/library/codetools/NAMESPACE
%{_libdir}/R/library/codetools/R/
# compiler
%{_libdir}/R/library/compiler/
# datasets
%{_libdir}/R/library/datasets/
# foreign
%dir %{_libdir}/R/library/foreign/
%{_libdir}/R/library/foreign/COPYRIGHTS
%{_libdir}/R/library/foreign/DESCRIPTION
%{_libdir}/R/library/foreign/files/
%{_libdir}/R/library/foreign/help/
%{_libdir}/R/library/foreign/html/
%{_libdir}/R/library/foreign/INDEX
%{_libdir}/R/library/foreign/libs/
%{_libdir}/R/library/foreign/Meta/
%{_libdir}/R/library/foreign/NAMESPACE
%dir %{_libdir}/R/library/foreign/po/
%lang(de) %{_libdir}/R/library/foreign/po/de/
%lang(en) %{_libdir}/R/library/foreign/po/en*/
%lang(fr) %{_libdir}/R/library/foreign/po/fr/
%lang(it) %{_libdir}/R/library/foreign/po/it/
%lang(pl) %{_libdir}/R/library/foreign/po/pl/
%{_libdir}/R/library/foreign/R/
# graphics
%{_libdir}/R/library/graphics/
# grDevices
%{_libdir}/R/library/grDevices
# grid
%{_libdir}/R/library/grid/
# KernSmooth
%dir %{_libdir}/R/library/KernSmooth/
%{_libdir}/R/library/KernSmooth/DESCRIPTION
%{_libdir}/R/library/KernSmooth/help/
%{_libdir}/R/library/KernSmooth/html/
%{_libdir}/R/library/KernSmooth/INDEX
%{_libdir}/R/library/KernSmooth/libs/
%{_libdir}/R/library/KernSmooth/Meta/
%{_libdir}/R/library/KernSmooth/NAMESPACE
%dir %{_libdir}/R/library/KernSmooth/po/
%lang(de) %{_libdir}/R/library/KernSmooth/po/de/
%lang(en) %{_libdir}/R/library/KernSmooth/po/en*/
%lang(fr) %{_libdir}/R/library/KernSmooth/po/fr/
%lang(it) %{_libdir}/R/library/KernSmooth/po/it/
%lang(ko) %{_libdir}/R/library/KernSmooth/po/ko/
%lang(pl) %{_libdir}/R/library/KernSmooth/po/pl/
%{_libdir}/R/library/KernSmooth/R/
# lattice
%dir %{_libdir}/R/library/lattice/
%{_libdir}/R/library/lattice/CITATION
%{_libdir}/R/library/lattice/data/
%{_libdir}/R/library/lattice/demo/
%{_libdir}/R/library/lattice/DESCRIPTION
%{_libdir}/R/library/lattice/help/
%{_libdir}/R/library/lattice/html/
%{_libdir}/R/library/lattice/INDEX
%{_libdir}/R/library/lattice/libs/
%{_libdir}/R/library/lattice/Meta/
%{_libdir}/R/library/lattice/NAMESPACE
%{_libdir}/R/library/lattice/NEWS
%dir %{_libdir}/R/library/lattice/po/
%lang(de) %{_libdir}/R/library/lattice/po/de/
%lang(en) %{_libdir}/R/library/lattice/po/en*/
%lang(fr) %{_libdir}/R/library/lattice/po/fr/
%lang(ko) %{_libdir}/R/library/lattice/po/ko/
%lang(pl) %{_libdir}/R/library/lattice/po/pl*/
%{_libdir}/R/library/lattice/R/
# MASS
%dir %{_libdir}/R/library/MASS/
%{_libdir}/R/library/MASS/CITATION
%{_libdir}/R/library/MASS/data/
%{_libdir}/R/library/MASS/DESCRIPTION
%{_libdir}/R/library/MASS/help/
%{_libdir}/R/library/MASS/html/
%{_libdir}/R/library/MASS/INDEX
%{_libdir}/R/library/MASS/libs/
%{_libdir}/R/library/MASS/Meta/
%{_libdir}/R/library/MASS/NAMESPACE
%{_libdir}/R/library/MASS/NEWS
%dir %{_libdir}/R/library/MASS/po
%lang(de) %{_libdir}/R/library/MASS/po/de/
%lang(en) %{_libdir}/R/library/MASS/po/en*/
%lang(fr) %{_libdir}/R/library/MASS/po/fr/
%lang(it) %{_libdir}/R/library/MASS/po/it/
%lang(ko) %{_libdir}/R/library/MASS/po/ko/
%lang(pl) %{_libdir}/R/library/MASS/po/pl/
%{_libdir}/R/library/MASS/R/
%{_libdir}/R/library/MASS/scripts/
# Matrix
%dir %{_libdir}/R/library/Matrix/
%{_libdir}/R/library/Matrix/Copyrights
%{_libdir}/R/library/Matrix/data/
%{_libdir}/R/library/Matrix/doc/
%{_libdir}/R/library/Matrix/DESCRIPTION
%{_libdir}/R/library/Matrix/Doxyfile
%{_libdir}/R/library/Matrix/external/
%{_libdir}/R/library/Matrix/help/
%{_libdir}/R/library/Matrix/html/
%{_libdir}/R/library/Matrix/include/
%{_libdir}/R/library/Matrix/INDEX
%{_libdir}/R/library/Matrix/libs/
%{_libdir}/R/library/Matrix/LICENCE
%{_libdir}/R/library/Matrix/Meta/
%{_libdir}/R/library/Matrix/NAMESPACE
%{_libdir}/R/library/Matrix/NEWS.Rd
%dir %{_libdir}/R/library/Matrix/po/
%lang(de) %{_libdir}/R/library/Matrix/po/de/
%lang(en) %{_libdir}/R/library/Matrix/po/en*/
%lang(fr) %{_libdir}/R/library/Matrix/po/fr/
%lang(ko) %{_libdir}/R/library/Matrix/po/ko/
%lang(pl) %{_libdir}/R/library/Matrix/po/pl/
%{_libdir}/R/library/Matrix/R/
%{_libdir}/R/library/Matrix/test-tools.R
%{_libdir}/R/library/Matrix/test-tools-1.R
%{_libdir}/R/library/Matrix/test-tools-Matrix.R
# methods
%{_libdir}/R/library/methods/
# mgcv
%{_libdir}/R/library/mgcv/
# nlme
%dir %{_libdir}/R/library/nlme/
%{_libdir}/R/library/nlme/CITATION
%{_libdir}/R/library/nlme/data/
%{_libdir}/R/library/nlme/DESCRIPTION
%{_libdir}/R/library/nlme/help/
%{_libdir}/R/library/nlme/html/
%{_libdir}/R/library/nlme/INDEX
%{_libdir}/R/library/nlme/libs/
%{_libdir}/R/library/nlme/LICENCE
%{_libdir}/R/library/nlme/Meta/
%{_libdir}/R/library/nlme/mlbook/
%{_libdir}/R/library/nlme/NAMESPACE
%dir %{_libdir}/R/library/nlme/po/
%lang(de) %{_libdir}/R/library/nlme/po/de/
%lang(en) %{_libdir}/R/library/nlme/po/en*/
%lang(fr) %{_libdir}/R/library/nlme/po/fr/
%lang(ko) %{_libdir}/R/library/nlme/po/ko/
%lang(pl) %{_libdir}/R/library/nlme/po/pl/
%{_libdir}/R/library/nlme/R/
%{_libdir}/R/library/nlme/scripts/
# nnet
%dir %{_libdir}/R/library/nnet/
%{_libdir}/R/library/nnet/CITATION
%{_libdir}/R/library/nnet/DESCRIPTION
%{_libdir}/R/library/nnet/help/
%{_libdir}/R/library/nnet/html/
%{_libdir}/R/library/nnet/INDEX
%{_libdir}/R/library/nnet/libs/
%{_libdir}/R/library/nnet/Meta/
%{_libdir}/R/library/nnet/NAMESPACE
%{_libdir}/R/library/nnet/NEWS
%dir %{_libdir}/R/library/nnet/po
%lang(de) %{_libdir}/R/library/nnet/po/de/
%lang(en) %{_libdir}/R/library/nnet/po/en*/
%lang(fr) %{_libdir}/R/library/nnet/po/fr/
%lang(it) %{_libdir}/R/library/nnet/po/it/
%lang(ko) %{_libdir}/R/library/nnet/po/ko/
%lang(pl) %{_libdir}/R/library/nnet/po/pl/
%{_libdir}/R/library/nnet/R/
# parallel
%{_libdir}/R/library/parallel/
# rpart
%dir %{_libdir}/R/library/rpart/
%{_libdir}/R/library/rpart/data/
%{_libdir}/R/library/rpart/DESCRIPTION
%{_libdir}/R/library/rpart/doc/
%{_libdir}/R/library/rpart/help/
%{_libdir}/R/library/rpart/html/
%{_libdir}/R/library/rpart/INDEX
%{_libdir}/R/library/rpart/libs/
%{_libdir}/R/library/rpart/Meta/
%{_libdir}/R/library/rpart/NAMESPACE
%{_libdir}/R/library/rpart/NEWS.Rd
%dir %{_libdir}/R/library/rpart/po
%lang(de) %{_libdir}/R/library/rpart/po/de/
%lang(en) %{_libdir}/R/library/rpart/po/en*/
%lang(fr) %{_libdir}/R/library/rpart/po/fr/
%lang(ko) %{_libdir}/R/library/rpart/po/ko/
%lang(pl) %{_libdir}/R/library/rpart/po/pl/
%lang(ru) %{_libdir}/R/library/rpart/po/ru/
%{_libdir}/R/library/rpart/R/
# spatial
%dir %{_libdir}/R/library/spatial/
%{_libdir}/R/library/spatial/CITATION
%{_libdir}/R/library/spatial/DESCRIPTION
%{_libdir}/R/library/spatial/help/
%{_libdir}/R/library/spatial/html/
%{_libdir}/R/library/spatial/INDEX
%{_libdir}/R/library/spatial/libs/
%{_libdir}/R/library/spatial/Meta/
%{_libdir}/R/library/spatial/NAMESPACE
%{_libdir}/R/library/spatial/NEWS
%dir %{_libdir}/R/library/spatial/po
%lang(de) %{_libdir}/R/library/spatial/po/de/
%lang(en) %{_libdir}/R/library/spatial/po/en*/
%lang(fr) %{_libdir}/R/library/spatial/po/fr/
%lang(it) %{_libdir}/R/library/spatial/po/it/
%lang(ko) %{_libdir}/R/library/spatial/po/ko/
%lang(pl) %{_libdir}/R/library/spatial/po/pl/
%{_libdir}/R/library/spatial/ppdata/
%{_libdir}/R/library/spatial/PP.files
%{_libdir}/R/library/spatial/R/
# splines
%{_libdir}/R/library/splines/
# stats
%{_libdir}/R/library/stats/
# stats4
%{_libdir}/R/library/stats4/
# survival
%{_libdir}/R/library/survival/
# tcltk
%{_libdir}/R/library/tcltk/
# tools
%{_libdir}/R/library/tools/
# utils
%{_libdir}/R/library/utils/
%{_libdir}/R/modules
%{_libdir}/R/COPYING
# %%{_libdir}/R/NEWS*
%{_libdir}/R/SVN-REVISION
%{_infodir}/R-*.info*
%{_mandir}/man1/*
%{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}}
%docdir %{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}}
/etc/ld.so.conf.d/*


%files  core-devel
%{_libdir}/pkgconfig/libR.pc
%{_includedir}/R
# Symlink to %%{_includedir}/R/
%{_libdir}/R/include


%files  devel
# Nothing, all files provided by R-core-devel


%files  java
# Nothing, all files provided by R-core


%files  java-devel
# Nothing, all files provided by R-core-devel


%files  -n libRmath
%doc doc/COPYING
%{_libdir}/libRmath.so


%files  -n libRmath-devel
%{_includedir}/Rmath.h
%{_libdir}/pkgconfig/libRmath.pc


%files  -n libRmath-static
%{_libdir}/libRmath.a


%changelog
* Mon Apr 8 2024 laokz <zhangkai@iscas.ac.cn> - 4.0.5-3
- riscv64: disable %check due to NaN issue

* Thu Jul 20 2023 wangkai <13474090681@163.com> - 4.0.5-2
- allow libcurl v8 for fix build error

* Thu Jun 03 2021 He Rengui <herengui@uniontech.com> - 4.0.5-1
- package init
