meson: add runtime_dir option
Summary
Adds a runtime_dir
option to the meson options, which allows the user to specify the run directory.
This commit also changes it so that `/run` is set as the default run directory if building with /usr prefix.
Partially inspired by the implementation dbus uses to configure their runtime setup: dbus/dbus@ff92efa3
There is also another MR focusing on this area: !1673 (closed) but I think it makes more sense to be able to specify the full run path, instead of toggling between options, if we're going to add an option for it.
Related issue: #24 (closed)
Purpose
Currently, there is no way to specify the run directory, and it always defaults to /var/run
for builds of NM made with meson, even if it may be desired to use /run
as the directory to store runtime files.
Checklist
Please read https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/main/CONTRIBUTING.md before opening the merge request. In particular, check that:
-
the subject for all commits is concise and explicative -
the message for all commits explains the reason for the change -
the source is properly formatted -
any relevant documentation is up to date -
you have added unit tests if applicable -
the NEWS file is updated when the change deserves to be mentioned, for example for new features, behavior changes, API deprecations, etc.