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:
parent
a37ea1b60e
commit
ad6ad094de
@ -3,7 +3,7 @@ var/*
|
||||
data/contrib/*
|
||||
data/doc/*
|
||||
conf/*
|
||||
!conf/*.dist
|
||||
!conf/dist
|
||||
docker/worldserver/data/*
|
||||
.idea
|
||||
cmake-build-debug/*
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@ -3,7 +3,7 @@
|
||||
#
|
||||
|
||||
conf/*
|
||||
!conf/*.dist
|
||||
!conf/dist
|
||||
apps/drassil/*
|
||||
env/dist/*
|
||||
env/user/*
|
||||
|
||||
@ -45,7 +45,7 @@ include(deps/drassil/cmake-utils/utils.cmake)
|
||||
include(src/cmake/ac_macros.cmake)
|
||||
|
||||
# set default buildoptions and print them
|
||||
include(conf/config.cmake.dist)
|
||||
include(conf/dist/config.cmake)
|
||||
|
||||
# load custom configurations for cmake if exists
|
||||
if(EXISTS "${CMAKE_SOURCE_DIR}/conf/config.cmake")
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
function registerHooks() { hwc_event_register_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
|
||||
source "$AC_PATH_CONF/config.sh" # should overwrite previous
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
## How to compile:
|
||||
|
||||
first of all, if you need some custom configuration you have to copy and rename
|
||||
/conf/config.sh.dist in /conf/config.sh and configure it
|
||||
first of all, if you need some custom configuration you have to copy
|
||||
/conf/dist/config.sh in /conf/config.sh and configure it
|
||||
|
||||
* for a "clean" compilation you must run all scripts in their order:
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@ This script allows you to assemble all sql files into one so you can easily impo
|
||||
|
||||
## 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._
|
||||
|
||||
|
||||
@ -4,14 +4,34 @@ function inst_configureOS() {
|
||||
solaris*) echo "Solaris is not supported yet" ;;
|
||||
darwin*) source "$AC_PATH_INSTALLER/includes/os_configs/osx.sh" ;;
|
||||
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 [ -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'//)
|
||||
# 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
|
||||
|
||||
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,,}
|
||||
|
||||
echo "Distro: $DISTRO"
|
||||
|
||||
1
apps/joiner
Submodule
1
apps/joiner
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit ee8d5a2718d96423f3d873ae7703be2ecee96ae9
|
||||
9
conf/config.sh.dist → conf/dist/config.sh
vendored
9
conf/config.sh.dist → conf/dist/config.sh
vendored
@ -8,6 +8,15 @@ BUILDPATH="$AC_PATH_ROOT/var/build/obj"
|
||||
# absolute path where binary files must be stored
|
||||
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
|
||||
# default: the system will use binpath by default
|
||||
# CONFDIR="$AC_PATH_ROOT/env/dist/etc/"
|
||||
@ -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
|
||||
ADD .git /azerothcore/.git
|
||||
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 modules /azerothcore/modules
|
||||
ADD CMakeLists.txt /azerothcore/CMakeLists.txt
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user