Blame SPECS/devtoolset-11.spec

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