import gcc-toolset-9-9.0-4.el8
This commit is contained in:
parent
d7df2f835a
commit
64d2ae4ce9
41
SOURCES/sudo.sh
Normal file
41
SOURCES/sudo.sh
Normal 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"
|
@ -5,11 +5,12 @@
|
|||||||
Summary: Package that installs %scl
|
Summary: Package that installs %scl
|
||||||
Name: %scl_name
|
Name: %scl_name
|
||||||
Version: 9.0
|
Version: 9.0
|
||||||
Release: 3%{?dist}
|
Release: 4%{?dist}
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
Group: Applications/File
|
Group: Applications/File
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||||
Source0: README
|
Source0: README
|
||||||
|
Source1: sudo.sh
|
||||||
|
|
||||||
# The base package requires just the toolchain and the perftools.
|
# The base package requires just the toolchain and the perftools.
|
||||||
Requires: %{scl_prefix}toolchain %{scl_prefix}perftools
|
Requires: %{scl_prefix}toolchain %{scl_prefix}perftools
|
||||||
@ -103,9 +104,6 @@ export PATH=%{_bindir}\${PATH:+:\${PATH}}
|
|||||||
export MANPATH=%{_mandir}:\${MANPATH}
|
export MANPATH=%{_mandir}:\${MANPATH}
|
||||||
export INFOPATH=%{_infodir}\${INFOPATH:+:\${INFOPATH}}
|
export INFOPATH=%{_infodir}\${INFOPATH:+:\${INFOPATH}}
|
||||||
export PCP_DIR=%{_scl_root}
|
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:
|
# bz847911 workaround:
|
||||||
# we need to evaluate rpm's installed run-time % { _libdir }, not rpmbuild time
|
# we need to evaluate rpm's installed run-time % { _libdir }, not rpmbuild time
|
||||||
# or else /etc/ld.so.conf.d files?
|
# or else /etc/ld.so.conf.d files?
|
||||||
@ -116,28 +114,13 @@ if [ "\$rpmlibdir" != "\${rpmlibdir/lib64/}" ]; then
|
|||||||
fi
|
fi
|
||||||
export LD_LIBRARY_PATH=%{_scl_root}\$rpmlibdir\$rpmlibdir32\${LD_LIBRARY_PATH:+:\${LD_LIBRARY_PATH}}
|
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}}
|
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}}
|
export PKG_CONFIG_PATH=%{_libdir}/pkgconfig\${PKG_CONFIG_PATH:+:\${PKG_CONFIG_PATH}}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Sudo script
|
# Sudo script
|
||||||
# ===========
|
# ===========
|
||||||
cat <<EOF >sudo
|
cat <<'EOF' > sudo
|
||||||
#! /bin/sh
|
%{expand:%(cat %{SOURCE1})}
|
||||||
# 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"
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# " (Fix vim syntax coloring.)
|
# " (Fix vim syntax coloring.)
|
||||||
@ -203,6 +186,10 @@ if [ $1 = 0 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
%changelog
|
%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
|
* Tue Aug 27 2019 Marek Polacek <polacek@redhat.com> - 9.0.3
|
||||||
- require dyninst on ppc64le and aarch64 (#1746085)
|
- require dyninst on ppc64le and aarch64 (#1746085)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user