Blame SPECS/devtoolset-3.spec

55a1e0
%global scl devtoolset-3
55a1e0
%scl_package %scl
55a1e0
55a1e0
Summary: Package that installs %scl
55a1e0
Name: %scl_name
55a1e0
Version: 3.0
55a1e0
Release: 15%{?dist}
55a1e0
BuildArch: noarch
55a1e0
License: GPLv2+
55a1e0
Group: Applications/File
55a1e0
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
55a1e0
55a1e0
# The base package must require everything in the collection
55a1e0
Requires: %{scl_prefix}toolchain %{scl_prefix}ide %{scl_prefix}perftools
55a1e0
55a1e0
BuildRequires: scl-utils-build >= 20120927-11
55a1e0
BuildRequires: iso-codes
55a1e0
55a1e0
%description
55a1e0
This is the main package for %scl Software Collection.
55a1e0
55a1e0
%package runtime
55a1e0
Summary: Package that handles %scl Software Collection.
55a1e0
Group: Applications/File
55a1e0
Requires: scl-utils >= 20120927-11
55a1e0
Requires(post): libselinux policycoreutils-python
55a1e0
Requires(postun): libselinux policycoreutils-python
55a1e0
Requires(preun): libselinux policycoreutils-python
55a1e0
55a1e0
%description runtime
55a1e0
Package shipping essential scripts to work with %scl Software Collection.
55a1e0
55a1e0
%package build
55a1e0
Summary: Package shipping basic build configuration
55a1e0
Group: Applications/File
55a1e0
Requires: %{scl_prefix}runtime
55a1e0
Requires: scl-utils-build >= 20120927-11
55a1e0
55a1e0
%description build
55a1e0
Package shipping essential configuration macros to build %scl Software Collection.
55a1e0
55a1e0
%package toolchain
55a1e0
Summary: Package shipping basic toolchain applications
55a1e0
Group: Applications/File
55a1e0
Requires: %{scl_prefix}runtime
55a1e0
Requires: %{scl_prefix}gcc %{scl_prefix}gcc-c++ %{scl_prefix}gcc-gfortran
55a1e0
Requires: %{scl_prefix}binutils %{scl_prefix}gdb %{scl_prefix}strace
55a1e0
Requires: %{scl_prefix}dwz %{scl_prefix}elfutils %{scl_prefix}memstomp
55a1e0
Requires: %{scl_prefix}ltrace
55a1e0
55a1e0
%description toolchain
55a1e0
Package shipping basic toolchain applications (compiler, debugger, ...)
55a1e0
55a1e0
%package ide
55a1e0
Summary: Package shipping Eclipse IDE
55a1e0
Group: Applications/File
55a1e0
Requires: %{scl_prefix}runtime
55a1e0
Requires: %{scl_prefix}eclipse-cdt
55a1e0
Requires: %{scl_prefix}eclipse-cdt-parsers
55a1e0
Requires: %{scl_prefix}eclipse-cdt-sdk
55a1e0
Requires: %{scl_prefix}eclipse-changelog
55a1e0
Requires: %{scl_prefix}eclipse-egit
55a1e0
Requires: %{scl_prefix}eclipse-emf
55a1e0
Requires: %{scl_prefix}eclipse-emf-core
55a1e0
Requires: %{scl_prefix}eclipse-emf-examples
55a1e0
Requires: %{scl_prefix}eclipse-emf-sdk
55a1e0
Requires: %{scl_prefix}eclipse-equinox-osgi
55a1e0
Requires: %{scl_prefix}eclipse-gcov
55a1e0
Requires: %{scl_prefix}eclipse-gef
55a1e0
Requires: %{scl_prefix}eclipse-gef-examples
55a1e0
Requires: %{scl_prefix}eclipse-gef-sdk
55a1e0
Requires: %{scl_prefix}eclipse-gprof
55a1e0
Requires: %{scl_prefix}eclipse-jdt
55a1e0
Requires: %{scl_prefix}eclipse-jgit
55a1e0
Requires: %{scl_prefix}eclipse-linuxtools
55a1e0
Requires: %{scl_prefix}eclipse-manpage
55a1e0
Requires: %{scl_prefix}eclipse-oprofile
55a1e0
Requires: %{scl_prefix}eclipse-pde
55a1e0
Requires: %{scl_prefix}eclipse-perf
55a1e0
Requires: %{scl_prefix}eclipse-platform
55a1e0
Requires: %{scl_prefix}eclipse-rcp
55a1e0
Requires: %{scl_prefix}eclipse-rpm-editor
55a1e0
Requires: %{scl_prefix}eclipse-rse
55a1e0
Requires: %{scl_prefix}eclipse-rse-server
55a1e0
Requires: %{scl_prefix}eclipse-swt
55a1e0
Requires: %{scl_prefix}eclipse-systemtap
55a1e0
Requires: %{scl_prefix}eclipse-valgrind
55a1e0
Requires: %{scl_prefix}eclipse-mylyn
55a1e0
Requires: %{scl_prefix}eclipse-mylyn-builds
55a1e0
Requires: %{scl_prefix}eclipse-mylyn-builds-hudson
55a1e0
Requires: %{scl_prefix}eclipse-mylyn-context-cdt
55a1e0
Requires: %{scl_prefix}eclipse-mylyn-context-java
55a1e0
Requires: %{scl_prefix}eclipse-mylyn-context-pde
55a1e0
Requires: %{scl_prefix}eclipse-mylyn-context-team
55a1e0
Requires: %{scl_prefix}eclipse-mylyn-docs-epub
55a1e0
Requires: %{scl_prefix}eclipse-mylyn-docs-htmltext
55a1e0
Requires: %{scl_prefix}eclipse-mylyn-docs-wikitext
55a1e0
Requires: %{scl_prefix}eclipse-mylyn-ide
55a1e0
Requires: %{scl_prefix}eclipse-mylyn-sdk
55a1e0
Requires: %{scl_prefix}eclipse-mylyn-tasks-bugzilla
55a1e0
Requires: %{scl_prefix}eclipse-mylyn-tasks-trac
55a1e0
Requires: %{scl_prefix}eclipse-mylyn-tasks-web
55a1e0
Requires: %{scl_prefix}eclipse-mylyn-versions
55a1e0
Requires: %{scl_prefix}eclipse-mylyn-versions-cvs
55a1e0
Requires: %{scl_prefix}eclipse-mylyn-versions-git
55a1e0
55a1e0
%description ide
55a1e0
Package shipping Eclipse IDE
55a1e0
55a1e0
%package perftools
55a1e0
Summary: Package shipping performance tools
55a1e0
Group: Applications/File
55a1e0
Requires: %{scl_prefix}runtime
55a1e0
Requires: %{scl_prefix}oprofile %{scl_prefix}systemtap %{scl_prefix}valgrind
55a1e0
Requires: %{scl_prefix}dyninst
55a1e0
55a1e0
%description perftools
55a1e0
Package shipping performance tools (systemtap, oprofile)
55a1e0
55a1e0
%prep
55a1e0
%setup -c -T
55a1e0
55a1e0
%build
55a1e0
# Enable collection script
55a1e0
# ========================
55a1e0
cat <<EOF >enable
55a1e0
# General environment variables
55a1e0
export PATH=%{_bindir}\${PATH:+:\${PATH}}
55a1e0
export MANPATH=%{_mandir}:\${MANPATH}
55a1e0
export INFOPATH=%{_infodir}\${INFOPATH:+:\${INFOPATH}}
55a1e0
55a1e0
# Needed by Java Packages Tools to locate java.conf
55a1e0
export JAVACONFDIRS="%{_sysconfdir}/java:\${JAVACONFDIRS:-/etc/java}"
55a1e0
55a1e0
# Required by XMvn to locate its configuration files
55a1e0
export XDG_CONFIG_DIRS="%{_sysconfdir}/xdg:\${XDG_CONFIG_DIRS:-/etc/xdg}"
55a1e0
export XDG_DATA_DIRS="%{_datadir}:\${XDG_DATA_DIRS:-/usr/local/share:/usr/share}"
55a1e0
55a1e0
export PCP_DIR=%{_scl_root}
55a1e0
# Some perl Ext::MakeMaker versions install things under /usr/lib/perl5
55a1e0
# even though the system otherwise would go to /usr/lib64/perl5.
55a1e0
export PERL5LIB=%{_scl_root}/%{perl_vendorarch}:%{_scl_root}/usr/lib/perl5:%{_scl_root}/%{perl_vendorlib}\${PERL5LIB:+:\${PERL5LIB}}
55a1e0
# bz847911 workaround:
55a1e0
# we need to evaluate rpm's installed run-time % { _libdir }, not rpmbuild time
55a1e0
# or else /etc/ld.so.conf.d files?
55a1e0
rpmlibdir=\$(rpm --eval "%%{_libdir}")
55a1e0
# bz1017604: On 64-bit hosts, we should include also the 32-bit library path.
55a1e0
if [ "\$rpmlibdir" != "\${rpmlibdir/lib64/}" ]; then
55a1e0
  rpmlibdir32=":%{_scl_root}\${rpmlibdir/lib64/lib}"
