Blame SPECS/gcc-toolset-10.spec

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