]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
meson: do not generate fstrim.service if we do not have systemd
authorMartin Roukala (né Peres) <martin.roukala@mupuf.org>
Sun, 16 Jan 2022 11:25:35 +0000 (13:25 +0200)
committerMartin Roukala (né Peres) <martin.roukala@mupuf.org>
Sun, 16 Jan 2022 11:52:06 +0000 (13:52 +0200)
When systemd is disabled, the variable `systemdsystemunitdir` is
missing, and thus we cannot install fstrim.service to it.

This commit simply disables installing this service if systemd is not
found or disabled.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
sys-utils/meson.build

index 70795eccc3e30e409974a64966511515a684038c..4b6cb7a1c898f26a53ec55c6ec2733d018da2389 100644 (file)
@@ -220,12 +220,14 @@ if LINUX
   ]
 endif
 
-fstrim_service = configure_file(
-  input : 'fstrim.service.in',
-  output : 'fstrim.service',
-  configuration : conf)
-
-install_data(fstrim_service,
-             install_dir : systemdsystemunitdir)
-install_data('fstrim.timer',
-             install_dir : systemdsystemunitdir)
+if systemd.found()
+  fstrim_service = configure_file(
+    input : 'fstrim.service.in',
+    output : 'fstrim.service',
+    configuration : conf)
+
+  install_data(fstrim_service,
+               install_dir : systemdsystemunitdir)
+  install_data('fstrim.timer',
+               install_dir : systemdsystemunitdir)
+endif