xref: /OK3568_Linux_fs/yocto/poky/meta/recipes-bsp/apmd/apmd_3.2.2-15.bb (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunSUMMARY = "Utilities for Advanced Power Management"
2*4882a593SmuzhiyunDESCRIPTION = "The Advanced Power Management (APM) support provides \
3*4882a593Smuzhiyunaccess to battery status information and a set of tools for managing \
4*4882a593Smuzhiyunnotebook power consumption."
5*4882a593SmuzhiyunHOMEPAGE = "http://apenwarr.ca/apmd/"
6*4882a593SmuzhiyunSECTION = "base"
7*4882a593SmuzhiyunLICENSE = "GPL-2.0-or-later"
8*4882a593SmuzhiyunLIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
9*4882a593Smuzhiyun                    file://apm.h;beginline=6;endline=18;md5=7d4acc1250910a89f84ce3cc6557c4c2"
10*4882a593SmuzhiyunDEPENDS = "libtool-cross"
11*4882a593Smuzhiyun
12*4882a593SmuzhiyunSRC_URI = "http://snapshot.debian.org/archive/debian/20160728T043443Z/pool/main/a/${BPN}/${BPN}_3.2.2.orig.tar.gz;name=tarball \
13*4882a593Smuzhiyun           file://legacy.patch \
14*4882a593Smuzhiyun           file://libtool.patch \
15*4882a593Smuzhiyun           file://unlinux.patch \
16*4882a593Smuzhiyun           file://wexitcode.patch \
17*4882a593Smuzhiyun           file://linkage.patch \
18*4882a593Smuzhiyun           file://init \
19*4882a593Smuzhiyun           file://default \
20*4882a593Smuzhiyun           file://apmd_proxy \
21*4882a593Smuzhiyun           file://apmd_proxy.conf \
22*4882a593Smuzhiyun           file://apmd.service"
23*4882a593Smuzhiyun
24*4882a593SmuzhiyunSRC_URI[tarball.md5sum] = "b1e6309e8331e0f4e6efd311c2d97fa8"
25*4882a593SmuzhiyunSRC_URI[tarball.sha256sum] = "7f7d9f60b7766b852881d40b8ff91d8e39fccb0d1d913102a5c75a2dbb52332d"
26*4882a593Smuzhiyun
27*4882a593Smuzhiyun# for this package we're mostly interested in tracking debian patches,
28*4882a593Smuzhiyun# and not in the upstream version where all development has effectively stopped
29*4882a593SmuzhiyunUPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/a/apmd/"
30*4882a593SmuzhiyunUPSTREAM_CHECK_REGEX = "(?P<pver>((\d+\.*)+)-((\d+\.*)+))\.(diff|debian\.tar)\.(gz|xz)"
31*4882a593Smuzhiyun
32*4882a593SmuzhiyunS = "${WORKDIR}/apmd-3.2.2.orig"
33*4882a593Smuzhiyun
34*4882a593Smuzhiyuninherit update-rc.d systemd
35*4882a593Smuzhiyun
36*4882a593SmuzhiyunINITSCRIPT_NAME = "apmd"
37*4882a593SmuzhiyunINITSCRIPT_PARAMS = "defaults"
38*4882a593Smuzhiyun
39*4882a593SmuzhiyunSYSTEMD_SERVICE:${PN} = "apmd.service"
40*4882a593SmuzhiyunSYSTEMD_AUTO_ENABLE = "disable"
41*4882a593Smuzhiyun
42*4882a593SmuzhiyunEXTRA_OEMAKE = "-e MAKEFLAGS="
43*4882a593Smuzhiyun
44*4882a593Smuzhiyundo_compile() {
45*4882a593Smuzhiyun	# apmd doesn't use whole autotools. Just libtool for installation
46*4882a593Smuzhiyun	oe_runmake apm apmd
47*4882a593Smuzhiyun}
48*4882a593Smuzhiyun
49*4882a593Smuzhiyundo_install() {
50*4882a593Smuzhiyun	install -d ${D}${sysconfdir}
51*4882a593Smuzhiyun	install -d ${D}${sysconfdir}/apm
52*4882a593Smuzhiyun	install -d ${D}${sysconfdir}/apm/event.d
53*4882a593Smuzhiyun	install -d ${D}${sysconfdir}/apm/other.d
54*4882a593Smuzhiyun	install -d ${D}${sysconfdir}/apm/suspend.d
55*4882a593Smuzhiyun	install -d ${D}${sysconfdir}/apm/resume.d
56*4882a593Smuzhiyun	install -d ${D}${sysconfdir}/apm/scripts.d
57*4882a593Smuzhiyun	install -d ${D}${sysconfdir}/default
58*4882a593Smuzhiyun	install -d ${D}${sysconfdir}/init.d
59*4882a593Smuzhiyun	install -d ${D}${sbindir}
60*4882a593Smuzhiyun	install -d ${D}${bindir}
61*4882a593Smuzhiyun	install -d ${D}${libdir}
62*4882a593Smuzhiyun	install -d ${D}${datadir}/apmd
63*4882a593Smuzhiyun	install -d ${D}${includedir}
64*4882a593Smuzhiyun
65*4882a593Smuzhiyun	install -m 4755 ${S}/.libs/apm ${D}${bindir}/apm
66*4882a593Smuzhiyun	install -m 0755 ${S}/.libs/apmd ${D}${sbindir}/apmd
67*4882a593Smuzhiyun	install -m 0755 ${WORKDIR}/apmd_proxy ${D}${sysconfdir}/apm/
68*4882a593Smuzhiyun	install -m 0644 ${WORKDIR}/apmd_proxy.conf ${D}${datadir}/apmd/
69*4882a593Smuzhiyun	install -m 0644 ${WORKDIR}/default ${D}${sysconfdir}/default/apmd
70*4882a593Smuzhiyun	oe_libinstall -so libapm ${D}${libdir}
71*4882a593Smuzhiyun	install -m 0644 apm.h ${D}${includedir}
72*4882a593Smuzhiyun
73*4882a593Smuzhiyun	sed -e 's,/usr/sbin,${sbindir},g; s,/etc,${sysconfdir},g;' ${WORKDIR}/init > ${D}${sysconfdir}/init.d/apmd
74*4882a593Smuzhiyun	chmod 755 ${D}${sysconfdir}/init.d/apmd
75*4882a593Smuzhiyun
76*4882a593Smuzhiyun	install -d ${D}${systemd_system_unitdir}
77*4882a593Smuzhiyun	install -m 0644 ${WORKDIR}/apmd.service ${D}${systemd_system_unitdir}/
78*4882a593Smuzhiyun	sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' \
79*4882a593Smuzhiyun		-e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_system_unitdir}/apmd.service
80*4882a593Smuzhiyun}
81*4882a593Smuzhiyun
82*4882a593SmuzhiyunPACKAGES =+ "libapm apm"
83*4882a593Smuzhiyun
84*4882a593SmuzhiyunFILES:libapm = "${libdir}/libapm${SOLIBS}"
85*4882a593SmuzhiyunFILES:apm = "${bindir}/apm*"
86