r-builds/builder/package.rhel-10
pat-s f869bd86ed
All checks were successful
ci/crow/manual/build/13 Pipeline was successful
ci/crow/manual/build/11 Pipeline was successful
ci/crow/manual/build/10 Pipeline was successful
ci/crow/manual/build/1 Pipeline was successful
ci/crow/manual/build/9 Pipeline was successful
ci/crow/manual/build/6 Pipeline was successful
ci/crow/manual/build/12 Pipeline was successful
ci/crow/manual/build/14 Pipeline was successful
ci/crow/manual/build/7 Pipeline was successful
ci/crow/manual/build/2 Pipeline was successful
ci/crow/manual/build/5 Pipeline was successful
ci/crow/manual/build/8 Pipeline was successful
ci/crow/manual/build/4 Pipeline was successful
ci/crow/manual/build/3 Pipeline was successful
chore: patch rhel10 build files
2025-06-30 16:35:46 +02:00

72 lines
1.4 KiB
Shell

#!/bin/bash
if [[ ! -d /tmp/output/${OS_IDENTIFIER} ]]; then
mkdir -p "/tmp/output/${OS_IDENTIFIER}"
fi
# R 4.5.0 and later require libzstd (with headers to link against libR)
zstd_libs='# - libzstd-devel'
if grep -q '^LIBS *=.*[-]lzstd' ${R_INSTALL_PATH}/lib/R/etc/Makeconf; then
zstd_libs='- libzstd-devel'
fi
# Create postremove script to remove empty directories, as nFPM doesn't include them in the RPM files.
cat <<EOF >> /after-remove.sh
if [ -d ${R_INSTALL_PATH} ]; then
rm -r ${R_INSTALL_PATH}
fi
EOF
scripts="scripts:
postremove: /after-remove.sh
"
if [ "$(arch)" == "aarch64" ]; then echo arm64; else echo amd64; fi > /tmp/arch
cat <<EOF > /tmp/nfpm.yml
name: R-${R_VERSION}
version: 1
version_schema: none
arch: $(cat /tmp/arch)
release: 1
maintainer: Posit Software, PBC <https://github.com/rstudio/r-builds>
description: |
GNU R statistical computation and graphics system
vendor: Posit Software, PBC
homepage: https://www.r-project.org
license: GPLv2+
depends:
- bzip2-devel
- gcc
- gcc-c++
- gcc-gfortran
- libcurl-devel
- libicu-devel
- libSM
- libtiff
- libXmu
- libXt
${zstd_libs}
- make
- flexiblas-devel
- pango
- pcre2-devel
- tcl
- tk
- unzip
- which
- xz-devel
- zip
- zlib-devel
contents:
- src: ${R_INSTALL_PATH}
dst: ${R_INSTALL_PATH}
${scripts}
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)