dropbear: add systemd units
[opendreambox.git] / meta-opendreambox / recipes-core / dropbear / dropbear_2012.55.bbappend
1 PRINC := "${@int(PRINC) + 1}"
2
3 SRC_URI += "file://dropbear.xinetd.in \
4             file://dropbearkey.service \
5             file://dropbear@.service \
6             file://dropbear.socket"
7
8 SYSTEMD_SERVICE_${PN} = "dropbear.socket"
9
10 inherit systemd xinetd
11
12 do_install_append() {
13         install -d ${D}${sysconfdir}/default
14         echo 'DAEMON="${base_bindir}/true"' >> ${D}${sysconfdir}/default/dropbear
15         if ${@base_contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
16                 install -d ${D}${systemd_unitdir}/system
17                 ln -sf /dev/null ${D}${systemd_unitdir}/system/dropbear.service
18                 install -m644 ${WORKDIR}/dropbear@.service ${D}${systemd_unitdir}/system
19                 install -m644 ${WORKDIR}/dropbear.socket ${D}${systemd_unitdir}/system
20                 install -m644 ${WORKDIR}/dropbearkey.service ${D}${systemd_unitdir}/system
21         fi
22 }
23
24 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"