55a1e0
fi
55a1e0
export LD_LIBRARY_PATH=%{_scl_root}\$rpmlibdir\$rpmlibdir32\${LD_LIBRARY_PATH:+:\${LD_LIBRARY_PATH}}
55a1e0
# duplicate python site.py logic for sitepackages
55a1e0
pythonvers=`python -c 'import sys; print sys.version[:3]'`
55a1e0
export PYTHONPATH=%{_prefix}/lib64/python\$pythonvers/site-packages:%{_prefix}/lib/python\$pythonvers/site-packages\${PYTHONPATH:+:\${PYTHONPATH}}
55a1e0
EOF
55a1e0
55a1e0
# Sudo script
55a1e0
# ===========
55a1e0
cat <<EOF >sudo
55a1e0
#! /bin/sh
55a1e0
# TODO: parse & pass-through sudo options from \$@
55a1e0
sudo_options="-E"
55a1e0
55a1e0
for arg in "\$@"
55a1e0
do
55a1e0
   case "\$arg" in
55a1e0
    *\'*)
55a1e0
      arg=`echo "\$arg" | sed "s/'/'\\\\\\\\''/g"` ;;
55a1e0
   esac
55a1e0
   cmd_options="\$cmd_options '\$arg'" 
55a1e0
done
55a1e0
exec /usr/bin/sudo \$sudo_options LD_LIBRARY_PATH=\$LD_LIBRARY_PATH PATH=\$PATH scl enable %{scl} "\$cmd_options"
55a1e0
EOF
55a1e0
55a1e0
# Java configuration
55a1e0
# ==================
55a1e0
cat <<EOF >java.conf
55a1e0
JAVA_LIBDIR=%{_javadir}
55a1e0
JNI_LIBDIR=%{_jnidir}
55a1e0
JVM_ROOT=%{_jvmdir}
55a1e0
EOF
55a1e0
55a1e0
# Ivy configuration
55a1e0
# =================
55a1e0
cat <<EOF >ivysettings.xml
55a1e0
55a1e0
     Artifact resolution order is:
