Add recipe for phosphor-user-manager

Removed the obmc-phosphor-user and put the new one

Also, removed the usage of PREFERRED_PROVIDER and replaced by
VIRTUAL_RUNTIME for this feature

Change-Id: I6f0825f8d51eecb9c666a95d9fd702a8ea8bb08b
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
diff --git a/meta-phosphor/classes/obmc-phosphor-image.bbclass b/meta-phosphor/classes/obmc-phosphor-image.bbclass
index 29694e7..bad16ba 100644
--- a/meta-phosphor/classes/obmc-phosphor-image.bbclass
+++ b/meta-phosphor/classes/obmc-phosphor-image.bbclass
@@ -48,10 +48,10 @@
 FEATURE_PACKAGES_obmc-settings-mgmt ?= "${@df_enabled(d, 'obmc-settings-mgmt', 'virtual-obmc-settings-mgmt')}"
 FEATURE_PACKAGES_obmc-software ?= "packagegroup-obmc-apps-software"
 FEATURE_PACKAGES_obmc-system-mgmt ?= "${@df_enabled(d, 'obmc-phosphor-system-mgmt', 'virtual-obmc-system-mgmt')}"
-FEATURE_PACKAGES_obmc-user-mgmt ?= "${@df_enabled(d, 'obmc-phosphor-user-mgmt', 'virtual-obmc-user-mgmt')}"
 FEATURE_PACKAGES_obmc-debug-collector ?= "packagegroup-obmc-apps-debug-collector"
 FEATURE_PACKAGES_obmc-settings ?= "packagegroup-obmc-apps-settings"
 FEATURE_PACKAGES_obmc-network-mgmt ?= "packagegroup-obmc-apps-network"
+FEATURE_PACKAGES_obmc-user-mgmt ?= "packagegroup-obmc-apps-user-mgmt"
 
 # Install entire Phosphor application stack by default
 IMAGE_FEATURES += " \
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 f7a0df0..50f9065 100644
--- a/meta-phosphor/common/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bb
+++ b/meta-phosphor/common/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bb
@@ -21,6 +21,7 @@
         ${PN}-debug-collector \
         ${PN}-settings \
         ${PN}-network \
+        ${PN}-user-mgmt \
         "
 
 SUMMARY_${PN}-bmc-state-mgmt = "BMC state management"
@@ -104,3 +105,8 @@
 RDEPENDS_${PN}-network = " \
         ${VIRTUAL-RUNTIME_obmc-network-manager} \
         "
