Move scripts to gcc-toolset-15-runtime

Resolves: RHEL-94841
This commit is contained in:
Siddhesh Poyarekar 2025-06-04 15:52:27 -04:00 committed by Siddhesh Poyarekar
parent 574ad5d274
commit 99843ffec7

View File

@ -24,8 +24,12 @@
%endif
%if %have_scl_utils
%global long_name %scl Software Collection
%global version_string %{?scl_name} %{version} Software Collection
BuildRequires: scl-utils-build
%else
%global long_name GCC Toolset %gts_ver
%global version_string %{?scl_name} %{version}
%include %{_sourcedir}/macros.gts
%endif
%{?scl_package:%scl_package %scl}
@ -33,7 +37,7 @@ BuildRequires: scl-utils-build
Summary: Package that installs %scl
Name: %scl_name
Version: %{gts_ver}.0
Release: 5%{?dist}
Release: 6%{?dist}
License: GPLv2+
Group: Applications/File
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -43,9 +47,7 @@ Source3: macros.gts
Source4: enable.in
Source5: gcc-toolset-env.in
%if %have_scl_utils
Requires: %{scl_prefix}runtime
%endif
Requires: %{scl_prefix}gcc %{scl_prefix}gcc-c++ %{scl_prefix}gcc-gfortran
Requires: %{scl_prefix}binutils
# None of these are in GTS in RHEL9 and later.
@ -68,19 +70,14 @@ BuildRequires: python3-devel
%endif
%description
%if %have_scl_utils
This is the main package for %scl Software Collection.
%else
This is the main package installs all of GCC Toolset %gts_ver and related
convenience scripts.
%endif
This is the main package for %long_name.
%if %have_scl_utils
%package runtime
Summary: Package that handles %scl Software Collection.
Summary: Package that handles %long_name.
Group: Applications/File
Requires: scl-utils >= 20120927-11
Obsoletes: %{name}-runtime < %{version}-%{release}
%if %have_scl_utils
Requires: scl-utils >= 20120927-11
%if 0%{?rhel} >= 7
%{?scl_package:Requires(post): %{_root_sbindir}/semanage %{_root_sbindir}/restorecon}
%{?scl_package:Requires(postun): %{_root_sbindir}/semanage %{_root_sbindir}/restorecon}
@ -88,17 +85,19 @@ Obsoletes: %{name}-runtime < %{version}-%{release}
Requires(post): libselinux policycoreutils-python
Requires(postun): libselinux policycoreutils-python
%endif
%endif
%description runtime
Package shipping essential scripts to work with %scl Software Collection.
%else
Package shipping essential scripts to work with %long_name.
%if %have_scl_utils == 0
%package devel
Summary: Scripts needed to build GCC Toolset %gts_ver.
Summary: Scripts needed to build %long_name.
Group: Applications/File
Conflicts: scl-utils-build
%description devel
Package shipping scripts to build GCC Toolset %gts_ver.
Package shipping scripts to build %long_name.
%endif
%prep
@ -113,11 +112,6 @@ EOF
%build
# Temporary helper script used by help2man.
%if %have_scl_utils
%define version_string %{?scl_name} %{version} Software Collection
%else
%define version_string %{?scl_name} %{version}
%endif
cat <<\EOF | tee h2m_helper
#!/bin/sh
if [ "$1" = "--version" ]; then
@ -200,6 +194,11 @@ install -p -m 755 enable %{buildroot}%{_root_prefix}/lib/gcc-toolset/%{gts_ver}-
# Install generated man page.
install -d -m 755 %{buildroot}%{_mandir}/man7
install -p -m 644 %{?scl_name}.7 %{buildroot}%{_mandir}/man7/
%if %have_scl_utils == 0
pushd %{buildroot}%{_mandir}/man7/
ln -s ./%{?scl_name}.7 gcc-toolset-%{gts_ver}-env.7
popd
%endif
# This trigger is used to decide which version of the annobin plugin for gcc
# should be used. See comments in the script for full details.
@ -220,24 +219,25 @@ install -p -m 644 %{?scl_name}.7 %{buildroot}%{_mandir}/man7/
%files
%doc README
%{_mandir}/man7/%{?scl_name}.*
%if %have_scl_utils == 0
%{_root_sysconfdir}/rpm/macros.%{scl}-enable
%{_root_bindir}/gcc-toolset-%{gts_ver}-env
%{_root_prefix}/lib/gcc-toolset/%{gts_ver}-env.source
%endif
%if %have_scl_utils
%files runtime
%{_root_sysconfdir}/rpm/macros.%{scl}-enable
%if %have_scl_utils
%if %gts_only_gcc_binutils == 0
%attr(0755,-,-) %{rrcdir}/gts-annobin-plugin-select.sh
%dir %{_datadir}/appdata
%endif
%scl_files
%{_root_sysconfdir}/rpm/macros.%{scl}-enable
%attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) %{_sysconfdir}/selinux-equiv.created
%dir %{_scl_root}/etc/alternatives
%else
%{_mandir}/man7/%{?scl_name}.*
%{_mandir}/man7/gcc-toolset-%{gts_ver}-env.*
%{_root_bindir}/gcc-toolset-%{gts_ver}-env
%{_root_prefix}/lib/gcc-toolset/%{gts_ver}-env.source
%endif
%if %have_scl_utils
%post runtime
if [ ! -f %{_sysconfdir}/selinux-equiv.created ]; then
/usr/sbin/semanage fcontext -a -e / %{_scl_root}
@ -253,12 +253,17 @@ if [ $1 = 0 ]; then
/usr/sbin/semanage fcontext -d %{_scl_root}
[ -d %{_scl_root} ] && restorecon -R %{_scl_root} || :
fi
%else
%endif
%if %have_scl_utils == 0
%files devel
%{_root_sysconfdir}/rpm/macros.%{scl}-build
%endif
%changelog
* Thu Jun 5 2025 Siddhesh Poyarekar <siddhesh@redhat.com> - 15.0-6
- Split out scripts into a -runtime package on RHEL10 (RHEL-94841)
* Wed Jun 4 2025 Siddhesh Poyarekar <siddhesh@redhat.com> - 15.0-5
- Fix quoting and other issues in gcc-toolset-env script (RHEL-94760)