Blame SPECS/gcc-toolset-11.spec

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