Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b96ce01cdc | ||
|
|
f66e1a352a | ||
|
|
c5d1a714f0 | ||
|
|
5f461f491a | ||
|
|
7069f9dae2 | ||
|
|
ba1534f53f | ||
|
|
b76cb7a596 | ||
|
|
2fe67f9f54 | ||
|
|
9519778a3a | ||
|
|
2f3d902808 | ||
|
|
e4a9cef5e5 | ||
|
|
3689f84db2 | ||
|
|
96a033abfd | ||
|
|
d1c2152dd1 | ||
|
|
0b73db02a7 | ||
|
|
8b7dca1df8 | ||
|
|
6734edaac0 | ||
|
|
2b2ffaedbb | ||
|
|
91444113e6 |
1
.fmf/version
Normal file
1
.fmf/version
Normal file
@ -0,0 +1 @@
|
||||
1
|
||||
29
README
Normal file
29
README
Normal file
@ -0,0 +1,29 @@
|
||||
Package %{scl_name} is the main package for Red Hat GCC
|
||||
Toolset 15. By installing the %{scl_name} package, you will get
|
||||
the working set of packages that are included in Red Hat GCC
|
||||
Toolset 15, which includes development and debugging tools.
|
||||
|
||||
Usage: scl enable %{scl} <command>
|
||||
|
||||
Red Hat GCC Toolset allows you to build and execute applications
|
||||
which are not located in the filesystem root hierarchy, but are
|
||||
stored in an alternative location, which is %{_scl_root} in case
|
||||
of the %{scl_name} collection.
|
||||
|
||||
Examples:
|
||||
scl enable %{scl_name} 'command --arg'
|
||||
Run a specific command with the argument --arg within the %{scl_name}
|
||||
Red Hat GCC Toolset environment.
|
||||
|
||||
scl enable %{scl_name} 'gcc'
|
||||
Run GCC from the %{scl_name} Red Hat GCC Toolset.
|
||||
|
||||
scl enable %{scl_name} 'bash'
|
||||
Run an interactive shell wherein the %{scl_name} software collection
|
||||
is enabled.
|
||||
|
||||
scl enable %{scl_name} 'man gcc'
|
||||
Show man pages for the gcc command, which is a part of the
|
||||
%{scl_name} Red Hat GCC Toolset.
|
||||
|
||||
Report bugs to <%{dist_bug_report_url}>.
|
||||
21
enable.in
Normal file
21
enable.in
Normal file
@ -0,0 +1,21 @@
|
||||
# General environment variables
|
||||
export PATH=%{_bindir}${PATH:+:${PATH}}
|
||||
export MANPATH=%{_mandir}${MANPATH:+:${MANPATH}}
|
||||
export INFOPATH=%{_infodir}${INFOPATH:+:${INFOPATH}}
|
||||
# bz847911 workaround:
|
||||
# we need to evaluate rpm's installed run-time % { _libdir }, not rpmbuild time
|
||||
# or else /etc/ld.so.conf.d files?
|
||||
rpmlibdir=$(rpm --eval "%%{_libdir}")
|
||||
# bz1017604: On 64-bit hosts, we should include also the 32-bit library path.
|
||||
# bz1873882: On 32-bit hosts, we should include also the 64-bit library path.
|
||||
# bz2027377: Avoid unbound variables
|
||||
if [ "$rpmlibdir" != "${rpmlibdir/lib64/}" ]; then
|
||||
rpmlibdir32=":%{_scl_root}${rpmlibdir/lib64/lib}"
|
||||
rpmlibdir64=
|
||||
else
|
||||
rpmlibdir64=":%{_scl_root}${rpmlibdir/lib/lib64}"
|
||||
rpmlibdir32=
|
||||
fi
|
||||
# Prepend the usual /opt/.../usr/lib{64,}.
|
||||
export LD_LIBRARY_PATH=%{_scl_root}$rpmlibdir$rpmlibdir64$rpmlibdir32${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
|
||||
export PKG_CONFIG_PATH=%{_libdir}/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}
|
||||
7
gating.yaml
Normal file
7
gating.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
--- !Policy
|
||||
product_versions:
|
||||
- rhel-9
|
||||
decision_context: osci_compose_gate
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.gate-build-fast-lane.functional}
|
||||
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.gate-build-slow-lane.functional}
|
||||
291
gcc-toolset-15.spec
Normal file
291
gcc-toolset-15.spec
Normal file
@ -0,0 +1,291 @@
|
||||
%global __python /usr/bin/python3
|
||||
%global gts_ver 15
|
||||
%global scl gcc-toolset-%{gts_ver}
|
||||
%global scl_prefix gcc-toolset-%{gts_ver}-
|
||||
%global scl_name %scl
|
||||
|
||||
# We moved away from scl-utils in RHEL10. Instead, we have bundled in the
|
||||
# minimal macro hackery necessary to build GTS into the same root to give us
|
||||
# the necessary isolation and allow an equivalent of `scl enable` since that's
|
||||
# a common way to use GTS.
|
||||
#
|
||||
# Some day we will move away from the 'scl' names, but today is not that day.
|
||||
%if 0%{?rhel} >= 10
|
||||
%global have_scl_utils 0
|
||||
%else
|
||||
%global have_scl_utils 1
|
||||
%endif
|
||||
|
||||
# GTS only has gcc and binutils in RHEL9 and later.
|
||||
%if 0%{?rhel} >= 9
|
||||
%global gts_only_gcc_binutils 1
|
||||
%else
|
||||
%global gts_only_gcc_binutils 0
|
||||
%endif
|
||||
|
||||
%if %have_scl_utils
|
||||
%global long_name %scl Software Collection
|
||||
%global version_string GCC-Toolset %{gts_ver} Software Collection
|
||||
BuildRequires: scl-utils-build
|
||||
%else
|
||||
%global long_name GCC Toolset %gts_ver
|
||||
%global version_string GCC-Toolset %{gts_ver}
|
||||
%include %{_sourcedir}/macros.gts
|
||||
%endif
|
||||
%{?scl_package:%scl_package %scl}
|
||||
|
||||
Summary: Package that installs %scl
|
||||
Name: %scl_name
|
||||
Version: %{gts_ver}.0
|
||||
Release: 9%{?dist}
|
||||
License: GPLv2+
|
||||
Group: Applications/File
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
Source0: README
|
||||
Source2: gts-annobin-plugin-select.sh
|
||||
Source3: macros.gts
|
||||
Source4: enable.in
|
||||
Source5: gcc-toolset-env.in
|
||||
|
||||
Requires: %{scl_prefix}runtime == %{version}-%{release}
|
||||
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.
|
||||
%if %gts_only_gcc_binutils == 0
|
||||
Requires: %{scl_prefix}gdb
|
||||
Requires: %{scl_prefix}dwz
|
||||
Requires: %{scl_prefix}annobin-plugin-gcc
|
||||
%endif
|
||||
Obsoletes: %{name} < %{version}-%{release}
|
||||
Obsoletes: %{scl_prefix}dockerfiles < %{version}-%{release}
|
||||
|
||||
BuildRequires: iso-codes
|
||||
BuildRequires: help2man
|
||||
%if 0%{?rhel} >= 8
|
||||
BuildRequires: python3-devel
|
||||
%endif
|
||||
|
||||
%if %gts_only_gcc_binutils == 0
|
||||
%global rrcdir %{_scl_root}/usr/lib/rpm/redhat
|
||||
%endif
|
||||
|
||||
%description
|
||||
This is the main package for %long_name.
|
||||
|
||||
%package runtime
|
||||
Summary: Package that handles %long_name.
|
||||
Group: Applications/File
|
||||
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}
|
||||
%else
|
||||
Requires(post): libselinux policycoreutils-python
|
||||
Requires(postun): libselinux policycoreutils-python
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%description runtime
|
||||
Package shipping essential scripts to work with %long_name.
|
||||
|
||||
%if %have_scl_utils == 0
|
||||
%package devel
|
||||
Summary: Scripts needed to build %long_name.
|
||||
Group: Applications/File
|
||||
Conflicts: scl-utils-build
|
||||
|
||||
%description devel
|
||||
Package shipping scripts to build %long_name.
|
||||
%endif
|
||||
|
||||
%prep
|
||||
%setup -c -T
|
||||
|
||||
# This section generates README file from a template and creates man page
|
||||
# from that file, expanding RPM macros in the template file.
|
||||
cat <<'EOF' | tee README
|
||||
%{expand:%(cat %{SOURCE0})}
|
||||
EOF
|
||||
|
||||
%build
|
||||
|
||||
# Temporary helper script used by help2man.
|
||||
cat <<\EOF | tee h2m_helper
|
||||
#!/bin/sh
|
||||
if [ "$1" = "--version" ]; then
|
||||
printf '%%s' "%{version_string}"
|
||||
else
|
||||
cat README
|
||||
fi
|
||||
EOF
|
||||
chmod a+x h2m_helper
|
||||
# Generate the man page.
|
||||
help2man -n "GNU project C, C++ and Fortran compiler and linker" -N --section 7 ./h2m_helper -o %{?scl_name}.7
|
||||
gzip %{?scl_name}.7
|
||||
|
||||
# Enable collection script
|
||||
# ========================
|
||||
cat <<'EOF' | tee enable
|
||||
%{expand:%(cat %{SOURCE4})}
|
||||
EOF
|
||||
|
||||
%if %have_scl_utils == 0
|
||||
cat <<'EOF' | tee gcc-toolset-%{gts_ver}-env
|
||||
%{expand:%(cat %{SOURCE5})}
|
||||
EOF
|
||||
%endif
|
||||
|
||||
%install
|
||||
|
||||
%if %have_scl_utils
|
||||
(%{scl_install})
|
||||
|
||||
# We no longer need this, and it would result in an "unpackaged but
|
||||
# installed" error.
|
||||
rm -rf %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-config
|
||||
%else
|
||||
mkdir -p %{buildroot}%{_root_sysconfdir}/rpm
|
||||
|
||||
# RPM macro weirdness: when it's explicitly included like in this spec file, it
|
||||
# expects the %%define but when it is installed as a macro file, it cannot
|
||||
# handle the %%define and instead expects %%<macro name> directly.
|
||||
sed 's/^%%define scl_/%%scl_/' %{SOURCE3} > %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-build
|
||||
%endif
|
||||
|
||||
%if %have_scl_utils
|
||||
%define source_cmd source scl_source enable %{scl}
|
||||
%else
|
||||
%define source_cmd source %{_root_prefix}/lib/gcc-toolset/%{gts_ver}-env.source
|
||||
%endif
|
||||
|
||||
# This allows users to build packages using DTS/GTS.
|
||||
cat >> %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-enable << EOF
|
||||
%%enable_gcctoolset%{gts_ver} %%global ___build_pre %%{___build_pre}; %source_cmd || :
|
||||
EOF
|
||||
|
||||
%if %have_scl_utils
|
||||
# Without SCL we just let gcc-toolset-*-binutils own this and use the
|
||||
# --altdir/--admindir mechanism.
|
||||
mkdir -p %{buildroot}%{_scl_root}/etc/alternatives %{buildroot}%{_scl_root}/var/lib/alternatives
|
||||
|
||||
install -d -m 755 %{buildroot}%{_scl_scripts}
|
||||
install -p -m 755 enable %{buildroot}%{_scl_scripts}/
|
||||
|
||||
%if %gts_only_gcc_binutils == 0
|
||||
# Other directories that should be owned by the runtime
|
||||
install -d -m 755 %{buildroot}%{_datadir}/appdata
|
||||
# Otherwise unowned perl directories
|
||||
install -d -m 755 %{buildroot}%{_libdir}/perl5
|
||||
install -d -m 755 %{buildroot}%{_libdir}/perl5/vendor_perl
|
||||
install -d -m 755 %{buildroot}%{_libdir}/perl5/vendor_perl/auto
|
||||
|
||||
# Install the plugin selector trigger script.
|
||||
mkdir -p %{buildroot}%{rrcdir}
|
||||
install -p -m 755 %{SOURCE2} %{buildroot}%{rrcdir}/
|
||||
%endif
|
||||
%else
|
||||
install -d -m 755 %{buildroot}%{_root_bindir}
|
||||
install -p -m 755 gcc-toolset-%{gts_ver}-env %{buildroot}%{_root_bindir}/
|
||||
install -d -m 755 %{buildroot}%{_root_prefix}/lib/gcc-toolset
|
||||
install -p -m 755 enable %{buildroot}%{_root_prefix}/lib/gcc-toolset/%{gts_ver}-env.source
|
||||
%endif
|
||||
|
||||
# Install generated man page.
|
||||
install -d -m 755 %{buildroot}%{_root_mandir}/man7
|
||||
install -p -m 644 %{?scl_name}.7.gz %{buildroot}%{_root_mandir}/man7/
|
||||
%if %have_scl_utils == 0
|
||||
pushd %{buildroot}%{_root_mandir}/man7/
|
||||
ln -s ./%{?scl_name}.7.gz gcc-toolset-%{gts_ver}-env.7.gz
|
||||
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.
|
||||
|
||||
%if %gts_only_gcc_binutils == 0
|
||||
%triggerin runtime -- %{scl_prefix}annobin-plugin-gcc %{scl_prefix}gcc-plugin-annobin
|
||||
%{rrcdir}/gts-annobin-plugin-select.sh %{_scl_root}
|
||||
%end
|
||||
|
||||
# We also trigger when annobin is uninstalled. This allows us to switch
|
||||
# over to the gcc generated version of the plugin. It does not matter if
|
||||
# gcc is uninstalled, since if that happens the plugin cannot be used.
|
||||
|
||||
%triggerpostun runtime -- %{scl_prefix}annobin-plugin-gcc
|
||||
%{rrcdir}/gts-annobin-plugin-select.sh %{_scl_root}
|
||||
%end
|
||||
%endif
|
||||
|
||||
%files
|
||||
%doc README
|
||||
%if %have_scl_utils
|
||||
%{_root_mandir}/man7/%{?scl_name}.*
|
||||
%endif
|
||||
|
||||
%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
|
||||
%attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) %{_sysconfdir}/selinux-equiv.created
|
||||
%dir %{_scl_root}/etc/alternatives
|
||||
%else
|
||||
%{_root_mandir}/man7/%{?scl_name}.*
|
||||
%{_root_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}
|
||||
restorecon -R %{_scl_root}
|
||||
touch %{_sysconfdir}/selinux-equiv.created
|
||||
fi
|
||||
|
||||
%preun runtime
|
||||
[ $1 = 0 ] && rm -f %{_sysconfdir}/selinux-equiv.created || :
|
||||
|
||||
%postun runtime
|
||||
if [ $1 = 0 ]; then
|
||||
/usr/sbin/semanage fcontext -d %{_scl_root}
|
||||
[ -d %{_scl_root} ] && restorecon -R %{_scl_root} || :
|
||||
fi
|
||||
%endif
|
||||
|
||||
%if %have_scl_utils == 0
|
||||
%files devel
|
||||
%{_root_sysconfdir}/rpm/macros.%{scl}-build
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Fri Jun 20 2025 Siddhesh Poyarekar <siddhesh@redhat.com> - 15.0-9
|
||||
- Compress man page and fix its name (RHEL-98730)
|
||||
|
||||
* Tue Jun 10 2025 Siddhesh Poyarekar <siddhesh@redhat.com> - 15.0-7
|
||||
- Man page and documentation updates (RHEL-96023)
|
||||
|
||||
* Thu Jun 5 2025 Siddhesh Poyarekar <siddhesh@redhat.com> - 15.0-6
|
||||
- Split out scripts into a -runtime package on RHEL10 (RHEL-94841)
|
||||
|
||||
* Tue May 20 2025 Siddhesh Poyarekar <siddhesh@redhat.com> - 15.0-4
|
||||
- New rhel10-specific script to replace scl-enable (RHEL-91830).
|
||||
|
||||
* Thu May 8 2025 Siddhesh Poyarekar <siddhesh@redhat.com> - 15.0-3
|
||||
- Drop the sudo wrapper script.
|
||||
|
||||
* Mon May 5 2025 Siddhesh Poyarekar <siddhesh@redhat.com> - 15.0-2
|
||||
- Split out a devel package to break the dependency look with gts-gcc and
|
||||
gts-binutils.
|
||||
|
||||
* Mon May 5 2025 Siddhesh Poyarekar <siddhesh@redhat.com> - 15.0-1
|
||||
- Drop scl-utils dependency on c10s and later.
|
||||
|
||||
* Mon Apr 14 2025 Marek Polacek <polacek@redhat.com> - 15.0-0
|
||||
- new package (RHELPLAN-171625)
|
||||
11
gcc-toolset-env.in
Normal file
11
gcc-toolset-env.in
Normal file
@ -0,0 +1,11 @@
|
||||
# Environment wrapper for GCC Toolset %{gts_ver}
|
||||
|
||||
source %{_root_prefix}/lib/gcc-toolset/%{gts_ver}-env.source
|
||||
|
||||
if [ -z $1 ]; then
|
||||
cmd="/bin/sh"
|
||||
else
|
||||
cmd=$*
|
||||
fi
|
||||
|
||||
exec $cmd
|
||||
226
gts-annobin-plugin-select.sh
Normal file
226
gts-annobin-plugin-select.sh
Normal file
@ -0,0 +1,226 @@
|
||||
#!/usr/bin/sh
|
||||
# This is a script to switch the symlinks in a GTS gcc's plugin
|
||||
# directory so that they select either the GTS-annobin provided
|
||||
# plugin or the GTS-gcc provided plugin.
|
||||
|
||||
# Author: Nick Clifton <nickc@redhat.com>
|
||||
# Copyright (c) 2021-2022 Red Hat.
|
||||
#
|
||||
# This is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published
|
||||
# by the Free Software Foundation; either version 2, or (at your
|
||||
# option) any later version.
|
||||
|
||||
# It is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# Usage:
|
||||
# gts-annobin-plugin-select scl_root
|
||||
#
|
||||
|
||||
# Set this variable to non-zero to enable the generation of debugging
|
||||
# messages.
|
||||
debug=0
|
||||
|
||||
if test "x$1" = "x" ;
|
||||
then
|
||||
if [ $debug -eq 1 ]
|
||||
then
|
||||
echo " gts-annobin-plugin-select: Must provide a root directory"
|
||||
fi
|
||||
exit 1
|
||||
else
|
||||
scl_root=$1
|
||||
fi
|
||||
|
||||
# This script is similar to the redhat-annobin-plugin-select.sh script which
|
||||
# is part of the redhat-rpm-config package. That scripts decides between two
|
||||
# versions of the annobin plugin for the system compiler and stores it choice
|
||||
# in a symlink in the /usr/lib/rpm/redhat directory. The choice eventually
|
||||
# resolves into the system gcc attempting to load either a plugin called
|
||||
# annobin.so or a plugin called gcc-annobin.so.
|
||||
|
||||
# In a GTS environment the choice made by redhat-annobin-plugin-select.sh
|
||||
# might not be appropriate (or even possible). The choice cannot be changed
|
||||
# because the system compilation environment must remain instact. So instead
|
||||
# the GTS versions of gcc and annobin install plugins called gts-annobin.so
|
||||
# and gts-gcc-annobin.so (into the GTS gcc's plugin directory) and this script
|
||||
# creates a pair of symlinks called annobin.so and gcc-annobin.so. In this
|
||||
# way the decision made by redhat-annobin-plugin-select.sh is overridden
|
||||
# without affecting any system files.
|
||||
|
||||
# We cannot be sure that this script will run inside a GTS enabled shell,
|
||||
# so we have to use absolute paths.
|
||||
gts_gcc=$scl_root/usr/bin/gcc
|
||||
|
||||
if [ ! -x $gts_gcc ]
|
||||
then
|
||||
if [ $debug -eq 1 ]
|
||||
then
|
||||
echo " gts-annobin-plugin-select: Could not find gcc. Expected: $gts_gcc"
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# This is where the annobin package stores the information on the version
|
||||
# of gcc that built the annobin plugin.
|
||||
aver=`$gts_gcc --print-file-name=plugin`/annobin-plugin-version-info
|
||||
|
||||
# This is where the gcc package stores its version information.
|
||||
gver=`$gts_gcc --print-file-name=rpmver`
|
||||
|
||||
aplugin=`$gts_gcc --print-file-name=plugin`/gts-annobin.so.0.0.0
|
||||
gplugin=`$gts_gcc --print-file-name=plugin`/gts-gcc-annobin.so.0.0.0
|
||||
|
||||
install_annobin_version=0
|
||||
install_gcc_version=0
|
||||
|
||||
if [ -f $aplugin ]
|
||||
then
|
||||
if [ -f $gplugin ]
|
||||
then
|
||||
if [ $debug -eq 1 ]
|
||||
then
|
||||
echo " gts-annobin-plugin-select: Both plugins exist, checking version information"
|
||||
fi
|
||||
|
||||
if [ -f $gver ]
|
||||
then
|
||||
if [ -f $aver ]
|
||||
then
|
||||
if [ $debug -eq 1 ]
|
||||
then
|
||||
echo " gts-annobin-plugin-select: Both plugin version files exist - comparing..."
|
||||
fi
|
||||
|
||||
# Get the first line from the version info files. This is just in
|
||||
# case there are extra lines in the files.
|
||||
avers=`head --lines=1 $aver`
|
||||
gvers=`head --lines=1 $gver`
|
||||
|
||||
if [ $debug -eq 1 ]
|
||||
then
|
||||
echo " gts-annobin-plugin-select: Annobin plugin built by gcc $avers"
|
||||
echo " gts-annobin-plugin-select: GCC plugin built by gcc $gvers"
|
||||
fi
|
||||
|
||||
# If both plugins were built by the same version of gcc then select
|
||||
# the one from the annobin package (in case it is built from newer
|
||||
# sources). If the plugin builder versions differ, select the gcc
|
||||
# built version instead. This assumes that the gcc built version
|
||||
# always matches the installed gcc, which should be true.
|
||||
if [ $avers = $gvers ]
|
||||
then
|
||||
if [ $debug -eq 1 ]
|
||||
then
|
||||
echo " gts-annobin-plugin-select: Both plugins built by the same compiler - using annobin-built plugin"
|
||||
fi
|
||||
install_annobin_version=1
|
||||
else
|
||||
if [ $debug -eq 1 ]
|
||||
then
|
||||
echo " gts-annobin-plugin-select: Versions differ - using gcc-built plugin"
|
||||
fi
|
||||
install_gcc_version=1
|
||||
fi
|
||||
else
|
||||
if [ $debug -eq 1 ]
|
||||
then
|
||||
echo " gts-annobin-plugin-select: Annobin version file does not exist, using gcc-built plugin"
|
||||
fi
|
||||
install_gcc_version=1
|
||||
fi
|
||||
else
|
||||
if [ -f $aver ]
|
||||
then
|
||||
# FIXME: This is suspicious. If the installed GCC does not supports plugins
|
||||
# then enabling the annobin plugin will not work.
|
||||
if [ $debug -eq 1 ]
|
||||
then
|
||||
echo " gts-annobin-plugin-select: GCC plugin version file does not exist, using annobin-built plugin"
|
||||
fi
|
||||
install_annobin_version=1
|
||||
else
|
||||
if [ $debug -eq 1 ]
|
||||
then
|
||||
echo " gts-annobin-plugin-select: Neither version file exists - playing safe and using gcc-built plugin"
|
||||
echo " gts-annobin-plugin-select: Note: expected to find $aver and/or $gver"
|
||||
fi
|
||||
install_gcc_version=1
|
||||
fi
|
||||
fi
|
||||
else
|
||||
if [ $debug -eq 1 ]
|
||||
then
|
||||
echo " gts-annobin-plugin-select: Only the annobin plugin exists - using that"
|
||||
fi
|
||||
install_annobin_version=1
|
||||
fi
|
||||
else
|
||||
if [ -f $gplugin ]
|
||||
then
|
||||
if [ $debug -eq 1 ]
|
||||
then
|
||||
echo " gts-annobin-plugin-select: Only the gcc plugin exists - using that"
|
||||
fi
|
||||
install_gcc_version=1
|
||||
else
|
||||
aplugin=`$gts_gcc --print-file-name=plugin`/annobin.so.0.0.0
|
||||
|
||||
if [ -f $aplugin ]
|
||||
then
|
||||
if [ $debug -eq 1 ]
|
||||
then
|
||||
echo " gts-annobin-plugin-select: Original annobin plugin exists - renaming"
|
||||
echo " gts-annobin-plugin-select: Using renamed original annobin plugin"
|
||||
fi
|
||||
pushd `$gts_gcc --print-file-name=plugin` > /dev/null
|
||||
mv annobin.so.0.0.0 gts-annobin.so.0.0.0
|
||||
popd > /dev/null
|
||||
install_annobin_version=1
|
||||
else
|
||||
if [ $debug -eq 1 ]
|
||||
then
|
||||
echo " gts-annobin-plugin-select: Neither plugin exists - playing safe and not changing anything"
|
||||
echo " gts-annobin-plugin-select: Note: expected to find $aplugin and/or $gplugin"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $install_annobin_version -eq 1 ]
|
||||
then
|
||||
if [ $debug -eq 1 ]
|
||||
then
|
||||
echo " gts-annobin-plugin-select: Setting symlinks for the annobin version of the plugin"
|
||||
fi
|
||||
pushd `$gts_gcc --print-file-name=plugin` > /dev/null
|
||||
rm -f gcc-annobin.so.0.0.0 annobin.so.0.0.0 gcc-annobin.so annobin.so
|
||||
ln -s gts-annobin.so.0.0.0 annobin.so
|
||||
ln -s gts-annobin.so.0.0.0 gcc-annobin.so
|
||||
ln -s gts-annobin.so.0.0.0 annobin.so.0.0.0
|
||||
ln -s gts-annobin.so.0.0.0 gcc-annobin.so.0.0.0
|
||||
popd > /dev/null
|
||||
|
||||
else if [ $install_gcc_version -eq 1 ]
|
||||
then
|
||||
if [ $debug -eq 1 ]
|
||||
then
|
||||
echo " gts-annobin-plugin-select: Setting symlinks for the gcc version of the plugin"
|
||||
fi
|
||||
pushd `$gts_gcc --print-file-name=plugin` > /dev/null
|
||||
rm -f gcc-annobin.so.0.0.0 annobin.so.0.0.0 gcc-annobin.so annobin.so
|
||||
ln -s gts-gcc-annobin.so.0.0.0 annobin.so
|
||||
ln -s gts-gcc-annobin.so.0.0.0 gcc-annobin.so
|
||||
ln -s gts-gcc-annobin.so.0.0.0 annobin.so.0.0.0
|
||||
ln -s gts-gcc-annobin.so.0.0.0 gcc-annobin.so.0.0.0
|
||||
popd > /dev/null
|
||||
else
|
||||
if [ $debug -eq 1 ]
|
||||
then
|
||||
echo " gts-annobin-plugin-select: NOT CHANGING SYMLINKS"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
109
macros.gts
Normal file
109
macros.gts
Normal file
@ -0,0 +1,109 @@
|
||||
# scl-utils RPM macros
|
||||
#
|
||||
# Copyright (C) 2012 Red Hat, Inc.
|
||||
# Written by Jindrich Novy <jnovy@redhat.com>.
|
||||
|
||||
%define scl_debug() %{expand:
|
||||
%define old_debug %{lua:print(rpm.expand("%{debug_package}"):len())}
|
||||
%undefine _debugsource_packages
|
||||
%global debug_package %{expand:
|
||||
%if "%{?old_debug}" == "0"
|
||||
%{expand: %{nil}}
|
||||
%else
|
||||
%if "%{?scl}%{!?scl:0}" == "%{pkg_name}"
|
||||
%{expand: %{nil}}
|
||||
%else
|
||||
%ifnarch noarch
|
||||
%package debuginfo
|
||||
Summary: Debug information for package %{name}
|
||||
Group: Development/Debug
|
||||
AutoReqProv: 0
|
||||
%{lua:
|
||||
debuginfo=tonumber(rpm.expand("%{old_debug}"))
|
||||
if debuginfo > 0 then
|
||||
rpm.define("__debug_package 1")
|
||||
end
|
||||
}
|
||||
%description debuginfo
|
||||
This package provides debug information for package %{name}.
|
||||
Debug information is useful when developing applications that use this
|
||||
package or when debugging this package.
|
||||
%files debuginfo -f debugfiles.list
|
||||
%defattr(-,root,root)
|
||||
%endif
|
||||
%endif
|
||||
%endif
|
||||
%{nil}}}
|
||||
|
||||
%define scl_prefix() %{?scl:%(if [ "%1" = "%%1" ]; then echo "%{scl}-"; else echo "%1-"; fi)}%{!?scl:%{nil}}
|
||||
|
||||
%define scl_package() %{expand:%{!?_root_prefix:
|
||||
%global pkg_name %1
|
||||
%global scl_name %{scl}
|
||||
%global scl_runtime %{scl}-runtime
|
||||
%global scl_basedir /opt
|
||||
%{!?scl_vendor: %global scl_vendor rh}
|
||||
%{!?_scl_prefix: %global _scl_prefix %{scl_basedir}/%{scl_vendor}}
|
||||
%global _scl_scripts %{_scl_prefix}/%{scl}
|
||||
%global _scl_root %{_scl_prefix}/%{scl}/root
|
||||
%global _root_prefix %{_prefix}
|
||||
%global _root_exec_prefix %{_root_prefix}
|
||||
%global _root_bindir %{_exec_prefix}/bin
|
||||
%global _root_sbindir %{_exec_prefix}/sbin
|
||||
%global _root_libexecdir %{_exec_prefix}/libexec
|
||||
%global _root_datadir %{_prefix}/share
|
||||
%global _root_sysconfdir %{_sysconfdir}
|
||||
%global _root_sharedstatedir %{_sharedstatedir}
|
||||
%global _root_localstatedir %{_localstatedir}
|
||||
%global _root_libdir %{_exec_prefix}/%{_lib}
|
||||
%global _root_includedir %{_prefix}/include
|
||||
%global _root_infodir %{_datadir}/info
|
||||
%global _root_mandir %{_datadir}/man
|
||||
%global _root_initddir %{_sysconfdir}/rc.d/init.d
|
||||
%global _prefix %{_scl_root}/usr
|
||||
%global _exec_prefix %{_prefix}
|
||||
%global _bindir %{_exec_prefix}/bin
|
||||
%global _sbindir %{_exec_prefix}/sbin
|
||||
%global _libexecdir %{_exec_prefix}/libexec
|
||||
%global _datadir %{_prefix}/share
|
||||
%global _sysconfdir %{_scl_root}/etc
|
||||
%{?nfsmountable: %global _sysconfdir %{_root_sysconfdir}%{_scl_prefix}/scls/%{scl}}
|
||||
%{?rh_layout: %global _sysconfdir %{_root_sysconfdir}%{_scl_prefix}/%{scl}}
|
||||
%global _sharedstatedir %{_scl_root}/var/lib
|
||||
%{?nfsmountable: %global _sharedstatedir %{_root_localstatedir}%{_scl_prefix}/scls/%{scl}/lib}
|
||||
%{?rh_layout: %global _sharedstatedir %{_root_localstatedir}%{_scl_prefix}/%{scl}/lib}
|
||||
%global _localstatedir %{_scl_root}/var
|
||||
%{?nfsmountable: %global _localstatedir %{_root_localstatedir}%{_scl_prefix}/scls/%{scl}}
|
||||
%{?rh_layout: %global _localstatedir %{_root_localstatedir}%{_scl_prefix}/%{scl}}
|
||||
%global _libdir %{_exec_prefix}/%{_lib}
|
||||
%global _includedir %{_prefix}/include
|
||||
%global _infodir %{_datadir}/info
|
||||
%global _mandir %{_datadir}/man
|
||||
%global _docdir %{_datadir}/doc
|
||||
%global _defaultdocdir %{_docdir}
|
||||
}
|
||||
%{?scl_dependency_generators:%scl_dependency_generators}
|
||||
%global scl_pkg_name %{scl}-%{pkg_name}
|
||||
%scl_debug
|
||||
%global __os_install_post %{expand:
|
||||
/usr/lib/rpm/brp-compress %{_scl_root}/usr
|
||||
%{!?__debug_package:/usr/lib/rpm/brp-strip %{__strip}
|
||||
/usr/lib/rpm/brp-strip-comment-note %{__strip} %{__objdump}
|
||||
}
|
||||
/usr/lib/rpm/brp-strip-static-archive %{__strip}
|
||||
[ -f /usr/lib/rpm/redhat/brp-python-hardlink ] && /usr/lib/rpm/redhat/brp-python-hardlink || /usr/lib/rpm/brp-python-hardlink
|
||||
%{nil}}
|
||||
%if "%{?scl}%{!?scl:0}" == "%{pkg_name}"
|
||||
%endif
|
||||
%{?scl_package_override:%scl_package_override}
|
||||
}
|
||||
|
||||
%define scl_require() %{_scl_prefix}/%1/enable, %1
|
||||
%define scl_require_package() %1-%2
|
||||
|
||||
%define scl_enable_script() %{expand:
|
||||
cat >> %{buildroot}%{_scl_scripts}/enable << 'EOF'
|
||||
eval `/usr/bin/modulecmd bash load %{scl}`
|
||||
EOF
|
||||
}
|
||||
|
||||
29
plans/tier0.fmf
Normal file
29
plans/tier0.fmf
Normal file
@ -0,0 +1,29 @@
|
||||
# Tier 0 test plan. It's actually Tier 1
|
||||
# - limited to its public part
|
||||
# - executed on the architecture at hand
|
||||
# When run by osci.tier0 on CentOS Stream or RHEL, it receives the following
|
||||
# context:
|
||||
# arch=x86_64 (the architecture at hand, currently OSCI uses just x86_64)
|
||||
# distro=rhel<M>.<m> (even for CentOS Stream builds)
|
||||
# trigger=build
|
||||
|
||||
summary: Tier 0 test plan
|
||||
context:
|
||||
component: gcc-toolset-15
|
||||
discover:
|
||||
- name: collect_info
|
||||
how: shell
|
||||
tests:
|
||||
- name: /info/rpms
|
||||
test: rpm -qa --last
|
||||
- name: public_tests
|
||||
how: fmf
|
||||
url: https://gitlab.com/redhat/centos-stream/tests/gcc-toolset-metapackage.git
|
||||
filter: tier:1
|
||||
execute:
|
||||
how: tmt
|
||||
prepare+:
|
||||
how: shell
|
||||
environment+:
|
||||
COLLECTIONS: gcc-toolset-15
|
||||
WITH_SCL: "scl enable gcc-toolset-15"
|
||||
Loading…
Reference in New Issue
Block a user