- Adding support for Ubuntu: Curl dependencies added

- Adding support when several WoW clients path are detected. Only the first one is selected
- Adding support for database updates. Only last folder (alphabetically sorted) will be takenxw
This commit is contained in:
Warkdev 2017-03-06 21:20:34 +01:00 committed by Antz
parent 1ff6c40b0d
commit c754186127

View File

@ -158,31 +158,31 @@ function GetPrerequisites()
case ${VER} in case ${VER} in
"sarah") "sarah")
# Linux Mint 18 - Ubuntu Xenial based # Linux Mint 18 - Ubuntu Xenial based
su -c "aptitude -y install build-essential linux-headers-$(uname -r) autoconf automake cmake libbz2-dev libace-dev libace-6.3.3 libssl-dev libmysqlclient-dev libtool zlib1g-dev" root su -c "aptitude -y install curl build-essential linux-headers-$(uname -r) autoconf automake cmake libbz2-dev libace-dev libace-6.3.3 libssl-dev libmysqlclient-dev libtool zlib1g-dev" root
;; ;;
"rosa") "rosa")
# Linux Mint 17.3 - Ubuntu Trusty based # Linux Mint 17.3 - Ubuntu Trusty based
su -c "apt-get -y install build-essential linux-headers-$(uname -r) autoconf automake cmake libbz2-dev libace-dev libace-6.0.3 libssl-dev libmysqlclient-dev libtool zlib1g-dev" root su -c "apt-get -y install curl build-essential linux-headers-$(uname -r) autoconf automake cmake libbz2-dev libace-dev libace-6.0.3 libssl-dev libmysqlclient-dev libtool zlib1g-dev" root
;; ;;
"rafaela") "rafaela")
# Linux Mint 17.2 - Ubuntu Trusty based # Linux Mint 17.2 - Ubuntu Trusty based
su -c "apt-get -y install build-essential linux-headers-$(uname -r) autoconf automake cmake libbz2-dev libace-dev libace-6.0.3 libssl-dev libmysqlclient-dev libtool zlib1g-dev" root su -c "apt-get -y install curl build-essential linux-headers-$(uname -r) autoconf automake cmake libbz2-dev libace-dev libace-6.0.3 libssl-dev libmysqlclient-dev libtool zlib1g-dev" root
;; ;;
"rebecca") "rebecca")
# Linux Mint 17.1 - Ubuntu Trusty based # Linux Mint 17.1 - Ubuntu Trusty based
su -c "apt-get -y install build-essential linux-headers-$(uname -r) autoconf automake cmake libbz2-dev libace-dev libace-6.0.3 libssl-dev libmysqlclient-dev libtool zlib1g-dev" root su -c "apt-get -y install curl build-essential linux-headers-$(uname -r) autoconf automake cmake libbz2-dev libace-dev libace-6.0.3 libssl-dev libmysqlclient-dev libtool zlib1g-dev" root
;; ;;
"qiana") "qiana")
# Linux Mint 17 - Ubuntu Trusty based # Linux Mint 17 - Ubuntu Trusty based
su -c "apt-get -y install build-essential linux-headers-$(uname -r) autoconf automake cmake libbz2-dev libace-dev libace-6.0.3 libssl-dev libmysqlclient-dev libtool zlib1g-dev" root su -c "apt-get -y install curl build-essential linux-headers-$(uname -r) autoconf automake cmake libbz2-dev libace-dev libace-6.0.3 libssl-dev libmysqlclient-dev libtool zlib1g-dev" root
;; ;;
"maya") "maya")
# Linux Mint 13 - Ubuntu Precise based # Linux Mint 13 - Ubuntu Precise based
su -c "apt-get -y install build-essential linux-headers-$(uname -r) autoconf automake cmake libbz2-dev libace-dev libace-6.0.1 libssl-dev libmysqlclient-dev libtool zlib1g-dev" root su -c "apt-get -y install curl build-essential linux-headers-$(uname -r) autoconf automake cmake libbz2-dev libace-dev libace-6.0.1 libssl-dev libmysqlclient-dev libtool zlib1g-dev" root
;; ;;
"betsy") "betsy")
# LMDE 2 - Debian Jessie based # LMDE 2 - Debian Jessie based
su -c "aptitude -y install build-essential linux-headers-$(uname -r) autoconf automake cmake libbz2-dev libace-dev libace-6.2.8 libssl-dev libmysqlclient-dev libtool zliblg-dev" root su -c "aptitude -y install curl build-essential linux-headers-$(uname -r) autoconf automake cmake libbz2-dev libace-dev libace-6.2.8 libssl-dev libmysqlclient-dev libtool zliblg-dev" root
;; ;;
*) *)
OS_VER=0 OS_VER=0
@ -193,35 +193,35 @@ function GetPrerequisites()
case ${VER} in case ${VER} in
"precise") "precise")
# Ubuntu 12.04 LTS # Ubuntu 12.04 LTS
su -c "apt-get -y install build-essential linux-headers-$(uname -r) autoconf automake cmake libbz2-dev libace-dev libace-6.0.1 libssl-dev libmysqlclient-dev libtool zlib1g-dev" root su -c "apt-get -y install curl build-essential linux-headers-$(uname -r) autoconf automake cmake libbz2-dev libace-dev libace-6.0.1 libssl-dev libmysqlclient-dev libtool zlib1g-dev" root
;; ;;
"trusty") "trusty")
# Ubuntu 14.04 LTS # Ubuntu 14.04 LTS
su -c "apt-get -y install build-essential linux-headers-$(uname -r) autoconf automake cmake libbz2-dev libace-dev libace-6.0.3 libssl-dev libmysqlclient-dev libtool zlib1g-dev" root su -c "apt-get -y install curl build-essential linux-headers-$(uname -r) autoconf automake cmake libbz2-dev libace-dev libace-6.0.3 libssl-dev libmysqlclient-dev libtool zlib1g-dev" root
;; ;;
"xenial") "xenial")
# Ubuntu 16.04 LTS # Ubuntu 16.04 LTS
su -c "apt-get -y install build-essential linux-headers-$(uname -r) autoconf automake cmake libbz2-dev libace-dev libace-6.3.3 libssl-dev libmysqlclient-dev libtool zlib1g-dev" root su -c "apt-get -y install curl build-essential linux-headers-$(uname -r) autoconf automake cmake libbz2-dev libace-dev libace-6.3.3 libssl-dev libmysqlclient-dev libtool zlib1g-dev" root
;; ;;
"yakkety") "yakkety")
# Ubuntu 16.10 # Ubuntu 16.10
su -c "apt-get -y install build-essential linux-headers-$(uname -r) autoconf automake cmake libbz2-dev libace-dev libace-6.3.3 libssl-dev libmysqlclient-dev libtool zlib1g-dev" root su -c "apt-get -y install curl build-essential linux-headers-$(uname -r) autoconf automake cmake libbz2-dev libace-dev libace-6.3.3 libssl-dev libmysqlclient-dev libtool zlib1g-dev" root
;; ;;
*) *)
OS_VER=0 OS_VER=0
;; ;;
esac esac
su -c "aptitude -y install build-essential linux-headers-$(uname -r) autoconf automake cmake libbz2-dev libace-dev libace-6.3.3 libssl-dev libmysqlclient-dev libtool zlib1g-dev" root su -c "aptitude -y install curl build-essential linux-headers-$(uname -r) autoconf automake cmake libbz2-dev libace-dev libace-6.3.3 libssl-dev libmysqlclient-dev libtool zlib1g-dev" root
;; ;;
"Debian") "Debian")
case ${VER} in case ${VER} in
"jessie") "jessie")
# Debian 8.0 "current" # Debian 8.0 "current"
su -c "aptitude -y install build-essential linux-headers-$(uname -r) autoconf automake cmake libbz2-dev libace-dev libace-6.2.8 libssl-dev libmysqlclient-dev libtool zliblg-dev" root su -c "aptitude -y install curl build-essential linux-headers-$(uname -r) autoconf automake cmake libbz2-dev libace-dev libace-6.2.8 libssl-dev libmysqlclient-dev libtool zliblg-dev" root
;; ;;
"stretch") "stretch")
# Debian Next # Debian Next
su -c "aptitude -y install build-essential linux-headers-$(uname -r) autoconf automake cmake libbz2-dev libace-dev libace-6.3.3 libssl-dev libmysqlclient-dev libtool zliblg-dev" root su -c "aptitude -y install curl build-essential linux-headers-$(uname -r) autoconf automake cmake libbz2-dev libace-dev libace-6.3.3 libssl-dev libmysqlclient-dev libtool zliblg-dev" root
;; ;;
*) *)
OS_VER=0 OS_VER=0
@ -232,11 +232,11 @@ function GetPrerequisites()
case ${VER} in case ${VER} in
"santiago") "santiago")
# Red Hat 6.x # Red Hat 6.x
su -c "yum -y install build-essential linux-headers-$(uname -r) autoconf automake cmake libbz2-dev libace-dev libace-6.2.8 libssl-dev libmysqlclient-dev libtool zliblg-dev" root su -c "yum -y install curl build-essential linux-headers-$(uname -r) autoconf automake cmake libbz2-dev libace-dev libace-6.2.8 libssl-dev libmysqlclient-dev libtool zliblg-dev" root
;; ;;
"maipo") "maipo")
# Red Hat 7.x # Red Hat 7.x
su -c "yum -y install build-essential linux-headers-$(uname -r) autoconf automake cmake libbz2-dev libace-dev libace-6.3.3 libssl-dev libmysqlclient-dev libtool zliblg-dev" root su -c "yum -y install curl build-essential linux-headers-$(uname -r) autoconf automake cmake libbz2-dev libace-dev libace-6.3.3 libssl-dev libmysqlclient-dev libtool zliblg-dev" root
;; ;;
*) *)
OS_VER=0 OS_VER=0
@ -824,7 +824,7 @@ function UpdateDatabases()
local DB_TOONS="$6" local DB_TOONS="$6"
# Loop through the character files # Loop through the character files
for pFile in $(ls $SRCPATH/database/Character/Updates/*.sql); do for pFile in $(ls $SRCPATH/database/Character/Updates/$(ls -a $SRCPATH/database/Character/Updates/ | tail -1)/*.sql); do
if [ ! -f "$pFile" ]; then if [ ! -f "$pFile" ]; then
continue continue
fi fi
@ -840,7 +840,7 @@ function UpdateDatabases()
done done
# Loop through the realm files # Loop through the realm files
for pFile in $(ls $SRCPATH/database/Realm/Updates/*.sql); do for pFile in $(ls $SRCPATH/database/Realm/Updates/$(ls -a $SRCPATH/database/Realm/Updates/ | tail -1)/*.sql); do
if [ ! -f "$pFile" ]; then if [ ! -f "$pFile" ]; then
continue continue
fi fi
@ -856,7 +856,7 @@ function UpdateDatabases()
done done
# Loop through the world files # Loop through the world files
for pFile in $(ls $SRCPATH/database/World/Updates/*.sql); do for pFile in $(ls $SRCPATH/database/World/Updates/$(ls -a $SRCPATH/database/World/Updates/ | tail -1)/*.sql); do
if [ ! -f "$pFile" ]; then if [ ! -f "$pFile" ]; then
continue continue
fi fi
@ -1086,7 +1086,7 @@ function HandleDatabases()
# Function helper to extract resources (mmaps, vmaps, dbc, ...) from the game # Function helper to extract resources (mmaps, vmaps, dbc, ...) from the game
function ExtractResources function ExtractResources
{ {
INSTGAMEPATH=$(dirname $(find /home -name "WoW.exe" 2>>/dev/null)) INSTGAMEPATH=$(dirname $(find /home -name "WoW.exe"| head -1 2>>/dev/null))
GAMEPATH=$($DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "WoW Game Path" \ GAMEPATH=$($DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "WoW Game Path" \
--inputbox "Please, provide the path to your game directory. Default: $INSTGAMEPATH" 8 60 3>&2 2>&1 1>&3) --inputbox "Please, provide the path to your game directory. Default: $INSTGAMEPATH" 8 60 3>&2 2>&1 1>&3)
@ -1111,7 +1111,8 @@ function ExtractResources
Log "The mangos server is not build, cannot extract data" 1 Log "The mangos server is not build, cannot extract data" 1
exit 1 exit 1
fi fi
#TODO What if DBC are not yet generated ??
if [[ $ACTIONS == *1* ]]; then if [[ $ACTIONS == *1* ]]; then
if [ -d "$GAMEPATH/dbc" ]; then if [ -d "$GAMEPATH/dbc" ]; then
$DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "DBC and Maps were already generated" \ $DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "DBC and Maps were already generated" \
@ -1151,9 +1152,30 @@ function ExtractResources
cp -R "$GAMEPATH/dbc" "$INSTPATH/bin" cp -R "$GAMEPATH/dbc" "$INSTPATH/bin"
cp -R "$GAMEPATH/maps" "$INSTPATH/bin" cp -R "$GAMEPATH/maps" "$INSTPATH/bin"
fi fi
else
rm -rf $GAMEPATH/map-extractor
cp "$INSTPATH/bin/tools/map-extractor" "$GAMEPATH"
Log "Extracting DBC and Maps" 0
cd $GAMEPATH
./map-extractor
if [ $? -eq 0 ]; then
Log "DBC and Maps are extracted" 0
Log "Copying DBC and Maps files to installation directory" 0
cp -R "$GAMEPATH/dbc" "$INSTPATH/bin"
cp -R "$GAMEPATH/maps" "$INSTPATH/bin"
rm -rf "$GAMEPATH/map-extractor"
Log "Changing ownership of the extracted directories"
chown -R $USER:$USER "$INSTPATH"
else
Log "There was an issue while extracting DBC and Maps!" 1
rm -rf "$GAMEPATH/map-extractor"
rm -rf "$GAMEPATH/dbc"
rm -rf "$GAMEPATH/maps"
exit 1
fi
fi fi
fi fi
if [[ $ACTIONS == *2* ]]; then if [[ $ACTIONS == *2* ]]; then
@ -1192,6 +1214,30 @@ function ExtractResources
Log "Copying VMaps files to installation directory" 0 Log "Copying VMaps files to installation directory" 0
cp -R "$GAMEPATH/vmaps" "$INSTPATH/bin" cp -R "$GAMEPATH/vmaps" "$INSTPATH/bin"
fi fi
else
Log "Copying VMaps extractor" 0
rm -f "$GAMEPATH/vmap-extractor"
cp "$INSTPATH/bin/tools/vmap-extractor" "$GAMEPATH"
Log "Extracting VMaps" 0
cd $GAMEPATH
# Make sure there is no previous vmaps generation that cause issue.
rm -rf Buildings
./vmap-extractor
if [ $? -eq 0 ]; then
Log "VMaps are extracted" 0
Log "Copying VMaps files to installation directory" 0
cp -R "$GAMEPATH/vmaps" "$INSTPATH/bin"
rm -rf "$GAMEPATH/vmap-extractor"
Log "Changing ownership of the extracted directories"
chown -R $USER:$USER "$INSTPATH"
else
Log "There was an issue while extracting VMaps!" 1
rm -rf "$GAMEPATH/vmap-extractor"
rm -rf "$GAMEPATH/vmaps"
exit 1
fi
fi fi
fi fi
@ -1265,6 +1311,57 @@ function ExtractResources
Log "Copying MMaps files to installation directory" 0 Log "Copying MMaps files to installation directory" 0
cp -R "$GAMEPATH/mmaps" "$INSTPATH/bin" cp -R "$GAMEPATH/mmaps" "$INSTPATH/bin"
fi fi
else
Log "Copying MMaps extractor" 0
rm -f "$GAMEPATH/MoveMapGen.sh"
cp "$INSTPATH/bin/tools/MoveMapGen.sh" "$GAMEPATH"
cp "$INSTPATH/bin/tools/offmesh.txt" "$GAMEPATH"
cp "$INSTPATH/bin/tools/mmap_excluded.txt" "$GAMEPATH"
cp "$INSTPATH/bin/tools/movemap-generator" "$GAMEPATH"
CPU=$($DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "Please provide the number of CPU to be used to generate MMaps (1-4)" \
--inputbox "Default: 1" 8 80 3>&2 2>&1 1>&3)
# User cancelled his choice, set default to 1.
if [ $? -ne 0 ]; then
Log "User selection was cancelled. Max CPU set to 1." 1
CPU=1
fi
if [ -z "$CPU" ]; then
Log "User didn't gave any value. Max CPU set to 1." 1
CPU=1
fi
if [ "$CPU" -lt 1 ] || [ "$CPU" -gt 4 ]; then
Log "User entered invalid value. Max CPU set to 1." 1
CPU=1
fi
Log "Extracting MMaps" 0
cd $GAMEPATH
# Making sure we can execute the script
chmod 700 MoveMapGen.sh
./MoveMapGen.sh $CPU
if [ $? -eq 0 ]; then
Log "MMaps are extracted" 0
Log "Copying MMaps files to installation directory" 0
cp -R "$GAMEPATH/mmaps" "$INSTPATH/bin"
rm -rf "$GAMEPATH/MoveMapGen.sh"
rm -rf "$GAMEPATH/offmesh.txt"
rm -rf "$GAMEPATH/mmap_excluded.txt"
rm -rf "$GAMEPATH/movemap-generator"
Log "Changing ownership of the extracted directories"
chown -R $USER:$USER "$INSTPATH"
else
Log "There was an issue while extracting MMaps!" 1
rm -rf "$GAMEPATH/MoveMapGen.sh"
rm -rf "$GAMEPATH/mmaps"
rm -rf "$GAMEPATH/offmesh.txt"
rm -rf "$GAMEPATH/mmap_excluded.txt"
rm -rf "$GAMEPATH/movemap-generator"
exit 1
fi
fi fi
fi fi
} }