summaryrefslogtreecommitdiff
path: root/meta-phosphor/classes/obmc-phosphor-dbus-service.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta-phosphor/classes/obmc-phosphor-dbus-service.bbclass')
-rw-r--r--meta-phosphor/classes/obmc-phosphor-dbus-service.bbclass20
1 files changed, 20 insertions, 0 deletions
diff --git a/meta-phosphor/classes/obmc-phosphor-dbus-service.bbclass b/meta-phosphor/classes/obmc-phosphor-dbus-service.bbclass
new file mode 100644
index 000000000..e6132faa7
--- /dev/null
+++ b/meta-phosphor/classes/obmc-phosphor-dbus-service.bbclass
@@ -0,0 +1,20 @@
+# Common code for applications providing a D-Bus service.
+
+# Class users should define DBUS_SERVICES prior to including.
+
+RDEPENDS_${PN} += "dbus-perms"
+
+python() {
+ services = d.getVar('DBUS_SERVICES', True)
+ if services:
+ uris = " ".join( [ 'file://' + s + '.conf' for s in services.split() ] )
+ d.appendVar('SRC_URI', ' ' + uris + ' ')
+}
+
+do_install_append() {
+ # install the service configuration files
+ install -d ${D}${sysconfdir}/dbus-1/system.d
+ for s in ${DBUS_SERVICES}; do
+ install ${WORKDIR}/$s.conf ${D}${sysconfdir}/dbus-1/system.d/$s.conf
+ done
+}