Blame SPECS/gcc-toolset-10.spec

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