blob: ea105268a60d9973c8d5a9a778e4ce95a9b40728 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "Utilities for Advanced Power Management"
2DESCRIPTION = "The Advanced Power Management (APM) support provides \
3access to battery status information and a set of tools for managing \
4notebook power consumption."
5HOMEPAGE = "http://apenwarr.ca/apmd/"
6SECTION = "base"
7LICENSE = "GPLv2+"
8LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
9 file://apm.h;beginline=6;endline=18;md5=7d4acc1250910a89f84ce3cc6557c4c2"
10DEPENDS = "libtool-cross"
11
12SRC_URI = "${DEBIAN_MIRROR}/main/a/apmd/apmd_3.2.2.orig.tar.gz;name=tarball \
13 file://legacy.patch \
14 file://libtool.patch \
15 file://unlinux.patch \
16 file://init \
17 file://default \
18 file://apmd_proxy \
19 file://apmd_proxy.conf \
20 file://apmd.service"
21
22SRC_URI[tarball.md5sum] = "b1e6309e8331e0f4e6efd311c2d97fa8"
23SRC_URI[tarball.sha256sum] = "7f7d9f60b7766b852881d40b8ff91d8e39fccb0d1d913102a5c75a2dbb52332d"
24
25S = "${WORKDIR}/apmd-3.2.2.orig"
26
27inherit update-rc.d systemd
28
29INITSCRIPT_NAME = "apmd"
30INITSCRIPT_PARAMS = "defaults"
31
32SYSTEMD_SERVICE_${PN} = "apmd.service"
33SYSTEMD_AUTO_ENABLE = "disable"
34
35do_compile() {
36 # apmd doesn't use whole autotools. Just libtool for installation
37 oe_runmake "LIBTOOL=${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool" apm apmd
38}
39
40do_install() {
41 install -d ${D}${sysconfdir}
42 install -d ${D}${sysconfdir}/apm
43 install -d ${D}${sysconfdir}/apm/event.d
44 install -d ${D}${sysconfdir}/apm/other.d
45 install -d ${D}${sysconfdir}/apm/suspend.d
46 install -d ${D}${sysconfdir}/apm/resume.d
47 install -d ${D}${sysconfdir}/apm/scripts.d
48 install -d ${D}${sysconfdir}/default
49 install -d ${D}${sysconfdir}/init.d
50 install -d ${D}${sbindir}
51 install -d ${D}${bindir}
52 install -d ${D}${libdir}
53 install -d ${D}${datadir}/apmd
54 install -d ${D}${includedir}
55
56 install -m 4755 ${S}/.libs/apm ${D}${bindir}/apm
57 install -m 0755 ${S}/.libs/apmd ${D}${sbindir}/apmd
58 install -m 0755 ${WORKDIR}/apmd_proxy ${D}${sysconfdir}/apm/
59 install -m 0644 ${WORKDIR}/apmd_proxy.conf ${D}${datadir}/apmd/
60 install -m 0644 ${WORKDIR}/default ${D}${sysconfdir}/default/apmd
61 oe_libinstall -so libapm ${D}${libdir}
62 install -m 0644 apm.h ${D}${includedir}
63
64 sed -e 's,/usr/sbin,${sbindir},g; s,/etc,${sysconfdir},g;' ${WORKDIR}/init > ${D}${sysconfdir}/init.d/apmd
65 chmod 755 ${D}${sysconfdir}/init.d/apmd
66
67 install -d ${D}${systemd_unitdir}/system
68 install -m 0644 ${WORKDIR}/apmd.service ${D}${systemd_unitdir}/system/
69 sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' \
70 -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/apmd.service
71}
72
73PACKAGES =+ "libapm apm"
74
75FILES_libapm = "${libdir}/libapm${SOLIBS}"
76FILES_apm = "${bindir}/apm*"