%define libname %mklibname Rmath %dnl Don't mangle shebangs in %{_libdir}/R/bin %define __brp_mangle_shebangs %{_bindir}/true # (tpg) really not needed # for private copy in /usr/lib/R/share/perl/Text/DelimMatch.pm %global __provides_exclude KernSmooth.so|MASS.so|R_X11.so|class.so|cluster.so|foreign.so|grDevices.so|grid.so|internet.so|lapack.so|lattice.so|libRblas.so|libRlapack.so|methods.so|mgcv.so|nlme.so|nnet.so|rpart.so|spatial.so|splines.so|stats.so|survival.so|tcltk.so|tools.so|vfonts.so|perl\\\(R::.*\\\) %global __requires_exclude libRblas.so|libRlapack.so|perl\\\(R::.*\\\) %define _disable_ld_no_undefined 1 %bcond_without tcltk %bcond_without java %bcond_without system_tre Summary: A language for data analysis and graphics Name: R-base Version: 4.5.2 Release: %mkrel 1 License: GPLv2+ Group: Sciences/Mathematics URL: https://www.r-project.org Source0: https://cran.r-project.org/src/base/R-4/R-%{version}.tar.gz Source1: https://www.r-project.org/logo/Rlogo.png#/Rlogo-%{version}.png Source2: https://www.r-project.org/logo/Rlogo.svg#/Rlogo-%{version}.svg Source3: R.bash_completion Patch0: R-2.15.3-menu.patch Patch11: R-4.4.2-roman-tests.patch BuildRequires: bison BuildRequires: pkgconfig(blas) BuildRequires: pkgconfig(bzip2) BuildRequires: cups-common BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: gcc-gfortran BuildRequires: gcc-objc BuildRequires: gcc-objc++ BuildRequires: gettext-devel BuildRequires: glibc-devel BuildRequires: gpm-devel BuildRequires: icu-devel BuildRequires: imagemagick BuildRequires: imake BuildRequires: pkgconfig(libjpeg) BuildRequires: lapack-devel BuildRequires: paper-utils BuildRequires: pkgconfig(cairo) BuildRequires: pkgconfig(libcurl) BuildRequires: pkgconfig(liblzma) BuildRequires: pkgconfig(libpcre2-8) BuildRequires: pkgconfig(libpng) BuildRequires: pkgconfig(libtiff-4) BuildRequires: pkgconfig(ncurses) BuildRequires: pkgconfig(pango) %if %{with system_tre} BuildRequires: pkgconfig(tre) %else Provides: bundled(tre) = 0.8.0 %endif BuildRequires: pkgconfig(x11) BuildRequires: pkgconfig(xmu) BuildRequires: pkgconfig(xt) %ifnarch %arm aarch64 BuildRequires: quadmath-devel %endif BuildRequires: pkgconfig(readline) BuildRequires: texinfo BuildRequires: texinfo-tex BuildRequires: texlive BuildRequires: texlive-fontsextra BuildRequires: xdg-utils BuildRequires: zip %if %{with java} BuildRequires: java-devel %endif %if %{with tcltk} BuildRequires: tcl BuildRequires: pkgconfig(tcl) BuildRequires: pkgconfig(tk) Requires: tcl Requires: tk Requires: x11-font-adobe-100dpi %endif Provides: R = %{version} Provides: R-recommended = %{version} Requires: perl Requires: sed # needed in order to test setlocale in make check BuildRequires: locales-en Provides: R(methods) = %{version} Provides: R(utils) = %{version} Provides: R(base) = %{version} Provides: R(class) = %{version} Provides: R(tools) = %{version} Provides: R-core = %{version} # First 2 numbers of version separated by dot Provides: R(ABI) = %(echo %{version}|cut -d. -f1,2) %description `GNU S' - A language and environment for statistical computing and graphics. R is similar to the 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 -n %{libname} Summary: Standalone math library from the R project Group: Development/Other %description -n %{libname} A standalone library of mathematical and statistical functions derived from the R project. This packages provides the shared libRmath library. %package -n %{libname}-devel Summary: Standalone math library from the R project Group: Development/Other Provides: libRmath-devel = %{version}-%{release} Requires: %{libname} = %{version}-%{release} %description -n %{libname}-devel A standalone library of mathematical and statistical functions derived from the R project. This packages provides the static libRmath library and header files. %prep %autosetup -p1 -n R-%{version} %build export R_BROWSER="$(type -p xdg-open)" export R_PDFVIEWER="$(type -p xdg-open)" export R_PRINTCMD="lpr" %if %{with java} export JAVA_HOME="%{java_home}" %endif unset DISPLAY # Turn off enable-lto. # lto requires that the flags for static libraries be # set specifically, and this causes link errors with CRAN # packages. # # See bug #13528 for where this can fail # the regression tests will fail with an external Lapack # 3.9.0 unless it has this fix is put into the lapack. # https://github.com/Reference-LAPACK/lapack/pull/390 # https://github.com/xianyi/OpenBLAS/pull/2442 %configure \ %if %{with tcltk} --with-tcltk \ --with-tcl-config=%{_libdir}/tclConfig.sh \ --with-tk-config=%{_libdir}/tkConfig.sh \ %else --without-tcltk \ %endif --with-cairo \ --with-libpng \ --with-jpeglib \ --with-pcre2 \ --with-system-tre=%{?with_system_tre:yes}%{?!with_system_tre:no} \ --with-ICU \ --with-readline \ --disable-BLAS-shlib \ --with-lapack \ --with-blas \ --enable-threads=pth \ --enable-R-profiling \ --enable-R-shlib \ --disable-lto %make_build pushd src/nmath/standalone %make_build popd %make_build pdf %make_build info # DON'T comment "make check" below! If R doesn't pass the 'check' test # then it is probably badly compiled, or there are problems with # the compiler. # %check %ifarch armv7hl %{ix86} TZ="Europe/Paris" LC_ALL=C make check || (find -name "*.fail" | xargs cat) %else TZ="Europe/Paris" LC_ALL=C make check || (find -name "*.fail" | xargs cat ; exit 1) %endif %install # N.B. don't use %%makeinstall because it sets prefix= which breaks Rscript # mga#1434 %make_install install-info pushd src/nmath/standalone %makeinstall \ includedir=%{buildroot}%{_includedir} \ libdir=%{buildroot}%{_libdir} popd mv doc/manual/*.pdf %{_builddir}/%{?buildsubdir} || : # Add soft links (useful for TK gui) for i in R-admin R-data refman R-exts R-FAQ R-intro R-lang; do ln -s %{_datadir}/doc/R-base/${i}.pdf %{buildroot}%{_libdir}/R/doc/manual/${i}.pdf done # Remove latex versions of help pages # rm -rf %{buildroot}%{_libdir}/R/library/*/latex/ # Get rid of buildroot in script for i in %{buildroot}%{_libdir}/R/bin/R %{buildroot}%{_bindir}/R %{buildroot}%{_libdir}/pkgconfig/libR*.pc; do sed -i "s|%{buildroot}||g" $i; done # Remove package indices. They are rebuilt by the postinstall script. # rm -f %{buildroot}%{_libdir}/R/doc/html/function.html rm -f %{buildroot}%{_libdir}/R/doc/html/packages.html rm -f %{buildroot}%{_libdir}/R/doc/html/search/index.txt # Fix permissions chmod 644 %{buildroot}%{_libdir}/R/library/MASS/scripts/* chmod 755 %{buildroot}%{_libdir}/R/share/sh/echo.sh %if %{with tcltk} # .desktop mkdir -p %{buildroot}%{_datadir}/applications cat > %{buildroot}%{_datadir}/applications/mageia-%{name}.desktop <