Replace fpm with nfpm for the newest platforms

fpm has had multiple Ruby gem dependency issues, and nfpm has better support
for code signing if we wanted to do that in the future. The rest of the
platforms may be migrated to nfpm later.
This commit is contained in:
Greg Lin 2022-08-22 19:02:33 -05:00
commit 1552c23b3c
6 changed files with 181 additions and 144 deletions

View file

@ -6,15 +6,17 @@ RUN set -x \
&& export DEBIAN_FRONTEND=noninteractive \ && export DEBIAN_FRONTEND=noninteractive \
&& echo 'deb-src http://deb.debian.org/debian bullseye main' >> /etc/apt/sources.list \ && echo 'deb-src http://deb.debian.org/debian bullseye main' >> /etc/apt/sources.list \
&& apt-get update \ && apt-get update \
&& apt-get install -y gcc libcurl4-openssl-dev libicu-dev \ && apt-get install -y curl gcc libcurl4-openssl-dev libicu-dev \
libopenblas-base libpcre2-dev make python3-pip ruby ruby-dev wget \ libopenblas-base libpcre2-dev make python3-pip wget \
&& apt-get build-dep -y r-base && apt-get build-dep -y r-base
RUN pip3 install awscli RUN pip3 install awscli
RUN chmod 0777 /opt RUN chmod 0777 /opt
RUN gem install fpm RUN curl -LO https://github.com/goreleaser/nfpm/releases/download/v2.18.1/nfpm_amd64.deb && \
apt install -y ./nfpm_amd64.deb && \
rm nfpm_amd64.deb
# Override the default pager used by R # Override the default pager used by R
ENV PAGER /usr/bin/pager ENV PAGER /usr/bin/pager

View file

@ -32,8 +32,6 @@ RUN dnf -y upgrade \
pcre2-devel \ pcre2-devel \
readline-devel \ readline-devel \
rpm-build \ rpm-build \
ruby \
ruby-devel \
tcl-devel \ tcl-devel \
tex \ tex \
texinfo-tex \ texinfo-tex \
@ -53,7 +51,9 @@ RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2
./aws/install && \ ./aws/install && \
rm -rf aws awscliv2.zip rm -rf aws awscliv2.zip
RUN gem install fpm RUN curl -LO https://github.com/goreleaser/nfpm/releases/download/v2.18.1/nfpm_amd64.rpm && \
dnf install -y nfpm_amd64.rpm && \
rm nfpm_amd64.rpm
RUN chmod 0777 /opt RUN chmod 0777 /opt

View file

@ -6,12 +6,14 @@ RUN set -x \
&& sed -i "s|# deb-src|deb-src|g" /etc/apt/sources.list \ && sed -i "s|# deb-src|deb-src|g" /etc/apt/sources.list \
&& export DEBIAN_FRONTEND=noninteractive \ && export DEBIAN_FRONTEND=noninteractive \
&& apt-get update \ && apt-get update \
&& apt-get install -y libcurl4-openssl-dev libicu-dev libopenblas-base libpcre2-dev wget python3-pip ruby ruby-dev \ && apt-get install -y curl libcurl4-openssl-dev libicu-dev libopenblas-base libpcre2-dev wget python3-pip \
&& apt-get build-dep -y r-base && apt-get build-dep -y r-base
RUN pip3 install awscli RUN pip3 install awscli
RUN gem install fpm RUN curl -LO https://github.com/goreleaser/nfpm/releases/download/v2.18.1/nfpm_amd64.deb && \
apt install -y ./nfpm_amd64.deb && \
rm nfpm_amd64.deb
RUN chmod 0777 /opt RUN chmod 0777 /opt

View file

