Fix fpm installation on openSUSE 15.4; switch to nfpm

fpm currently fails to install because the public_suffix gem dependency
requires Ruby 2.6, which openSUSE 15.4 doesn't provide. Because there have
been so many Ruby dependency issues with fpm in the past, switch to the fewer-
dependency nfpm, which also has better support for code signing if we want to
do that in the future.
This commit is contained in:
Greg Lin 2022-08-22 18:52:05 -05:00
commit a245fc65d9
2 changed files with 60 additions and 51 deletions

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

@ -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)