import gcc-toolset-9-9.0-4.el8

This commit is contained in:
CentOS Sources 2020-01-21 18:18:44 -05:00 committed by Stepan Oksanichenko
parent 82644793b4
commit 638a29fdab
2 changed files with 57 additions and 22 deletions

41
SOURCES/sudo.sh Normal file
View File

@ -0,0 +1,41 @@
#! /bin/bash
# Emulate /usr/bin/sudo, so that SCL environment variables
# are passed through via an /bin/env wrapper.
# Includes work by Andy Fong <boringuy@gmail.com>
cmd_started=false
is_option_param_next=false
for arg in "$@"
do
case "$arg" in
*\'*)
arg= ;;
esac
if [ "$cmd_started" = true ]; then
cmd_options="$cmd_options '$arg'"
elif [ "$is_option_param_next" = true ]; then
sudo_options="$sudo_options $arg"
is_option_param_next=false
elif [[ $arg == -* ]]; then
sudo_options="$sudo_options $arg"
case "$arg" in
# all the options that take a parameter
"-g" | "-h" | "-p" | "-u" | "-U" | "-C" | "-s" | "-r" | "-t" | "-T")
is_option_param_next=true
;;
"--")
cmd_started=true
;;
esac
elif [[ $arg == *=* ]]; then
sudo_options="$sudo_options $arg"
else
cmd_options="$cmd_options '$arg'"
cmd_started=true
fi
done
if [ "$sudo_options" == "" ]; then
sudo_options="-E"
fi
exec /usr/bin/sudo $sudo_options env LD_LIBRARY_PATH=$LD_LIBRARY_PATH PATH=$PATH scl enable %{scl} "$cmd_options"

View File

@ -5,11 +5,12 @@
Summary: Package that installs %scl
Name: %scl_name
Version: 9.0
Release: 1%{?dist}
Release: 4%{?dist}
License: GPLv2+
Group: Applications/File
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Source0: README
Source1: sudo.sh
# The base package requires just the toolchain and the perftools.
Requires: %{scl_prefix}toolchain %{scl_prefix}perftools
@ -52,6 +53,7 @@ Requires: %{scl_prefix}gcc %{scl_prefix}gcc-c++ %{scl_prefix}gcc-gfortran
Requires: %{scl_prefix}binutils %{scl_prefix}gdb %{scl_prefix}strace
Requires: %{scl_prefix}dwz %{scl_prefix}elfutils
Requires: %{scl_prefix}ltrace %{scl_prefix}make
Requires: %{scl_prefix}annobin
Obsoletes: %{name}-toolchain < %{version}-%{release}
%description toolchain
@ -62,7 +64,7 @@ Summary: Package shipping performance tools
Group: Applications/File
Requires: %{scl_prefix}runtime
Requires: %{scl_prefix}systemtap %{scl_prefix}valgrind
%ifarch x86_64 ppc64
%ifarch x86_64 ppc64le aarch64
Requires: %{scl_prefix}dyninst
%endif
Obsoletes: %{name}-perftools < %{version}-%{release}
@ -102,9 +104,6 @@ export PATH=%{_bindir}\${PATH:+:\${PATH}}
export MANPATH=%{_mandir}:\${MANPATH}
export INFOPATH=%{_infodir}\${INFOPATH:+:\${INFOPATH}}
export PCP_DIR=%{_scl_root}
# Some perl Ext::MakeMaker versions install things under /usr/lib/perl5
# even though the system otherwise would go to /usr/lib64/perl5.
export PERL5LIB=%{_scl_root}/%{perl_vendorarch}:%{_scl_root}/usr/lib/perl5:%{_scl_root}/%{perl_vendorlib}\${PERL5LIB:+:\${PERL5LIB}}
# bz847911 workaround:
# we need to evaluate rpm's installed run-time % { _libdir }, not rpmbuild time
# or else /etc/ld.so.conf.d files?
@ -115,28 +114,13 @@ if [ "\$rpmlibdir" != "\${rpmlibdir/lib64/}" ]; then
fi
export LD_LIBRARY_PATH=%{_scl_root}\$rpmlibdir\$rpmlibdir32\${LD_LIBRARY_PATH:+:\${LD_LIBRARY_PATH}}
export LD_LIBRARY_PATH=%{_scl_root}\$rpmlibdir\$rpmlibdir32:%{_scl_root}\$rpmlibdir/dyninst\$rpmlibdir32/dyninst\${LD_LIBRARY_PATH:+:\${LD_LIBRARY_PATH}}
# duplicate python site.py logic for sitepackages
pythonvers=`python3 -c 'import sys; print (sys.version[:3])'`
export PYTHONPATH=%{_prefix}/lib64/python\$pythonvers/site-packages:%{_prefix}/lib/python\$pythonvers/site-packages\${PYTHONPATH:+:\${PYTHONPATH}}
export PKG_CONFIG_PATH=%{_libdir}/pkgconfig\${PKG_CONFIG_PATH:+:\${PKG_CONFIG_PATH}}
EOF
# Sudo script
# ===========
cat <<EOF >sudo
#! /bin/sh
# TODO: parse & pass-through sudo options from \$@
sudo_options="-E"
for arg in "\$@"
do
case "\$arg" in
*\'*)
arg=`echo "\$arg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
cmd_options="\$cmd_options '\$arg'"
done
exec /usr/bin/sudo \$sudo_options LD_LIBRARY_PATH=\$LD_LIBRARY_PATH PATH=\$PATH scl enable %{scl} "\$cmd_options"
cat <<'EOF' > sudo
%{expand:%(cat %{SOURCE1})}
EOF
# " (Fix vim syntax coloring.)
@ -202,6 +186,16 @@ if [ $1 = 0 ]; then
fi
%changelog
* Wed Nov 20 2019 Marek Polacek <polacek@redhat.com> - 9.0.4
- implement better sudo wrapper (#1774118)
- drop setting PYTHONPATH and PERL5LIB
* Tue Aug 27 2019 Marek Polacek <polacek@redhat.com> - 9.0.3
- require dyninst on ppc64le and aarch64 (#1746085)
* Wed Jul 24 2019 Marek Polacek <polacek@redhat.com> - 9.0.2
- require GTS 9 annobin (#1732819)
* Thu Jun 6 2019 Marek Polacek <polacek@redhat.com> - 9.0.1
- bump for rebuild