+
+SUMMARY_${PN}-user-mgmt = "User management applications"
+RDEPENDS_${PN}-user-mgmt = " \
+        ${VIRTUAL-RUNTIME_obmc-user-mgmt} \
+        "
diff --git a/meta-phosphor/common/recipes-phosphor/users/obmc-phosphor-user.bb b/meta-phosphor/common/recipes-phosphor/users/obmc-phosphor-user.bb
deleted file mode 100644
index 83b7024..0000000
--- a/meta-phosphor/common/recipes-phosphor/users/obmc-phosphor-user.bb
+++ /dev/null
@@ -1,37 +0,0 @@
-SUMMARY = "User DBUS object"
-DESCRIPTION = "User DBUS object"
-HOMEPAGE = "http://github.com/openbmc/phosphor-networkd"
-PR = "r1"
-
-inherit allarch
-inherit obmc-phosphor-license
-inherit obmc-phosphor-dbus-service
-inherit phosphor-networkd-rev
-
-PROVIDES += "virtual/obmc-user-mgmt"
-RPROVIDES_${PN} += "virtual-obmc-user-mgmt"
-
-RDEPENDS_${PN} += " \
-        python-dbus \
-        python-pygobject \
-        python-subprocess \
-        python-pexpect"
-
-S = "${WORKDIR}/git"
-INSTALL_NAME = "userman.py"
-
-DBUS_SERVICE_${PN} += "org.openbmc.UserManager.service"
-
-# Since base_do_compile finds a makefile (from networkd) it tries to
-# compile.  Short-circuit that because we just need to copy a python
-# file in this package.
-do_compile() {
-    :
-}
-
-do_install_append() {
-echo "***installing $INSTALL_NAME"
-        install -d ${D}/${sbindir}
-        install ${S}/${INSTALL_NAME} ${D}/${sbindir}/obmc-phosphor-userd
-}
-
diff --git a/meta-phosphor/common/recipes-phosphor/users/obmc-phosphor-user/org.openbmc.UserManager.service b/meta-phosphor/common/recipes-phosphor/users/obmc-phosphor-user/org.openbmc.UserManager.service
deleted file mode 100644
index 64408b7..0000000
--- a/meta-phosphor/common/recipes-phosphor/users/obmc-phosphor-user/org.openbmc.UserManager.service
+++ /dev/null
@@ -1,13 +0,0 @@
-[Unit]
-Description=Phosphor User Manager
-
-[Service]
-ExecStart=/usr/bin/env obmc-phosphor-userd
-SyslogIdentifier=obmc-phosphor-userd
-Environment="PYTHONUNBUFFERED=1"
-Restart=always
-Type=dbus
-BusName={BUSNAME}
-
-[Install]
-WantedBy={SYSTEMD_DEFAULT_TARGET}
diff --git a/meta-phosphor/common/recipes-phosphor/users/phosphor-user-manager.bb b/meta-phosphor/common/recipes-phosphor/users/phosphor-user-manager.bb
new file mode 100644
index 0000000..390c51a
--- /dev/null
+++ b/meta-phosphor/common/recipes-phosphor/users/phosphor-user-manager.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Phosphor User Manager Daemon"
+DESCRIPTION = "Daemon that does user management"
+HOMEPAGE = "http://github.com/openbmc/phosphor-user-manager"
+PR = "r1"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
+inherit autotools pkgconfig
+inherit obmc-phosphor-dbus-service
+
+DEPENDS += "autoconf-archive-native"
+DEPENDS += "sdbusplus"
+DEPENDS += "phosphor-logging"
+DEPENDS += "phosphor-dbus-interfaces"
+RDEPENDS_${PN} += "libsystemd"
+RDEPENDS_${PN} += "phosphor-logging"
+
+
+DBUS_SERVICE_${PN} += "xyz.openbmc_project.User.Manager.service"
+
+SRC_URI += "git://github.com/openbmc/phosphor-user-manager"
+SRCREV = "035a96983cdf8a11a1c2380106c11c94cb8418b2"
+S = "${WORKDIR}/git"
diff --git a/meta-phosphor/common/recipes-phosphor/users/phosphor-user-manager/xyz.openbmc_project.User.Manager.service b/meta-phosphor/common/recipes-phosphor/users/phosphor-user-manager/xyz.openbmc_project.User.Manager.service
new file mode 100644
index 0000000..f8926e7
--- /dev/null
+++ b/meta-phosphor/common/recipes-phosphor/users/phosphor-user-manager/xyz.openbmc_project.User.Manager.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Phosphor User Manager
+
+[Service]
+ExecStart=/usr/bin/env phosphor-user-manager
+SyslogIdentifier=phosphor-user-manager
+Restart=always
+Type=dbus
+BusName={BUSNAME}
+
+[Install]
+WantedBy={SYSTEMD_DEFAULT_TARGET}
diff --git a/meta-phosphor/conf/distro/include/phosphor-defaults.inc b/meta-phosphor/conf/distro/include/phosphor-defaults.inc
index 5a5fe3a..431ba23 100644
--- a/meta-phosphor/conf/distro/include/phosphor-defaults.inc
+++ b/meta-phosphor/conf/distro/include/phosphor-defaults.inc
@@ -108,7 +108,6 @@
 
 PREFERRED_PROVIDER_virtual/obmc-settings-mgmt ?= "phosphor-settings"
 PREFERRED_PROVIDER_virtual/obmc-system-mgmt ?= "obmc-phosphor-sysd"
-PREFERRED_PROVIDER_virtual/obmc-user-mgmt ?= "obmc-phosphor-user"
 PREFERRED_PROVIDER_virtual/obmc-wsgihost ?= "phosphor-gevent"
 
 # phosphor-hwmon-config
@@ -216,5 +215,11 @@
 # the timeout if needed.
 PREFERRED_PROVIDER_virtual/obmc-watchdog ?= "phosphor-watchdog"
 
+# obmc-user-mgmt
+#
+# Provides an implementation of xyz.openbmc_project.User.Manager catering
+# to user management
+VIRTUAL-RUNTIME_obmc-user-mgmt ?= "phosphor-user-manager"
+
 OBMC_DBUS_PATH_ROOT ?= "/xyz/openbmc_project"
 OBMC_DBUS_IFACE_ROOT ?= "xyz.openbmc_project"