# Variables
+auto_prefixes = ['/', '/usr', '/usr/local']
libkres_soversion = 9
libext = '.so'
sbin_dir = prefix / get_option('sbindir')
bin_dir = prefix / get_option('bindir')
if host_machine.system() == 'linux'
- run_dir = '/run' / 'knot-resolver'
+ # When installing from sources with a non-standard prefix,
+ # we need to set the correct run directory with the prefix,
+ # otherwise rwx permissions will fail with a validation error
+ # on the run directory
+ if prefix in auto_prefixes
+ run_dir = '/run' / 'knot-resolver'
+ else
+ run_dir = prefix / 'run' / 'knot-resolver'
+ endif
elif host_machine.system() == 'darwin'
run_dir = prefix / get_option('localstatedir') / 'run' / 'knot-resolver'
else
# When installing from sources into a non-standard prefix and the library is
# shared/dynamic, we need to set the executables' RPATH so that they can find
# `libkresd`, otherwise running them will fail with dynamic linkage errors
-auto_prefixes = ['/', '/usr', '/usr/local']
rpath_opt = get_option('install_rpath')
if (get_option('default_library') == 'static' or
rpath_opt == 'disabled' or
GROUP = "@group@"
# dirs paths
-RUN_DIR = Path("@prefix@@run_dir@")
+RUN_DIR = Path("@run_dir@")
ETC_DIR = Path("@etc_dir@")
SBIN_DIR = Path("@sbin_dir@")
CACHE_DIR = Path("@cache_dir@")
constants_config.set('version', meson.project_version())
constants_config.set('user', user)
constants_config.set('group', group)
-constants_config.set('prefix', prefix)
constants_config.set('run_dir', run_dir)
constants_config.set('etc_dir', etc_dir)
constants_config.set('sbin_dir', sbin_dir)