Blame SPECS/gcc-toolset-9.spec

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