meson: add in service file support

meson requires just the normal service file name so create a copy of it
for now. A future commit will remove the automake required .in version.

Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I6cb6998716c4e21eb948b8fdf934d538aac017d1
diff --git a/meson.build b/meson.build
index 81bcfae..5f3eb31 100644
--- a/meson.build
+++ b/meson.build
@@ -109,6 +109,12 @@
     install: true
 )
 
+systemd = dependency('systemd')
+systemd_system_unit_dir = systemd.get_pkgconfig_variable(
+    'systemdsystemunitdir',
+    define_variable: ['prefix', get_option('prefix')])
+subdir('service_files')
+
 build_tests = get_option('tests')
 
 # If test coverage of source files within the root directory are wanted,
diff --git a/service_files/meson.build b/service_files/meson.build
new file mode 100644
index 0000000..8d45b15
--- /dev/null
+++ b/service_files/meson.build
@@ -0,0 +1,13 @@
+unit_files = [
+    'phosphor-systemd-target-monitor.service',
+]
+
+foreach u : unit_files
+    configure_file(
+        copy: true,
+        input: u,
+        install: true,
+        install_dir: systemd_system_unit_dir,
+        output: u,
+        )
+endforeach
diff --git a/service_files/phosphor-systemd-target-monitor.service b/service_files/phosphor-systemd-target-monitor.service
new file mode 100644
index 0000000..ffd980f
--- /dev/null
+++ b/service_files/phosphor-systemd-target-monitor.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=phosphor systemd target monitor
+After=dbus.service
+
+[Service]
+Restart=always
+ExecStart=/usr/bin/phosphor-systemd-target-monitor -f /etc/phosphor-systemd-target-monitor/phosphor-target-monitor-default.json
+
+[Install]
+WantedBy=multi-user.target