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 \
&& echo 'deb-src http://deb.debian.org/debian bullseye main' >> /etc/apt/sources.list \
&& apt-get update \
&& apt-get install -y gcc libcurl4-openssl-dev libicu-dev \
libopenblas-base libpcre2-dev make python3-pip ruby ruby-dev wget \
&& apt-get install -y curl gcc libcurl4-openssl-dev libicu-dev \
libopenblas-base libpcre2-dev make python3-pip wget \
&& apt-get build-dep -y r-base
RUN pip3 install awscli
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
ENV PAGER /usr/bin/pager

View file

@ -32,8 +32,6 @@ RUN dnf -y upgrade \
pcre2-devel \
readline-devel \
rpm-build \
ruby \
ruby-devel \
tcl-devel \
tex \
texinfo-tex \
@ -53,7 +51,9 @@ RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2
./aws/install && \
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

View file

@ -6,12 +6,14 @@ RUN set -x \
&& sed -i "s|# deb-src|deb-src|g" /etc/apt/sources.list \
&& export DEBIAN_FRONTEND=noninteractive \
&& 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
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

View file

@ -1,59 +1,69 @@
#!/bin/bash
if [[ ! -d /tmp/output/debian-11 ]]; then
mkdir -p /tmp/output/debian-11
if [[ ! -d /tmp/output/${OS_IDENTIFIER} ]]; then
mkdir -p "/tmp/output/${OS_IDENTIFIER}"
fi
# 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
pcre_lib_flags='-d libpcre2-dev -d libpcre3-dev'
pcre_libs='- libpcre2-dev
- libpcre3-dev'
fi
fpm \
-s dir \
-t deb \
-v 1 \
-n R-${R_VERSION} \
--vendor "RStudio, PBC" \
--deb-priority "optional" \
--deb-field 'Bugs: https://github.com/rstudio/r-builds/issues' \
--url "http://www.r-project.org/" \
--description "GNU R statistical computation and graphics system" \
--maintainer "RStudio, PBC https://github.com/rstudio/r-builds" \
--license "GPL-2" \
-p /tmp/output/debian-11/ \
-d ca-certificates \
-d g++ \
-d gcc \
-d gfortran \
-d libbz2-dev \
-d libc6 \
-d libcairo2 \
-d libcurl4-openssl-dev \
-d libglib2.0-0 \
-d libgomp1 \
-d libicu-dev \
-d liblzma-dev \
-d libopenblas-dev \
-d libpango-1.0-0 \
-d libpangocairo-1.0-0 \
-d libpaper-utils \
${pcre_lib_flags} \
-d libpng16-16 \
-d libreadline8 \
-d libtcl8.6 \
-d libtiff5 \
-d libtk8.6 \
-d libx11-6 \
-d libxt6 \
-d make \
-d ucf \
-d unzip \
-d zip \
-d zlib1g-dev \
/opt/R/${R_VERSION}
cat <<EOF > /tmp/nfpm.yml
name: r-${R_VERSION}
version: 1
version_schema: none
section: gnu-r
priority: optional
maintainer: RStudio, PBC <https://github.com/rstudio/r-builds>
description: |
GNU R statistical computation and graphics system
vendor: RStudio, PBC
homepage: https://www.r-project.org
license: GPL-2
deb:
fields:
Bugs: https://github.com/rstudio/r-builds/issues
depends:
- ca-certificates
- g++
- gcc
- gfortran
- libbz2-dev
- libc6
- libcairo2
- libcurl4-openssl-dev
- libglib2.0-0
- libgomp1
- libicu-dev
- liblzma-dev
- libopenblas-dev
- libpango-1.0-0
- libpangocairo-1.0-0
- libpaper-utils
${pcre_libs}
- libpng16-16
- libreadline8
- libtcl8.6
- libtiff5
- libtk8.6
- libx11-6
- libxt6
- make
- ucf
- unzip
- zip
- zlib1g-dev
contents:
- src: /opt/R/${R_VERSION}
dst: /opt/R/${R_VERSION}
EOF
shopt -s extglob
export PKG_FILE=$(ls /tmp/output/debian-11/[rR]-${R_VERSION}*.@(deb|rpm) | head -1)
nfpm package \
-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
mkdir -p /tmp/output/rhel-9
#!/bin/bash
if [[ ! -d /tmp/output/${OS_IDENTIFIER} ]]; then
mkdir -p "/tmp/output/${OS_IDENTIFIER}"
fi
# R 3.x requires PCRE1
@ -37,40 +39,50 @@ if [ -d /opt/R/${R_VERSION} ]; then
fi
EOF
fpm \
-s dir \
-t rpm \
-v 1 \
-n "R-${R_VERSION}" \
--vendor "RStudio, PBC" \
--url "https://www.r-project.org" \
--description "GNU R statistical computation and graphics system" \
--maintainer "RStudio, PBC <https://github.com/rstudio/r-builds>" \
--license "GPLv2+" \
--after-install /post-install.sh \
--after-remove /after-remove.sh \
-p /tmp/output/rhel-9/ \
-d bzip2-devel \
-d gcc \
-d gcc-c++ \
-d gcc-gfortran \
-d libcurl-devel \
-d libicu-devel \
-d libSM \
-d libtiff \
-d libXmu \
-d libXt \
-d make \
-d openblas-devel \
-d pango \
-d ${pcre_lib} \
-d tcl \
-d tk \
-d unzip \
-d which \
-d xz-devel \
-d zip \
-d zlib-devel \
"/opt/R/${R_VERSION}"
cat <<EOF > /tmp/nfpm.yml
name: R-${R_VERSION}
version: 1
version_schema: none
release: 1
maintainer: RStudio, PBC <https://github.com/rstudio/r-builds>
description: |
GNU R statistical computation and graphics system
vendor: RStudio, 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
- make
- openblas-devel
- pango
- ${pcre_lib}
- tcl
- tk
- unzip
- which
- xz-devel
- zip
- zlib-devel
contents:
- 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
if [[ ! -d /tmp/output/ubuntu-2204 ]]; then
mkdir -p /tmp/output/ubuntu-2204
if [[ ! -d /tmp/output/${OS_IDENTIFIER} ]]; then
mkdir -p "/tmp/output/${OS_IDENTIFIER}"
fi
# 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
pcre_lib_flags='-d libpcre2-dev -d libpcre3-dev'
pcre_libs='- libpcre2-dev
- libpcre3-dev'
fi
fpm \
-s dir \
-t deb \
-v 1 \
-n R-${R_VERSION} \
--vendor "RStudio, PBC" \
--deb-priority "optional" \
--deb-field 'Bugs: https://github.com/rstudio/r-builds/issues' \
--url "http://www.r-project.org/" \
--description "GNU R statistical computation and graphics system" \
--maintainer "RStudio, PBC https://github.com/rstudio/r-builds" \
--license "GPL-2" \
-p /tmp/output/ubuntu-2204/ \
-d g++ \
-d gcc \
-d gfortran \
-d libbz2-dev \
-d libc6 \
-d libcairo2 \
-d libcurl4 \
-d libglib2.0-0 \
-d libgomp1 \
-d libicu-dev \
-d libjpeg8 \
-d liblzma-dev \
-d libopenblas-dev \
-d libpango-1.0-0 \
-d libpangocairo-1.0-0 \
-d libpaper-utils \
${pcre_lib_flags} \
-d libpng16-16 \
-d libreadline8 \
-d libtcl8.6 \
-d libtiff5 \
-d libtk8.6 \
-d libx11-6 \
-d libxt6 \
-d make \
-d ucf \
-d unzip \
-d zip \
-d zlib1g-dev \
/opt/R/${R_VERSION}
cat <<EOF > /tmp/nfpm.yml
name: r-${R_VERSION}
version: 1
version_schema: none
section: universe/math
priority: optional
maintainer: RStudio, PBC <https://github.com/rstudio/r-builds>
description: |
GNU R statistical computation and graphics system
vendor: RStudio, PBC
homepage: https://www.r-project.org
license: GPL-2
deb:
fields:
Bugs: https://github.com/rstudio/r-builds/issues
depends:
- g++
- gcc
- gfortran
- libbz2-dev
- libc6
- libcairo2
- libcurl4
- libglib2.0-0
- libgomp1
- libicu-dev
- libjpeg8
- liblzma-dev
- libopenblas-dev
- libpango-1.0-0
- libpangocairo-1.0-0
- libpaper-utils
${pcre_libs}
- libpng16-16
- libreadline8
- libtcl8.6
- libtiff5
- libtk8.6
- libx11-6
- libxt6
- make
- ucf
- unzip
- zip
- zlib1g-dev
contents:
- src: /opt/R/${R_VERSION}
dst: /opt/R/${R_VERSION}
EOF
shopt -s extglob
export PKG_FILE=$(ls /tmp/output/ubuntu-2204/[rR]-${R_VERSION}*.@(deb|rpm) | head -1)
nfpm package \
-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)