@@ -15,11 +15,17 @@ SRC_URI = " file://print-gplv3-packages.sh \
file://gplv3-notice.service"
do_install(){
- install -d ${D}${sysconfdir}/init.d
- install -m 0755 ${S}/print-gplv3-packages.sh ${D}${sysconfdir}/init.d/gplv3-notice
-
- install -d ${D}${systemd_system_unitdir}
- install -m0644 ${WORKDIR}/gplv3-notice.service ${D}${systemd_system_unitdir}
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${S}/print-gplv3-packages.sh ${D}${sysconfdir}/init.d/gplv3-notice
+ fi
+
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}${bindir}
+ install -d ${D}${systemd_system_unitdir}
+ install -m 0755 ${S}/print-gplv3-packages.sh ${D}${bindir}/gplv3-notice
+ install -m 0644 ${WORKDIR}/gplv3-notice.service ${D}${systemd_system_unitdir}
+ fi
}
SYSTEMD_SERVICE:${PN} = "gplv3-notice.service"
@@ -3,8 +3,8 @@ Description=Print notice about GPLv3 packages
[Service]
Type=oneshot
-ExecStart=/etc/init.d/gplv3-notice
-WorkingDirectory=/etc/init.d
+ExecStart=/usr/bin/gplv3-notice
+WorkingDirectory=/usr/bin
StandardOutput=tty
[Install]