summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/opkg/opkg.inc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/opkg/opkg.inc')
-rw-r--r--meta/recipes-devtools/opkg/opkg.inc21
1 files changed, 19 insertions, 2 deletions
diff --git a/meta/recipes-devtools/opkg/opkg.inc b/meta/recipes-devtools/opkg/opkg.inc
index afe6cb0ce6..3d568867d4 100644
--- a/meta/recipes-devtools/opkg/opkg.inc
+++ b/meta/recipes-devtools/opkg/opkg.inc
@@ -16,7 +16,13 @@ do_configure_prepend() {
16 sed -i -e s:-Werror::g ${S}/libopkg/Makefile.am 16 sed -i -e s:-Werror::g ${S}/libopkg/Makefile.am
17} 17}
18 18
19inherit autotools pkgconfig 19inherit autotools pkgconfig systemd
20
21python () {
22 if 'sysvinit' not in d.getVar("DISTRO_FEATURES", True).split():
23 pn = d.getVar('PN', True)
24 d.setVar('SYSTEMD_SERVICE_%s' % (pn), 'opkg-configure.service')
25}
20 26
21target_localstatedir := "${localstatedir}" 27target_localstatedir := "${localstatedir}"
22OPKGLIBDIR = "${target_localstatedir}/lib" 28OPKGLIBDIR = "${target_localstatedir}/lib"
@@ -49,6 +55,16 @@ FILES_libopkg = "${libdir}/*.so.* ${OPKGLIBDIR}/opkg/"
49do_install_append() { 55do_install_append() {
50 # We need to create the lock directory 56 # We need to create the lock directory
51 install -d ${D}${OPKGLIBDIR}/opkg 57 install -d ${D}${OPKGLIBDIR}/opkg
58
59 if ${@base_contains('DISTRO_FEATURES','sysvinit','false','true',d)};then
60 install -d ${D}${systemd_unitdir}/system
61 install -m 0644 ${WORKDIR}/opkg-configure.service ${D}${systemd_unitdir}/system/
62 sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
63 -e 's,@SYSCONFDIR@,${sysconfdir},g' \
64 -e 's,@BINDIR@,${bindir},g' \
65 -e 's,@SYSTEMD_UNITDIR@,${systemd_unitdir},g' \
66 ${D}${systemd_unitdir}/system/opkg-configure.service
67 fi
52} 68}
53 69
54do_install_append_class-native() { 70do_install_append_class-native() {
@@ -59,7 +75,8 @@ do_install_append_class-native() {
59 75
60pkg_postinst_${PN} () { 76pkg_postinst_${PN} () {
61#!/bin/sh 77#!/bin/sh
62if [ "x$D" != "x" ] && [ -f $D${OPKGLIBDIR}/opkg/status ]; then 78if ${@base_contains('DISTRO_FEATURES','sysvinit','true','false',d)} && \
79 [ "x$D" != "x" ] && [ -f $D${OPKGLIBDIR}/opkg/status ]; then
63 install -d $D${sysconfdir}/rcS.d 80 install -d $D${sysconfdir}/rcS.d
64 81
65 # this happens at S98 where our good 'ole packages script used to run 82 # this happens at S98 where our good 'ole packages script used to run