From 3d5b646fe1271a5514ebc6ec6daf5a981220e088 Mon Sep 17 00:00:00 2001 From: Patrick Palka Date: Thu, 11 Jan 2024 10:32:39 -0500 Subject: [PATCH] Provide /opt/rh/SAP/lib64/libstdc++.so.6 symlink Resolves: RHEL-21071 --- compat-sap-c++-12.spec | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/compat-sap-c++-12.spec b/compat-sap-c++-12.spec index 747ca4b..69d15cc 100644 --- a/compat-sap-c++-12.spec +++ b/compat-sap-c++-12.spec @@ -33,7 +33,7 @@ Summary: C++ compatibility runtime library for SAP applications Name: %{?scl_prefix}c++-12 ExclusiveArch: x86_64 ppc64le s390x Version: %{gcc_version} -Release: %{gcc_release}%{?dist} +Release: %{gcc_release}.1%{?dist} # libgcc, libgfortran, libgomp, libstdc++ and crtstuff have # GCC Runtime Exception. License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD @@ -544,8 +544,40 @@ rm -rf testlogs-%{_target_platform}-%{version}-%{release} %{_root_prefix}/%{_lib}/compat-sap-c++-%{gcc_version}.so %{_root_prefix}/%{_lib}/compat-sap-c++-%{gcc_major}.so %{_root_prefix}/%{_lib}/README%{gcc_major} +%ghost %{_root_prefix}/%{_lib}/libstdc++.so.6 + +%transfiletriggerin -- %{_root_prefix}/%{_lib} +if ! [ -d %{_root_prefix}/%{_lib} ]; then + exit 0 +fi +symlink=%{_root_prefix}/%{_lib}/libstdc++.so.6 +if [ -e $symlink ] && ! [ -L $symlink ]; then + exit 0 +fi +latest_so=$(ls %{_root_prefix}/%{_lib} | grep "^compat-sap-c++-[1-9][0-9]\.so$" | tail -n1) +if [ -n $latest_so ]; then + ln -sf $latest_so $symlink +fi +%end + +%transfiletriggerpostun -- %{_root_prefix}/%{_lib} +if ! [ -d %{_root_prefix}/%{_lib} ]; then + exit 0 +fi +symlink=%{_root_prefix}/%{_lib}/libstdc++.so.6 +if [ -e $symlink ] && ! [ -L $symlink ]; then + exit 0 +fi +latest_so=$(ls %{_root_prefix}/%{_lib} | grep "^compat-sap-c++-[1-9][0-9]\.so$" | tail -n1) +if [ -n $latest_so ]; then + ln -sf $latest_so $symlink +fi +%end %changelog +* Thu Jan 11 2024 Patrick Palka 12.1.1-1.1 +- provide /opt/rh/SAP/lib64/libstdc++.so.6 symlink (RHEL-21071) + * Mon May 16 2022 Marek Polacek 12.1.1-1 - update to GCC 12 (#2070133)