blob: 82c2649340e7c81465c1f3f746a3c08c063449d4 [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
Patrick Williamsc0f7c042017-02-23 20:41:17 -060012SRC_URI = "http://snapshot.debian.org/archive/debian/20160728T043443Z/pool/main/a/${BPN}/${BPN}_3.2.2.orig.tar.gz;name=tarball \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050013 file://legacy.patch \
14 file://libtool.patch \
15 file://unlinux.patch \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050016 file://wexitcode.patch \
17 file://linkage.patch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050018 file://init \
19 file://default \
20 file://apmd_proxy \
21 file://apmd_proxy.conf \
22 file://apmd.service"
23
24SRC_URI[tarball.md5sum] = "b1e6309e8331e0f4e6efd311c2d97fa8"
25SRC_URI[tarball.sha256sum] = "7f7d9f60b7766b852881d40b8ff91d8e39fccb0d1d913102a5c75a2dbb52332d"
26
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050027# for this package we're mostly interested in tracking debian patches,
28# and not in the upstream version where all development has effectively stopped
Patrick Williamsc0f7c042017-02-23 20:41:17 -060029UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/a/apmd/"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050030UPSTREAM_CHECK_REGEX = "(?P<pver>((\d+\.*)+)-((\d+\.*)+))\.(diff|debian\.tar)\.(gz|xz)"
31
Patrick Williamsc124f4f2015-09-15 14:41:29 -050032S = "${WORKDIR}/apmd-3.2.2.orig"
33
34inherit update-rc.d systemd
35
36INITSCRIPT_NAME = "apmd"
37INITSCRIPT_PARAMS = "defaults"
38
39SYSTEMD_SERVICE_${PN} = "apmd.service"
40SYSTEMD_AUTO_ENABLE = "disable"
41
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050042EXTRA_OEMAKE = "-e MAKEFLAGS="
43
Patrick Williamsc124f4f2015-09-15 14:41:29 -050044do_compile() {
45 # apmd doesn't use whole autotools. Just libtool for installation
46 oe_runmake "LIBTOOL=${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool" apm apmd
47}
48
49do_install() {
50 install -d ${D}${sysconfdir}
51 install -d ${D}${sysconfdir}/apm
52 install -d ${D}${sysconfdir}/apm/event.d
53 install -d ${D}${sysconfdir}/apm/other.d
54 install -d ${D}${sysconfdir}/apm/suspend.d
55 install -d ${D}${sysconfdir}/apm/resume.d
56 install -d ${D}${sysconfdir}/apm/scripts.d
57 install -d ${D}${sysconfdir}/default
58 install -d ${D}${sysconfdir}/init.d
59 install -d ${D}${sbindir}
60 install -d ${D}${bindir}
61 install -d ${D}${libdir}
62 install -d ${D}${datadir}/apmd
63 install -d ${D}${includedir}
64
65 install -m 4755 ${S}/.libs/apm ${D}${bindir}/apm
66 install -m 0755 ${S}/.libs/apmd ${D}${sbindir}/apmd
67 install -m 0755 ${WORKDIR}/apmd_proxy ${D}${sysconfdir}/apm/
68 install -m 0644 ${WORKDIR}/apmd_proxy.conf ${D}${datadir}/apmd/
69 install -m 0644 ${WORKDIR}/default ${D}${sysconfdir}/default/apmd
70 oe_libinstall -so libapm ${D}${libdir}
71 install -m 0644 apm.h ${D}${includedir}
72
73 sed -e 's,/usr/sbin,${sbindir},g; s,/etc,${sysconfdir},g;' ${WORKDIR}/init > ${D}${sysconfdir}/init.d/apmd
74 chmod 755 ${D}${sysconfdir}/init.d/apmd
75
76 install -d ${D}${systemd_unitdir}/system
77 install -m 0644 ${WORKDIR}/apmd.service ${D}${systemd_unitdir}/system/
78 sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' \
79 -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/apmd.service
80}
81
82PACKAGES =+ "libapm apm"
83
84FILES_libapm = "${libdir}/libapm${SOLIBS}"
85FILES_apm = "${bindir}/apm*"