2010-03-28 04:04:44 +00:00
#!/bin/sh
2012-07-12 19:03:37 +00:00
#
2011-12-14 07:40:48 +00:00
# Use this script to install build dependencies on a number of Linux platforms
# ----------------------------------------------------------------------------
2012-07-12 19:03:37 +00:00
# Originally written by Mark Vejvoda <mark_vejvoda@hotmail.com>
# Rewritten by Tom Reynolds <tomreyn@megaglest.org>
# Copyright (c) 2012 Mark Vejvoda, Tom Reynolds under GNU GPL v3.0
2010-04-19 05:39:03 +00:00
2011-11-30 05:10:04 +00:00
2012-07-12 19:03:37 +00:00
LANG = C
2010-04-19 05:39:03 +00:00
2012-07-12 19:03:37 +00:00
# Got root?
if [ ` id -u` 'x' != '0x' ]
then
echo 'This script must be run as root (UID 0).' >& 2
exit 1
fi
# Do you have the 'svnversion' command?
if [ ` which svnversion` 'x' = 'x' ]
then
echo 'Could not find "svnversion", please make sure it is installed.' >& 2
exit 1
2010-06-07 05:32:41 +00:00
fi
2012-07-12 19:03:37 +00:00
svnversion = ` readlink -f $0 | xargs dirname | xargs svnversion`
architecture = ` uname -m`
# Is the lsb_release command supported?
if [ ` which lsb_release` 'x' = 'x' ]
then
lsb = 0
if [ -e /etc/debian_version ] ; then distribution = 'Debian' ; release = 'unknown release version' ; codename = ` cat /etc/debian_version` ; fi
if [ -e /etc/SuSE-release ] ; then distribution = 'SuSE' ; release = 'unknown release version' ; codename = ` cat /etc/SuSE-release` ; fi
if [ -e /etc/fedora-release ] ; then distribution = 'Fedora' ; release = 'unknown release version' ; codename = ` cat /etc/fedora-release` ; fi
if [ -e /etc/redhat-release ] ; then distribution = 'Redhat' ; release = 'unknown release version' ; codename = ` cat /etc/redhat-release` ; fi
if [ -e /etc/mandrake-release ] ; then distribution = 'Mandrake' ; release = 'unknown release version' ; codename = ` cat /etc/mandrake-release` ; fi
2010-04-19 05:39:03 +00:00
else
2012-07-12 19:03:37 +00:00
lsb = 1
# lsb_release output by example:
#
# $ lsb_release -i
# Distributor ID: Ubuntu
#
# $ lsb_release -d
# Description: Ubuntu 12.04 LTS
#
# $ lsb_release -r
# Release: 12.04
#
# $ lsb_release -c
# Codename: precise
distribution = ` lsb_release -i | awk -F':' '{ gsub(/^[ \t]*/,"",$2); print $2 }' `
release = ` lsb_release -r | awk -F':' '{ gsub(/^[ \t]*/,"",$2); print $2 }' `
codename = ` lsb_release -c | awk -F':' '{ gsub(/^[ \t]*/,"",$2); print $2 }' `
# Some distribution examples:
#
# OpenSuSE 11.4
#LSB Version: n/a
#Distributor ID: SUSE LINUX
#Description: openSUSE 11.4 (x86_64)
#Release: 11.4
#Codename: Celadon
#
2012-07-14 19:44:25 +00:00
# OpenSuSE 12.1
#LSB support: 1
#Distribution: SUSE LINUX
#Release: 12.1
#Codename: Asparagus
#
2012-07-12 19:03:37 +00:00
# Arch
#LSB Version: n/a
#Distributor ID: archlinux
#Description: Arch Linux
#Release: rolling
#Codename: n/a
#
# Ubuntu 12.04
#Distributor ID: Ubuntu
#Description: Ubuntu 12.04 LTS
#Release: 12.04
#Codename: precise
2010-04-19 05:39:03 +00:00
fi
2012-07-12 19:03:37 +00:00
echo 'We have detected the following system:'
echo ' [ ' " $distribution " ' ] [ ' " $release " ' ] [ ' " $codename " ' ] [ ' " $architecture " ' ]'
echo ''
echo 'On supported systems, we will now install build dependencies.'
echo ''
# Until this point you may cancel without any modifications applied
#exit 0
unsupported_distribution ( ) {
echo 'Unsupported Linux distribution.' >& 2
echo ''
echo 'Please report a bug at http://bugs.megaglest.org providing the following information:'
echo '--- snip ---'
echo 'SVN version: ' " $svnversion "
echo 'LSB support: ' " $lsb "
echo 'Distribution: ' " $distribution "
echo 'Release: ' " $release "
echo 'Codename: ' " $codename "
2013-05-15 03:18:31 +00:00
echo 'Architecture: ' " $architecture "
2012-07-12 19:03:37 +00:00
echo '--- snip ---'
echo ''
echo 'For now, you may want to take a look at the build hints on the MegaGlest wiki at http://wiki.megaglest.org/'
echo 'If you can come up with something which works for you, please report back to us, too. Thanks!'
}
unsupported_release ( ) {
2013-01-25 19:34:10 +00:00
echo 'Unsupported ' " $distribution " ' release.' >& 2
2012-07-12 19:03:37 +00:00
echo ''
echo 'Please report a bug at http://bugs.megaglest.org providing the following information:'
echo '--- snip ---'
echo 'SVN version: ' " $svnversion "
echo 'LSB support: ' " $lsb "
echo 'Distribution: ' " $distribution "
echo 'Release: ' " $release "
echo 'Codename: ' " $codename "
2013-05-15 03:18:31 +00:00
echo 'Architecture: ' " $architecture "
2012-07-12 19:03:37 +00:00
echo '--- snip ---'
echo ''
2013-01-25 19:34:10 +00:00
if [ " $installcommand " != '' ]
2012-07-12 19:03:37 +00:00
then
echo 'For now, please try this (which works with other ' " $distribution " ' releases) and report back how it works for you:'
2013-01-25 19:34:10 +00:00
echo $installcommand
2012-07-12 19:03:37 +00:00
echo 'Thanks!'
fi
}
error_during_installation ( ) {
echo 'An error occurred while installing build dependencies.' >& 2
echo ''
echo 'Please report a bugs at http://bugs.megaglest.org providing the following information:'
echo '--- snip ---'
echo 'SVN version: ' " $svnversion "
echo 'LSB support: ' " $lsb "
echo 'Distribution: ' " $distribution "
echo 'Release: ' " $release "
echo 'Codename: ' " $codename "
2013-05-15 03:18:31 +00:00
echo 'Architecture: ' " $architecture "
2012-07-12 19:03:37 +00:00
echo '--- snip ---'
echo ''
echo 'For now, you may want to take a look at the build hints on the MegaGlest wiki at http://wiki.megaglest.org/'
echo 'If you can come up with something which works for you, please report back to us, too. Thanks!'
}
case $distribution in
Debian)
case $release in
2013-06-21 14:44:53 +00:00
6.0*| unstable)
2012-07-14 19:44:25 +00:00
# No libvlc-dev since version (1.1.3) in Debian 6.0/Squeeze is incompatible, no libluajit-5.1-dev because it is not available on Debian 6.0/Squeeze, cf. http://glest.org/glest_board/?topic=8460
2013-04-30 01:27:14 +00:00
installcommand = 'apt-get install build-essential subversion automake autoconf autogen cmake libsdl1.2-dev libxerces-c2-dev libalut-dev libgl1-mesa-dev libglu1-mesa-dev libvorbis-dev libwxbase2.8-dev libwxgtk2.8-dev libx11-dev liblua5.1-0-dev libjpeg-dev libpng12-dev libcurl4-gnutls-dev libxml2-dev libircclient-dev libglew-dev libftgl-dev libfribidi-dev libminiupnpc-dev librtmp-dev libgtk2.0-dev libcppunit-dev'
2013-01-25 19:34:10 +00:00
$installcommand
2012-09-25 22:29:24 +00:00
if [ $? != 0 ] ; then
error_during_installation;
echo ''
echo 'Be sure to have the squeeze-backports repository installed, it is required for libminiupnpc-dev.'
exit 1;
fi
2012-07-12 19:03:37 +00:00
; ;
*)
2013-05-15 03:18:31 +00:00
installcommand = 'apt-get install build-essential subversion automake autoconf autogen cmake libsdl1.2-dev libxerces-c2-dev libalut-dev libgl1-mesa-dev libglu1-mesa-dev libvorbis-dev libwxbase2.8-dev libwxgtk2.8-dev libx11-dev liblua5.1-0-dev libjpeg-dev libpng12-dev libcurl4-gnutls-dev libxml2-dev libircclient-dev libglew-dev libftgl-dev libfribidi-dev libvlc-dev libminiupnpc-dev librtmp-dev libgtk2.0-dev libcppunit-dev'
2012-07-12 19:03:37 +00:00
unsupported_release
exit 1
; ;
esac
; ;
Ubuntu)
case $release in
8.04)
2013-04-30 01:27:14 +00:00
installcommand = 'apt-get install build-essential subversion automake autoconf autogen cmake libsdl1.2-dev libxerces-c2-dev libalut-dev libgl1-mesa-dev libglu1-mesa-dev libvorbis-dev libwxbase2.8-dev libwxgtk2.8-dev libx11-dev liblua5.1-0-dev libjpeg-dev libpng12-dev libcurl4-gnutls-dev libxml2-dev libircclient-dev libglew-dev libftgl-dev libfribidi-dev libcppunit-dev'
2013-01-25 19:34:10 +00:00
$installcommand
2012-07-12 19:03:37 +00:00
if [ $? != 0 ] ; then error_during_installation; exit 1; fi
; ;
2012-07-18 18:36:03 +00:00
10.04)
2013-04-30 01:27:14 +00:00
installcommand = 'apt-get install build-essential subversion automake autoconf autogen cmake libsdl1.2-dev libxerces-c2-dev libalut-dev libgl1-mesa-dev libglu1-mesa-dev libvorbis-dev libwxbase2.8-dev libwxgtk2.8-dev libx11-dev liblua5.1-0-dev libjpeg-dev libpng12-dev libcurl4-gnutls-dev libxml2-dev libircclient-dev libglew1.5-dev libftgl-dev libfribidi-dev libcppunit-dev'
2013-01-25 19:34:10 +00:00
$installcommand
2012-07-18 18:36:03 +00:00
if [ $? != 0 ] ; then error_during_installation; exit 1; fi
; ;
2013-05-02 00:14:19 +00:00
11.10| 12.04| 12.10| 13.04)
2013-04-30 01:27:14 +00:00
installcommand = 'apt-get install build-essential subversion automake autoconf autogen cmake libsdl1.2-dev libxerces-c2-dev libalut-dev libgl1-mesa-dev libglu1-mesa-dev libvorbis-dev libwxbase2.8-dev libwxgtk2.8-dev libx11-dev liblua5.1-0-dev libjpeg-dev libpng12-dev libcurl4-gnutls-dev libxml2-dev libircclient-dev libglew-dev libftgl-dev libfribidi-dev libvlc-dev libcppunit-dev'
2013-01-25 19:34:10 +00:00
$installcommand
2012-07-12 19:03:37 +00:00
if [ $? != 0 ] ; then error_during_installation; exit 1; fi
; ;
*)
2013-04-30 01:27:14 +00:00
installcommand = 'apt-get install build-essential subversion automake autoconf autogen cmake libsdl1.2-dev libxerces-c2-dev libalut-dev libgl1-mesa-dev libglu1-mesa-dev libvorbis-dev libwxbase2.8-dev libwxgtk2.8-dev libx11-dev liblua5.1-0-dev libjpeg-dev libpng12-dev libcurl4-gnutls-dev libxml2-dev libircclient-dev libglew-dev libftgl-dev libfribidi-dev libvlc-dev libcppunit-dev'
2012-07-12 19:03:37 +00:00
unsupported_release
exit 1
; ;
esac
; ;
2012-10-31 14:50:23 +00:00
LinuxMint)
case $release in
2013-01-25 19:34:10 +00:00
13| 14)
2013-04-30 01:27:14 +00:00
installcommand = 'apt-get install build-essential subversion automake autoconf autogen cmake libsdl1.2-dev libxerces-c2-dev libalut-dev libgl1-mesa-dev libglu1-mesa-dev libvorbis-dev libwxbase2.8-dev libwxgtk2.8-dev libx11-dev liblua5.1-0-dev libjpeg-dev libpng12-dev libcurl4-gnutls-dev libxml2-dev libircclient-dev libglew-dev libftgl-dev libfribidi-dev libvlc-dev libcppunit-dev'
2013-01-25 19:34:10 +00:00
$installcommand
2012-10-31 14:50:23 +00:00
if [ $? != 0 ] ; then error_during_installation; exit 1; fi
; ;
*)
2013-04-30 01:27:14 +00:00
installcommand = 'apt-get install build-essential subversion automake autoconf autogen cmake libsdl1.2-dev libxerces-c2-dev libalut-dev libgl1-mesa-dev libglu1-mesa-dev libvorbis-dev libwxbase2.8-dev libwxgtk2.8-dev libx11-dev liblua5.1-0-dev libjpeg-dev libpng12-dev libcurl4-gnutls-dev libxml2-dev libircclient-dev libglew-dev libftgl-dev libfribidi-dev libvlc-dev libcppunit-dev'
2012-10-31 14:50:23 +00:00
unsupported_release
exit 1
; ;
esac
; ;
2013-01-07 15:37:48 +00:00
SuSE| SUSE?LINUX| Opensuse)
2012-07-12 19:03:37 +00:00
case $release in
2013-03-05 19:31:09 +00:00
11.2| 11.3| 11.4| 12.1)
2013-04-30 01:27:14 +00:00
installcommand = 'zypper install subversion gcc gcc-c++ automake cmake libSDL-devel libxerces-c-devel MesaGLw-devel freeglut-devel libvorbis-devel wxGTK-devel lua-devel libjpeg-devel libpng14-devel libcurl-devel openal-soft-devel xorg-x11-libX11-devel libxml2-devel libircclient-devel glew-devel ftgl-devel fribidi-devel cppunit-devel'
2013-01-25 19:34:10 +00:00
$installcommand
2012-07-12 19:03:37 +00:00
if [ $? != 0 ] ; then error_during_installation; exit 1; fi
; ;
2013-03-05 19:31:09 +00:00
12.2)
2013-04-30 01:27:14 +00:00
installcommand = 'zypper install subversion gcc gcc-c++ automake cmake libSDL-devel libxerces-c-devel Mesa-libGL-devel freeglut-devel libvorbis-devel wxGTK-devel lua-devel libjpeg-devel libpng14-devel libcurl-devel openal-soft-devel xorg-x11-libX11-devel libxml2-devel libircclient-devel glew-devel ftgl-devel fribidi-devel cppunit-devel'
2013-03-05 19:31:09 +00:00
$installcommand
if [ $? != 0 ] ; then error_during_installation; exit 1; fi
; ;
*)
2013-04-30 01:27:14 +00:00
installcommand = 'zypper install subversion gcc gcc-c++ automake cmake libSDL-devel libxerces-c-devel Mesa-libGL-devel freeglut-devel libvorbis-devel wxGTK-devel lua-devel libjpeg-devel libpng14-devel libcurl-devel openal-soft-devel xorg-x11-libX11-devel libxml2-devel libircclient-devel glew-devel ftgl-devel fribidi-devel cppunit-devel'
2012-07-12 19:03:37 +00:00
unsupported_release
exit 1
; ;
esac
; ;
Fedora)
case $release in
13| 14)
2013-04-30 01:27:14 +00:00
installcommand = 'yum groupinstall "Development Tools"; yum install subversion automake autoconf autogen cmake SDL-devel xerces-c-devel mesa-libGL-devel mesa-libGLU-devel libvorbis-devel wxBase wxGTK-devel lua-devel libjpeg-devel libpng-devel libcurl-devel openal-soft-devel libX11-devel libxml2-dev libircclient-dev glew-devel ftgl-devel fribidi-devel cppunit-devel'
2013-01-25 19:34:10 +00:00
$installcommand
if [ $? != 0 ] ; then error_during_installation; exit 1; fi
2012-07-12 19:03:37 +00:00
; ;
*)
2013-04-30 01:27:14 +00:00
installcommand = 'yum groupinstall "Development Tools"; yum install subversion automake autoconf autogen cmake SDL-devel xerces-c-devel mesa-libGL-devel mesa-libGLU-devel libvorbis-devel wxBase wxGTK-devel lua-devel libjpeg-devel libpng-devel libcurl-devel openal-soft-devel libX11-devel libxml2-dev libircclient-dev glew-devel ftgl-devel fribidi-devel cppunit-devel'
2012-07-12 19:03:37 +00:00
unsupported_release
exit 1
; ;
esac
; ;
2012-07-14 19:44:25 +00:00
archlinux)
case $release in
rolling)
unsupported_release
exit 1
; ;
esac
; ;
2012-07-12 19:03:37 +00:00
# Redhat)
#
# ;;
#
# Mandrake|Mandriva)
#
# ;;
*)
unsupported_distribution
exit 1
; ;
esac
echo ''
echo 'Installation of build dependencies complete.'