diff options
author | A. Wilcox <awilcox@wilcox-tech.com> | 2018-12-08 17:31:16 +0000 |
---|---|---|
committer | A. Wilcox <awilcox@wilcox-tech.com> | 2018-12-08 17:31:16 +0000 |
commit | 39af0df5ca8d7acd233d6cc872d184c41fbe6737 (patch) | |
tree | 4ff075126e3bf22fc26c7e58a484f27c44ec7f48 /user | |
parent | 4227be08fb2c9d6d668132b008a110ce4f6852a9 (diff) | |
parent | 6e5fd9cb2156eec3b6e8f71de371239d1c9af1b7 (diff) | |
download | packages-39af0df5ca8d7acd233d6cc872d184c41fbe6737.tar.gz packages-39af0df5ca8d7acd233d6cc872d184c41fbe6737.tar.bz2 packages-39af0df5ca8d7acd233d6cc872d184c41fbe6737.tar.xz packages-39af0df5ca8d7acd233d6cc872d184c41fbe6737.zip |
Merge branch 'master' into 'master'
user/acpid: new package
This merge requests adds the `acpid` daemon, which listens for ACPI events such as lid switches triggering or special purpose keyboard keys being pressed, and can be configured to take actions upon these events.
This is the first package I have made for Adelie, and the APKBUILD was created using `newapkbuild(8)` and is otherwise a mechanical conversion of Arch Linux's PKGBUILD with a sideways look at the APKBUILD of `system/at` for reference. Other distributions customarily include a default "catch-all" event handler which logs all ACPI events to syslog using `logger(1)`, so I have included one as part of the package.
I have copied the OpenRC init script and configuration script from Gentoo's gitweb; `acpid` itself is GPL 2 or later (according to the comments in the source code), while the OpenRC init script appears to be GPL 2 only. I'm not sure how to proceed here, however I have marked the package licence as "GPL-2.0+" -- some guidance on this would be appreciated.
See merge request !125
Diffstat (limited to 'user')
-rw-r--r-- | user/acpid/APKBUILD | 57 | ||||
-rw-r--r-- | user/acpid/acpid.confd | 6 | ||||
-rw-r--r-- | user/acpid/acpid.initd | 19 | ||||
-rw-r--r-- | user/acpid/default | 2 | ||||
-rw-r--r-- | user/acpid/handler.sh | 4 |
5 files changed, 88 insertions, 0 deletions
diff --git a/user/acpid/APKBUILD b/user/acpid/APKBUILD new file mode 100644 index 000000000..aa674dfbb --- /dev/null +++ b/user/acpid/APKBUILD @@ -0,0 +1,57 @@ +# Maintainer: multiplexd <multi@in-addr.xyz> +# Contributor: Morten Linderud <foxboron@archlinux.org> +# Contributor: Sébastien Luttringer +# Contributor: xduugu +# Contributor: Manolis Tzanidakis +# Contributor: Jonathan Schmidt <j.schmidt@archlinux.us> +# Contributor: multiplexd <multi@in-addr.xyz> + +pkgname=acpid +pkgver=2.0.31 +pkgrel=0 +pkgdesc="Daemon for handling ACPI power management events" +url="https://sourceforge.net/projects/acpid2/" +arch="all" +options="!check" # No test suite. +license="GPL-2.0+ AND GPL-2.0-only" +depends="" +makedepends="" +subpackages="$pkgname-doc $pkgname-openrc" +source="http://downloads.sourceforge.net/sourceforge/acpid2/$pkgname-$pkgver.tar.xz + handler.sh + default + acpid.initd + acpid.confd" + +build() { + cd "$builddir" + ./configure \ + --build=$CBUILD \ + --host=$CHOST \ + --prefix=/usr \ + --sbindir=/usr/sbin \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --localstatedir=/var + make +} + +package() { + cd "$builddir" + make DESTDIR="$pkgdir" install + + install -m 755 -D "$srcdir"/acpid.initd \ + "$pkgdir"/etc/init.d/acpid + install -m 644 -D "$srcdir"/acpid.confd \ + "$pkgdir"/etc/conf.d/acpid + install -m 644 -D "$srcdir"/default \ + "$pkgdir"/etc/acpi/events/default + install -m 755 -D "$srcdir"/handler.sh \ + "$pkgdir"/etc/acpi/handler.sh +} + +sha512sums="05eb96cdae698731b14caa89aa01239a0f16ce732f897d295447753aab7c8d49227c9b9ce901c6fd3bfdb117688e6ed80ec61aea0f64d75c9c0afe2aea2aa91a acpid-2.0.31.tar.xz +f5935340391a927b2c0b8d36f6b9579d740299a46c210f762483336f2685e80bdfc237dd5ac5eeed5e458eff2fa436cd36e3277c4ee2085e05662e1525c56edd handler.sh +2ca236168ce6aaa56c980568c781d6e51590870b7a7936c74bf72532ef3f6c60a369f37597202f3a236d60637fd0daa6611d4ae0348484011ff71871a9914246 default +7381d30b5c6478cdbf5dff93ae95baa0b3b1fe0a04b02cf491831f1657d6f71b8eef121b7e78f3201d11a5856bfb30df0a57437c76e6fbe05ad88cd45e86ae64 acpid.initd +518cb397b2aa63b893ead1be08f32fe436d19b72663dee66834cfbc112b003333f0df8b9e4f1ffe64b813783f657d3fe8b9a0c5e992d5665583357e68b266705 acpid.confd" diff --git a/user/acpid/acpid.confd b/user/acpid/acpid.confd new file mode 100644 index 000000000..9aadb4cd8 --- /dev/null +++ b/user/acpid/acpid.confd @@ -0,0 +1,6 @@ +# /etc/conf.d/acpid: config file for /etc/init.d/acpid + +# Options to pass to the acpid daemon. +# See the acpid(8) man page for more info. + +ACPID_ARGS="" diff --git a/user/acpid/acpid.initd b/user/acpid/acpid.initd new file mode 100644 index 000000000..f8076d43b --- /dev/null +++ b/user/acpid/acpid.initd @@ -0,0 +1,19 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +extra_started_commands="reload" +command="/usr/sbin/acpid" +command_args="${ACPID_ARGS}" +description="Daemon for Advanced Configuration and Power Interface" + +depend() { + need localmount + use logger +} + +reload() { + ebegin "Reloading acpid configuration" + start-stop-daemon --exec $command --signal HUP + eend $? +} diff --git a/user/acpid/default b/user/acpid/default new file mode 100644 index 000000000..96f031dbf --- /dev/null +++ b/user/acpid/default @@ -0,0 +1,2 @@ +event=.* +action=/etc/acpi/handler.sh %e diff --git a/user/acpid/handler.sh b/user/acpid/handler.sh new file mode 100644 index 000000000..8e291bc2b --- /dev/null +++ b/user/acpid/handler.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +logger "Received ACPI event: ${@}" + |