Blame SPECS/gcc-toolset-10.spec

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