Merge pull request #136 from rstudio/fix-fpm

Fix openSUSE 15.4 image build; begin replacing fpm with nFPM
This commit is contained in:
Greg Lin 2022-08-24 11:53:34 -05:00 committed by GitHub
commit 92ef513670
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 241 additions and 195 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

@ -40,8 +40,6 @@ RUN zypper --non-interactive --gpg-auto-import-keys -n install \
perl-macros \
readline-devel \
rpm-build \
ruby \
ruby-devel \
shadow \
tcl-devel \
texinfo \
@ -74,8 +72,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 && \
ln -s /usr/bin/fpm.ruby2.5 /usr/local/bin/fpm
RUN curl -LO https://github.com/goreleaser/nfpm/releases/download/v2.18.1/nfpm_amd64.rpm && \
zypper --non-interactive --no-gpg-checks install nfpm_amd64.rpm && \
rm nfpm_amd64.rpm
RUN chmod 0777 /opt

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,7 +1,7 @@
#!/bin/bash
if [[ ! -d /tmp/output/opensuse-154 ]]; then
mkdir -p /tmp/output/opensuse-154
if [[ ! -d /tmp/output/${OS_IDENTIFIER} ]]; then
mkdir -p "/tmp/output/${OS_IDENTIFIER}"
fi
# R 3.x requires PCRE1
@ -39,49 +39,59 @@ if [ -d /opt/R/${R_VERSION} ]; then
fi
EOF
fpm \
-s dir \
-t rpm \
-v 1 \
-n "R-${R_VERSION}" \
--vendor "RStudio, PBC" \
--url "http://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/opensuse-154/ \
-d fontconfig \
-d gcc \
-d gcc-c++ \
-d gcc-fortran \
-d glibc-locale \
-d gzip \
-d icu.691-devel \
-d libbz2-devel \
-d libcairo2 \
-d libcurl-devel \
-d libfreetype6 \
-d libgomp1 \
-d libjpeg62 \
-d libopenblas_pthreads-devel \
-d libpango-1_0-0 \
-d libreadline7 \
-d libtiff5 \
-d make \
-d ${pcre_lib} \
-d tar \
-d tcl \
-d tk \
-d unzip \
-d which \
-d xorg-x11 \
-d xorg-x11-fonts-100dpi \
-d xorg-x11-fonts-75dpi \
-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:
- 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: /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/opensuse-154/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,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)