cleanup: replace some last manual lib install+symlink with calls to oe_soinstall.
[vuplus_openembedded] / apmd / apmd_3.2.0.oe
1 SECTION = "base"
2 PRIORITY = "required"
3 MAINTAINER = "Greg Gilbert <greg@treke.net>"
4 RDEPENDS = "libc6"
5 DEPENDS = "virtual/libc"
6 DESCRIPTION = "Set of tools for managing notebook power consumption."
7
8 SRC_URI = "${DEBIAN_MIRROR}/main/a/apmd/apmd_${PV}.orig.tar.gz;"
9 SRC_URI_append =" file://${FILESDIR}/apmd_${PV}-3.diff;patch=1"
10 SRC_URI_append =" file://${FILESDIR}/workaround.patch;patch=1"
11 SRC_URI_append =" file://${FILESDIR}/conf.patch;patch=1"
12 SRC_URI_append =" file://${FILESDIR}/proxy.patch;patch=1"
13 SRC_URI_append =" file://${FILESDIR}/compile.patch;patch=1"
14 SRC_URI_append =" file://${FILESDIR}/make.patch;patch=1"
15
16 S = "${WORKDIR}/apmd-${PV}.orig"
17
18 inherit libtool
19
20 do_compile() {
21         if [ -e ${STAGING_BINDIR}/${TARGET_SYS}-libtool ]; then
22             LIBTOOL=${STAGING_BINDIR}/${TARGET_SYS}-libtool
23         else
24             LIBTOOL=libtool
25         fi
26         oe_runmake "LIBTOOL=$LIBTOOL" apm apmd
27 }
28
29 do_stage() {
30         oe_soinstall .libs/libapm.so.1.0.0 ${STAGING_LIBDIR}/
31 }
32
33 do_install() {
34
35         install -d ${D}/${sysconfdir}
36         install -d ${D}/${sysconfdir}/apm
37         install -d ${D}/${sysconfdir}/apm/event.d
38         install -d ${D}/${sysconfdir}/apm/other.d
39         install -d ${D}/${sysconfdir}/apm/suspend.d
40         install -d ${D}/${sysconfdir}/apm/resume.d
41         install -d ${D}/${sysconfdir}/apm/scripts.d
42         install -d ${D}/${sysconfdir}/default
43         install -d ${D}/${sysconfdir}/init.d
44         install -d ${D}/${sbindir}
45         install -d ${D}/${bindir}
46         install -d ${D}/${libdir}
47         install -d ${D}/${datadir}/apmd
48         install -m 4755 ${S}/.libs/apm ${D}/${bindir}/apm.orig
49         install -m 0755 ${FILESDIR}/apmwrapper ${D}/${bindir}/apm
50         install -m 0755 ${S}/.libs/apmd ${D}/${sbindir}/apmd
51         install -m 0755 ${S}/debian/apmd_proxy ${D}/${sysconfdir}/apm/
52         install -m 0644 ${S}/debian/apmd_proxy.conf ${D}/${datadir}/apmd/
53         install -m 0644 ${S}/debian/apmd.default ${D}/${sysconfdir}/default/apmd
54         oe_soinstall .libs/libapm.so.1.0.0 ${D}/${libdir}/
55                     
56         cat ${FILESDIR}/init | sed -e 's,/usr/sbin,${sbindir},g; s,/etc,${sysconfdir},g;' > ${D}/${sysconfdir}/init.d/apmd
57         chmod 755 ${D}/${sysconfdir}/init.d/apmd
58 }
59
60 pkg_postinst () {
61         if test -n "$D"; then
62                 D="-r $D"
63         fi
64         update-rc.d $D apmd defaults
65 }
66
67 pkg_prerm () {
68         if test -n "$D"; then
69                 D="-r $D"
70         fi
71         update-rc.d $D apmd remove
72 }