Blame SPECS/devtoolset-10.spec

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