|
|
e3977e |
%global __python /usr/bin/python3
|
|
|
e3977e |
%global scl gcc-toolset-11
|
|
|
e3977e |
%scl_package %scl
|
|
|
e3977e |
|
|
|
e3977e |
Summary: Package that installs %scl
|
|
|
e3977e |
Name: %scl_name
|
|
|
e3977e |
Version: 11.0
|
|
|
ab609b |
Release: 1%{?dist}
|
|
|
e3977e |
License: GPLv2+
|
|
|
e3977e |
Group: Applications/File
|
|
|
e3977e |
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
|
|
e3977e |
Source0: README
|
|
|
e3977e |
Source1: sudo.sh
|
|
|
e3977e |
|
|
|
e3977e |
# The base package requires just the toolchain and the perftools.
|
|
|
e3977e |
Requires: %{scl_prefix}toolchain %{scl_prefix}perftools
|
|
|
e3977e |
Obsoletes: %{name} < %{version}-%{release}
|
|
|
ab609b |
Obsoletes: %{scl_prefix}dockerfiles < %{version}-%{release}
|
|
|
e3977e |
|
|
|
e3977e |
BuildRequires: scl-utils-build >= 20120927-11
|
|
|
e3977e |
BuildRequires: iso-codes
|
|
|
e3977e |
BuildRequires: help2man
|
|
|
ab609b |
%if 0%{?rhel} >= 8
|
|
|
e3977e |
BuildRequires: python3-devel
|
|
|
ab609b |
%endif
|
|
|
e3977e |
|
|
|
e3977e |
%description
|
|
|
e3977e |
This is the main package for %scl Software Collection.
|
|
|
e3977e |
|
|
|
e3977e |
%package runtime
|
|
|
e3977e |
Summary: Package that handles %scl Software Collection.
|
|
|
e3977e |
Group: Applications/File
|
|
|
e3977e |
Requires: scl-utils >= 20120927-11
|
|
|
e3977e |
Obsoletes: %{name}-runtime < %{version}-%{release}
|
|
|
ab609b |
%if 0%{?rhel} >= 7
|
|
|
e3977e |
Requires(post): %{_root_sbindir}/semanage %{_root_sbindir}/restorecon
|
|
|
e3977e |
Requires(postun): %{_root_sbindir}/semanage %{_root_sbindir}/restorecon
|
|
|
ab609b |
%else
|
|
|
ab609b |
Requires(post): libselinux policycoreutils-python
|
|
|
ab609b |
Requires(postun): libselinux policycoreutils-python
|
|
|
ab609b |
%endif
|
|
|
e3977e |
|
|
|
e3977e |
%description runtime
|
|
|
e3977e |
Package shipping essential scripts to work with %scl Software Collection.
|
|
|
e3977e |
|
|
|
e3977e |
%package build
|
|
|
e3977e |
Summary: Package shipping basic build configuration
|
|
|
e3977e |
Group: Applications/File
|
|
|
e3977e |
Requires: %{scl_prefix}runtime
|
|
|
e3977e |
Requires: scl-utils-build >= 20120927-11
|
|
|
e3977e |
Obsoletes: %{name}-build < %{version}-%{release}
|
|
|
e3977e |
|
|
|
e3977e |
%description build
|
|
|
e3977e |
Package shipping essential configuration macros to build %scl Software Collection.
|
|
|
e3977e |
|
|
|
e3977e |
%package toolchain
|
|
|
e3977e |
Summary: Package shipping basic toolchain applications
|
|
|
e3977e |
Group: Applications/File
|
|
|
e3977e |
Requires: %{scl_prefix}runtime
|
|
|
e3977e |
Requires: %{scl_prefix}gcc %{scl_prefix}gcc-c++ %{scl_prefix}gcc-gfortran
|
|
|
e3977e |
Requires: %{scl_prefix}binutils %{scl_prefix}gdb %{scl_prefix}strace
|
|
|
e3977e |
Requires: %{scl_prefix}dwz %{scl_prefix}elfutils
|
|
|
e3977e |
Requires: %{scl_prefix}ltrace %{scl_prefix}make
|
|
|
e3977e |
Requires: %{scl_prefix}annobin
|
|
|
ab609b |
%if 0%{?rhel} <= 7
|
|
|
ab609b |
Requires: %{scl_prefix}memstomp
|
|
|
ab609b |
%endif
|
|
|
e3977e |
Obsoletes: %{name}-toolchain < %{version}-%{release}
|
|
|
e3977e |
|
|
|
e3977e |
%description toolchain
|
|
|
e3977e |
Package shipping basic toolchain applications (compiler, debugger, ...)
|
|
|
e3977e |
|
|
|
e3977e |
%package perftools
|
|
|
e3977e |
Summary: Package shipping performance tools
|
|
|
e3977e |
Group: Applications/File
|
|
|
e3977e |
Requires: %{scl_prefix}runtime
|
|
|
e3977e |
Requires: %{scl_prefix}systemtap %{scl_prefix}valgrind
|
|
|
ab609b |
%if 0%{?rhel} <= 7
|
|
|
ab609b |
Requires: %{scl_prefix}oprofile
|
|
|
ab609b |
%ifarch x86_64
|
|
|
ab609b |
Requires: %{scl_prefix}dyninst
|
|
|
ab609b |
%endif
|
|
|
ab609b |
%else
|
|
|
e3977e |
%ifarch x86_64 ppc64le aarch64
|
|
|
e3977e |
Requires: %{scl_prefix}dyninst
|
|
|
e3977e |
%endif
|
|
|
ab609b |
%endif
|
|
|
e3977e |
Obsoletes: %{name}-perftools < %{version}-%{release}
|
|
|
e3977e |
|
|
|
e3977e |
%description perftools
|
|
|
ab609b |
%if 0%{?rhel} <= 7
|
|
|
ab609b |
Package shipping performance tools (systemtap, oprofile)
|
|
|
ab609b |
%else
|
|
|
e3977e |
Package shipping performance tools (systemtap)
|
|
|
ab609b |
%endif
|
|
|
e3977e |
|
|
|
e3977e |
%prep
|
|
|
e3977e |
%setup -c -T
|
|
|
e3977e |
|
|
|
e3977e |
# This section generates README file from a template and creates man page
|
|
|
e3977e |
# from that file, expanding RPM macros in the template file.
|
|
|
e3977e |
cat <<'EOF' | tee README
|
|
|
e3977e |
%{expand:%(cat %{SOURCE0})}
|
|
|
e3977e |
EOF
|
|
|
e3977e |
|
|
|
e3977e |
%build
|
|
|
e3977e |
|
|
|
e3977e |
# Temporary helper script used by help2man.
|
|
|
e3977e |
cat <<\EOF | tee h2m_helper
|
|
|
e3977e |
#!/bin/sh
|
|
|
e3977e |
if [ "$1" = "--version" ]; then
|
|
|
e3977e |
printf '%%s' "%{?scl_name} %{version} Software Collection"
|
|
|
e3977e |
else
|
|
|
e3977e |
cat README
|
|
|
e3977e |
fi
|
|
|
e3977e |
EOF
|
|
|
e3977e |
chmod a+x h2m_helper
|
|
|
e3977e |
# Generate the man page.
|
|
|
e3977e |
help2man -N --section 7 ./h2m_helper -o %{?scl_name}.7
|
|
|
e3977e |
|
|
|
e3977e |
# Enable collection script
|
|
|
e3977e |
# ========================
|
|
|
e3977e |
cat <<EOF >enable
|
|
|
e3977e |
# General environment variables
|
|
|
e3977e |
export PATH=%{_bindir}\${PATH:+:\${PATH}}
|
|
|
e3977e |
export MANPATH=%{_mandir}:\${MANPATH}
|
|
|
e3977e |
export INFOPATH=%{_infodir}\${INFOPATH:+:\${INFOPATH}}
|
|
|
e3977e |
export PCP_DIR=%{_scl_root}
|
|
|
e3977e |
# bz847911 workaround:
|
|
|
e3977e |
# we need to evaluate rpm's installed run-time % { _libdir }, not rpmbuild time
|
|
|
e3977e |
# or else /etc/ld.so.conf.d files?
|
|
|
e3977e |
rpmlibdir=\$(rpm --eval "%%{_libdir}")
|
|
|
e3977e |
# bz1017604: On 64-bit hosts, we should include also the 32-bit library path.
|
|
|
ab609b |
# bz1873882: On 32-bit hosts, we should include also the 64-bit library path.
|
|
|
e3977e |
if [ "\$rpmlibdir" != "\${rpmlibdir/lib64/}" ]; then
|
|
|
e3977e |
rpmlibdir32=":%{_scl_root}\${rpmlibdir/lib64/lib}"
|
|
|
ab609b |
dynpath32="\$rpmlibdir32/dyninst"
|
|
|
ab609b |
else
|
|
|
ab609b |
rpmlibdir64=":%{_scl_root}\${rpmlibdir/lib/lib64}"
|
|
|
ab609b |
dynpath64="\$rpmlibdir64/dyninst"
|
|
|
e3977e |
fi
|
|
|
ab609b |
# Add SCL dyninst to LD_LIBRARY_PATH, both 64- and 32-bit paths.
|
|
|
ab609b |
export LD_LIBRARY_PATH=%{_scl_root}\$rpmlibdir/dyninst\$dynpath64\$dynpath32\${LD_LIBRARY_PATH:+:\${LD_LIBRARY_PATH}}
|
|
|
ab609b |
# Now prepend the usual /opt/.../usr/lib{64,}.
|
|
|
ab609b |
export LD_LIBRARY_PATH=%{_scl_root}\$rpmlibdir\$rpmlibdir64\$rpmlibdir32\${LD_LIBRARY_PATH:+:\${LD_LIBRARY_PATH}}
|
|
|
e3977e |
export PKG_CONFIG_PATH=%{_libdir}/pkgconfig\${PKG_CONFIG_PATH:+:\${PKG_CONFIG_PATH}}
|
|
|
e3977e |
EOF
|
|
|
e3977e |
|
|
|
e3977e |
# Sudo script
|
|
|
e3977e |
# ===========
|
|
|
e3977e |
cat <<'EOF' > sudo
|
|
|
e3977e |
%{expand:%(cat %{SOURCE1})}
|
|
|
e3977e |
EOF
|
|
|
e3977e |
|
|
|
e3977e |
%install
|
|
|
e3977e |
(%{scl_install})
|
|
|
e3977e |
|
|
|
ab609b |
# This allows users to build packages using DTS/GTS.
|
|
|
e3977e |
cat >> %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-config << EOF
|
|
|
e3977e |
%%enable_devtoolset11 %%global ___build_pre %%{___build_pre}; source scl_source enable %{scl} || :
|
|
|
e3977e |
EOF
|
|
|
e3977e |
|
|
|
e3977e |
mkdir -p %{buildroot}%{_scl_root}/etc/alternatives %{buildroot}%{_scl_root}/var/lib/alternatives
|
|
|
e3977e |
|
|
|
e3977e |
install -d -m 755 %{buildroot}%{_scl_scripts}
|
|
|
e3977e |
install -p -m 755 enable %{buildroot}%{_scl_scripts}/
|
|
|
e3977e |
|
|
|
e3977e |
install -d -m 755 %{buildroot}%{_scl_scripts}
|
|
|
e3977e |
install -p -m 755 sudo %{buildroot}%{_bindir}/
|
|
|
e3977e |
|
|
|
e3977e |
# Other directories that should be owned by the runtime
|
|
|
e3977e |
install -d -m 755 %{buildroot}%{_datadir}/appdata
|
|
|
e3977e |
# Otherwise unowned perl directories
|
|
|
e3977e |
install -d -m 755 %{buildroot}%{_libdir}/perl5
|
|
|
e3977e |
install -d -m 755 %{buildroot}%{_libdir}/perl5/vendor_perl
|
|
|
e3977e |
install -d -m 755 %{buildroot}%{_libdir}/perl5/vendor_perl/auto
|
|
|
e3977e |
|
|
|
e3977e |
# Install generated man page.
|
|
|
e3977e |
install -d -m 755 %{buildroot}%{_mandir}/man7
|
|
|
e3977e |
install -p -m 644 %{?scl_name}.7 %{buildroot}%{_mandir}/man7/
|
|
|
e3977e |
|
|
|
e3977e |
%files
|
|
|
e3977e |
%doc README
|
|
|
e3977e |
%{_mandir}/man7/%{?scl_name}.*
|
|
|
e3977e |
|
|
|
e3977e |
%files runtime
|
|
|
e3977e |
%scl_files
|
|
|
e3977e |
%attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) %{_sysconfdir}/selinux-equiv.created
|
|
|
e3977e |
%dir %{_scl_root}/etc/alternatives
|
|
|
e3977e |
%dir %{_datadir}/appdata
|
|
|
e3977e |
|
|
|
e3977e |
%files build
|
|
|
e3977e |
%{_root_sysconfdir}/rpm/macros.%{scl}*
|
|
|
e3977e |
|
|
|
e3977e |
%files toolchain
|
|
|
e3977e |
|
|
|
e3977e |
%files perftools
|
|
|
e3977e |
|
|
|
e3977e |
%post runtime
|
|
|
e3977e |
if [ ! -f %{_sysconfdir}/selinux-equiv.created ]; then
|
|
|
e3977e |
/usr/sbin/semanage fcontext -a -e / %{_scl_root}
|
|
|
e3977e |
restorecon -R %{_scl_root}
|
|
|
e3977e |
touch %{_sysconfdir}/selinux-equiv.created
|
|
|
e3977e |
fi
|
|
|
e3977e |
|
|
|
e3977e |
%preun runtime
|
|
|
e3977e |
[ $1 = 0 ] && rm -f %{_sysconfdir}/selinux-equiv.created || :
|
|
|
e3977e |
|
|
|
e3977e |
%postun runtime
|
|
|
e3977e |
if [ $1 = 0 ]; then
|
|
|
e3977e |
/usr/sbin/semanage fcontext -d %{_scl_root}
|
|
|
e3977e |
[ -d %{_scl_root} ] && restorecon -R %{_scl_root} || :
|
|
|
e3977e |
fi
|
|
|
e3977e |
|
|
|
e3977e |
%changelog
|
|
|
ab609b |
* Wed Jul 28 2021 Marek Polacek <polacek@redhat.com> - 11.0-1
|
|
|
ab609b |
- on 32-bit hosts, include also the 64-bit library path (#1986097)
|
|
|
ab609b |
|
|
|
ab609b |
* Wed Apr 21 2021 Marek Polacek <polacek@redhat.com> - 11.0-0
|
|
|
e3977e |
- new package
|