BlockPlanet-old/util/install.sh

111 lines
2.7 KiB
Bash
Raw Permalink Normal View History

2012-05-01 15:20:19 -07:00
#!/bin/bash
#################################################
## ___ _ _ ___ _ _ ##
## | _ ) |___ __| |_| _ \ |__ _ _ _ ___| |_ ##
## | _ \ / _ \/ _| / / _/ / _` | ' \/ -_) _| ##
## |___/_\___/\__|_\_\_| |_\__,_|_||_\___|\__| ##
## ##
#################################################
# Copyright (c) MiJyn, Joel Leclerc <mijyn@mail.com>
#########################
## Installation Script ##
#########################
# Include utility script
. `readlink -f $0 | sed 's:\(.*\)/.*:\1/utility.sh:g'`
# Globals
VERSION=0.1
TARGET=`readlink -f "."`
NOTARGET=1
usage()
{
echo "BlockPlanet Installation Script"
echo "Usage: $0 [args]"
echo
displayhelp "-h" "Shows this help message" "-v" "Shows the version of this script" "-t TARGET" "Sets the target directory"
echo
echo "Copyright (c) MiJyn, Joel Leclerc <mijyn@mail.com>"
exit $1
}
version()
{
echo "BlockPlanet Installation Script version $VERSION"
exit $1
}
while getopts ":hvt:" opt
do
case $opt in
h) usage;;
v) version;;
t) TARGET=`readlink -f $OPTARG`;NOTARGET=0;;
2012-05-01 15:27:33 -07:00
\?) printe "Invalid option: $OPTARG"; usage 1;;
:) printe "Option requires an argument: $OPTARG"; usage 1;;
2012-05-01 15:20:19 -07:00
esac
done
if [ $NOTARGET -eq 1 ]
then
2012-05-01 15:27:33 -07:00
printe "FATAL: No target specified"
2012-05-01 15:20:19 -07:00
usage 1
fi
if [ -e $TARGET ]
then
2012-05-01 15:27:33 -07:00
printe "FATAL: Target already exists"
2012-05-01 15:20:19 -07:00
exit 1
fi
bboxes "BlockPlanet Installation Script"
echo
2012-05-02 12:16:23 -07:00
inst build-essential Essential_Build_Utilities libirrlicht-dev Irrlicht_Development_Files cmake CMake libbz2-dev BZ2_Development_Files libpng12-dev PNG_Development_Files libjpeg8-dev JPEG_Development_Files libxxf86vm-dev X11_Free86_Development_Files libgl1-mesa-dev GL_Development_Files libsqlite3-dev SQLite_Development_Files libogg-dev OGG_Development_Files libvorbis-dev Vorbis_Development_Files libopenal-dev OpenAL_Development_Files libcurl3 cURL_Library libcurl4-gnutls-dev cURL_Development_Files unzip Unzipper ncurses-bin Shell_NCurses
2012-05-01 15:20:19 -07:00
echo
2012-05-02 12:16:23 -07:00
echo "Downloading and extracting BlockPlanet Source"
export NOC=7
export NOCC=1
percent $NOC
rm -f /tmp/blockplanet.zip &> /dev/null
percentupd8 $NOC $NOCC
NOCC=$(($NOCC+1))
wget https://github.com/MiJyn/BlockPlanet/zipball/master -O /tmp/blockplanet.zip &> /dev/null
percentupd8 $NOC $NOCC
NOCC=$(($NOCC+1))
2012-05-01 15:20:19 -07:00
mkdir -p $TARGET &> /dev/null
2012-05-02 12:16:23 -07:00
percentupd8 $NOC $NOCC
NOCC=$(($NOCC+1))
cd $TARGET &> /dev/null
percentupd8 $NOC $NOCC
NOCC=$(($NOCC+1))
2012-05-01 15:20:19 -07:00
unzip /tmp/blockplanet.zip &> /dev/null
2012-05-02 12:16:23 -07:00
percentupd8 $NOC $NOCC
NOCC=$(($NOCC+1))
cd * &> /dev/null
percentfinish
2012-05-01 15:20:19 -07:00
echo
2012-05-02 12:16:23 -07:00
echo "Creating structure"
export NOC=4
export NOCC=1
percent $NOC
2012-05-01 15:20:19 -07:00
mkdir build
2012-05-02 12:16:23 -07:00
percentupd8 $NOC $NOCC
NOCC=$(($NOCC+1))
2012-05-01 15:20:19 -07:00
cd build
2012-05-02 12:16:23 -07:00
percentupd8 $NOC $NOCC
NOCC=$(($NOCC+1))
2012-05-01 15:20:19 -07:00
cmake .. && make
2012-05-02 12:16:23 -07:00
percentfinish
2012-05-01 15:20:19 -07:00
echo
echo "Installing BlockPlanet"
sudo make install
#EOF