Blame SPECS/gcc-toolset-11.spec

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