mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 09:17:18 +00:00
Directory Structure [step 1]: moving files
working on #672 NOTE: This commit can't be compiled!!
This commit is contained in:
117
apps/installer/includes/functions.sh
Normal file
117
apps/installer/includes/functions.sh
Normal file
@@ -0,0 +1,117 @@
|
||||
function inst_configureOS() {
|
||||
echo "Platform: $OSTYPE"
|
||||
case "$OSTYPE" in
|
||||
solaris*) echo "Solaris is not supported yet" ;;
|
||||
darwin*) source "$AC_PATH_INSTALLER/includes/os_configs/osx.sh" ;;
|
||||
linux*)
|
||||
# If available, use LSB to identify distribution
|
||||
if [ -f /etc/lsb-release -o -d /etc/lsb-release.d ]; then
|
||||
DISTRO=$(lsb_release -i | cut -d: -f2 | sed s/'^\t'//)
|
||||
# Otherwise, use release info file
|
||||
else
|
||||
DISTRO=$(ls -d /etc/[A-Za-z]*[_-][rv]e[lr]* | grep -v "lsb" | cut -d'/' -f3 | cut -d'-' -f1 | cut -d'_' -f1)
|
||||
fi
|
||||
|
||||
DISTRO=${DISTRO,,}
|
||||
|
||||
# TODO: implement different configurations by distro
|
||||
source "$AC_PATH_INSTALLER/includes/os_configs/$DISTRO.sh"
|
||||
;;
|
||||
bsd*) echo "BSD is not supported yet" ;;
|
||||
msys*) source "$AC_PATH_INSTALLER/includes/os_configs/windows.sh" ;;
|
||||
*) echo "This platform is not supported" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
function inst_updateRepo() {
|
||||
cd "$AC_PATH_ROOT"
|
||||
git pull origin $(git rev-parse --abbrev-ref HEAD)
|
||||
}
|
||||
|
||||
function inst_resetRepo() {
|
||||
cd "$AC_PATH_ROOT"
|
||||
git reset --hard $(git rev-parse --abbrev-ref HEAD)
|
||||
git clean -f
|
||||
}
|
||||
|
||||
function inst_compile() {
|
||||
comp_configure
|
||||
comp_build
|
||||
}
|
||||
|
||||
function inst_cleanCompile() {
|
||||
comp_clean
|
||||
inst_compile
|
||||
}
|
||||
|
||||
function inst_assembleDb {
|
||||
dbasm_import true true true
|
||||
}
|
||||
|
||||
function inst_allInOne() {
|
||||
inst_configureOS
|
||||
inst_updateRepo
|
||||
inst_compile
|
||||
inst_assembleDb
|
||||
}
|
||||
|
||||
function inst_module_search {
|
||||
search=""
|
||||
if [ -z "$1" ]; then
|
||||
echo "Type what to search or leave blank for full list"
|
||||
read -p "Insert name: " res
|
||||
|
||||
search="+$res"
|
||||
fi
|
||||
echo "Searching ..."
|
||||
echo "";
|
||||
|
||||
for i in `curl -s "https://api.github.com/search/repositories?q=org%3Aazerothcore${search}+fork%3Atrue+topic%3Acore-module+sort%3Astars&type=" | grep \"name\" | cut -d ':' -f 2-3|tr -d '",'`; do
|
||||
echo "-> $i";
|
||||
done
|
||||
|
||||
echo "";
|
||||
echo "";
|
||||
}
|
||||
|
||||
function inst_module_install {
|
||||
if [ -z "$1" ]; then
|
||||
echo "Type the name of the module to install"
|
||||
read -p "Insert name: " res
|
||||
fi
|
||||
|
||||
git clone "https://github.com/azerothcore/$res" "$AC_PATH_ROOT/modules/$res" && echo "Done, please re-run compiling and db assembly. Read instruction on module repository for more information"
|
||||
|
||||
echo "";
|
||||
echo "";
|
||||
}
|
||||
|
||||
function inst_module_update {
|
||||
if [ -z "$1" ]; then
|
||||
echo "Type the name of the module to update"
|
||||
read -p "Insert name: " res
|
||||
fi
|
||||
|
||||
cd "$AC_PATH_ROOT/modules/$res"
|
||||
|
||||
#git reset --hard master
|
||||
#git clean -f
|
||||
git pull origin master && echo "Done"
|
||||
|
||||
cd "../../"
|
||||
|
||||
echo "";
|
||||
echo "";
|
||||
}
|
||||
|
||||
function inst_module_remove {
|
||||
if [ -z "$1" ]; then
|
||||
echo "Type the name of the module to remove"
|
||||
read -p "Insert name: " res
|
||||
fi
|
||||
|
||||
rm -rf "$AC_PATH_ROOT/modules/$res" && echo "Done"
|
||||
|
||||
echo "";
|
||||
echo "";
|
||||
}
|
||||
14
apps/installer/includes/includes.sh
Normal file
14
apps/installer/includes/includes.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
CURRENT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
source "$CURRENT_PATH/../../bash_shared/includes.sh"
|
||||
|
||||
AC_PATH_INSTALLER="$AC_PATH_BIN/installer"
|
||||
|
||||
if [ -f "$AC_PATH_INSTALLER/config.sh" ]; then
|
||||
source "$AC_PATH_INSTALLER/config.sh" # should overwrite previous
|
||||
fi
|
||||
|
||||
source "$AC_PATH_BIN/compiler/includes/includes.sh"
|
||||
source "$AC_PATH_BIN/db_assembler/includes/includes.sh"
|
||||
|
||||
source "$AC_PATH_INSTALLER/includes/functions.sh"
|
||||
5
apps/installer/includes/os_configs/debian.sh
Normal file
5
apps/installer/includes/os_configs/debian.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
|
||||
sudo apt-get install -y git cmake make gcc g++ clang libmysqlclient-dev \
|
||||
libssl1.0-dev libbz2-dev libreadline-dev libncurses-dev \
|
||||
mysql-server libace-6.* libace-dev
|
||||
6
apps/installer/includes/os_configs/osx.sh
Normal file
6
apps/installer/includes/os_configs/osx.sh
Normal file
@@ -0,0 +1,6 @@
|
||||
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
||||
|
||||
brew update
|
||||
|
||||
brew install openssl readline cmake ace coreutils bash bash-completion md5sha1sum
|
||||
|
||||
5
apps/installer/includes/os_configs/ubuntu.sh
Normal file
5
apps/installer/includes/os_configs/ubuntu.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
|
||||
sudo apt-get install -y git cmake make gcc g++ clang libmysqlclient-dev \
|
||||
libssl-dev=1.0.2g-1ubuntu4.8 libbz2-dev libreadline-dev libncurses-dev \
|
||||
mysql-server libace-6.* libace-dev
|
||||
17
apps/installer/includes/os_configs/windows.sh
Normal file
17
apps/installer/includes/os_configs/windows.sh
Normal file
@@ -0,0 +1,17 @@
|
||||
echo "WARNING: Installer Script for Windows is not fully supported yet. Work in progress.."
|
||||
echo "!!README!!: Please install openssl and mysql libraries manually following our wiki"
|
||||
|
||||
# install chocolatey before
|
||||
|
||||
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
|
||||
|
||||
# install automatically following packages:
|
||||
# cmake
|
||||
# git
|
||||
# microsoft-build-tools
|
||||
# mysql 5.6
|
||||
|
||||
choco install -y --skip-checksums cmake git git.install microsoft-build-tools
|
||||
choco install -y --skip-checksums mysql --version 5.6.12
|
||||
|
||||
echo "!!README!!: Please remember to install openssl and mysql libraries manually following our wiki"
|
||||
77
apps/installer/main.sh
Normal file
77
apps/installer/main.sh
Normal file
@@ -0,0 +1,77 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CURRENT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
source "$CURRENT_PATH/includes/includes.sh"
|
||||
|
||||
cmdopt=$1
|
||||
|
||||
while true
|
||||
do
|
||||
echo "===== INSTALLER SCRIPT ====="
|
||||
PS3='Please enter your choice: '
|
||||
options=(
|
||||
"First Installation" "Configure OS dep" "Update Repository" "Reset & Clean Repository"
|
||||
"Compile" "Clean & Compile" "Assemble & Import DB" "Module Search" "Module Install" "Module Update" "Module Remove"
|
||||
"Sub Menu >> Compiler" "Sub Menu >> DB Assembler"
|
||||
"Quit"
|
||||
)
|
||||
|
||||
function _switch() {
|
||||
case $1 in
|
||||
"First Installation")
|
||||
inst_allInOne
|
||||
;;
|
||||
"Configure OS dep")
|
||||
inst_configureOS
|
||||
;;
|
||||
"Update Repository")
|
||||
inst_updateRepo
|
||||
;;
|
||||
"Reset & Clean Repository")
|
||||
inst_resetRepo
|
||||
;;
|
||||
"Compile")
|
||||
inst_compile
|
||||
;;
|
||||
"Clean & Compile")
|
||||
inst_cleanCompile
|
||||
;;
|
||||
"Assemble & Import DB")
|
||||
inst_assembleDb
|
||||
;;
|
||||
"Module Search")
|
||||
inst_module_search $2
|
||||
;;
|
||||
"Module Install")
|
||||
inst_module_install $2
|
||||
;;
|
||||
"Module Update")
|
||||
inst_module_update $2
|
||||
;;
|
||||
"Module Remove")
|
||||
inst_module_remove $2
|
||||
;;
|
||||
"Sub Menu >> Compiler")
|
||||
bash "$AC_PATH_BIN/compiler/compiler.sh"
|
||||
;;
|
||||
"Sub Menu >> DB Assembler")
|
||||
bash "$AC_PATH_BIN/db_assembler/db_assembler.sh"
|
||||
;;
|
||||
"Quit")
|
||||
echo "Goodbye!"
|
||||
exit
|
||||
;;
|
||||
*) echo invalid option;;
|
||||
esac
|
||||
}
|
||||
|
||||
# run option directly if specified in argument
|
||||
[ ! -z $1 ] && _switch "${options[$cmdopt-1]}" && exit 0
|
||||
|
||||
select opt in "${options[@]}"
|
||||
do
|
||||
_switch "$opt"
|
||||
break
|
||||
done
|
||||
done
|
||||
Reference in New Issue
Block a user