[libvirt PATCH 1/5] meson: Introduce initconfdir option

Andrea Bolognani posted 5 patches 1 year, 6 months ago
[libvirt PATCH 1/5] meson: Introduce initconfdir option
Posted by Andrea Bolognani 1 year, 6 months ago
Right now we expect the configuration files for init scripts
to live in /etc/sysconfig, but that location is only used by
RHEL- and SUSE-derived distros.

This means that packagers for other distros have to patch
things as part of the build process, while people building
from source will get wonky integration.

This new option will provide a convenient way to override
the default location at build time that is usable by distro
packagers and people building from source alike.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
 meson.build       | 5 +++++
 meson_options.txt | 1 +
 2 files changed, 6 insertions(+)

diff --git a/meson.build b/meson.build
index bad13c0c9d..8da987b1cb 100644
--- a/meson.build
+++ b/meson.build
@@ -76,6 +76,11 @@ if runstatedir == ''
   runstatedir = localstatedir / 'run'
 endif
 
+initconfdir = get_option('initconfdir')
+if initconfdir == ''
+  initconfdir = sysconfdir / 'sysconfig'
+endif
+
 bindir = prefix / get_option('bindir')
 datadir = prefix / get_option('datadir')
 includedir = prefix / get_option('includedir')
diff --git a/meson_options.txt b/meson_options.txt
index 861c5577d2..9174c4021c 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -3,6 +3,7 @@ option('packager', type: 'string', value: '', description: 'Extra packager name'
 option('packager_version', type: 'string', value: '', description: 'Extra packager version')
 option('system', type: 'boolean', value: false, description: 'Set install paths to system ones')
 option('runstatedir', type: 'string', value: '', description: 'State directory for temporary sockets, pid files, etc')
+option('initconfdir', type: 'string', value: '', description: 'directory for init script configuration files')
 option('expensive_tests', type: 'feature', value: 'auto', description: 'set the default for enabling expensive tests (long timeouts)')
 option('test_coverage', type: 'boolean', value: false, description: 'turn on code coverage instrumentation')
 option('git_werror', type: 'feature', value: 'auto', description: 'use -Werror if building from GIT')
-- 
2.40.1
Re: [libvirt PATCH 1/5] meson: Introduce initconfdir option
Posted by Martin Kletzander 1 year, 5 months ago
On Tue, May 02, 2023 at 07:15:48PM +0200, Andrea Bolognani wrote:
>Right now we expect the configuration files for init scripts
>to live in /etc/sysconfig, but that location is only used by
>RHEL- and SUSE-derived distros.
>
>This means that packagers for other distros have to patch
>things as part of the build process, while people building
>from source will get wonky integration.
>
>This new option will provide a convenient way to override
>the default location at build time that is usable by distro
>packagers and people building from source alike.
>
>Signed-off-by: Andrea Bolognani <abologna@redhat.com>

Reviewed-by: Martin Kletzander <mkletzan@redhat.com>