systemd: limit bbclass hooks to class-target scope

Allow the phosphor systemd and dbus bbclasses to be inherited
by recipes using BBCLASSEXTEND (native, etc).  No-op in non-target
recipe class context.

Tested:  Built an image and verified dbus and systemd unit files.
Change-Id: Ib2f64233f89d05679c568527a074d9236729201f
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/classes/obmc-phosphor-dbus-service.bbclass b/classes/obmc-phosphor-dbus-service.bbclass
index 029d260..77fffe0 100644
--- a/classes/obmc-phosphor-dbus-service.bbclass
+++ b/classes/obmc-phosphor-dbus-service.bbclass
@@ -124,6 +124,11 @@
             % (d.getVar('dbus_system_servicesdir', True), search_match))
 
 
+    if d.getVar('CLASSOVERRIDE', True) != 'class-target':
+        return
+
+    d.appendVarFlag('do_install', 'postfuncs', ' dbus_do_postinst')
+
     for pkg in listvar_to_list(d, 'DBUS_PACKAGES'):
         if pkg not in (d.getVar('SYSTEMD_PACKAGES', True) or ''):
             set_append(d, 'SYSTEMD_PACKAGES', pkg)
@@ -169,6 +174,4 @@
         done
 }
 
-do_install[postfuncs] += "dbus_do_postinst"
-
 inherit obmc-phosphor-systemd