diff --git a/config/etc/meson.build b/config/etc/meson.build new file mode 100644 index 000000000..04a044aee --- /dev/null +++ b/config/etc/meson.build @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +lxc_system_config = configure_file( + configuration: dummy_config_data, + input: 'default.conf.lxcbr', + output: 'default.conf', + install: true, + install_dir: lxcconfdir) diff --git a/config/init/common/meson.build b/config/init/common/meson.build new file mode 100644 index 000000000..ac15c762e --- /dev/null +++ b/config/init/common/meson.build @@ -0,0 +1,15 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +lxc_containers = configure_file( + configuration: conf, + input: 'lxc-containers.in', + output: 'lxc-containers', + install: true, + install_dir: lxclibexec) + +lxc_net = configure_file( + configuration: conf, + input: 'lxc-net.in', + output: 'lxc-net', + install: true, + install_dir: lxclibexec) diff --git a/config/init/systemd/meson.build b/config/init/systemd/meson.build new file mode 100644 index 000000000..6904badf9 --- /dev/null +++ b/config/init/systemd/meson.build @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +lxc_apparmor_load = configure_file( + configuration: dummy_config_data, + input: 'lxc-apparmor-load', + output: 'lxc-apparmor-load', + install: true, + install_dir: lxclibexec) diff --git a/config/selinux/meson.build b/config/selinux/meson.build new file mode 100644 index 000000000..05ca35c9e --- /dev/null +++ b/config/selinux/meson.build @@ -0,0 +1,15 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +lxc_selinux_if = configure_file( + configuration: dummy_config_data, + input: 'lxc.if', + output: 'lxc.if', + install: libselinux.found(), + install_dir: lxcselinuxdir) + +lxc_selinux_te = configure_file( + configuration: dummy_config_data, + input: 'lxc.te', + output: 'lxc.te', + install: libselinux.found(), + install_dir: lxcselinuxdir) diff --git a/config/templates/common.conf.d/meson.build b/config/templates/common.conf.d/meson.build new file mode 100644 index 000000000..32acfc480 --- /dev/null +++ b/config/templates/common.conf.d/meson.build @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +lxc_conf_common_readme = configure_file( + configuration: dummy_config_data, + input: 'README', + output: 'README', + install: true, + install_dir: lxctemplateconfcommondir) diff --git a/config/templates/meson.build b/config/templates/meson.build new file mode 100644 index 000000000..bed1cd4ea --- /dev/null +++ b/config/templates/meson.build @@ -0,0 +1,36 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +lxc_conf_common_seccomp = configure_file( + configuration: conf, + input: 'common.seccomp', + output: 'common.seccomp', + install: true, + install_dir: lxctemplateconfdir) + +lxc_conf_common_main = configure_file( + configuration: conf, + input: 'common.conf.in', + output: 'common.conf', + install: true, + install_dir: lxctemplateconfdir) + +lxc_conf_common_nesting = configure_file( + configuration: conf, + input: 'nesting.conf.in', + output: 'nesting.conf', + install: true, + install_dir: lxctemplateconfdir) + +lxc_conf_common_oci = configure_file( + configuration: conf, + input: 'oci.common.conf.in', + output: 'oci.common.conf', + install: true, + install_dir: lxctemplateconfdir) + +lxc_conf_common_userns = configure_file( + configuration: conf, + input: 'userns.conf.in', + output: 'userns.conf', + install: true, + install_dir: lxctemplateconfdir) diff --git a/config/yum/meson.build b/config/yum/meson.build new file mode 100644 index 000000000..fa1abb159 --- /dev/null +++ b/config/yum/meson.build @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +lxc_patch = configure_file( + configuration: dummy_config_data, + input: 'lxc-patch.py', + output: 'lxc-patch.py', + install: true, + install_dir: lxcdatadir) diff --git a/meson.build b/meson.build index 322ea2b30..09f85de58 100644 --- a/meson.build +++ b/meson.build @@ -69,18 +69,22 @@ sbindir = join_paths(prefixdir, get_option('sbindir')) sysconfdir = join_paths(prefixdir, get_option('sysconfdir')) lxcapparmorcachedir = join_paths(localstatedir, apparmorcachedir) -lxcdefaultconfig = join_paths(sysconfdir, 'lxc/default.conf') +lxcconfdir = join_paths(sysconfdir, globalconfig) +lxcdefaultconfig = join_paths(lxcconfdir, 'default.conf') +lxcglobalconfig = join_paths(lxcconfdir, 'lxc.conf') lxcexamplesdir = join_paths(docdir, 'examples') -lxcglobalconfig = join_paths(sysconfdir, globalconfig) lxchookbindir = join_paths(libexecdir, 'lxc/hooks') -lxchookdir = join_paths(datadir, 'lxc/hooks') lxcinclude = join_paths(includedir, 'lxc') lxclibexec = join_paths(libexecdir, 'lxc') lxclogpath = join_paths(localstatedir, logpath) lxcpath = join_paths(localstatedir, lxcpathprefix) lxcrootfsmount = join_paths(libdir, rootfsmount) -lxctemplateconfig = join_paths(datadir, 'lxc/config') -lxctemplatedir = join_paths(datadir, 'lxc/templates') +lxcdatadir = join_paths(datadir, 'lxc') +lxchookdir = join_paths(lxcdatadir, 'hooks') +lxcselinuxdir = join_paths(lxcdatadir, 'selinux') +lxctemplateconfdir = join_paths(lxcdatadir, 'config') +lxctemplateconfcommondir = join_paths(lxctemplateconfdir, 'common.conf.d') +lxctemplatedir = join_paths(lxcdatadir, 'templates') lxc_user_network_conf = join_paths(sysconfdir, user_network_conf_opt) lxc_user_network_db = join_paths(runtimepath, user_network_db_opt) @@ -104,7 +108,7 @@ conf.set_quoted('LXCHOOKDIR', lxchookdir) conf.set_quoted('LXCINITDIR', libexecdir) conf.set_quoted('LXCPATH', lxcpath) conf.set_quoted('LXCROOTFSMOUNT', lxcrootfsmount) -conf.set_quoted('LXCTEMPLATECONFIG', lxctemplateconfig) +conf.set_quoted('LXCTEMPLATECONFIG', lxctemplateconfdir) conf.set_quoted('LXCTEMPLATEDIR', lxctemplatedir) conf.set_quoted('LXC_USERNIC_CONF', lxc_user_network_conf) conf.set_quoted('LXC_USERNIC_DB', lxc_user_network_db) @@ -594,6 +598,13 @@ liblxc_dep = declare_dependency( # Rest of sub-directories. subdir('config/bash') +subdir('config/etc') +subdir('config/init/common') +subdir('config/init/systemd') +subdir('config/selinux') +subdir('config/templates') +subdir('config/templates/common.conf.d') +subdir('config/yum') subdir('doc/examples') subdir('doc/rootfs') subdir('hooks') @@ -644,7 +655,7 @@ status = [ 'lxc rootfs mount directory: @0@'.format(lxcrootfsmount), 'log path: @0@'.format(lxclogpath), 'lxc path: @0@'.format(lxcpath), - 'lxc template config: @0@'.format(lxctemplateconfig), + 'lxc template config: @0@'.format(lxctemplateconfdir), 'lxc template directory: @0@'.format(lxctemplatedir), 'lxc user network config: @0@'.format(lxc_user_network_conf), 'lxc user network database: @0@'.format(lxc_user_network_db)] diff --git a/meson_options.txt b/meson_options.txt index 6114cf1b2..6f050f868 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -30,8 +30,8 @@ option('data-path', type: 'string', value: 'lib/lxc', option('doc-path', type: 'string', value: 'doc/lxc', description: 'Documentation directory') -option('global-config-path', type: 'string', value: 'lxc/lxc.conf', - description: 'Global configuration file path') +option('global-config-path', type: 'string', value: 'lxc', + description: 'Global configuration directory') option('log-path', type: 'string', value: 'log/lxc', description: 'Loging directory') diff --git a/src/lxc/meson.build b/src/lxc/meson.build index 0fe370642..2f47b76b1 100644 --- a/src/lxc/meson.build +++ b/src/lxc/meson.build @@ -148,3 +148,10 @@ liblxc_static = static_library( include_directories: liblxc_includes, dependencies: [threads], c_args: '-fvisibility=default') + +lxc_functions = configure_file( + configuration: conf, + input: 'lxc.functions.in', + output: 'lxc.functions', + install: true, + install_dir: lxcdatadir) diff --git a/templates/meson.build b/templates/meson.build index 14edb4e4c..53148b10c 100644 --- a/templates/meson.build +++ b/templates/meson.build @@ -9,7 +9,7 @@ template_scripts = configure_file( template_config_data = configuration_data() template_config_data.set_quoted('LXCHOOKDIR', lxchookdir) -template_config_data.set_quoted('LXCTEMPLATECONFIG', lxctemplateconfig) +template_config_data.set_quoted('LXCTEMPLATECONFIG', lxctemplateconfdir) template_config_data.set_quoted('LOCALSTATEDIR', localstatedir) template_config_data.set_quoted('PACKAGE_VERSION', meson.project_version())