| %global scl devtoolset-8 |
| %scl_package %scl |
| |
| Summary: Package that installs %scl |
| Name: %scl_name |
| Version: 8.1 |
| Release: 1%{?dist} |
| License: GPLv2+ |
| Group: Applications/File |
| BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) |
| Source0: README |
| |
| |
| Requires: %{scl_prefix}toolchain %{scl_prefix}perftools |
| Obsoletes: %{name} < %{version}-%{release} |
| Obsoletes: %{scl_prefix}dockerfiles |
| |
| BuildRequires: scl-utils-build >= 20120927-11 |
| BuildRequires: iso-codes |
| BuildRequires: help2man |
| |
| %description |
| This is the main package for %scl Software Collection. |
| |
| %package runtime |
| Summary: Package that handles %scl Software Collection. |
| Group: Applications/File |
| Requires: scl-utils >= 20120927-11 |
| Obsoletes: %{name}-runtime < %{version}-%{release} |
| %if 0%{?rhel} >= 7 |
| Requires(post): %{_root_sbindir}/semanage %{_root_sbindir}/restorecon |
| Requires(postun): %{_root_sbindir}/semanage %{_root_sbindir}/restorecon |
| %else |
| Requires(post): libselinux policycoreutils-python |
| Requires(postun): libselinux policycoreutils-python |
| %endif |
| |
| %description runtime |
| Package shipping essential scripts to work with %scl Software Collection. |
| |
| %package build |
| Summary: Package shipping basic build configuration |
| Group: Applications/File |
| Requires: %{scl_prefix}runtime |
| Requires: scl-utils-build >= 20120927-11 |
| Obsoletes: %{name}-build < %{version}-%{release} |
| |
| %description build |
| Package shipping essential configuration macros to build %scl Software Collection. |
| |
| %package toolchain |
| Summary: Package shipping basic toolchain applications |
| Group: Applications/File |
| Requires: %{scl_prefix}runtime |
| Requires: %{scl_prefix}gcc %{scl_prefix}gcc-c++ %{scl_prefix}gcc-gfortran |
| Requires: %{scl_prefix}binutils %{scl_prefix}gdb %{scl_prefix}strace |
| Requires: %{scl_prefix}dwz %{scl_prefix}elfutils %{scl_prefix}memstomp |
| Requires: %{scl_prefix}ltrace %{scl_prefix}make |
| Obsoletes: %{name}-toolchain < %{version}-%{release} |
| |
| %description toolchain |
| Package shipping basic toolchain applications (compiler, debugger, ...) |
| |
| %package perftools |
| Summary: Package shipping performance tools |
| Group: Applications/File |
| Requires: %{scl_prefix}runtime |
| Requires: %{scl_prefix}oprofile %{scl_prefix}systemtap %{scl_prefix}valgrind |
| %ifarch x86_64 ppc64 |
| Requires: %{scl_prefix}dyninst |
| %endif |
| Obsoletes: %{name}-perftools < %{version}-%{release} |
| |
| %description perftools |
| Package shipping performance tools (systemtap, oprofile) |
| |
| %prep |
| %setup -c -T |
| |
| |
| |
| cat <<'EOF' | tee README |
| %{expand:%(cat %{SOURCE0})} |
| EOF |
| |
| %build |
| |
| |
| cat <<\EOF | tee h2m_helper |
| |
| if [ "$1" = "--version" ]; then |
| printf '%%s' "%{?scl_name} %{version} Software Collection" |
| else |
| cat README |
| fi |
| EOF |
| chmod a+x h2m_helper |
| |
| help2man -N --section 7 ./h2m_helper -o %{?scl_name}.7 |
| |
| |
| |
| cat <<EOF >enable |
| |
| export PATH=%{_bindir}\${PATH:+:\${PATH}} |
| export MANPATH=%{_mandir}:\${MANPATH} |
| export INFOPATH=%{_infodir}\${INFOPATH:+:\${INFOPATH}} |
| export PCP_DIR=%{_scl_root} |
| |
| |
| export PERL5LIB=%{_scl_root}/%{perl_vendorarch}:%{_scl_root}/usr/lib/perl5:%{_scl_root}/%{perl_vendorlib}\${PERL5LIB:+:\${PERL5LIB}} |
| |
| |
| |
| rpmlibdir=\$(rpm --eval "%%{_libdir}") |
| |
| if [ "\$rpmlibdir" != "\${rpmlibdir/lib64/}" ]; then |
| rpmlibdir32=":%{_scl_root}\${rpmlibdir/lib64/lib}" |
| fi |
| export LD_LIBRARY_PATH=%{_scl_root}\$rpmlibdir\$rpmlibdir32\${LD_LIBRARY_PATH:+:\${LD_LIBRARY_PATH}} |
| export LD_LIBRARY_PATH=%{_scl_root}\$rpmlibdir\$rpmlibdir32:%{_scl_root}\$rpmlibdir/dyninst\$rpmlibdir32/dyninst\${LD_LIBRARY_PATH:+:\${LD_LIBRARY_PATH}} |
| |
| pythonvers=`python -c 'import sys; print sys.version[:3]'` |
| export PYTHONPATH=%{_prefix}/lib64/python\$pythonvers/site-packages:%{_prefix}/lib/python\$pythonvers/site-packages\${PYTHONPATH:+:\${PYTHONPATH}} |
| export PKG_CONFIG_PATH=%{_libdir}/pkgconfig\${PKG_CONFIG_PATH:+:\${PKG_CONFIG_PATH}} |
| EOF |
| |
| |
| |
| cat <<EOF >sudo |
| |
| |
| sudo_options="-E" |
| |
| for arg in "\$@" |
| do |
| case "\$arg" in |
| *\'*) |
| arg=`echo "\$arg" | sed "s/'/'\\\\\\\\''/g"` ;; |
| esac |
| cmd_options="\$cmd_options '\$arg'" |
| done |
| exec /usr/bin/sudo \$sudo_options LD_LIBRARY_PATH=\$LD_LIBRARY_PATH PATH=\$PATH scl enable %{scl} "\$cmd_options" |
| EOF |
| |
| |
| |
| %install |
| (%{scl_install}) |
| |
| |
| cat >> %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-config << EOF |
| %%enable_devtoolset8 %%global ___build_pre %%{___build_pre}; source scl_source enable %{scl} || : |
| EOF |
| |
| mkdir -p %{buildroot}%{_scl_root}/etc/alternatives %{buildroot}%{_scl_root}/var/lib/alternatives |
| |
| install -d -m 755 %{buildroot}%{_scl_scripts} |
| install -p -m 755 enable %{buildroot}%{_scl_scripts}/ |
| |
| install -d -m 755 %{buildroot}%{_scl_scripts} |
| install -p -m 755 sudo %{buildroot}%{_bindir}/ |
| |
| |
| install -d -m 755 %{buildroot}%{_datadir}/appdata |
| |
| install -d -m 755 %{buildroot}%{_libdir}/perl5 |
| install -d -m 755 %{buildroot}%{_libdir}/perl5/vendor_perl |
| install -d -m 755 %{buildroot}%{_libdir}/perl5/vendor_perl/auto |
| |
| |
| install -d -m 755 %{buildroot}%{_mandir}/man7 |
| install -p -m 644 %{?scl_name}.7 %{buildroot}%{_mandir}/man7/ |
| |
| %files |
| %doc README |
| %{_mandir}/man7/%{?scl_name}.* |
| |
| %files runtime |
| %scl_files |
| %attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) %{_sysconfdir}/selinux-equiv.created |
| %dir %{_scl_root}/etc/alternatives |
| %dir %{_datadir}/appdata |
| |
| %files build |
| %{_root_sysconfdir}/rpm/macros.%{scl}* |
| |
| %files toolchain |
| |
| %files perftools |
| |
| %post runtime |
| if [ ! -f %{_sysconfdir}/selinux-equiv.created ]; then |
| /usr/sbin/semanage fcontext -a -e / %{_scl_root} |
| restorecon -R %{_scl_root} |
| touch %{_sysconfdir}/selinux-equiv.created |
| fi |
| |
| %preun runtime |
| [ $1 = 0 ] && rm -f %{_sysconfdir}/selinux-equiv.created || : |
| |
| %postun runtime |
| if [ $1 = 0 ]; then |
| /usr/sbin/semanage fcontext -d %{_scl_root} |
| [ -d %{_scl_root} ] && restorecon -R %{_scl_root} || : |
| fi |
| |
| %changelog |
| * Wed Mar 20 2019 Marek Polacek <polacek@redhat.com> - 8.1.1 |
| - add Obsoletes devtoolset-8-dockerfiles ( |
| |
| * Wed Jan 9 2019 Marek Polacek <polacek@redhat.com> - 8.1.0 |
| - update to 8.1 |
| - remove -dockerfiles subpackage ( |
| |
| * Wed Jun 27 2018 Marek Polacek <polacek@redhat.com> - 8.0.2 |
| - add PKG_CONFIG_PATH |
| |
| * Fri Jun 8 2018 Marek Polacek <polacek@redhat.com> - 8.0.1 |
| - fix enable_devtoolset8 macro |
| |
| * Fri Apr 27 2018 Marek Polacek <polacek@redhat.com> - 8.0.0 |
| - new package |