build: Install bridge in libexec

Users aren't intended to run the server directly so it shouldn't be
included in their PATH.

Change-Id: Idc49664a7a07142ee27aac1318066bba6f67a6fd
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/meson.build b/meson.build
index 6f9c3c5..31586cf 100644
--- a/meson.build
+++ b/meson.build
@@ -12,7 +12,12 @@
 
 systemd = dependency('systemd')
 if systemd.found()
-  install_data(
-    'phosphor-ipmi-kcs@.service',
+  conf_data = configuration_data()
+  conf_data.set('BIN', get_option('prefix') / get_option('libexecdir') / kcsbridged.name())
+  configure_file(
+    input: 'phosphor-ipmi-kcs@.service.in',
+    output: 'phosphor-ipmi-kcs@.service',
+    configuration: conf_data,
+    install: true,
     install_dir: systemd.get_variable(pkgconfig: 'systemdsystemunitdir'))
 endif
diff --git a/phosphor-ipmi-kcs@.service b/phosphor-ipmi-kcs@.service.in
similarity index 85%
rename from phosphor-ipmi-kcs@.service
rename to phosphor-ipmi-kcs@.service.in
index 56c0b72..1d41541 100644
--- a/phosphor-ipmi-kcs@.service
+++ b/phosphor-ipmi-kcs@.service.in
@@ -5,7 +5,7 @@
 
 [Service]
 Restart=always
-ExecStart=/usr/bin/kcsbridged -c "%i"
+ExecStart=@BIN@ -c "%i"
 SyslogIdentifier=kcsbridged-%i
 
 [Install]
diff --git a/src/meson.build b/src/meson.build
index 00394f0..7d57e5a 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -8,7 +8,7 @@
   required: false)
 assert(has_cli11, 'CLI11 is required')
 
-executable(
+kcsbridged = executable(
   'kcsbridged',
   'kcsbridged.cpp',
   implicit_include_directories: false,
@@ -32,4 +32,4 @@
     '-DBOOST_COROUTINES_NO_DEPRECATION_WARNING',
   ],
   install: true,
-  install_dir: get_option('bindir'))
+  install_dir: get_option('libexecdir'))