]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
scripts/poe-tasks: text and naming improvements
authorAleš Mrázek <ales.mrazek@nic.cz>
Mon, 9 Sep 2024 21:44:28 +0000 (23:44 +0200)
committerAleš Mrázek <ales.mrazek@nic.cz>
Mon, 30 Sep 2024 09:16:07 +0000 (11:16 +0200)
.gitignore
scripts/poe-tasks/clean
scripts/poe-tasks/configure
scripts/poe-tasks/man
scripts/poe-tasks/run
scripts/poe-tasks/utils/_env.sh

index 1c503cf148e292e58cd54b32c59b18dd3ddfe756..c6c37c71666f5ddd40f151f8803b6e769e8db5d7 100644 (file)
@@ -86,7 +86,7 @@ luacov.*.out
 dist/
 .coverage
 .mypy_cache
-.install_kresd/
-.build_kresd/
+.install/
+.build/
 poetry.lock
 *.junit.xml
index ff69ad69eb5b9248991b31d25da5cfe8c8767ae2..697f7dd2985ae9180c5de01a3b141c3bb379236e 100755 (executable)
@@ -10,9 +10,9 @@ echo --------------------------------------------
 rm -vrf .coverage .mypy_cache .pytest_cache
 
 echo
-echo Removing meson build directories and files
+echo Removing Meson build directories and files
 echo ------------------------------------------
-rm -vrf .build_kresd .install_kresd build build_doc dist 
+rm -vrf $build_dir $install_dir build build_doc dist 
 
 echo
 echo Removing __pycache__ directories and files
index ea2bdeb3e4d1e9940fc2d7c684464206e87acf32..c7cfbb2f1cf439ac2914c7d6c9e29e0be32cfd9a 100755 (executable)
@@ -4,10 +4,6 @@
 src_dir="$(dirname "$(realpath "$0")")"
 source $src_dir/utils/_env.sh
 
-reconfigure=''
-if [ -f .build_kresd/ninja.build ]; then
-       reconfigure='--reconfigure'
-fi
-meson setup .build_kresd "$reconfigure" --prefix=$(realpath .install_kresd) -Duser=$USER -Dgroup=$(id -gn) "$@"
+kres_meson_configure
 
-build_kresd
+kres_meson_build
index 3cdafb34d60879cf162e0ccdb262f46efac4a5f5..f6986d5841f9319c739da85c80c494d8f6a02bc7 100755 (executable)
@@ -4,6 +4,6 @@
 src_dir="$(dirname "$(realpath "$0")")"
 source $src_dir/utils/_env.sh
 
-build_kresd
+build_knot_resolver_c
 
-man -l .install_kresd/share/man/man8/$1*
+man -l .install/share/man/man8/$1*
index 90f02632ea0e91afbd4827149d7fddd916202aba..cd3ca37dbf0ba5fcfd4ca1637557ae97a9b63566 100755 (executable)
@@ -4,11 +4,11 @@
 src_dir="$(dirname "$(realpath "$0")")"
 source $src_dir/utils/_env.sh
 
-build_kresd
+kres_meson_build
 
 echo
-echo Building Knot Resolver Manager native extensions
-echo ------------------------------------------------
+echo Building Knot Resolver Python komponents
+echo ----------------------------------------
 poetry build
 # copy native modules from build directory to source directory
 shopt -s globstar
@@ -22,8 +22,8 @@ shopt -u globstar
 shopt -u nullglob
 
 echo
-echo The Knot Resolver management API is accessible on http://localhost:5000
-echo -----------------------------------------------------------------------
+echo The Knot Resolver API is accessible on http://localhost:5000
+echo ------------------------------------------------------------
 
 # run the knot-resolver manager
 python3 -m knot_resolver.manager $@
index 1ea73a3962a58e070a626548dcc79913be73155b..59947fb543538f5c3b59d21f59f4b69fc703cd0d 100644 (file)
@@ -17,6 +17,10 @@ if test -z "$gitroot"; then
 fi
 cd $gitroot
 
+# build dirs
+build_dir=$gitroot/.build
+install_dir=$gitroot/.install
+
 # ensure consistent environment with virtualenv
 if test -z "$VIRTUAL_ENV" -a "$CI" != "true" -a -z "$KNOT_ENV"; then
        echo -e "${yellow}You are NOT running the script within the project's virtual environment.${reset}"
@@ -41,31 +45,43 @@ fi
 mkdir -p "$KRES_CONFIG_DIR/runtime" "$KRES_CONFIG_DIR/cache"
 
 # env variables
-if [ -z "${KRES_MANAGER_CONFIG:-}" ]; then
-    KRES_MANAGER_CONFIG="$KRES_CONFIG_DIR/config.dev.yaml"
+if [ -z "${KRES_CONFIG_FILE:-}" ]; then
+    KRES_CONFIG_FILE="$KRES_CONFIG_DIR/config.dev.yaml"
 fi
 
-if [ -z "${KRES_MANAGER_API_SOCK:-}" ]; then
-    KRES_MANAGER_API_SOCK="$KRES_CONFIG_DIR/manager.sock"
+if [ -z "${KRES_API_SOCK_FILE:-}" ]; then
+    KRES_API_SOCK_FILE="$KRES_CONFIG_DIR/kres-api.sock"
 fi
-export KRES_MANAGER_CONFIG
-export KRES_MANAGER_API_SOCK
+export KRES_CONFIG_FILE
+export KRES_API_SOCK_FILE
+
+function kres_meson_configure {
+       reconfigure=''
+       if [ -f .build/ninja.build ]; then
+               reconfigure='--reconfigure'
+       fi
+       echo
+       echo Configuring Knot Resolver Meson
+       echo -------------------------------
+       echo -e "${blue}${reset}"
+       echo
+       meson setup $build_dir $reconfigure --prefix=$install_dir -Duser=$USER -Dgroup=$(id -gn) "$@"
+}
 
-function build_kresd {
-       if [ -d .build_kresd ]; then
+function kres_meson_build {
+       if [ -d .build ]; then
                echo
-               echo Building Knot Resolver
-               echo ----------------------
+               echo Building Knot Resolver C komponents
+               echo -----------------------------------
                echo -e "${blue}In case of an compilation error, run this command to try to fix it:${reset}"
-               echo -e "\t${blue}rm -r $(realpath .install_kresd) $(realpath .build_kresd)${reset}"
+               echo -e "\t${blue}rm -r $install_dir $build_dir${reset}"
                echo
-               ninja -C .build_kresd
-               ninja install -C .build_kresd
-               export PYTHONPATH="$(realpath .build_kresd/python):${PYTHONPATH:-}"
+               ninja -C $build_dir
+               ninja install -C $build_dir
        else
                echo
-               echo Knot Resolver daemon is not configured.
-               echo "Please run './poe configure' (optionally with additional Meson arguments)"
+               echo Knot Resolver is not configured for building.
+               echo "Please run './poe configure' (optionally with additional Meson arguments)".
                echo
                exit 2
        fi