meson: simplify systemd dependency

Reduce duplication of the systemd dependency and name the dependency
`systemd_dep` to follow meson conventions.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ibf1b6ead42f51611b2b2ae9eca5421de079c53c8
diff --git a/bios/meson.build b/bios/meson.build
index 48136d6..1d378f2 100644
--- a/bios/meson.build
+++ b/bios/meson.build
@@ -22,11 +22,6 @@
     install_dir: get_option('libexecdir') / 'phosphor-code-mgmt',
 )
 
-systemd_system_unit_dir = dependency('systemd').get_variable(
-    'systemd_system_unit_dir',
-    pkgconfig_define: ['prefix', get_option('prefix')],
-)
-
 install_data(
     'xyz.openbmc_project.Software.BIOS.service',
     install_dir: systemd_system_unit_dir,
diff --git a/bmc/side-switch/meson.build b/bmc/side-switch/meson.build
index 9e44852..65bd395 100644
--- a/bmc/side-switch/meson.build
+++ b/bmc/side-switch/meson.build
@@ -9,11 +9,6 @@
     install_dir: get_option('libexecdir') / 'phosphor-code-mgmt',
 )
 
-systemd_system_unit_dir = dependency('systemd').get_variable(
-    'systemd_system_unit_dir',
-    pkgconfig_define: ['prefix', get_option('prefix')],
-)
-
 install_data(
     'phosphor-bmc-side-switch.service',
     install_dir: systemd_system_unit_dir,
diff --git a/bmc/usb/meson.build b/bmc/usb/meson.build
index 386c943..d284a52 100644
--- a/bmc/usb/meson.build
+++ b/bmc/usb/meson.build
@@ -23,10 +23,6 @@
     install_dir: get_option('libexecdir') / 'phosphor-code-mgmt',
 )
 
-systemd_system_unit_dir = dependency('systemd').get_variable(
-    'systemd_system_unit_dir',
-    pkgconfig_define: ['prefix', get_option('prefix')],
-)
 udev_dir = dependency('udev').get_variable(
     'udev_dir',
     pkgconfig_define: ['prefix', get_option('prefix')],
diff --git a/cpld/meson.build b/cpld/meson.build
index cb5c706..7f1a421 100644
--- a/cpld/meson.build
+++ b/cpld/meson.build
@@ -20,11 +20,6 @@
     install: true,
 )
 
-systemd_system_unit_dir = dependency('systemd').get_variable(
-    'systemd_system_unit_dir',
-    pkgconfig_define: ['prefix', get_option('prefix')],
-)
-
 install_data(
     'xyz.openbmc_project.Software.CPLD.service',
     install_dir: systemd_system_unit_dir,
diff --git a/eeprom-device/meson.build b/eeprom-device/meson.build
index c5e2ba7..89608cb 100644
--- a/eeprom-device/meson.build
+++ b/eeprom-device/meson.build
@@ -22,11 +22,6 @@
     install_dir: get_option('libexecdir') / 'phosphor-code-mgmt',
 )
 
-systemd_system_unit_dir = dependency('systemd').get_variable(
-    'systemd_system_unit_dir',
-    pkgconfig_define: ['prefix', get_option('prefix')],
-)
-
 install_data(
     'xyz.openbmc_project.Software.EEPROMDevice.service',
     install_dir: systemd_system_unit_dir,
diff --git a/i2c-vr/meson.build b/i2c-vr/meson.build
index 13e1b37..0e292f5 100644
--- a/i2c-vr/meson.build
+++ b/i2c-vr/meson.build
@@ -24,11 +24,6 @@
     link_args: '-li2c',
 )
 
-systemd_system_unit_dir = dependency('systemd').get_variable(
-    'systemd_system_unit_dir',
-    pkgconfig_define: ['prefix', get_option('prefix')],
-)
-
 install_data(
     'xyz.openbmc_project.Software.I2CVR.service',
     install_dir: systemd_system_unit_dir,
diff --git a/meson.build b/meson.build
index a93cdd2..565b534 100644
--- a/meson.build
+++ b/meson.build
@@ -60,7 +60,10 @@
 ssl_dep = dependency('openssl')
 
 systemd = dependency('systemd')
-systemd_system_unit_dir = systemd.get_variable('systemd_system_unit_dir')
+systemd_system_unit_dir = systemd.get_variable(
+    'systemd_system_unit_dir',
+    pkgconfig_define: ['prefix', get_option('prefix')],
+)
 
 build_tests = get_option('tests')