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/common/recipes-devtools/python/pyphosphor.bb b/common/recipes-devtools/python/pyphosphor.bb
index 1758557..a7564de 100644
--- a/common/recipes-devtools/python/pyphosphor.bb
+++ b/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"
 
diff --git a/common/recipes-phosphor/dbus/obmc-rest.bb b/common/recipes-phosphor/dbus/obmc-rest.bb
index 0e4f5ba..8a747f0 100644
--- a/common/recipes-phosphor/dbus/obmc-rest.bb
+++ b/common/recipes-phosphor/dbus/obmc-rest.bb
@@ -18,7 +18,8 @@
         python-bottle \
         python-spwd \
         python-netserver \
-        pyphosphor \
+        pyphosphor-utils \
+        pyphosphor-dbus \
         "
 SRC_URI += "git://github.com/openbmc/phosphor-rest-server"
 
diff --git a/common/recipes-phosphor/obmc-phosphor-chassis/obmc-control-chassis.bb b/common/recipes-phosphor/obmc-phosphor-chassis/obmc-control-chassis.bb
index 0eff00c..157d416 100644
--- a/common/recipes-phosphor/obmc-phosphor-chassis/obmc-control-chassis.bb
+++ b/common/recipes-phosphor/obmc-phosphor-chassis/obmc-control-chassis.bb
@@ -9,7 +9,7 @@
         python-dbus \
         python-pygobject \
         python-netclient \
-        pyphosphor \
+        pyphosphor-dbus \
         "
 
 SKELETON_DIR = "pychassisctl"
diff --git a/common/recipes-phosphor/obmc-phosphor-chassis/obmc-mgr-inventory.bb b/common/recipes-phosphor/obmc-phosphor-chassis/obmc-mgr-inventory.bb
index 910d905..73a598c 100644
--- a/common/recipes-phosphor/obmc-phosphor-chassis/obmc-mgr-inventory.bb
+++ b/common/recipes-phosphor/obmc-phosphor-chassis/obmc-mgr-inventory.bb
@@ -14,7 +14,7 @@
         python-pickle \
         python-pygobject \
         python-subprocess \
-        pyphosphor \
+        pyphosphor-dbus \
         ${VIRTUAL-RUNTIME_skeleton_workbook} \
         "
 
diff --git a/common/recipes-phosphor/obmc-phosphor-fan/obmc-control-fan.bb b/common/recipes-phosphor/obmc-phosphor-fan/obmc-control-fan.bb
index d4504a6..256f9fc 100644
--- a/common/recipes-phosphor/obmc-phosphor-fan/obmc-control-fan.bb
+++ b/common/recipes-phosphor/obmc-phosphor-fan/obmc-control-fan.bb
@@ -8,7 +8,7 @@
 RDEPENDS_${PN} += "\
         python-dbus \
         python-pygobject \
-        pyphosphor \
+        pyphosphor-dbus \
         "
 SKELETON_DIR = "pyfanctl"
 DBUS_SERVICE_${PN} += "org.openbmc.control.Fans.service"
diff --git a/common/recipes-phosphor/obmc-phosphor-flash/obmc-flash-bmc.bb b/common/recipes-phosphor/obmc-phosphor-flash/obmc-flash-bmc.bb
index 2de28e0..5cf3855 100644
--- a/common/recipes-phosphor/obmc-phosphor-flash/obmc-flash-bmc.bb
+++ b/common/recipes-phosphor/obmc-phosphor-flash/obmc-flash-bmc.bb
@@ -12,7 +12,7 @@
         python-pygobject \
         python-subprocess \
         python-io \
-        pyphosphor \
+        pyphosphor-dbus \
         "
 
 SKELETON_DIR = "pyflashbmc"
diff --git a/common/recipes-phosphor/obmc-phosphor-flash/obmc-mgr-download.bb b/common/recipes-phosphor/obmc-phosphor-flash/obmc-mgr-download.bb
index 72a6350..a608b0a 100644
--- a/common/recipes-phosphor/obmc-phosphor-flash/obmc-mgr-download.bb
+++ b/common/recipes-phosphor/obmc-phosphor-flash/obmc-mgr-download.bb
@@ -9,7 +9,7 @@
         python-dbus \
         python-pygobject \
         python-subprocess \
-        pyphosphor \
+        pyphosphor-dbus \
         "
 
 SKELETON_DIR = "pydownloadmgr"
diff --git a/common/recipes-phosphor/obmc-phosphor-sensor/obmc-hwmon.bb b/common/recipes-phosphor/obmc-phosphor-sensor/obmc-hwmon.bb
index 7d437cf..0e555b8 100644
--- a/common/recipes-phosphor/obmc-phosphor-sensor/obmc-hwmon.bb
+++ b/common/recipes-phosphor/obmc-phosphor-sensor/obmc-hwmon.bb
@@ -12,7 +12,7 @@
         python-json \
         python-shell \
         python-pygobject \
-        pyphosphor \
+        pyphosphor-dbus \
         ${VIRTUAL-RUNTIME_skeleton_workbook} \
         "
 
diff --git a/common/recipes-phosphor/obmc-phosphor-sensor/obmc-mgr-sensor.bb b/common/recipes-phosphor/obmc-phosphor-sensor/obmc-mgr-sensor.bb
index d6b416b..3b77460 100644
--- a/common/recipes-phosphor/obmc-phosphor-sensor/obmc-mgr-sensor.bb
+++ b/common/recipes-phosphor/obmc-phosphor-sensor/obmc-mgr-sensor.bb
@@ -11,7 +11,7 @@
         python-dbus \
         python-json \
         python-pygobject\
-        pyphosphor \
+        pyphosphor-dbus \
         ${VIRTUAL-RUNTIME_skeleton_workbook} \
         "
 
diff --git a/common/recipes-phosphor/obmc-phosphor-sys/obmc-mgr-system.bb b/common/recipes-phosphor/obmc-phosphor-sys/obmc-mgr-system.bb
index b59833e..8b97e62 100644
--- a/common/recipes-phosphor/obmc-phosphor-sys/obmc-mgr-system.bb
+++ b/common/recipes-phosphor/obmc-phosphor-sys/obmc-mgr-system.bb
@@ -12,7 +12,7 @@
         python-json \
         python-subprocess \
         python-pygobject \
-        pyphosphor \
+        pyphosphor-dbus \
         ${VIRTUAL-RUNTIME_skeleton_workbook} \
         "
 
diff --git a/common/recipes-phosphor/rest-dbus/rest-dbus.bb b/common/recipes-phosphor/rest-dbus/rest-dbus.bb
index ee1b80d..8cc8428 100644
--- a/common/recipes-phosphor/rest-dbus/rest-dbus.bb
+++ b/common/recipes-phosphor/rest-dbus/rest-dbus.bb
@@ -13,7 +13,7 @@
         python-json \
         python-dbus \
         python-xml \
-        pyphosphor \
+        pyphosphor-dbus \
         "
 
 SYSTEMD_SERVICE_${PN} += "rest-dbus.service rest-dbus.socket"