Rygel becomes systemd user service
[AGL/meta-agl.git] / meta-agl / recipes-connectivity / rygel / rygel_%.bbappend
1 # Disable everything but the media-export plugin, add the lms plugin
2 PACKAGECONFIG = "media-export lms"
3 PACKAGECONFIG[lms] = "--enable-lms-plugin,--disable-lms-plugin,sqlite3"
4
5 # LightMediaScanner plugin patches
6 SRC_URI += "file://0001-Add-LightMediaScanner-plugin.patch \
7             file://0002-lms-add-C-source-files.patch \
8             file://rygel.service \
9             "
10
11 inherit systemd
12
13 do_install_append() {
14        # Install rygel systemd service
15        if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
16               install -p -D ${WORKDIR}/rygel.service ${D}${systemd_user_unitdir}/rygel.service
17
18               # Execute these manually on behalf of systemctl script (from systemd-systemctl-native.bb)
19               # because it does not support systemd's user mode.
20               mkdir -p ${D}/etc/systemd/user/default.target.wants/
21               ln -sf ${systemd_user_unitdir}/lightmediascanner.service ${D}/etc/systemd/user/dbus-org.gnome.Rygel1.service
22               ln -sf ${systemd_user_unitdir}/lightmediascanner.service ${D}/etc/systemd/user/default.target.wants/rygel.service
23        fi
24 }
25
26 FILES_${PN} += " \
27     ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_user_unitdir}/rygel.service', '', d)} \
28     "