From 27576d1650e7113db050bfbbf43a0984b9c02cc7 Mon Sep 17 00:00:00 2001 From: nihara-thomas Date: Mon, 2 Oct 2023 14:19:30 -0700 Subject: [PATCH] Updated README + added package script --- README.md | 6 +++ builder/package.opensuse-155 | 100 +++++++++++++++++++++++++++++++++++ 2 files changed, 106 insertions(+) create mode 100644 builder/package.opensuse-155 diff --git a/README.md b/README.md index f43401f..01661ea 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,9 @@ R binaries are built for the following Linux operating systems: - CentOS 7 - Red Hat Enterprise Linux 7, 8, 9 - openSUSE 15.4 +- openSUSE 15.5 - SUSE Linux Enterprise 15 SP4 +- SUSE Linux Enterprise 15 SP5 - Fedora 37, 38 Operating systems are supported until their vendor end-of-support dates, which @@ -140,6 +142,10 @@ Download the rpm package: ```bash # openSUSE 15.4 / SLES 15 SP4 curl -O https://cdn.posit.co/r/opensuse-154/pkgs/R-${R_VERSION}-1-1.x86_64.rpm + + +# openSUSE 15.5 / SLES 15 SP5 +curl -O https://cdn.posit.co/r/opensuse-155/pkgs/R-${R_VERSION}-1-1.x86_64.rpm ``` Then install the package: diff --git a/builder/package.opensuse-155 b/builder/package.opensuse-155 new file mode 100644 index 0000000..3bd9d89 --- /dev/null +++ b/builder/package.opensuse-155 @@ -0,0 +1,100 @@ +#!/bin/bash + +if [[ ! -d /tmp/output/${OS_IDENTIFIER} ]]; then + mkdir -p "/tmp/output/${OS_IDENTIFIER}" +fi + +# R 3.x requires PCRE1 +pcre_lib='pcre2-devel' +if [[ "${R_VERSION}" =~ ^3 ]]; then + pcre_lib='pcre-devel' +fi + +# Create post-install script required for OpenBLAS. +# +# On RHEL and SUSE, we link R against the internal shared BLAS to make the +# R binaries more portable and allow users to switch BLAS implementations without +# having to recompile R. We default to OpenBLAS, but users may prefer other implementations. +# +# Binary packages built against the shared BLAS are also more portable and may be used +# with the default R distributed by RHEL/SUSE, or other R installations using +# shared BLAS and configured with a different BLAS (such as Microsoft R Open with MKL). +# This is especially important for RSPM's binary packages. +# +# On Ubuntu/Debian, we link R against the external BLAS instead (--with-blas/--with-lapack), +# as those distributions use the alternatives system to swap BLAS libraries at runtime. +# The default R distributions on Ubuntu/Debian use the external BLAS, so we do as well +# for portability. +# +# https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Shared-BLAS +cat <> /post-install.sh +mv ${R_INSTALL_PATH}/lib/R/lib/libRblas.so ${R_INSTALL_PATH}/lib/R/lib/libRblas.so.keep +ln -s /usr/lib64/libopenblas.so ${R_INSTALL_PATH}/lib/R/lib/libRblas.so +EOF + +# Create after-remove script to remove internal BLAS, which won't be cleaned up automatically. +cat <> /after-remove.sh +if [ -d ${R_INSTALL_PATH} ]; then + rm -r ${R_INSTALL_PATH} +fi +EOF + +if [ "$(arch)" == "aarch64" ]; then echo arm64; else echo amd64; fi > /tmp/arch + +cat < /tmp/nfpm.yml +name: R-${R_VERSION} +version: 1 +version_schema: none +arch: $(cat /tmp/arch) +release: 1 +maintainer: Posit Software, PBC +description: | + GNU R statistical computation and graphics system +vendor: Posit Software, PBC +homepage: https://www.r-project.org +license: GPLv2+ +depends: +- fontconfig +- gcc +- gcc-c++ +- gcc-fortran +- glibc-locale +- gzip +- icu.691-devel +- libbz2-devel +- libcairo2 +- libcurl-devel +- libfreetype6 +- libgomp1 +- libjpeg62 +- libopenblas_pthreads-devel +- libpango-1_0-0 +- libreadline7 +- libtiff5 +- make +- ${pcre_lib} +- tar +- tcl +- tk +- unzip +- which +- xorg-x11 +- xorg-x11-fonts-100dpi +- xorg-x11-fonts-75dpi +- xz-devel +- zip +- zlib-devel +contents: +- src: ${R_INSTALL_PATH} + dst: ${R_INSTALL_PATH} +scripts: + postinstall: /post-install.sh + postremove: /after-remove.sh +EOF + +nfpm package \ + -f /tmp/nfpm.yml \ + -p rpm \ + -t "/tmp/output/${OS_IDENTIFIER}" + +export PKG_FILE=$(ls /tmp/output/${OS_IDENTIFIER}/R-${R_VERSION}*.rpm | head -1)