Blame SPECS/devtoolset-8.spec

226eed
%global scl devtoolset-8
226eed
%scl_package %scl
226eed
226eed
Summary: Package that installs %scl
226eed
Name: %scl_name
1f1290
Version: 8.1
1f1290
Release: 1%{?dist}
226eed
License: GPLv2+
226eed
Group: Applications/File
226eed
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
226eed
Source0: README
226eed
226eed
# The base package requires just the toolchain and the perftools.
226eed
Requires: %{scl_prefix}toolchain %{scl_prefix}perftools
226eed
Obsoletes: %{name} < %{version}-%{release}
1f1290
Obsoletes: %{scl_prefix}dockerfiles
226eed
226eed
BuildRequires: scl-utils-build >= 20120927-11
226eed
BuildRequires: iso-codes
226eed
BuildRequires: help2man
226eed
226eed
%description
226eed
This is the main package for %scl Software Collection.
226eed
226eed
%package runtime
226eed
Summary: Package that handles %scl Software Collection.
226eed
Group: Applications/File
226eed
Requires: scl-utils >= 20120927-11
226eed
Obsoletes: %{name}-runtime < %{version}-%{release}
226eed
%if 0%{?rhel} >= 7
226eed
Requires(post): %{_root_sbindir}/semanage %{_root_sbindir}/restorecon
226eed
Requires(postun): %{_root_sbindir}/semanage %{_root_sbindir}/restorecon
226eed
%else
226eed
Requires(post): libselinux policycoreutils-python
226eed
Requires(postun): libselinux policycoreutils-python
226eed
%endif
226eed
226eed
%description runtime
226eed
Package shipping essential scripts to work with %scl Software Collection.
226eed
226eed
%package build
226eed
Summary: Package shipping basic build configuration
226eed
Group: Applications/File
226eed
Requires: %{scl_prefix}runtime
226eed
Requires: scl-utils-build >= 20120927-11
226eed
Obsoletes: %{name}-build < %{version}-%{release}
226eed
226eed
%description build
226eed
Package shipping essential configuration macros to build %scl Software Collection.
226eed
226eed
%package toolchain
226eed
Summary: Package shipping basic toolchain applications
226eed
Group: Applications/File
226eed
Requires: %{scl_prefix}runtime
226eed
Requires: %{scl_prefix}gcc %{scl_prefix}gcc-c++ %{scl_prefix}gcc-gfortran
226eed
Requires: %{scl_prefix}binutils %{scl_prefix}gdb %{scl_prefix}strace
226eed
Requires: %{scl_prefix}dwz %{scl_prefix}elfutils %{scl_prefix}memstomp
226eed
Requires: %{scl_prefix}ltrace %{scl_prefix}make
226eed
Obsoletes: %{name}-toolchain < %{version}-%{release}
226eed
226eed
%description toolchain
226eed
Package shipping basic toolchain applications (compiler, debugger, ...)
226eed
226eed
%package perftools
226eed
Summary: Package shipping performance tools
226eed
Group: Applications/File
226eed
Requires: %{scl_prefix}runtime
226eed
Requires: %{scl_prefix}oprofile %{scl_prefix}systemtap %{scl_prefix}valgrind
226eed
%ifarch x86_64 ppc64
226eed
Requires: %{scl_prefix}dyninst
226eed
%endif
226eed
Obsoletes: %{name}-perftools < %{version}-%{release}
226eed
226eed
%description perftools
226eed
Package shipping performance tools (systemtap, oprofile)
226eed
226eed
%prep
1f1290
%setup -c -T
226eed
226eed
# This section generates README file from a template and creates man page
226eed
# from that file, expanding RPM macros in the template file.
226eed
cat <<'EOF' | tee README
226eed
%{expand:%(cat %{SOURCE0})}
226eed
EOF
226eed
226eed
%build
226eed
226eed
# Temporary helper script used by help2man.
226eed
cat <<\EOF | tee h2m_helper
226eed
#!/bin/sh
226eed
if [ "$1" = "--version" ]; then
226eed
  printf '%%s' "%{?scl_name} %{version} Software Collection"
226eed
else
226eed
  cat README
226eed
fi
226eed
EOF
226eed
chmod a+x h2m_helper
226eed
# Generate the man page.
226eed
help2man -N --section 7 ./h2m_helper -o %{?scl_name}.7
226eed
226eed
# Enable collection script
226eed
# ========================
226eed
cat <<EOF >enable
226eed
# General environment variables
226eed
export PATH=%{_bindir}\${PATH:+:\${PATH}}
226eed
export MANPATH=%{_mandir}:\${MANPATH}
226eed
export INFOPATH=%{_infodir}\${INFOPATH:+:\${INFOPATH}}
226eed
export PCP_DIR=%{_scl_root}
226eed
# Some perl Ext::MakeMaker versions install things under /usr/lib/perl5
226eed
# even though the system otherwise would go to /usr/lib64/perl5.
226eed
export PERL5LIB=%{_scl_root}/%{perl_vendorarch}:%{_scl_root}/usr/lib/perl5:%{_scl_root}/%{perl_vendorlib}\${PERL5LIB:+:\${PERL5LIB}}
226eed
# bz847911 workaround:
226eed
# we need to evaluate rpm's installed run-time % { _libdir }, not rpmbuild time
226eed
# or else /etc/ld.so.conf.d files?
226eed
rpmlibdir=\$(rpm --eval "%%{_libdir}")
226eed
# bz1017604: On 64-bit hosts, we should include also the 32-bit library path.
226eed
if [ "\$rpmlibdir" != "\${rpmlibdir/lib64/}" ]; then
226eed
  rpmlibdir32=":%{_scl_root}\${rpmlibdir/lib64/lib}"
