Gentoo Archives: gentoo-commits

From: Marek Szuba <marecki@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-power/acpid/files/, sys-power/acpid/
Date: Wed, 06 Apr 2022 23:29:28
Message-Id: 1649287746.925b860332cacf91c6028e2082285ef1a9cb09c0.marecki@gentoo
1 commit: 925b860332cacf91c6028e2082285ef1a9cb09c0
2 Author: Marek Szuba <marecki <AT> gentoo <DOT> org>
3 AuthorDate: Wed Apr 6 22:05:28 2022 +0000
4 Commit: Marek Szuba <marecki <AT> gentoo <DOT> org>
5 CommitDate: Wed Apr 6 23:29:06 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=925b8603
7
8 sys-power/acpid: add 2.0.33
9
10 Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>
11
12 sys-power/acpid/Manifest | 1 +
13 sys-power/acpid/acpid-2.0.33.ebuild | 56 ++++++++++++++++++++++++++
14 sys-power/acpid/files/acpid-1.0.4-default | 19 +++++++++
15 sys-power/acpid/files/acpid-1.0.6-default.sh | 59 ++++++++++++++++++++++++++++
16 sys-power/acpid/files/acpid-2.0.16-conf.d | 6 +++
17 sys-power/acpid/files/acpid-2.0.26-init.d | 19 +++++++++
18 sys-power/acpid/files/acpid.service | 10 +++++
19 sys-power/acpid/files/acpid.socket | 8 ++++
20 8 files changed, 178 insertions(+)
21
22 diff --git a/sys-power/acpid/Manifest b/sys-power/acpid/Manifest
23 index 9b2b11111ae4..8c4bc36725df 100644
24 --- a/sys-power/acpid/Manifest
25 +++ b/sys-power/acpid/Manifest
26 @@ -1,2 +1,3 @@
27 DIST acpid-2.0.32.tar.xz 155768 BLAKE2B 829b2f78f497d9c0bbd90d952cadad96beece3070240bee69f2a5cf28903e9e5f969a3bf9000552c63a52c17f8b94285a181f4301449a9b64c573032d9a4d255 SHA512 c7afffdf9818504e1ac03b0ad693a05f772bfd07af9808262b3b6bb82ca4dabe6253c94e6dc59e5be6f0da9e815e8bcf2d3e16f02b23d0248b6bad4509e78be7
28 +DIST acpid-2.0.33.tar.xz 156580 BLAKE2B 72a0835f3d88f4ccae44016809fdb930977f6b02dae6f74068186a8c850237764a1e8cd69a478e5af42115d5f630a9f91cd77b35b8cf01854e24b7e06bbdd536 SHA512 491a58c62fcad44dc57cbd9294437fbc215c2ec99a030286601cd1956ea504e723e61b11b315983073d66aace1997bc40e6421475f6073298f60b8dcda2add75
29 DIST sys-power_acpid_2.0.32-r2_extras.tar.xz 2196 BLAKE2B 0975289f7cff6ce24523246f1daac22149d69c410e07a19a5952457e269fc1f736bd3636c93038f660c411f3085d375250c31dc3de3ac1bc6335a97e1fa3dea3 SHA512 f49cf3f75f5db4ca454d29330ae40461deb1109f076e140188a7560fedd78970572a6c023146c4d33c0778ff65056abcbc66725c000ece8e6861419d02d0c6ca
30
31 diff --git a/sys-power/acpid/acpid-2.0.33.ebuild b/sys-power/acpid/acpid-2.0.33.ebuild
32 new file mode 100644
33 index 000000000000..ea38f6148a38
34 --- /dev/null
35 +++ b/sys-power/acpid/acpid-2.0.33.ebuild
36 @@ -0,0 +1,56 @@
37 +# Copyright 1999-2022 Gentoo Authors
38 +# Distributed under the terms of the GNU General Public License v2
39 +
40 +EAPI=8
41 +
42 +inherit linux-info systemd
43 +
44 +DESCRIPTION="Daemon for Advanced Configuration and Power Interface"
45 +HOMEPAGE="https://sourceforge.net/projects/acpid2/"
46 +SRC_URI="mirror://sourceforge/${PN}2/${P}.tar.xz"
47 +
48 +LICENSE="GPL-2"
49 +SLOT="0"
50 +KEYWORDS="~amd64 ~arm ~arm64 ~ia64 ~riscv ~x86"
51 +IUSE="selinux"
52 +
53 +RDEPEND="selinux? ( sec-policy/selinux-apm )"
54 +DEPEND=">=sys-kernel/linux-headers-3"
55 +
56 +pkg_pretend() {
57 + local CONFIG_CHECK="~INPUT_EVDEV"
58 + local WARNING_INPUT_EVDEV="CONFIG_INPUT_EVDEV is required for ACPI button event support."
59 + [[ ${MERGE_TYPE} != buildonly ]] && check_extra_config
60 +}
61 +
62 +pkg_setup() { :; }
63 +
64 +src_install() {
65 + emake DESTDIR="${D}" install
66 +
67 + newdoc kacpimon/README README.kacpimon
68 + dodoc -r samples
69 + rm -f "${D}"/usr/share/doc/${PF}/COPYING || die
70 +
71 + exeinto /etc/acpi
72 + newexe "${FILESDIR}"/${PN}-1.0.6-default.sh default.sh
73 + exeinto /etc/acpi/actions
74 + newexe samples/powerbtn/powerbtn.sh powerbtn.sh
75 + insinto /etc/acpi/events
76 + newins "${FILESDIR}"/${PN}-1.0.4-default default
77 +
78 + newinitd "${FILESDIR}"/${PN}-2.0.26-init.d ${PN}
79 + newconfd "${FILESDIR}"/${PN}-2.0.16-conf.d ${PN}
80 +
81 + systemd_dounit "${FILESDIR}"/${PN}.{service,socket}
82 +}
83 +
84 +pkg_postinst() {
85 + if [[ -z ${REPLACING_VERSIONS} ]]; then
86 + elog
87 + elog "You may wish to read the Gentoo Linux Power Management Guide,"
88 + elog "which can be found online at:"
89 + elog "https://wiki.gentoo.org/wiki/Power_management/Guide"
90 + elog
91 + fi
92 +}
93
94 diff --git a/sys-power/acpid/files/acpid-1.0.4-default b/sys-power/acpid/files/acpid-1.0.4-default
95 new file mode 100644
96 index 000000000000..a07c1827f4e9
97 --- /dev/null
98 +++ b/sys-power/acpid/files/acpid-1.0.4-default
99 @@ -0,0 +1,19 @@
100 +# /etc/acpi/events/default
101 +# This is the ACPID default configuration, it takes all
102 +# events and passes them to /etc/acpi/default.sh for further
103 +# processing.
104 +
105 +# event keeps a regular expression matching the event. To get
106 +# power events only, just use something like "event=button[ /]power.*"
107 +# to catch it.
108 +# action keeps the command to be executed after an event occurs
109 +# In case of the power event above, your entry may look this way:
110 +#event=button[ /]power.*
111 +#action=/sbin/init 0
112 +
113 +# Optionally you can specify the placeholder %e. It will pass
114 +# through the whole kernel event message to the program you've
115 +# specified.
116 +
117 +event=.*
118 +action=/etc/acpi/default.sh %e
119
120 diff --git a/sys-power/acpid/files/acpid-1.0.6-default.sh b/sys-power/acpid/files/acpid-1.0.6-default.sh
121 new file mode 100644
122 index 000000000000..8be6f3e1a9f4
123 --- /dev/null
124 +++ b/sys-power/acpid/files/acpid-1.0.6-default.sh
125 @@ -0,0 +1,59 @@
126 +#!/bin/sh
127 +# /etc/acpi/default.sh
128 +# Default acpi script that takes an entry for all actions
129 +
130 +set $*
131 +
132 +group=${1%%/*}
133 +action=${1#*/}
134 +device=$2
135 +id=$3
136 +value=$4
137 +
138 +log_unhandled() {
139 + logger "ACPI event unhandled: $*"
140 +}
141 +
142 +case "$group" in
143 + button)
144 + case "$action" in
145 + power)
146 + /etc/acpi/actions/powerbtn.sh
147 + ;;
148 +
149 + # if your laptop doesnt turn on/off the display via hardware
150 + # switch and instead just generates an acpi event, you can force
151 + # X to turn off the display via dpms. note you will have to run
152 + # 'xhost +local:0' so root can access the X DISPLAY.
153 + #lid)
154 + # xset dpms force off
155 + # ;;
156 +
157 + *) log_unhandled $* ;;
158 + esac
159 + ;;
160 +
161 + ac_adapter)
162 + case "$value" in
163 + # Add code here to handle when the system is unplugged
164 + # (maybe change cpu scaling to powersave mode). For
165 + # multicore systems, make sure you set powersave mode
166 + # for each core!
167 + #*0)
168 + # cpufreq-set -g powersave
169 + # ;;
170 +
171 + # Add code here to handle when the system is plugged in
172 + # (maybe change cpu scaling to performance mode). For
173 + # multicore systems, make sure you set performance mode
174 + # for each core!
175 + #*1)
176 + # cpufreq-set -g performance
177 + # ;;
178 +
179 + *) log_unhandled $* ;;
180 + esac
181 + ;;
182 +
183 + *) log_unhandled $* ;;
184 +esac
185
186 diff --git a/sys-power/acpid/files/acpid-2.0.16-conf.d b/sys-power/acpid/files/acpid-2.0.16-conf.d
187 new file mode 100644
188 index 000000000000..9aadb4cd814a
189 --- /dev/null
190 +++ b/sys-power/acpid/files/acpid-2.0.16-conf.d
191 @@ -0,0 +1,6 @@
192 +# /etc/conf.d/acpid: config file for /etc/init.d/acpid
193 +
194 +# Options to pass to the acpid daemon.
195 +# See the acpid(8) man page for more info.
196 +
197 +ACPID_ARGS=""
198
199 diff --git a/sys-power/acpid/files/acpid-2.0.26-init.d b/sys-power/acpid/files/acpid-2.0.26-init.d
200 new file mode 100644
201 index 000000000000..f8076d43b0ab
202 --- /dev/null
203 +++ b/sys-power/acpid/files/acpid-2.0.26-init.d
204 @@ -0,0 +1,19 @@
205 +#!/sbin/openrc-run
206 +# Copyright 1999-2016 Gentoo Foundation
207 +# Distributed under the terms of the GNU General Public License v2
208 +
209 +extra_started_commands="reload"
210 +command="/usr/sbin/acpid"
211 +command_args="${ACPID_ARGS}"
212 +description="Daemon for Advanced Configuration and Power Interface"
213 +
214 +depend() {
215 + need localmount
216 + use logger
217 +}
218 +
219 +reload() {
220 + ebegin "Reloading acpid configuration"
221 + start-stop-daemon --exec $command --signal HUP
222 + eend $?
223 +}
224
225 diff --git a/sys-power/acpid/files/acpid.service b/sys-power/acpid/files/acpid.service
226 new file mode 100644
227 index 000000000000..e4ddacdbead7
228 --- /dev/null
229 +++ b/sys-power/acpid/files/acpid.service
230 @@ -0,0 +1,10 @@
231 +[Unit]
232 +Description=ACPI event daemon
233 +Requires=acpid.socket
234 +
235 +[Service]
236 +ExecStart=/usr/sbin/acpid -f
237 +
238 +[Install]
239 +WantedBy=multi-user.target
240 +Also=acpid.socket
241
242 diff --git a/sys-power/acpid/files/acpid.socket b/sys-power/acpid/files/acpid.socket
243 new file mode 100644
244 index 000000000000..1e5365bf1ecb
245 --- /dev/null
246 +++ b/sys-power/acpid/files/acpid.socket
247 @@ -0,0 +1,8 @@
248 +[Unit]
249 +Description=ACPID Listen Socket
250 +
251 +[Socket]
252 +ListenStream=/run/acpid.socket
253 +
254 +[Install]
255 +WantedBy=sockets.target