phosphor-logging: Add native SDK classes to install parser scripts

Install elog-gen.py and mako script by default in the
obmc-phosphor-image sdk.

Change-Id: Ibfb94fc4a645bcca66f7b93656edd88a1af5c4f6
Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
diff --git a/classes/phosphor-logging.bbclass b/classes/phosphor-logging.bbclass
index 18f53d4..48676f4 100644
--- a/classes/phosphor-logging.bbclass
+++ b/classes/phosphor-logging.bbclass
@@ -1 +1,2 @@
 callouts_datadir="${datadir}/phosphor-logging/callouts"
+elog_dir = "${datadir}/phosphor-logging/elog"
diff --git a/common/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend b/common/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend
index 936c16b..f98e5c5 100644
--- a/common/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend
+++ b/common/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend
@@ -2,4 +2,5 @@
         nativesdk-autoconf-archive-dev \
         nativesdk-phosphor-dbus-interfaces-yaml \
         nativesdk-sdbus++ \
+        nativesdk-phosphor-logging-elog \
         "
diff --git a/common/recipes-phosphor/logging/phosphor-logging.bb b/common/recipes-phosphor/logging/phosphor-logging.bb
index 5704923..c02a08c 100644
--- a/common/recipes-phosphor/logging/phosphor-logging.bb
+++ b/common/recipes-phosphor/logging/phosphor-logging.bb
@@ -21,6 +21,7 @@
 DEPENDS += "phosphor-dbus-interfaces phosphor-dbus-interfaces-native"
 DEPENDS += "virtual/phosphor-logging-callouts"
 DEPENDS += "phosphor-logging-error-logs-native"
+DEPENDS += "phosphor-logging-native"
 DEPENDS += "cereal"
 RDEPENDS_${PN} += "sdbusplus phosphor-dbus-interfaces"
 PROVIDES += "virtual/obmc-logging-mgmt"
@@ -29,18 +30,57 @@
 PACKAGE_BEFORE_PN = "${PN}-test"
 FILES_${PN}-test = "${bindir}/*-test"
 
+PACKAGE_BEFORE_PN += "${PN}-elog"
+FILES_${PN}-elog += "${elog_dir}"
+
 SRC_URI += "git://github.com/openbmc/phosphor-logging"
-SRCREV = "37af9bacea7847f8990a93fc600fad19b3194751"
+SRCREV = "dd50846bed41a8f8c3197df3d863ed502279a426"
 
 S = "${WORKDIR}/git"
 
-PACKAGECONFIG ??= "metadata-processing"
+# Do not DEPEND on the specified packages for native build
+# as they will not be available in host machine
+DEPENDS_remove_class-native =   " \
+        virtual/phosphor-logging-callouts \
+        sdbus++-native \
+        systemd-native \
+        cereal-native \
+        "
+
+# Do not DEPEND on the specified packages for native SDK build
+# as they will not be available in host machine
+DEPENDS_remove_class-nativesdk = " \
+        virtual/phosphor-logging-callouts \
+        sdbus++-native \
+        nativesdk-cereal \
+        nativesdk-systemd \
+        nativesdk-phosphor-dbus-interfaces \
+        nativesdk-phosphor-logging \
+        "
+
+PACKAGECONFIG ??= "metadata-processing install_scripts"
+
 PACKAGECONFIG[metadata-processing] = " \
         --enable-metadata-processing, \
         --disable-metadata-processing, , \
         "
 
+# Provide a means to enable/disable install_scripts feature
+PACKAGECONFIG[install_scripts] = " \
+        --enable-install_scripts, \
+        --disable-install_scripts, ,\
+        "
+
+# Enable install_scripts during native and native SDK build
+PACKAGECONFIG_add_class-native = "install_scripts"
+PACKAGECONFIG_add_class-nativesdk = "install_scripts"
+
+# Disable install_scripts during target build
+PACKAGECONFIG_remove_class-target = "install_scripts"
+
 EXTRA_OECONF = " \
         YAML_DIR=${STAGING_DIR_NATIVE}${yaml_dir} \
         CALLOUTS_YAML=${STAGING_DIR_NATIVE}${callouts_datadir}/callouts.yaml \
         "
+
+BBCLASSEXTEND += "native nativesdk"