diff options
author | Jörg Thalheim <joerg@thalheim.io> | 2020-11-12 08:01:39 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-11-12 11:21:46 +0100 |
commit | d7aa78c32f076c305ceeb183fc06eb1de0960deb (patch) | |
tree | d7d262549dff0b1e195b1367616995241370d821 /meson.build | |
parent | license: LGPL-2.1+ -> LGPL-2.1-or-later (diff) | |
download | systemd-d7aa78c32f076c305ceeb183fc06eb1de0960deb.tar.xz systemd-d7aa78c32f076c305ceeb183fc06eb1de0960deb.zip |
meson: add option to skip installing to $sysconfdir
This is useful for development where overwriting files out side
the configured prefix will affect the host as well as stateless
systems such as NixOS that don't let packages install to /etc but handle
configuration on their own.
Alternative to https://github.com/systemd/systemd/pull/17501
tested with:
$ mkdir inst build && cd build
$ meson \
-Dcreate-log-dirs=false \
-Dsysvrcnd-path=$(realpath ../inst)/etc/rc.d \
-Dsysvinit-path=$(realpath ../inst)/etc/init.d \
-Drootprefix=$(realpath ../inst) \
-Dinstall-sysconfdir=false \
--prefix=$(realpath ../inst) ..
$ ninja install
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/meson.build b/meson.build index 19efa92db8..7996bc2c65 100644 --- a/meson.build +++ b/meson.build @@ -126,6 +126,7 @@ if rootlibdir == '' rootlibdir = join_paths(rootprefixdir, libdir.split('/')[-1]) endif +install_sysconfdir = get_option('install-sysconfdir') # Dirs of external packages pkgconfigdatadir = get_option('pkgconfigdatadir') == '' ? join_paths(datadir, 'pkgconfig') : get_option('pkgconfigdatadir') pkgconfiglibdir = get_option('pkgconfiglibdir') == '' ? join_paths(libdir, 'pkgconfig') : get_option('pkgconfiglibdir') @@ -2776,8 +2777,10 @@ if conf.get('ENABLE_BINFMT') == 1 meson.add_install_script('sh', '-c', mkdir_p.format(binfmtdir)) - meson.add_install_script('sh', '-c', - mkdir_p.format(join_paths(sysconfdir, 'binfmt.d'))) + if install_sysconfdir + meson.add_install_script('sh', '-c', + mkdir_p.format(join_paths(sysconfdir, 'binfmt.d'))) + endif endif if conf.get('ENABLE_REPART') == 1 @@ -2891,8 +2894,10 @@ executable( install : true, install_dir : rootlibexecdir) -install_data('src/sleep/sleep.conf', - install_dir : pkgsysconfdir) +if install_sysconfdir + install_data('src/sleep/sleep.conf', + install_dir : pkgsysconfdir) +endif public_programs += executable( 'systemd-sysctl', @@ -3243,8 +3248,10 @@ if conf.get('HAVE_KMOD') == 1 meson.add_install_script('sh', '-c', mkdir_p.format(modulesloaddir)) - meson.add_install_script('sh', '-c', - mkdir_p.format(join_paths(sysconfdir, 'modules-load.d'))) + if install_sysconfdir + meson.add_install_script('sh', '-c', + mkdir_p.format(join_paths(sysconfdir, 'modules-load.d'))) + endif endif public_programs += executable( @@ -3489,8 +3496,10 @@ subdir('docs/var-log') install_subdir('factory/etc', install_dir : factorydir) -install_data('xorg/50-systemd-user.sh', - install_dir : xinitrcdir) +if install_sysconfdir + install_data('xorg/50-systemd-user.sh', + install_dir : xinitrcdir) +endif install_data('modprobe.d/systemd.conf', install_dir : modprobedir) install_data('LICENSE.GPL2', |