feat(bash): support for derivated distro + refactor conf (#3259)

* feat(bash): support for derivated distro

* refactor: refactoring for dist files
This commit is contained in:
Yehonal
2020-08-06 02:37:14 +02:00
committed by GitHub
parent a37ea1b60e
commit ad6ad094de
11 changed files with 39 additions and 9 deletions

View File

@@ -3,7 +3,7 @@ var/*
data/contrib/* data/contrib/*
data/doc/* data/doc/*
conf/* conf/*
!conf/*.dist !conf/dist
docker/worldserver/data/* docker/worldserver/data/*
.idea .idea
cmake-build-debug/* cmake-build-debug/*

2
.gitignore vendored
View File

@@ -3,7 +3,7 @@
# #
conf/* conf/*
!conf/*.dist !conf/dist
apps/drassil/* apps/drassil/*
env/dist/* env/dist/*
env/user/* env/user/*

View File

@@ -45,7 +45,7 @@ include(deps/drassil/cmake-utils/utils.cmake)
include(src/cmake/ac_macros.cmake) include(src/cmake/ac_macros.cmake)
# set default buildoptions and print them # set default buildoptions and print them
include(conf/config.cmake.dist) include(conf/dist/config.cmake)
# load custom configurations for cmake if exists # load custom configurations for cmake if exists
if(EXISTS "${CMAKE_SOURCE_DIR}/conf/config.cmake") if(EXISTS "${CMAKE_SOURCE_DIR}/conf/config.cmake")

View File

@@ -1,7 +1,7 @@
function registerHooks() { hwc_event_register_hooks "$@"; } function registerHooks() { hwc_event_register_hooks "$@"; }
function runHooks() { hwc_event_run_hooks "$@"; } function runHooks() { hwc_event_run_hooks "$@"; }
source "$AC_PATH_CONF/config.sh.dist" # "hack" to avoid missing conf variables source "$AC_PATH_CONF/dist/config.sh" # include dist to avoid missing conf variables
if [ -f "$AC_PATH_CONF/config.sh" ]; then if [ -f "$AC_PATH_CONF/config.sh" ]; then
source "$AC_PATH_CONF/config.sh" # should overwrite previous source "$AC_PATH_CONF/config.sh" # should overwrite previous

View File

@@ -1,7 +1,7 @@
## How to compile: ## How to compile:
first of all, if you need some custom configuration you have to copy and rename first of all, if you need some custom configuration you have to copy
/conf/config.sh.dist in /conf/config.sh and configure it /conf/dist/config.sh in /conf/config.sh and configure it
* for a "clean" compilation you must run all scripts in their order: * for a "clean" compilation you must run all scripts in their order:

View File

@@ -4,7 +4,7 @@ This script allows you to assemble all sql files into one so you can easily impo
## How to use: ## How to use:
First of all, if you need some custom configuration, you have to copy and rename `/conf/config.sh.dist` to `/conf/config.sh` and configure it. The file is here: https://github.com/azerothcore/azerothcore-wotlk/tree/master/conf First of all, if you need some custom configuration, you have to copy `/conf/dist/config.sh` to `/conf/config.sh` and configure it. The file is here: https://github.com/azerothcore/azerothcore-wotlk/tree/master/conf
_Read it because there are several options to configure._ _Read it because there are several options to configure._

View File

@@ -4,14 +4,34 @@ function inst_configureOS() {
solaris*) echo "Solaris is not supported yet" ;; solaris*) echo "Solaris is not supported yet" ;;
darwin*) source "$AC_PATH_INSTALLER/includes/os_configs/osx.sh" ;; darwin*) source "$AC_PATH_INSTALLER/includes/os_configs/osx.sh" ;;
linux*) linux*)
# If $OSDISTRO is set, use this value (from config.sh)
if [ ! -z "$OSDISTRO" ]; then
DISTRO=$OSDISTRO
# If available, use LSB to identify distribution # If available, use LSB to identify distribution
if [ -f /etc/lsb-release -o -d /etc/lsb-release.d ]; then elif [ -f /etc/lsb-release -o -d /etc/lsb-release.d ]; then
DISTRO=$(lsb_release -i | cut -d: -f2 | sed s/'^\t'//) DISTRO=$(lsb_release -i | cut -d: -f2 | sed s/'^\t'//)
# Otherwise, use release info file # Otherwise, use release info file
else else
DISTRO=$(ls -d /etc/[A-Za-z]*[_-][rv]e[lr]* | grep -v "lsb" | cut -d'/' -f3 | cut -d'-' -f1 | cut -d'_' -f1) DISTRO=$(ls -d /etc/[A-Za-z]*[_-][rv]e[lr]* | grep -v "lsb" | cut -d'/' -f3 | cut -d'-' -f1 | cut -d'_' -f1)
fi fi
case $DISTRO in
# add here distro that are debian or ubuntu based
# TODO: find a better way, maybe checking the existance
# of a package manager
"neon" | "ubuntu")
DISTRO="ubuntu"
;;
"debian")
DISTRO="debian"
;;
*)
echo "Distro: $DISTRO, is not supported. If your distribution is based on debian or ubuntu,
please set the 'OSDISTRO' environment variable to one of these distro (you can use config.sh file)"
;;
esac
DISTRO=${DISTRO,,} DISTRO=${DISTRO,,}
echo "Distro: $DISTRO" echo "Distro: $DISTRO"

1
apps/joiner Submodule

Submodule apps/joiner added at ee8d5a2718

View File

@@ -8,6 +8,15 @@ BUILDPATH="$AC_PATH_ROOT/var/build/obj"
# absolute path where binary files must be stored # absolute path where binary files must be stored
BINPATH="$AC_PATH_ROOT/env/dist" BINPATH="$AC_PATH_ROOT/env/dist"
# bash fills it by default with your os type. No need to change it.
# Change it if you really know what you're doing.
# OSTYPE=""
# When using linux, our installer automatically get information about your distro
# using lsb_release. If your distro is not supported but it's based on ubuntu or debian,
# please change it to one of these values.
#OSDISTRO="ubuntu"
# absolute path where config. files must be stored # absolute path where config. files must be stored
# default: the system will use binpath by default # default: the system will use binpath by default
# CONFDIR="$AC_PATH_ROOT/env/dist/etc/" # CONFDIR="$AC_PATH_ROOT/env/dist/etc/"

View File

@@ -6,7 +6,7 @@ RUN apt update && apt install -y git cmake make gcc g++ clang libmysqlclient-dev
# copy the sources from the host machine to the Docker container # copy the sources from the host machine to the Docker container
ADD .git /azerothcore/.git ADD .git /azerothcore/.git
ADD deps /azerothcore/deps ADD deps /azerothcore/deps
ADD conf/config.cmake.dist /azerothcore/conf/config.cmake.dist ADD conf/dist /azerothcore/conf/dist
ADD src /azerothcore/src ADD src /azerothcore/src
ADD modules /azerothcore/modules ADD modules /azerothcore/modules
ADD CMakeLists.txt /azerothcore/CMakeLists.txt ADD CMakeLists.txt /azerothcore/CMakeLists.txt