55a1e0
      1. %{scl} collection
55a1e0
      2. base operating system
55a1e0
-->
55a1e0
<ivysettings>
55a1e0
  <settings defaultResolver="default"/>
55a1e0
  <resolvers>
55a1e0
    <filesystem name="%{scl}-public">
55a1e0
      <ivy pattern="\${ivy.conf.dir}/lib/[module]/apache-ivy-[revision].xml" />
55a1e0
      <artifact pattern="%{_datadir}/java/\[artifact].[ext]" />
55a1e0
    </filesystem>
55a1e0
    <filesystem name="public">
55a1e0
      <ivy pattern="\${ivy.conf.dir}/lib/[module]/apache-ivy-[revision].xml" />
55a1e0
      <artifact pattern="%{_root_datadir}/java/\[artifact].[ext]" />
55a1e0
    </filesystem>
55a1e0
    <chain name="main" dual="true">
55a1e0
      <resolver ref="%{scl}-public"/>
55a1e0
      <resolver ref="public"/>
55a1e0
    </chain>
55a1e0
  </resolvers>
55a1e0
  <include url="\${ivy.default.settings.dir}/ivysettings-local.xml"/>
55a1e0
  <include url="\${ivy.default.settings.dir}/ivysettings-default-chain.xml"/>
55a1e0
</ivysettings>
55a1e0
EOF
55a1e0
55a1e0
# XMvn configuration
55a1e0
# =================
55a1e0
cat <<EOF >configuration.xml
55a1e0
55a1e0
     Artifact resolution order is:
55a1e0
      1. %{scl} collection
55a1e0
      2. base operating system
55a1e0
-->
55a1e0
<configuration>
55a1e0
  <resolverSettings>
55a1e0
    <prefixes>
55a1e0
      <prefix>/opt/rh/%{scl}/root</prefix>
55a1e0
    </prefixes>
55a1e0
  </resolverSettings>
