Add recipe for phosphor-dbus-monitor

Add a recipe for the phosphor-dbus-monitor application.

phosphor-dbus-monitor is a YAML driven dbus event -> response
application.

Resolves: openbmc/openbmc#1303

Change-Id: If27ab0b73ec23e9f15150e98d5798a41f28435df
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/meta-phosphor/classes/phosphor-dbus-monitor.bbclass b/meta-phosphor/classes/phosphor-dbus-monitor.bbclass
new file mode 100644
index 0000000..da282df
--- /dev/null
+++ b/meta-phosphor/classes/phosphor-dbus-monitor.bbclass
@@ -0,0 +1 @@
+config_dir="${datadir}/phosphor-dbus-monitor"
diff --git a/meta-phosphor/common/recipes-phosphor/dbus/phosphor-dbus-monitor-config-native.bb b/meta-phosphor/common/recipes-phosphor/dbus/phosphor-dbus-monitor-config-native.bb
new file mode 100644
index 0000000..178a941
--- /dev/null
+++ b/meta-phosphor/common/recipes-phosphor/dbus/phosphor-dbus-monitor-config-native.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Phosphor DBus Monitor Configuration"
+DESCRIPTION = "Meta-recipe, pulling in native recipes that wish to add \
+configuration files to the /usr/share/phosphor-dbus-monitor filesystem."
+HOMEPAGE = "http://github.com/openbmc/phosphor-dbus-monitor"
+PR = "r1"
+
+inherit obmc-phosphor-license
+inherit native
+inherit phosphor-dbus-monitor
+
+PHOSPHOR_DBUS_MONITOR_CONFIGS ??= ""
+
+# To add additional config files, create a recipe in your layer,
+# and add it to PHOSPHOR_DBUS_MONITOR_CONFIGS with a bbappend to this recipe.
+
+DEPENDS += "${PHOSPHOR_DBUS_MONITOR_CONFIGS}"
+
+do_install_append() {
+    mkdir -p ${config_dir}
+}
diff --git a/meta-phosphor/common/recipes-phosphor/dbus/phosphor-dbus-monitor.bb b/meta-phosphor/common/recipes-phosphor/dbus/phosphor-dbus-monitor.bb
new file mode 100644
index 0000000..8f1fe7f
--- /dev/null
+++ b/meta-phosphor/common/recipes-phosphor/dbus/phosphor-dbus-monitor.bb
@@ -0,0 +1,34 @@
+SUMMARY = "Phosphor DBus Monitor"
+DESCRIPTION = "Phosphor DBus Monitor is a general purpose DBus application \
+that watches DBus traffic for events and takes actions based on those events."
+PR = "r1"
+
+HOMEPAGE = "http://github.com/openbmc/phosphor-dbus-monitor"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
+SRC_URI = "git://github.com/openbmc/phosphor-dbus-monitor"
+SRCREV = "1ada93be00378c94ff14bec8c2c7f5bbd85f72b0"
+
+inherit autotools \
+        pkgconfig \
+        pythonnative \
+        phosphor-dbus-monitor \
+        obmc-phosphor-systemd
+
+DEPENDS += " \
+        ${PN}-config-native \
+        phosphor-logging \
+        autoconf-archive-native \
+        gtest \
+        "
+RDEPENDS_${PN} += " \
+        sdbusplus \
+        phosphor-dbus-interfaces \
+        phosphor-logging \
+        "
+
+S = "${WORKDIR}/git"
+
+EXTRA_OECONF = " \
+        YAML_PATH=${STAGING_DIR_NATIVE}${config_dir} \
+        "
diff --git a/meta-phosphor/common/recipes-phosphor/dbus/phosphor-dbus-monitor/phosphor-dbus-monitor.service b/meta-phosphor/common/recipes-phosphor/dbus/phosphor-dbus-monitor/phosphor-dbus-monitor.service
new file mode 100644
index 0000000..a985030
--- /dev/null
+++ b/meta-phosphor/common/recipes-phosphor/dbus/phosphor-dbus-monitor/phosphor-dbus-monitor.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Phosphor DBus Monitor
+After=obmc-mapper.target
+
+[Service]
+Restart=always
+ExecStart={sbindir}/phosphor-dbus-monitor
+
+[Install]
+WantedBy={SYSTEMD_DEFAULT_TARGET}
diff --git a/meta-phosphor/common/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bb b/meta-phosphor/common/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bb
index a500bf3..e49674f 100644
--- a/meta-phosphor/common/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bb
+++ b/meta-phosphor/common/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bb
@@ -40,6 +40,7 @@
 SUMMARY_${PN}-extras = "Extra features"
 RDEPENDS_${PN}-extras = " \
         phosphor-rest \
+        phosphor-dbus-monitor \
         "
 
 SUMMARY_${PN}-extrasdev = "Development features"