Skip to content
Snippets Groups Projects
Commit d2c8db59 authored by Aleš Mrázek's avatar Aleš Mrázek
Browse files

meson.build: use non-standard prefix for run_dir

parent 5ad88a40
Branches
Tags
1 merge request!1613python/knot_resolver: meson configured constants
......@@ -33,6 +33,7 @@ message('------------------------------')
# Variables
auto_prefixes = ['/', '/usr', '/usr/local']
libkres_soversion = 9
libext = '.so'
......@@ -54,7 +55,15 @@ modules_dir = lib_dir / 'kres_modules'
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
......@@ -71,7 +80,6 @@ completion_dir = prefix / 'share'
# 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
......
......@@ -5,7 +5,7 @@ USER = "@user@"
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@")
......
......@@ -5,7 +5,6 @@ constants_config = configuration_data()
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)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment