pyphosphor: split into subpackages

Add namespace packages for packages that install python modules
into the obmc site-packages namespace.

Split the modules in the dbuslib and utils dirs into a dbus and
utils package.

This enables more granular dependency expression in other
recipes.

Change-Id: I6fd8abc1a56584f25b300260370c8ed2ed9e03ec
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/meta-phosphor/common/recipes-devtools/python/pyphosphor.bb b/meta-phosphor/common/recipes-devtools/python/pyphosphor.bb
index 1758557..a7564de 100644
--- a/meta-phosphor/common/recipes-devtools/python/pyphosphor.bb
+++ b/meta-phosphor/common/recipes-devtools/python/pyphosphor.bb
@@ -7,6 +7,39 @@
 
 inherit allarch
 inherit setuptools
+inherit python-dir
+
+PACKAGE_BEFORE_PN = " \
+        ${PN}-ns \
+        ${PN}-utils-ns \
+        ${PN}-dbus-ns \
+        ${PN}-utils \
+        ${PN}-dbus \
+        "
+
+RDEPENDS_${PN}-utils-ns += "${PN}-ns"
+RDEPENDS_${PN}-dbus-ns += "${PN}-ns"
+RDEPENDS_${PN}-utils += "${PN}-utils-ns"
+RDEPENDS_${PN}-dbus += " \
+        ${PN}-dbus-ns \
+        python-dbus \
+        python-xml \
+        python-json \
+        python-pickle \
+        "
+RDEPENDS_${PN} += " \
+        ${PN}-ns \
+        ${PN}-dbus \
+        python-subprocess \
+        python-dbus \
+        "
+
+FILES_${PN}-ns = "${PYTHON_SITEPACKAGES_DIR}/obmc/__init__.py*"
+FILES_${PN}-utils-ns = "${PYTHON_SITEPACKAGES_DIR}/obmc/utils/__init__.py*"
+FILES_${PN}-dbus-ns = "${PYTHON_SITEPACKAGES_DIR}/obmc/dbuslib/__init__.py*"
+
+FILES_${PN}-utils = "${PYTHON_SITEPACKAGES_DIR}/obmc/utils"
+FILES_${PN}-dbus = "${PYTHON_SITEPACKAGES_DIR}/obmc/dbuslib"
 
 SRC_URI += "git://github.com/openbmc/pyphosphor"