# No Tests by default. For tests: rpmbuild -ba --define 'dotests 1' R*.spec %{!?dotests: %define dotests 0} Summary: A language for data analysis and graphics Name: R Version: 3.6.1 Release: 1 License: GPLv2+ Group: Sciences/Mathematics URL: http://www.r-project.org Source0: https://cran.cnr.berkeley.edu/src/base/R-3/R-%{version}.tar.gz Patch0: R-3.5.1-Makefile-aix.patch BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root BuildRequires: bison BuildRequires: bzip2-devel BuildRequires: libjpeg-devel BuildRequires: openldap-devel BuildRequires: libpng-devel BuildRequires: libiconv BuildRequires: pcre-devel BuildRequires: readline-devel BuildRequires: zlib-devel BuildRequires: gettext-devel BuildRequires: curl-devel BuildRequires: cairo-devel BuildRequires: xproto-devel BuildRequires: info BuildRequires: texinfo Requires: zlib >= 1.2.11-1 Requires: openldap >= 2.4.45-1 Requires: pcre >= 8.33-1 Requires: libpng >= 1.6.27-2 Requires: readline >= 8.0-2 Requires: libssh2 >= 1.8.0-2 Requires: gcc-gfortran >= 6.3.0-1 Requires: libgcc >= 6.3.0-1 Requires: curl >= 7.51.0-1 Requires: bzip2 >= 1.0.6-2 Requires: libiconv >= 1.14-1 Requires: xz-libs >= 5.2.3-1 Requires: libjpeg >= 6b-6 Requires: gettext >= 0.19.7-1 Requires: sed >= 4.4-1 Requires: cairo >= 1.14.6 %description 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 devel Summary: Files for development of R packages Group: Development/Other Requires: %{name} = %{version}-%{release} %description devel Install R-devel if you are going to develop or compile R packages. %package -n libRmath Summary: Standalone math library from the R project Group: System/Libraries %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 Group: Development/Libraries Requires: libRmath = %{version}-%{release} %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 Group: Development/Libraries 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 %setup -q %patch0 -p1 -b .aix mkdir ../32bit mv * ../32bit mv ../32bit . mkdir 64bit cp -rp 32bit/* 64bit/ %build # Add PATHS to Renviron for R_LIBS_SITE export R_BROWSER="%{_bindir}/firefox" export R_PDFVIEWER="%{_bindir}/xdg-open" export R_PRINTCMD="lpr" export R_BROWSER="%{_bindir}/xdg-open" ulimit -f unlimited ulimit -d unlimited ulimit -s unlimited ulimit -m unlimited ulimit -c unlimited ulimit -n unlimited # setup environment for 32-bit and 64-bit builds export RM="/usr/bin/rm -f" export AR="/usr/bin/ar -X32_64" # first build the 32-bit version cd 32bit export CC="gcc" export CXX="g++" export FC="gfortran" export F77="gfortran" export LDFLAGS="-L/opt/freeware/lib -L/usr/lib -Wl,-bmaxdata:0x80000000" export CFLAGS="-O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES -I/opt/freeware/include -I/usr/include -D_GETDELIM" export CXXFLAGS="-O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES -I/opt/freeware/include -I/usr/include -D_GETDELIM" export CPPFLAGS="-O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES -I/opt/freeware/include -I/usr/include -D_GETDELIM" export FCLAGS="-O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES -I/opt/freeware/include -I/usr/include -D_GETDELIM" export FFLAGS="-O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES -I/opt/freeware/include -I/usr/include -D_GETDELIM" export OBJECT_MODE=32 export PKG_CONFIG_PATH=/opt/freeware/lib/pkgconfig ./configure \ --prefix=%{_prefix} \ --libdir=%{_libdir} \ --enable-R-shlib \ --enable-BLAS-shlib \ --with-readline \ --with-cairo \ --with-libpng \ --with-jpeglib \ --with-recommended-packages \ --with-internal-tzcode \ --enable-memory-profiling make make -C src/nmath/standalone make info if [ "%{dotests}" == 1 ] then (make -i check || true) fi # now build 64-bit version cd ../64bit export CC="gcc -maix64" export CXX="g++ -maix64" export FC="gfortran -maix64" export F77="gfortran -maix64" export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -L/usr/lib" export CFLAGS="-O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM" export CXXFLAGS="-O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM" export CPPFLAGS="-O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM" export FCLAGS="-O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM" export FFLAGS="-O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM" export OBJECT_MODE=64 export PKG_CONFIG_PATH=/opt/freeware/lib64/pkgconfig:/opt/freeware/lib/pkgconfig ./configure \ --prefix=%{_prefix} \ --libdir=%{_libdir}64 \ --enable-R-shlib \ --enable-BLAS-shlib \ --with-readline \ --with-cairo \ --with-libpng \ --with-jpeglib \ --with-recommended-packages \ --with-internal-tzcode \ --enable-memory-profiling make make -C src/nmath/standalone make info if [ "%{dotests}" == 1 ] then (make -i check || true) fi %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} export RM="/usr/bin/rm -f" #First install 64bit mode cd 64bit make DESTDIR=${RPM_BUILD_ROOT} install # Install libRmath files make -C src/nmath/standalone install DESTDIR=${RPM_BUILD_ROOT} make install-info DESTDIR=${RPM_BUILD_ROOT} # Fix exec bits chmod +x ${RPM_BUILD_ROOT}%{_prefix}/lib64/R/share/sh/echo.sh chmod -x ${RPM_BUILD_ROOT}%{_prefix}/lib64/R/library/mgcv/CITATION # Preserve binaries 64bit cd ${RPM_BUILD_ROOT}%{_bindir} for f in R Rscript do mv ${f} ${f}64 done cd - #Now build 32bit mode cd ../32bit make DESTDIR=${RPM_BUILD_ROOT} install # Install libRmath files make -C src/nmath/standalone install DESTDIR=${RPM_BUILD_ROOT} make install-info DESTDIR=${RPM_BUILD_ROOT} # Fix html/packages.html # We can safely use RHOME here, because all of these are system packages. mkdir -p ${RPM_BUILD_ROOT}%{_docdir}/R/html cp ${RPM_BUILD_DIR}/%{name}-%{version}/32bit/doc/html/packages.html ${RPM_BUILD_ROOT}%{_docdir}/R/html/packages.html sed -e "s|\..\/\..|%{_libdir}64/R|g" ${RPM_BUILD_ROOT}%{_docdir}/R/html/packages.html > ${RPM_BUILD_ROOT}%{_docdir}/R/html/file.tmp mv ${RPM_BUILD_ROOT}%{_docdir}/R/html/file.tmp ${RPM_BUILD_ROOT}%{_docdir}/R/html/packages.html # Fix exec bits chmod +x ${RPM_BUILD_ROOT}%{_libdir}/R/share/sh/echo.sh chmod -x ${RPM_BUILD_ROOT}%{_libdir}/R/library/base/CITATION # Preserve binaries 32bit cd ${RPM_BUILD_ROOT}%{_bindir} for f in R Rscript do mv ${f} ${f}32 done cd - # Common build 32 and 64bit rm -f ${RPM_BUILD_ROOT}%{_infodir}/dir rm -f ${RPM_BUILD_ROOT}%{_infodir}/dir.old #Default binaries are 64bit cd ${RPM_BUILD_ROOT}/%{_bindir} ln -sf R64 R ln -sf Rscript64 Rscript %post # Create directory entries for info files # (optional doc files, so we must check that they are installed) for doc in admin data exts FAQ intro lang; do file=%{_datadir}/info/R-${doc}.info.gz if [ -e $file ]; then /sbin/install-info ${file} %{_infodir}/dir 2>/dev/null || : fi done %preun if [ $1 = 0 ]; then # Delete directory entries for info files (if they were installed) for doc in admin data exts FAQ intro lang; do file=%{_datadir}/info/R-${doc}.info.gz if [ -e ${file} ]; then /sbin/install-info --delete ${file} %{_infodir}/dir 2>/dev/null || : fi done fi %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc 32bit/ChangeLog 32bit/COPYING 32bit/INSTALL 32bit/README 32bit/VERSION %doc 32bit/doc/AUTHORS 32bit/doc/NEWS 32bit/doc/COPYRIGHTS %doc 32bit/doc/CRAN_mirrors.csv 32bit/doc/FAQ 32bit/doc/KEYWORDS %doc 32bit/doc/RESOURCES 32bit/doc/THANKS 32bit/doc/manual/ %doc %{_docdir}/R %{_bindir}/R* %dir %{_prefix}/lib64/R %dir %{_libdir}/R %{_libdir}/R/bin %{_prefix}/lib64/R/bin %{_libdir}/R/doc %{_prefix}/lib64/R/doc %{_libdir}/R/etc %{_prefix}/lib64/R/etc %{_libdir}/R/lib %{_prefix}/lib64/R/lib %{_libdir}/R/library %{_prefix}/lib64/R/library %{_libdir}/R/modules %{_prefix}/lib64/R/modules %{_libdir}/R/share %{_prefix}/lib64/R/share %{_libdir}/R/COPYING %{_prefix}/lib64/R/COPYING %{_libdir}/R/SVN-REVISION %{_prefix}/lib64/R/SVN-REVISION %{_datadir}/info/R-*.info* %{_datadir}/man/man1/* %files devel %defattr(-,root,system,-) %{_libdir}/R/include %{_prefix}/lib64/R/include %{_libdir}/pkgconfig/libR.pc %{_prefix}/lib64/pkgconfig/libR.pc %files -n libRmath %defattr(-,root,system,-) %doc 32bit/doc/COPYING %{_libdir}/libRmath.so %{_prefix}/lib64/libRmath.so %files -n libRmath-devel %defattr(-,root,system,-) %{_includedir}/Rmath.h %{_libdir}/pkgconfig/libRmath.pc %{_prefix}/lib64/pkgconfig/libRmath.pc %files -n libRmath-static %defattr(-,root,system,-) %{_libdir}/libRmath.a %{_prefix}/lib64/libRmath.a %changelog * Fri Aug 16 2019 Ayappan P - 3.6.1-1 - Update to 3.6.1 * Fri Jul 31 2018 Ayappan P - 3.5.1-1 - First port of R to AIX Toolbox