Brad Bishop | 9ee75e1 | 2015-09-17 16:39:49 -0400 | [diff] [blame] | 1 | # Common code for applications providing a D-Bus service. |
| 2 | |
| 3 | # Class users should define DBUS_SERVICES prior to including. |
| 4 | |
Brad Bishop | 065a1be | 2015-09-25 10:23:09 -0400 | [diff] [blame] | 5 | RDEPENDS_${PN} += "dbus-perms" |
| 6 | |
Brad Bishop | 9ee75e1 | 2015-09-17 16:39:49 -0400 | [diff] [blame] | 7 | python() { |
Brad Bishop | f691a18 | 2015-09-21 17:07:52 -0400 | [diff] [blame] | 8 | services = d.getVar('DBUS_SERVICES', True) |
| 9 | if services: |
| 10 | uris = " ".join( [ 'file://' + s + '.conf' for s in services.split() ] ) |
Brad Bishop | 1bd117d | 2015-09-21 21:56:48 -0400 | [diff] [blame] | 11 | d.appendVar('SRC_URI', ' ' + uris + ' ') |
Brad Bishop | 9ee75e1 | 2015-09-17 16:39:49 -0400 | [diff] [blame] | 12 | } |
| 13 | |
| 14 | do_install_append() { |
| 15 | # install the service configuration files |
| 16 | install -d ${D}${sysconfdir}/dbus-1/system.d |
| 17 | for s in ${DBUS_SERVICES}; do |
| 18 | install ${WORKDIR}/$s.conf ${D}${sysconfdir}/dbus-1/system.d/$s.conf |
| 19 | done |
| 20 | } |