phosphor-logging: create bbclass for non-native YAML

The current working model for many packages that supply YAML
is that they have both a native and a non-native package where
the native package doesn't build anything but supplies YAML and
the non-native package does the real building.  In the case of
phosphor-logging this is due to a cyclic dependency:

    package-yaml -> logging header -> package

To hopefully reduce the complexity on package makefiles to
this dual-build structure, I have created a non-native bbclass
that can be used to create simple packages for the logging YAML.

I have also created a sample for phosphor-led.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I3148f14c0502aebb55f083e39ac5c499e6276680
diff --git a/classes/phosphor-logging-yaml-provider.bbclass b/classes/phosphor-logging-yaml-provider.bbclass
new file mode 100644
index 0000000..f18adbb
--- /dev/null
+++ b/classes/phosphor-logging-yaml-provider.bbclass
@@ -0,0 +1,22 @@
+inherit phosphor-dbus-yaml
+
+LOGGING_YAML_SUBDIRS ??= "xyz/openbmc_project"
+
+do_install_append() {
+    for yaml_d in ${LOGGING_YAML_SUBDIRS} ;
+    do
+        if [ ! -d ${S}/${yaml_d} ];
+        then
+            continue
+        fi
+
+        for yaml_f in $(find ${S}/${yaml_d} -name "*.errors.yaml" -or \
+            -name "*.metadata.yaml") ;
+        do
+            subpath=$(realpath --relative-to=${S} ${yaml_f})
+            install -d $(dirname ${D}${yaml_dir}/$subpath)
+
+            install -m 0644 ${yaml_f} ${D}${yaml_dir}/$subpath
+        done
+    done
+}