@ -1,59 +1,69 @@
#!/bin/bash #!/bin/bash
if [[ ! -d /tmp/output/debian-11 ]]; then if [[ ! -d /tmp/output/${OS_IDENTIFIER} ]]; then
mkdir -p /tmp/output/debian-11 mkdir -p "/tmp/output/${OS_IDENTIFIER}"
fi fi
# R 3.x requires PCRE1. On Debian 11, R 3.x also requires PCRE2 for Pango support. # R 3.x requires PCRE1. On Debian 11, R 3.x also requires PCRE2 for Pango support.
pcre_lib_flags='-d libpcre2-dev' pcre_libs='- libpcre2-dev'
if [[ "${R_VERSION}" =~ ^3 ]]; then if [[ "${R_VERSION}" =~ ^3 ]]; then
pcre_lib_flags='-d libpcre2-dev -d libpcre3-dev' pcre_libs='- libpcre2-dev
- libpcre3-dev'
fi fi
fpm \ cat <<EOF > /tmp/nfpm.yml
-s dir \ name: r-${R_VERSION}
-t deb \ version: 1
-v 1 \ version_schema: none
-n R-${R_VERSION} \ section: gnu-r
--vendor "RStudio, PBC" \ priority: optional
--deb-priority "optional" \ maintainer: RStudio, PBC <https://github.com/rstudio/r-builds>
--deb-field 'Bugs: https://github.com/rstudio/r-builds/issues' \ description: |
--url "http://www.r-project.org/" \ GNU R statistical computation and graphics system
--description "GNU R statistical computation and graphics system" \ vendor: RStudio, PBC
--maintainer "RStudio, PBC https://github.com/rstudio/r-builds" \ homepage: https://www.r-project.org
--license "GPL-2" \ license: GPL-2
-p /tmp/output/debian-11/ \ deb:
-d ca-certificates \ fields:
-d g++ \ Bugs: https://github.com/rstudio/r-builds/issues
-d gcc \ depends:
-d gfortran \ - ca-certificates
-d libbz2-dev \ - g++
-d libc6 \ - gcc
-d libcairo2 \ - gfortran
-d libcurl4-openssl-dev \ - libbz2-dev
-d libglib2.0-0 \ - libc6
-d libgomp1 \ - libcairo2
-d libicu-dev \ - libcurl4-openssl-dev
-d liblzma-dev \ - libglib2.0-0
-d libopenblas-dev \ - libgomp1
-d libpango-1.0-0 \ - libicu-dev
-d libpangocairo-1.0-0 \ - liblzma-dev
-d libpaper-utils \ - libopenblas-dev
${pcre_lib_flags} \ - libpango-1.0-0
-d libpng16-16 \ - libpangocairo-1.0-0
-d libreadline8 \ - libpaper-utils
-d libtcl8.6 \ ${pcre_libs}
-d libtiff5 \ - libpng16-16
-d libtk8.6 \ - libreadline8
-d libx11-6 \ - libtcl8.6
-d libxt6 \ - libtiff5
-d make \ - libtk8.6
-d ucf \ - libx11-6
-d unzip \ - libxt6
-d zip \ - make
-d zlib1g-dev \ - ucf
/opt/R/${R_VERSION} - unzip
- zip
- zlib1g-dev
contents:
- src: /opt/R/${R_VERSION}
dst: /opt/R/${R_VERSION}
EOF
shopt -s extglob nfpm package \
export PKG_FILE=$(ls /tmp/output/debian-11/[rR]-${R_VERSION}*.@(deb|rpm) | head -1) -f /tmp/nfpm.yml \
-p deb \
-t "/tmp/output/${OS_IDENTIFIER}"
export PKG_FILE=$(ls /tmp/output/${OS_IDENTIFIER}/r-${R_VERSION}*.deb | head -1)

View file

@ -1,5 +1,7 @@
if [[ ! -d /tmp/output/rhel-9 ]]; then #!/bin/bash
mkdir -p /tmp/output/rhel-9
if [[ ! -d /tmp/output/${OS_IDENTIFIER} ]]; then
mkdir -p "/tmp/output/${OS_IDENTIFIER}"
fi fi
# R 3.x requires PCRE1 # R 3.x requires PCRE1
@ -37,40 +39,50 @@ if [ -d /opt/R/${R_VERSION} ]; then
fi fi
EOF EOF
fpm \ cat <<EOF > /tmp/nfpm.yml
-s dir \ name: R-${R_VERSION}
-t rpm \ version: 1
-v 1 \ version_schema: none
-n "R-${R_VERSION}" \ release: 1
--vendor "RStudio, PBC" \ maintainer: RStudio, PBC <https://github.com/rstudio/r-builds>
--url "https://www.r-project.org" \ description: |
--description "GNU R statistical computation and graphics system" \ GNU R statistical computation and graphics system
--maintainer "RStudio, PBC <https://github.com/rstudio/r-builds>" \ vendor: RStudio, PBC
--license "GPLv2+" \ homepage: https://www.r-project.org
--after-install /post-install.sh \ license: GPLv2+
--after-remove /after-remove.sh \ depends:
-p /tmp/output/rhel-9/ \ - bzip2-devel
-d bzip2-devel \ - gcc
-d gcc \ - gcc-c++
-d gcc-c++ \ - gcc-gfortran
-d gcc-gfortran \ - libcurl-devel
-d libcurl-devel \ - libicu-devel
-d libicu-devel \ - libSM
-d libSM \ - libtiff
-d libtiff \ - libXmu
-d libXmu \ - libXt
-d libXt \ - make
-d make \ - openblas-devel
-d openblas-devel \ - pango
-d pango \ - ${pcre_lib}
-d ${pcre_lib} \ - tcl
-d tcl \ - tk
-d tk \ - unzip
-d unzip \ - which
-d which \ - xz-devel
-d xz-devel \ - zip
-d zip \ - zlib-devel
-d zlib-devel \ contents:
"/opt/R/${R_VERSION}" - src: /opt/R/${R_VERSION}
dst: /opt/R/${R_VERSION}
scripts:
postinstall: /post-install.sh
postremove: /after-remove.sh
EOF
export PKG_FILE=$(ls /tmp/output/rhel-9/R-${R_VERSION}*.rpm | head -1) 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)

