Blame SPECS/devtoolset-9.spec

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