55a1e0
  <installerSettings>
55a1e0
    <metadataDir>opt/rh/%{scl}/root/usr/share/maven-fragments</metadataDir>
55a1e0
  </installerSettings>
55a1e0
  <repositories>
55a1e0
    <repository>
55a1e0
      <id>%{scl}-resolve</id>
55a1e0
      <type>compound</type>
55a1e0
      <properties>
55a1e0
        <prefix>opt/rh/%{scl}/root</prefix>
55a1e0
        <namespace>%{scl}</namespace>
55a1e0
      </properties>
55a1e0
      <configuration>
55a1e0
        <repositories>
55a1e0
          <repository>base-resolve</repository>
55a1e0
        </repositories>
55a1e0
      </configuration>
55a1e0
    </repository>
55a1e0
    <repository>
55a1e0
      <id>resolve-system</id>
55a1e0
      <type>compound</type>
55a1e0
      <properties>
55a1e0
        <prefix>/</prefix>
55a1e0
      </properties>
55a1e0
      <configuration>
55a1e0
        <repositories>
55a1e0
          <repository>%{scl}-resolve</repository>
55a1e0
          <repository>base-resolve</repository>
55a1e0
        </repositories>
55a1e0
      </configuration>
55a1e0
    </repository>
55a1e0
    <repository>
55a1e0
      <id>install</id>
55a1e0
      <type>compound</type>
55a1e0
      <properties>
55a1e0
        <prefix>opt/rh/%{scl}/root</prefix>
55a1e0
        <namespace>%{scl}</namespace>
55a1e0
      </properties>
55a1e0
      <configuration>
55a1e0
        <repositories>
55a1e0
          <repository>base-install</repository>
55a1e0
        </repositories>
55a1e0
      </configuration>
55a1e0
    </repository>
55a1e0
    <repository>
55a1e0
      <id>install-raw-pom</id>
55a1e0
      <type>compound</type>
55a1e0
      <properties>
55a1e0
        <prefix>opt/rh/%{scl}/root</prefix>
55a1e0
        <namespace>%{scl}</namespace>
55a1e0
      </properties>
55a1e0
      <configuration>
55a1e0
        <repositories>
55a1e0
          <repository>base-raw-pom</repository>
55a1e0
        </repositories>
55a1e0
      </configuration>
55a1e0
    </repository>
55a1e0
    <repository>
55a1e0
      <id>install-effective-pom</id>
55a1e0
      <type>compound</type>
55a1e0
      <properties>
55a1e0
        <prefix>opt/rh/%{scl}/root</prefix>
55a1e0
        <namespace>%{scl}</namespace>
55a1e0
      </properties>
55a1e0
      <configuration>
55a1e0
        <repositories>
55a1e0
          <repository>base-effective-pom</repository>
55a1e0
        </repositories>
55a1e0
      </configuration>
55a1e0
    </repository>
55a1e0
  </repositories>
55a1e0
</configuration>
55a1e0
EOF
55a1e0
55a1e0
%install
55a1e0
(%{scl_install})
55a1e0
55a1e0
mkdir -p %{buildroot}%{_scl_root}/etc/alternatives %{buildroot}%{_scl_root}/var/lib/alternatives
55a1e0
55a1e0
install -d -m 755 %{buildroot}%{_scl_scripts}
55a1e0
install -p -m 755 enable %{buildroot}%{_scl_scripts}/
55a1e0
55a1e0
install -d -m 755 %{buildroot}%{_scl_scripts}
55a1e0
install -p -m 755 sudo %{buildroot}%{_bindir}/
55a1e0
55a1e0
install -d -m 755 %{buildroot}%{_sysconfdir}/java
55a1e0
install -p -m 644 java.conf %{buildroot}%{_sysconfdir}/java/
55a1e0
55a1e0
install -d -m 755 %{buildroot}%{_sysconfdir}/ivy
55a1e0
install -p -m 644 ivysettings.xml %{buildroot}%{_sysconfdir}/ivy/
55a1e0
55a1e0
install -d -m 755 %{buildroot}%{_sysconfdir}/xdg/xmvn
55a1e0
install -p -m 644 configuration.xml %{buildroot}%{_sysconfdir}/xdg/xmvn/
55a1e0
55a1e0
%files
55a1e0
55a1e0
%files runtime
55a1e0
%scl_files
55a1e0
%attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) %{_sysconfdir}/selinux-equiv.created
55a1e0
%{_sysconfdir}/ivy
55a1e0
%{_sysconfdir}/java
55a1e0
%{_sysconfdir}/xdg/xmvn
55a1e0
%dir %{_scl_root}/etc/alternatives
55a1e0
55a1e0
%files build
55a1e0
%{_root_sysconfdir}/rpm/macros.%{scl}*
55a1e0
55a1e0
%files toolchain
55a1e0
55a1e0
%files ide
55a1e0
55a1e0
%files perftools
55a1e0
55a1e0
%post runtime
55a1e0
if [ ! -f %{_sysconfdir}/selinux-equiv.created ]; then
55a1e0
  /usr/sbin/semanage fcontext -a -e / %{_scl_root}
