Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "Utilities for Advanced Power Management" |
| 2 | DESCRIPTION = "The Advanced Power Management (APM) support provides \ |
| 3 | access to battery status information and a set of tools for managing \ |
| 4 | notebook power consumption." |
| 5 | HOMEPAGE = "http://apenwarr.ca/apmd/" |
| 6 | SECTION = "base" |
| 7 | LICENSE = "GPLv2+" |
| 8 | LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ |
| 9 | file://apm.h;beginline=6;endline=18;md5=7d4acc1250910a89f84ce3cc6557c4c2" |
| 10 | DEPENDS = "libtool-cross" |
| 11 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 12 | SRC_URI = "http://snapshot.debian.org/archive/debian/20160728T043443Z/pool/main/a/${BPN}/${BPN}_3.2.2.orig.tar.gz;name=tarball \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 13 | file://legacy.patch \ |
| 14 | file://libtool.patch \ |
| 15 | file://unlinux.patch \ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 16 | file://wexitcode.patch \ |
| 17 | file://linkage.patch \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 18 | file://init \ |
| 19 | file://default \ |
| 20 | file://apmd_proxy \ |
| 21 | file://apmd_proxy.conf \ |
| 22 | file://apmd.service" |
| 23 | |
| 24 | SRC_URI[tarball.md5sum] = "b1e6309e8331e0f4e6efd311c2d97fa8" |
| 25 | SRC_URI[tarball.sha256sum] = "7f7d9f60b7766b852881d40b8ff91d8e39fccb0d1d913102a5c75a2dbb52332d" |
| 26 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 27 | # 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 Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 29 | UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/a/apmd/" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 30 | UPSTREAM_CHECK_REGEX = "(?P<pver>((\d+\.*)+)-((\d+\.*)+))\.(diff|debian\.tar)\.(gz|xz)" |
| 31 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 32 | S = "${WORKDIR}/apmd-3.2.2.orig" |
| 33 | |
| 34 | inherit update-rc.d systemd |
| 35 | |
| 36 | INITSCRIPT_NAME = "apmd" |
| 37 | INITSCRIPT_PARAMS = "defaults" |
| 38 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 39 | SYSTEMD_SERVICE:${PN} = "apmd.service" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 40 | SYSTEMD_AUTO_ENABLE = "disable" |
| 41 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 42 | EXTRA_OEMAKE = "-e MAKEFLAGS=" |
| 43 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 44 | do_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 | |
| 49 | do_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 | |
| 82 | PACKAGES =+ "libapm apm" |
| 83 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 84 | FILES:libapm = "${libdir}/libapm${SOLIBS}" |
| 85 | FILES:apm = "${bindir}/apm*" |