#!/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