From 0083f93c4dab931bc7ed7bbaf80f098ec6325156 Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Mon, 1 Sep 2025 20:31:44 +0300 Subject: [PATCH] meson: add config_dir; option for creating config/log dirs --- meson.build | 10 +++++++--- meson_options.txt | 3 +++ src/meson.build | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index d2655307..31f6dcb8 100644 --- a/meson.build +++ b/meson.build @@ -46,7 +46,7 @@ endif ############ # Variable # ############ -config_dir = get_option('sysconfdir') / meson.project_name() +config_dir = get_option('config_dir') / meson.project_name() log_dir = get_option('localstatedir') / 'log' / meson.project_name() ##################### @@ -57,8 +57,12 @@ subdir('src') ################ # Config + Log # ################ -install_emptydir(config_dir) -install_emptydir(log_dir) +if get_option('create_config_dir') + install_emptydir(config_dir) +endif +if get_option('create_log_dir') + install_emptydir(log_dir) +endif #################### # Shell completion # diff --git a/meson_options.txt b/meson_options.txt index 8a4d3f3d..523734ef 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,2 +1,5 @@ option('boot_service', type : 'combo', choices : ['systemd', 'openrc'], value : 'systemd') option('tests', type : 'boolean', value : false) +option('config_dir', type : 'string', value : '/etc') +option('create_config_dir', type : 'boolean', value : true) +option('create_log_dir', type : 'boolean', value : true) diff --git a/src/meson.build b/src/meson.build index 1d95fafe..7fa3aca0 100644 --- a/src/meson.build +++ b/src/meson.build @@ -80,4 +80,4 @@ if get_option('tests') test_exe, timeout: 0 ) -endif \ No newline at end of file +endif