Blame SPECS/devtoolset-12.spec

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