View file

@ -1,58 +1,69 @@
#!/bin/bash #!/bin/bash
if [[ ! -d /tmp/output/ubuntu-2204 ]]; then if [[ ! -d /tmp/output/${OS_IDENTIFIER} ]]; then
mkdir -p /tmp/output/ubuntu-2204 mkdir -p "/tmp/output/${OS_IDENTIFIER}"
fi fi
# R 3.x requires PCRE1. On Ubuntu 22, R 3.x also requires PCRE2 for Pango support. # R 3.x requires PCRE1. On Ubuntu 22, R 3.x also requires PCRE2 for Pango support.
pcre_lib_flags='-d libpcre2-dev' pcre_libs='- libpcre2-dev'
if [[ "${R_VERSION}" =~ ^3 ]]; then if [[ "${R_VERSION}" =~ ^3 ]]; then
pcre_lib_flags='-d libpcre2-dev -d libpcre3-dev' pcre_libs='- libpcre2-dev
- libpcre3-dev'
fi fi
fpm \ cat <<EOF > /tmp/nfpm.yml
-s dir \ name: r-${R_VERSION}
-t deb \ version: 1
-v 1 \ version_schema: none
-n R-${R_VERSION} \ section: universe/math
--vendor "RStudio, PBC" \ priority: optional
--deb-priority "optional" \ maintainer: RStudio, PBC <https://github.com/rstudio/r-builds>
--deb-field 'Bugs: https://github.com/rstudio/r-builds/issues' \ description: |
--url "http://www.r-project.org/" \ GNU R statistical computation and graphics system
--description "GNU R statistical computation and graphics system" \ vendor: RStudio, PBC
--maintainer "RStudio, PBC https://github.com/rstudio/r-builds" \ homepage: https://www.r-project.org
--license "GPL-2" \ license: GPL-2
-p /tmp/output/ubuntu-2204/ \ deb:
-d g++ \ fields:
-d gcc \ Bugs: https://github.com/rstudio/r-builds/issues
-d gfortran \ depends:
-d libbz2-dev \ - g++
-d libc6 \ - gcc
-d libcairo2 \ - gfortran
-d libcurl4 \ - libbz2-dev
-d libglib2.0-0 \ - libc6
-d libgomp1 \ - libcairo2
-d libicu-dev \ - libcurl4
-d libjpeg8 \ - libglib2.0-0
-d liblzma-dev \ - libgomp1
-d libopenblas-dev \ - libicu-dev
-d libpango-1.0-0 \ - libjpeg8
-d libpangocairo-1.0-0 \ - liblzma-dev
-d libpaper-utils \ - libopenblas-dev
${pcre_lib_flags} \ - libpango-1.0-0
-d libpng16-16 \ - libpangocairo-1.0-0
-d libreadline8 \ - libpaper-utils
-d libtcl8.6 \ ${pcre_libs}
-d libtiff5 \ - libpng16-16
-d libtk8.6 \ - libreadline8
-d libx11-6 \ - libtcl8.6
-d libxt6 \ - libtiff5
-d make \ - libtk8.6
-d ucf \ - libx11-6
-d unzip \ - libxt6
-d zip \ - make
-d zlib1g-dev \ - ucf
/opt/R/${R_VERSION} - unzip
- zip
- zlib1g-dev
contents:
- src: /opt/R/${R_VERSION}
dst: /opt/R/${R_VERSION}
EOF
shopt -s extglob nfpm package \
export PKG_FILE=$(ls /tmp/output/ubuntu-2204/[rR]-${R_VERSION}*.@(deb|rpm) | head -1) -f /tmp/nfpm.yml \
-p deb \
-t "/tmp/output/${OS_IDENTIFIER}"
export PKG_FILE=$(ls /tmp/output/${OS_IDENTIFIER}/r-${R_VERSION}*.deb | head -1)