Add rest-dbus DBUS Introspecting REST server.

 -recipe and supporting files/patches
diff --git a/classes/obmc-phosphor-image.bbclass b/classes/obmc-phosphor-image.bbclass
index 59be345..37e034c 100644
--- a/classes/obmc-phosphor-image.bbclass
+++ b/classes/obmc-phosphor-image.bbclass
@@ -35,4 +35,5 @@
 
 IMAGE_INSTALL += " \
        bash \
+       packagegroup-obmc-phosphor-apps-extras \
        "
diff --git a/common/recipes-phosphor/packagegroups/packagegroup-obmc-phosphor-apps.bb b/common/recipes-phosphor/packagegroups/packagegroup-obmc-phosphor-apps.bb
index 634f5d8..8aa6ba8 100644
--- a/common/recipes-phosphor/packagegroups/packagegroup-obmc-phosphor-apps.bb
+++ b/common/recipes-phosphor/packagegroups/packagegroup-obmc-phosphor-apps.bb
@@ -12,6 +12,7 @@
 
 PROVIDES = "${PACKAGES}"
 PACKAGES = " \
+        packagegroup-obmc-phosphor-apps-extras \
         ${@mf_enabled("obmc-phosphor-fan-mgmt", "packagegroup-obmc-phosphor-apps-fan-mgmt", d)} \
         ${@mf_enabled("obmc-phosphor-chassis-mgmt", "packagegroup-obmc-phosphor-apps-chassis-mgmt", d)} \
         ${@mf_enabled("obmc-phosphor-sensor-mgmt", "packagegroup-obmc-phosphor-apps-sensor-mgmt", d)} \
@@ -21,6 +22,11 @@
         ${@df_enabled("obmc-phosphor-system-mgmt", "packagegroup-obmc-phosphor-apps-system-mgmt", d)} \
         "
 
+SUMMARY_packagegroup-obmc-phosphor-apps-extras = "Extra features"
+RDEPENDS_packagegroup-obmc-phosphor-apps-extras = " \
+        rest-dbus \
+        "
+
 SUMMARY_packagegroup-obmc-phosphor-apps-fan-mgmt = "Fan management support"
 RDEPENDS_packagegroup-obmc-phosphor-apps-fan-mgmt = \
         "${@cf_enabled("obmc-phosphor-fan-mgmt", " \
diff --git a/common/recipes-phosphor/rest-dbus/files/makefile.patch b/common/recipes-phosphor/rest-dbus/files/makefile.patch
new file mode 100644
index 0000000..96a82c1
--- /dev/null
+++ b/common/recipes-phosphor/rest-dbus/files/makefile.patch
@@ -0,0 +1,24 @@
+diff --git a/Makefile b/Makefile
+new file mode 100644
+index 0000000..3d79547
+--- /dev/null
++++ b/Makefile
+@@ -0,0 +1,18 @@
++PACKAGE=rest-dbus
++
++prefix?=/usr/local
++bin=$(prefix)/usr/bin
++share=$(prefix)/usr/share/$(PACKAGE)
++
++build clean all:
++
++install:
++	@install -d $(bin) $(share)/resources $(srv)
++	@install -m 755 $(PACKAGE) $(bin)
++	@for f in resources/*; do \
++		install -m644 $$f $(share)/resources; \
++	done
++
++uninstall:
++	@rm -f $(bin)/$(PACKAGE)
++	@rm -rf $(share)
diff --git a/common/recipes-phosphor/rest-dbus/files/no-session-bus.patch b/common/recipes-phosphor/rest-dbus/files/no-session-bus.patch
new file mode 100644
index 0000000..d68a037
--- /dev/null
+++ b/common/recipes-phosphor/rest-dbus/files/no-session-bus.patch
@@ -0,0 +1,12 @@
+Index: git/rest-dbus
+===================================================================
+--- git.orig/rest-dbus
++++ git/rest-dbus
+@@ -8,7 +8,6 @@ import os
+ from xml.etree import ElementTree
+ 
+ busses = {
+-    'session': dbus.SessionBus,
+     'system': dbus.SystemBus,
+ }
+ 
diff --git a/common/recipes-phosphor/rest-dbus/files/resources-path.patch b/common/recipes-phosphor/rest-dbus/files/resources-path.patch
new file mode 100644
index 0000000..dee4404
--- /dev/null
+++ b/common/recipes-phosphor/rest-dbus/files/resources-path.patch
@@ -0,0 +1,13 @@
+diff --git a/rest-dbus b/rest-dbus
+index 56ec1f9..078b1cf 100755
+--- a/rest-dbus
++++ b/rest-dbus
+@@ -40,7 +40,7 @@ class DBusRestResourceResponse(DBusRestResponse):
+         'png': 'image/png',
+         'gif': 'image/gif',
+     }
+-    resource_base = 'resources'
++    resource_base = '/usr/share/rest-dbus/resources'
+ 
+     def __init__(self, name):
+         (_, ext) = os.path.splitext(name)
diff --git a/common/recipes-phosphor/rest-dbus/files/rest-dbus.service b/common/recipes-phosphor/rest-dbus/files/rest-dbus.service
new file mode 100644
index 0000000..686cf69
--- /dev/null
+++ b/common/recipes-phosphor/rest-dbus/files/rest-dbus.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=DBUS introspecting REST server.
+
+[Service]
+ExecStart=/usr/bin/rest-dbus
+
+[Install]
+WantedBy=multi-user.target
diff --git a/common/recipes-phosphor/rest-dbus/rest-dbus.bb b/common/recipes-phosphor/rest-dbus/rest-dbus.bb
new file mode 100644
index 0000000..e2b4719
--- /dev/null
+++ b/common/recipes-phosphor/rest-dbus/rest-dbus.bb
@@ -0,0 +1,31 @@
+SUMMARY = "Phosphor OpenBMC REST framework"
+DESCRIPTION = "Phosphor OpenBMC REST to DBUS daemon."
+HOMEPAGE = "http://github.com/openbmc/rest-dbus"
+PR = "r1"
+
+inherit allarch
+inherit obmc-phosphor-license
+inherit obmc-phosphor-systemd
+
+SYSTEMD_SERVICE_${PN} = "${PN}.service"
+
+RDEPENDS_${PN} += " \
+        python-netserver \
+        python-json \
+        python-dbus \
+        python-xml \
+        "
+SRC_URI += " \
+        git://github.com/openbmc/rest-dbus.git \
+        file://makefile.patch \
+        file://resources-path.patch \
+        file://no-session-bus.patch \
+        "
+
+SRCREV = "9b0e0bab5150ccc4333ce442932f8969f365155e"
+
+S = "${WORKDIR}/git"
+
+do_install() {
+        oe_runmake prefix=${D} install
+}