Merge branch 'org.openembedded.dev' of git://git.openembedded.net/openembedded into...
[vuplus_openembedded] / packages / apmd / apmd_3.2.2.bb
1 DESCRIPTION = "Set of tools for managing notebook power consumption."
2 SECTION = "base"
3 PRIORITY = "required"
4 DEPENDS = "libtool-cross"
5 LICENSE = "GPL"
6 PR = "r11"
7
8 SRC_URI = "${DEBIAN_MIRROR}/main/a/apmd/apmd_${PV}.orig.tar.gz \
9            file://debian.patch;patch=1 \
10            file://workaround.patch;patch=1 \
11            file://zaurus24.patch;patch=1 \
12            file://unlinux.patch;patch=1 \
13            file://libtool.patch;patch=1 \
14            file://init \
15            file://default \
16            file://apmd_proxy \
17            file://apmd_proxy.conf"
18
19 S = "${WORKDIR}/apmd-${PV}.orig"
20
21 inherit update-rc.d
22
23 INITSCRIPT_NAME = "apmd"
24 INITSCRIPT_PARAMS = "defaults"
25
26 do_compile() {
27         oe_runmake "LIBTOOL=${STAGING_BINDIR_NATIVE}/${TARGET_PREFIX}libtool" apm apmd
28 }
29
30 do_stage() {
31         install -m 0644 apm.h ${STAGING_INCDIR}
32         oe_libinstall -so libapm ${STAGING_LIBDIR}
33 }
34
35 do_install() {
36         install -d ${D}${sysconfdir}
37         install -d ${D}${sysconfdir}/apm
38         install -d ${D}${sysconfdir}/apm/event.d
39         install -d ${D}${sysconfdir}/apm/other.d
40         install -d ${D}${sysconfdir}/apm/suspend.d
41         install -d ${D}${sysconfdir}/apm/resume.d
42         install -d ${D}${sysconfdir}/apm/scripts.d
43         install -d ${D}${sysconfdir}/default
44         install -d ${D}${sysconfdir}/init.d
45         install -d ${D}${sbindir}
46         install -d ${D}${bindir}
47         install -d ${D}${libdir}
48         install -d ${D}${datadir}/apmd
49         install -d ${D}${includedir}
50
51         install -m 4755 ${S}/.libs/apm ${D}${bindir}/apm
52         install -m 0755 ${S}/.libs/apmd ${D}${sbindir}/apmd
53         install -m 0755 ${WORKDIR}/apmd_proxy ${D}${sysconfdir}/apm/
54         install -m 0644 ${WORKDIR}/apmd_proxy.conf ${D}${datadir}/apmd/
55         install -m 0644 ${WORKDIR}/default ${D}${sysconfdir}/default/apmd
56         oe_libinstall -so libapm ${D}${libdir}
57         install -m 0644 apm.h ${D}${includedir}
58
59         cat ${WORKDIR}/init | sed -e 's,/usr/sbin,${sbindir},g; s,/etc,${sysconfdir},g;' > ${D}${sysconfdir}/init.d/apmd
60         chmod 755 ${D}${sysconfdir}/init.d/apmd
61 }
62
63 PACKAGES =+ "libapm libapm-dev apm"
64
65 FILES_libapm = "${libdir}/libapm.so.*"
66 FILES_libapm-dev = "${libdir}/libapm.* ${includedir}"
67 FILES_apm = "${bindir}/apm*"