]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3732] Meson: Install fuzz/input
authorAndrei Pavel <andrei@isc.org>
Tue, 22 Apr 2025 15:13:51 +0000 (18:13 +0300)
committerAndrei Pavel <andrei@isc.org>
Wed, 23 Apr 2025 20:35:05 +0000 (23:35 +0300)
fuzz/install-input.sh.in [new file with mode: 0755]
fuzz/meson.build

diff --git a/fuzz/install-input.sh.in b/fuzz/install-input.sh.in
new file mode 100755 (executable)
index 0000000..5cfd04f
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+set -eu
+
+# Destdir is set everytime the installation happens through meson or ninja even when --destdir is not passed.
+# Set target path to prefix in case someone wants to run this script directly.
+target_path='@PREFIX@'
+if test -n "${MESON_INSTALL_DESTDIR_PREFIX+x}"; then
+    target_path="${MESON_INSTALL_DESTDIR_PREFIX}"
+fi
+
+cp -Tr @current_build_dir@/input "${target_path}/share/kea/fuzz"
index ee0c2371ab68d563a8de7c529c66a3f2a2505363..62d388eb9eb7d52b1c571810785db166cd1f6035 100644 (file)
@@ -2,7 +2,9 @@ if not FUZZ_OPT.enabled()
     subdir_done()
 endif
 
+current_build_dir = meson.current_build_dir()
 current_source_dir = meson.current_source_dir()
+
 list = []
 foreach i : [
     'fuzz_config_kea_dhcp4',
@@ -30,6 +32,22 @@ foreach i : [
         )
     endforeach
 endforeach
+foreach i : ['kea-dhcp4.conf', 'kea-dhcp6.conf']
+    run_command(
+        ['cp', f'input/@i@', f'@TOP_BUILD_DIR@/fuzz/input/@i@'],
+        check: true,
+    )
+endforeach
+
+
+install_input = configure_file(
+    input: 'install-input.sh.in',
+    output: 'install-input.sh',
+    configuration: configuration_data(
+        {'PREFIX': PREFIX, 'current_build_dir': current_build_dir},
+    ),
+)
+meson.add_install_script(install_input)
 
 fuzz_sources = ['fuzz.cc', 'fuzz.h']
 cpp_flags = [