226eed
fi
226eed
export LD_LIBRARY_PATH=%{_scl_root}\$rpmlibdir\$rpmlibdir32\${LD_LIBRARY_PATH:+:\${LD_LIBRARY_PATH}}
226eed
export LD_LIBRARY_PATH=%{_scl_root}\$rpmlibdir\$rpmlibdir32:%{_scl_root}\$rpmlibdir/dyninst\$rpmlibdir32/dyninst\${LD_LIBRARY_PATH:+:\${LD_LIBRARY_PATH}}
226eed
# duplicate python site.py logic for sitepackages
226eed
pythonvers=`python -c 'import sys; print sys.version[:3]'`
226eed
export PYTHONPATH=%{_prefix}/lib64/python\$pythonvers/site-packages:%{_prefix}/lib/python\$pythonvers/site-packages\${PYTHONPATH:+:\${PYTHONPATH}}
226eed
export PKG_CONFIG_PATH=%{_libdir}/pkgconfig\${PKG_CONFIG_PATH:+:\${PKG_CONFIG_PATH}}
226eed
EOF
226eed
226eed
# Sudo script
226eed
# ===========
226eed
cat <<EOF >sudo
226eed
#! /bin/sh
226eed
# TODO: parse & pass-through sudo options from \$@
226eed
sudo_options="-E"
226eed
226eed
for arg in "\$@"
226eed
do
226eed
   case "\$arg" in
226eed
    *\'*)
226eed
      arg=`echo "\$arg" | sed "s/'/'\\\\\\\\''/g"` ;;
226eed
   esac
226eed
   cmd_options="\$cmd_options '\$arg'" 
226eed
done
226eed
exec /usr/bin/sudo \$sudo_options LD_LIBRARY_PATH=\$LD_LIBRARY_PATH PATH=\$PATH scl enable %{scl} "\$cmd_options"
226eed
EOF
226eed
226eed
# " (Fix vim syntax coloring.)
226eed
226eed
%install
226eed
(%{scl_install})
226eed
226eed
# This allows users to build packages using DTS.
226eed
cat >> %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-config << EOF
226eed
%%enable_devtoolset8 %%global ___build_pre %%{___build_pre}; source scl_source enable %{scl} || :
226eed
EOF
226eed
226eed
mkdir -p %{buildroot}%{_scl_root}/etc/alternatives %{buildroot}%{_scl_root}/var/lib/alternatives
226eed
226eed
install -d -m 755 %{buildroot}%{_scl_scripts}
226eed
install -p -m 755 enable %{buildroot}%{_scl_scripts}/
226eed
226eed
install -d -m 755 %{buildroot}%{_scl_scripts}
226eed
install -p -m 755 sudo %{buildroot}%{_bindir}/
226eed
226eed
# Other directories that should be owned by the runtime
226eed
install -d -m 755 %{buildroot}%{_datadir}/appdata
226eed
# Otherwise unowned perl directories
226eed
install -d -m 755 %{buildroot}%{_libdir}/perl5
226eed
install -d -m 755 %{buildroot}%{_libdir}/perl5/vendor_perl
226eed
install -d -m 755 %{buildroot}%{_libdir}/perl5/vendor_perl/auto
226eed
226eed
# Install generated man page.
226eed
install -d -m 755 %{buildroot}%{_mandir}/man7
226eed
install -p -m 644 %{?scl_name}.7 %{buildroot}%{_mandir}/man7/
226eed
226eed
%files
226eed
%doc README
226eed
%{_mandir}/man7/%{?scl_name}.*
226eed
226eed
%files runtime
226eed
%scl_files
226eed
%attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) %{_sysconfdir}/selinux-equiv.created
226eed
%dir %{_scl_root}/etc/alternatives
226eed
%dir %{_datadir}/appdata
226eed
226eed
%files build
226eed
%{_root_sysconfdir}/rpm/macros.%{scl}*
226eed
226eed
%files toolchain
226eed
226eed
%files perftools
226eed
226eed
%post runtime
226eed
if [ ! -f %{_sysconfdir}/selinux-equiv.created ]; then
226eed
  /usr/sbin/semanage fcontext -a -e / %{_scl_root}
226eed
  restorecon -R %{_scl_root}
226eed
  touch %{_sysconfdir}/selinux-equiv.created
226eed
fi
226eed
226eed
%preun runtime
226eed
[ $1 = 0 ] && rm -f %{_sysconfdir}/selinux-equiv.created || :
226eed
226eed
%postun runtime
226eed
if [ $1 = 0 ]; then
226eed
  /usr/sbin/semanage fcontext -d %{_scl_root}
226eed
  [ -d %{_scl_root} ] && restorecon -R %{_scl_root} || :
226eed
fi
226eed
226eed
%changelog
1f1290
* Wed Mar 20 2019 Marek Polacek <polacek@redhat.com> - 8.1.1
1f1290
- add Obsoletes devtoolset-8-dockerfiles (#1658648)
1f1290
1f1290
* Wed Jan  9 2019 Marek Polacek <polacek@redhat.com> - 8.1.0
1f1290
- update to 8.1
1f1290
- remove -dockerfiles subpackage (#1658648)
1f1290
226eed
* Wed Jun 27 2018 Marek Polacek <polacek@redhat.com> - 8.0.2
226eed
- add PKG_CONFIG_PATH
226eed
226eed
* Fri Jun  8 2018 Marek Polacek <polacek@redhat.com> - 8.0.1
226eed
- fix enable_devtoolset8 macro
226eed
226eed
* Fri Apr 27 2018 Marek Polacek <polacek@redhat.com> - 8.0.0
226eed
- new package