Add a hack to the ccdv.oeclass that overrides the LIBTOOL variable in builds to make...
[vuplus_openembedded] / classes / update-rc.d.oeclass
1 DEPENDS_append = " update-rc.d"
2 RDEPENDS_append = " update-rc.d"
3
4 INIT_D_DIR = "${sysconfdir}/init.d"
5
6 updatercd_postinst() {
7 if test "x$D" != "x"; then
8         D="-r $D"
9 else
10         D="-s"
11 fi
12 update-rc.d $D ${INITSCRIPT_NAME} ${INITSCRIPT_PARAMS}
13 }
14
15 updatercd_postrm() {
16 if test "x$D" != "x"; then
17         D="-r $D"
18 else
19         ${INIT_D_DIR}/${INITSCRIPT_NAME} stop
20 fi
21 update-rc.d $D ${INITSCRIPT_NAME} remove
22 }
23
24 python __anonymous() {
25         if oe.data.getVar('INITSCRIPT_NAME', d) == None:
26                 raise oe.build.FuncFailed, "%s inherits update-rc.d but doesn't set INITSCRIPT_NAME" % oe.data.getVar('FILE', d)
27         if oe.data.getVar('INITSCRIPT_PARAMS', d) == None:
28                 raise oe.build.FuncFailed, "%s inherits update-rc.d but doesn't set INITSCRIPT_PARAMS" % oe.data.getVar('FILE', d)
29 }
30
31 python populate_packages_prepend () {
32         pkg = oe.data.getVar('PN', d, 1)
33         packages = (oe.data.getVar('PACKAGES', d, 1) or "").split()
34         if not pkg in packages:
35                 pkg = packages[0]
36         oe.note('adding update-rc.d calls to postinst/postrm for %s' % pkg)
37         postinst = oe.data.getVar('pkg_postinst_%s' % pkg, d, 1) or oe.data.getVar('pkg_postinst', d, 1)
38         if not postinst:
39                 postinst = '#!/bin/sh\n'
40         postinst += oe.data.getVar('updatercd_postinst', d, 1)
41         oe.data.setVar('pkg_postinst_%s' % pkg, postinst, d)
42         postrm = oe.data.getVar('pkg_postrm_%s' % pkg, d, 1) or oe.data.getVar('pkg_postrm', d, 1)
43         if not postrm:
44                 postrm = '#!/bin/sh\n'
45         postrm += oe.data.getVar('updatercd_postrm', d, 1)
46         oe.data.setVar('pkg_postrm_%s' % pkg, postrm, d)
47 }