build: add dbus policy

Provide our own dbus policy instead of relying on the distro packager to
create one.

Change-Id: I17e8589f623f81aac19b57ae7febc8125bd046a9
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/dbus/org.open_power.Software.Host.Updater.conf b/dbus/org.open_power.Software.Host.Updater.conf
new file mode 100644
index 0000000..a5f8245
--- /dev/null
+++ b/dbus/org.open_power.Software.Host.Updater.conf
@@ -0,0 +1,8 @@
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+        "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+        <policy user="root">
+                <allow own="org.open_power.Software.Host.Updater"/>
+                <allow send_destination="org.open_power.Software.Host.Updater"/>
+        </policy>
+</busconfig>
diff --git a/meson.build b/meson.build
index 12ff150..a31d90a 100644
--- a/meson.build
+++ b/meson.build
@@ -223,6 +223,17 @@
     )
 endforeach
 
+dbus_system_bus_services_dir = dependency('dbus-1').get_pkgconfig_variable(
+    'system_bus_services_dir',
+    define_variable: ['prefix', get_option('prefix')])
+dbus_policy_dir = run_command(
+    'realpath',
+    join_paths(dbus_system_bus_services_dir, '..', 'system.d')).stdout().strip()
+
+install_data(
+    'dbus/org.open_power.Software.Host.Updater.conf',
+    install_dir: dbus_policy_dir)
+
 if not get_option('tests').disabled()
     test(
         'utest',