blob: 54bb5be49970790c2462dc298af09098e853ca85 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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
|