summaryrefslogtreecommitdiff
path: root/opt/acpid/MAKEPKG
diff options
context:
space:
mode:
authorrawnix ports <ports@rawnix.org>2026-09-26 18:19:05 +0000
committerrawnix ports <ports@rawnix.org>2026-09-26 18:19:05 +0000
commitc82e88dd00d1b0b7fcfb4e5628d99611388cef6f (patch)
tree56d864b5a5c6c145edd96178ae219a8f90e191a6 /opt/acpid/MAKEPKG
downloadports-c82e88dd00d1b0b7fcfb4e5628d99611388cef6f.tar.gz
sync 2026-09-26 18:19 UTC
1672 files changed, 151396 insertions(+)
Diffstat (limited to 'opt/acpid/MAKEPKG')
-rw-r--r--opt/acpid/MAKEPKG84
1 files changed, 84 insertions, 0 deletions
diff --git a/opt/acpid/MAKEPKG b/opt/acpid/MAKEPKG
new file mode 100644
index 0000000..54bb5be
--- /dev/null
+++ b/opt/acpid/MAKEPKG
@@ -0,0 +1,84 @@
+#!/bin/mkpkg
+# description: Daemon for delivering ACPI power management events
+# url: https://sourceforge.net/projects/acpid2/
+
+name=acpid
+version=2.0.34
+release=1
+depends=()
+services=(acpid)
+source=(
+ https://downloads.sourceforge.net/acpid2/acpid-${version}.tar.xz
+ fix-musl.patch
+)
+sha256sums=(
+ "2d095c8cfcbc847caec746d62cdc8d0bff1ec1bc72ef7c674c721e04da6ab333"
+ "bbab52f0121c215655f145428d163e36ac019090cc07323980e746413dcb97e8"
+)
+patch() {
+ cd ${name}-${version}
+ patch -p1 < ../fix-musl.patch
+}
+
+build() {
+ cd ${name}-${version}
+
+ ./configure --prefix=/usr --sbindir=/usr/sbin
+
+ make
+ make DESTDIR=${PKG} install
+
+ install -d ${PKG}/etc/acpi/events
+
+ printf '%s\n' \
+ 'event=.*' \
+ 'action=/etc/acpi/handler.sh %e' \
+ > ${PKG}/etc/acpi/events/anything
+
+ printf '%s\n' \
+ '#!/bin/sh' \
+ '' \
+ 'case "$1" in' \
+ ' button/power)' \
+ ' logger "ACPI: power button pressed"' \
+ ' ;;' \
+ ' button/lid)' \
+ ' case "$3" in' \
+ ' close) logger "ACPI: lid closed" ;;' \
+ ' open) logger "ACPI: lid opened" ;;' \
+ ' esac' \
+ ' ;;' \
+ ' *)' \
+ ' logger "ACPI: unhandled event $*"' \
+ ' ;;' \
+ 'esac' \
+ > ${PKG}/etc/acpi/handler.sh
+
+ chmod 755 ${PKG}/etc/acpi/handler.sh
+}
+
+post_build() {
+ # runit service
+ install -d ${PKG}/etc/sv/acpid/log
+
+ printf '%s\n' \
+ '#!/bin/sh' \
+ 'exec 2>&1' \
+ 'exec acpid -f' \
+ > ${PKG}/etc/sv/acpid/run
+
+ printf '%s\n' \
+ '#!/bin/sh' \
+ 'mkdir -p /var/log/acpid' \
+ 'exec svlogd -tt /var/log/acpid' \
+ > ${PKG}/etc/sv/acpid/log/run
+
+ chmod 755 ${PKG}/etc/sv/acpid/run
+ chmod 755 ${PKG}/etc/sv/acpid/log/run
+}
+
+signify() {
+ untrusted comment: public key
+ RWTZ9IduCSQ/mL8337TEUinPwT92xFEUpD92hkS7IxcOnzTt9QdpohT3
+}
+# vim: filetype=sh