]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
meson.build: use non-standard prefix for run_dir
authorAleš Mrázek <ales.mrazek@nic.cz>
Mon, 16 Sep 2024 15:56:27 +0000 (17:56 +0200)
committerAleš Mrázek <ales.mrazek@nic.cz>
Mon, 30 Sep 2024 09:16:07 +0000 (11:16 +0200)
meson.build
python/constants.py.in
python/meson.build

index 0bd46ad6d9019855f9ce5cf1f2eed6884fca8d79..85c69fa79eaf23de33c92abd0b31a63d3055da8c 100644 (file)
@@ -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
index 3f2eb734fee68f43e01d2b3f5d60d0bd48a93b2e..0f1c3a882f6186072c6ee7faf088d00c16c99dbd 100644 (file)
@@ -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@")
index a0ea0c066f7ff52a0dd6e2c404d5952cda572cbf..38794daa2e7b8d36dd98a9ff77f7bd8bbed66ff5 100644 (file)
@@ -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)