55a1e0
  restorecon -R %{_scl_root}
55a1e0
  touch %{_sysconfdir}/selinux-equiv.created
55a1e0
fi
55a1e0
55a1e0
%preun runtime
55a1e0
[ $1 = 0 ] && rm -f %{_sysconfdir}/selinux-equiv.created || :
55a1e0
55a1e0
%postun runtime
55a1e0
if [ $1 = 0 ]; then
55a1e0
  /usr/sbin/semanage fcontext -d %{_scl_root}
55a1e0
  [ -d %{_scl_root} ] && restorecon -R %{_scl_root} || :
55a1e0
fi
55a1e0
55a1e0
%changelog
55a1e0
* Wed Jun 04 2014 Marek Polacek <polacek@redhat.com> 3.0-15
55a1e0
- Drop the -vc subpackage (#1104342)
55a1e0
55a1e0
* Tue Jun 03 2014 Mat Booth <mat.booth@redhat.com> - 3.0-14
55a1e0
- Prevent premature command substitution (#1102796)
55a1e0
55a1e0
* Tue Jun 03 2014 Marek Polacek <polacek@redhat.com> 3.0-13
55a1e0
- Create alternatives directories (#1101246)
55a1e0
55a1e0
* Tue Jun 03 2014 Mat Booth <mat.booth@redhat.com> - 3.0-12
55a1e0
- Fix MANPATH variable (#1102741)
55a1e0
55a1e0
* Fri May 30 2014 Alexander Kurtakov <akurtako@redhat.com> 3.0-11
55a1e0
- Re enable mylyn-docs-epub.
55a1e0
55a1e0
* Tue May 27 2014 Alexander Kurtakov <akurtako@redhat.com> 3.0-10
55a1e0
- Comment mylyn-epub as the new version has huge dependency chain.
55a1e0
55a1e0
* Tue May 27 2014 Alexander Kurtakov <akurtako@redhat.com> 3.0-9
55a1e0
- Drop eclipse-xsd as it's no longer part of emf.
55a1e0
- Drop eclipse-rpmstubby as it's merged into rpm-editor.
55a1e0
55a1e0
* Wed May 21 2014 Mat Booth <mat.booth@redhat.com> - 3.0-8
55a1e0
- Revert ant_home fix temporarily
55a1e0
55a1e0
* Mon May 19 2014 Marek Polacek <polacek@redhat.com> 3.0-7
55a1e0
- Require ltrace (#1098247, #1098249)
55a1e0
- Properly set ANT_HOME (#1087654)
55a1e0
55a1e0
* Fri May 16 2014 Mat Booth <mat.booth@redhat.com> - 3.0-6
55a1e0
- Drop maven30 collection bits (we can use base OS maven on rhel7)
55a1e0
55a1e0
* Fri May 16 2014 Mat Booth <mat.booth@redhat.com> - 3.0-5
55a1e0
- Require newest version of scl-utils
55a1e0
55a1e0
* Fri May 16 2014 Mat Booth <mat.booth@redhat.com> - 3.0-4
55a1e0
- Conditionally enable maven30 collection
55a1e0
- Add maven scl macros for other packages to use
55a1e0
55a1e0
* Thu May 15 2014 Mat Booth <mat.booth@redhat.com> - 3.0-3
55a1e0
- Add collection-specific maven, java, ivy configuration
55a1e0
55a1e0
* Thu May 15 2014 Alexander Kurtakov <akurtako@redhat.com> 3.0-2
55a1e0
- Build subpackage should R: scl-utils.
55a1e0
55a1e0
* Tue Mar 4 2014 Marek Polacek <polacek@redhat.com> 3.0-1
55a1e0
- Initial package