]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
meson: etc/config - install kresd.conf
authorTomas Krizek <tomas.krizek@nic.cz>
Thu, 7 Feb 2019 16:06:29 +0000 (17:06 +0100)
committerTomas Krizek <tomas.krizek@nic.cz>
Tue, 12 Mar 2019 09:43:24 +0000 (10:43 +0100)
etc/config/meson.build
meson.build
meson_options.txt

index 3be1c8c9133a614affe8e255d4d9c196c56ba7c7..27128bc92792cb557b248465434341fd68e3ef3e 100644 (file)
@@ -26,7 +26,7 @@ endif
 # Configure and install config examples
 example_configs = [
   'config.cluster',
-  'config.docker',
+  'config.docker',  # TODO should it be installed?
   'config.isp',
   'config.personal',
   'config.splitview',
@@ -42,9 +42,25 @@ foreach config_filename : example_configs
   configure_file(
     input: config_filename + '.in',
     output: config_filename,
+    configuration: conf_config,
     install_dir: examples_dir,
   )
 endforeach
 
-# Install kresd.conf
-# TODO kresd.conf
+
+# kresd.conf
+install_kresd_conf = get_option('install_kresd_conf').enabled()
+if get_option('install_kresd_conf').auto()
+  if run_command(['test', '-r', join_paths(etc_dir, 'kresd.conf')]).returncode() == 1
+    install_kresd_conf = true
+  endif
+endif
+
+if install_kresd_conf
+  configure_file(
+    input: 'config.personal.in',
+    output: 'kresd.conf',
+    configuration: conf_config,
+    install_dir: etc_dir,
+  )
+endif
index a80d714d81e68b541d9f7861104c42cd70b2745e..dbbc36c5250743412213694505ae7b9f206eb585 100644 (file)
@@ -165,6 +165,7 @@ summary_build_daemon = build_daemon ? 'enabled' : 'disabled'
 summary_build_doc = build_doc ? 'enabled' : 'disabled'
 summary_build_extra_tests = build_extra_tests ? 'enabled' : 'disabled'
 summary_build_unit_tests = build_unit_tests ? 'enabled' : 'disabled'
+summary_install_kresd_conf = install_kresd_conf ? 'enabled' : 'disabled'
 message('''
 
 ======================= SUMMARY =======================
@@ -191,7 +192,7 @@ message('''
   additional
     user:               @0@'''.format(user) + '''
     group:              @0@'''.format(group) + '''
-    install_kresd_conf: @0@'''.format(get_option('install_kresd_conf')) + '''
+    install_kresd_conf: @0@'''.format(summary_install_kresd_conf) + '''
     version:            @0@'''.format(meson.project_version()) + '''
 
 =======================================================
index f68b4f6ac2f3b0fb17e590da665bdd52697db1bd..8e3ee76bf0e0660b29796d4e3f773aca7dd688b2 100644 (file)
@@ -14,8 +14,8 @@ option(
 
 option(
   'install_kresd_conf',
-  type: 'boolean',
-  value: false,
+  type: 'feature',
+  value: 'auto',
   description: 'creates kresd.conf in config directory',
 )