#!/bin/bash

#
# install-dependencies-yum
#
# Copyright (C) 2009-12 by RStudio, Inc.
#
# Unless you have received this program directly from RStudio pursuant
# to the terms of a commercial license agreement with RStudio, then
# this program is licensed to you under the terms of version 3 of the
# GNU Affero General Public License. This program is distributed WITHOUT
# ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT,
# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the
# AGPL (http://www.gnu.org/licenses/agpl-3.0.txt) for more details.
#
#

set -e

# build/development tools
sudo yum install -y make
sudo yum install -y gcc
sudo yum install -y gcc-c++
sudo yum install -y cmake
sudo yum install -y rpmdevtools
sudo yum install -y wget

# core system libraries
sudo yum install -y libuuid-devel
sudo yum install -y openssl-devel
sudo yum install -y bzip2-devel
sudo yum install -y zlib-devel
sudo yum install -y pam-devel

# needed by Qt WebKit >= 5
sudo yum install -y gstreamer-devel
sudo yum install -y gstreamer-plugins-base-devel

# pandoc depenencies
sudo yum install -y libffi

# boost
sudo yum install -y boost-devel

# pango cairo
sudo yum install -y pango-devel

# gwt prereqs
sudo yum install -y java-1.6.0-openjdk 
sudo yum install -y ant
sudo yum install -y xml-commons-apis

# overlay
if [ -e install-overlay-yum ]
then
  ./install-overlay-yum
fi

# common
cd ../common
./install-common
cd ../linux

# desktop dependencies (qt)
if [ "$1" != "--exclude-qt-sdk" ]
then
   # install Qt 4.8 SDK (into a private /opt/RStudio-QtSDK directory so as to 
   # not conflict with any other installed versions of Qt on the system)
   ./install-qt-sdk
fi


