Skip to content

Commit

Permalink
Use devtoolset-11 for CentOS 7 to build Ruby 3.2
Browse files Browse the repository at this point in the history
Signed-off-by: Takuro Ashie <[email protected]>
  • Loading branch information
ashie committed Jan 16, 2023
1 parent 4314ccb commit 33a40f4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
12 changes: 7 additions & 5 deletions td-agent/yum/centos-7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ RUN \
yum install -y ${quiet} epel-release && \
yum groupinstall -y ${quiet} "Development Tools" && \
yum install -y ${quiet} \
rh-ruby26-ruby-devel \
devtoolset-11 \
rh-ruby26-ruby-devel \
rh-ruby26-rubygems \
rh-ruby26-rubygem-rake \
rh-ruby26-rubygem-bundler \
Expand All @@ -48,8 +49,9 @@ RUN \
zlib-devel \
rpmlint \
cmake3 && \
# raise IPv4 priority
echo "precedence ::ffff:0:0/96 100" > /etc/gai.conf && \
# enable multiplatform feature
source /opt/rh/rh-ruby26/enable && gem install --no-document --install-dir /opt/rh/rh-ruby26/root/usr/share/gems bundler builder && \
# raise IPv4 priority
echo "precedence ::ffff:0:0/96 100" > /etc/gai.conf && \
# enable multiplatform feature
source /opt/rh/rh-ruby26/enable && gem install --no-document --install-dir /opt/rh/rh-ruby26/root/usr/share/gems bundler builder && \
scl enable devtoolset-11 bash && \
yum clean ${quiet} all
7 changes: 7 additions & 0 deletions td-agent/yum/td-agent.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
%define _amazon_ver %{?amzn:%{amzn}}%{!?amzn:0}
%define _suse_ver %{?suse_version:%{suse_version}}%{!?suse_version:0}
%define use_suse (%{_suse_ver} >= 1315)
%define use_scl_gcc (%{_centos_ver} <= 7)
%define use_scl_ruby (%{_centos_ver} <= 7 && %{_amazon_ver} == 0)
%define use_devtoolset (%{_centos_ver} <= 6 && %{_amazon_ver} == 0)
%if %{_centos_ver} <= 6
Expand Down Expand Up @@ -139,8 +140,14 @@ The stable distribution of Fluentd, called td-agent.
%setup -q -n @PACKAGE@-%{version}

%build
%if %{use_scl_gcc}
. /opt/rh/devtoolset-11/enable
%endif

%install
%if %{use_scl_gcc}
. /opt/rh/devtoolset-11/enable
%endif
%if %{use_scl_ruby}
. /opt/rh/rh-ruby%{scl_ruby_ver}/enable
%endif
Expand Down

0 comments on commit 33a40f4

Please sign in to comment.