commit: 56372d1da557172a2c66c0801fd60627e4176f59 Author: Aric Belsito <lluixhi <AT> gmail <DOT> com> AuthorDate: Sun Nov 20 19:50:17 2016 +0000 Commit: Aric Belsito <lluixhi <AT> gmail <DOT> com> CommitDate: Sun Nov 20 19:50:17 2016 +0000 URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=56372d1d
sys-power/acpid: Add Stable version. Latest doesn't require a patch, but it's not stable yet. sys-power/acpid/Manifest | 10 ++++ sys-power/acpid/acpid-2.0.23.ebuild | 73 +++++++++++++++++++++++++++ sys-power/acpid/files/acpid-1.0.4-default | 19 +++++++ sys-power/acpid/files/acpid-1.0.6-default.sh | 59 ++++++++++++++++++++++ sys-power/acpid/files/acpid-2.0.16-conf.d | 6 +++ sys-power/acpid/files/acpid-2.0.16-init.d | 21 ++++++++ sys-power/acpid/files/acpid-2.0.23-musl.patch | 67 ++++++++++++++++++++++++ sys-power/acpid/files/systemd/acpid.service | 10 ++++ sys-power/acpid/files/systemd/acpid.socket | 8 +++ sys-power/acpid/metadata.xml | 11 ++++ 10 files changed, 284 insertions(+) diff --git a/sys-power/acpid/Manifest b/sys-power/acpid/Manifest new file mode 100644 index 0000000..150e7e4 --- /dev/null +++ b/sys-power/acpid/Manifest @@ -0,0 +1,10 @@ +AUX acpid-1.0.4-default 663 SHA256 2b18111978043d68848983a54dfc946dd9b9b15592d0f4dc33491599dbe24b23 SHA512 817c971371046bdac72c644eed508b17fe524007f0cf360198d2649bc80254a0b127def0f6442288432ea2fb822b42299324507711feb13dd14a29e9315e9238 WHIRLPOOL 53b617a76c7a0716f1768789009ed0eca57b8b24e7e8f435d4cbb4cd6b1e201c1e28355c873893d73cbfcb0cb0f9091c438989016dc85c06f8df965307659842 +AUX acpid-1.0.6-default.sh 1231 SHA256 37079c125004cc7b66debc8021eb53b4b1dbcebd03f5dc213b4bbab34a1c1b01 SHA512 25629153eb97d7dc60d9a2b3a40fb7c22d4dd8ff84bbe5431230b70660d6ad8efb43976be062ac581b796f7e515722c67f8875a3aaa5f460a1172580dcac3d14 WHIRLPOOL 9e70f931c85c726f9ad8c7ae7498d40659d23f9d6d154893b7a2694e9ed68ea25c6e983662e5e92aada5a1ee373dfb5c78675746e53f4eb78f69010a8b743c3f +AUX acpid-2.0.16-conf.d 153 SHA256 3755d4eb8bb64a1304e5defedb949305ac550565da36fe4f94d5f31beee821ba SHA512 518cb397b2aa63b893ead1be08f32fe436d19b72663dee66834cfbc112b003333f0df8b9e4f1ffe64b813783f657d3fe8b9a0c5e992d5665583357e68b266705 WHIRLPOOL bc6e88e3558869e493725d3381633b2943f5fb0047f4157b847d02d54560df25e52b95d1e2899e3ac6f20bb405456e12866236265f77769184b9825cafa6f659 +AUX acpid-2.0.16-init.d 476 SHA256 ae1672a3db0786e66a7e0635fe558a67a3f1fbc201f5e22b3d19f7b52b3ebcbd SHA512 4d7816d5a4d46eca6e97be167ed2bd5394233cd5ba0470ab414d450cb211d12ebb02df0bd8139f2b623bf80aa95be8b0a00290a111a4fa8767a711740c18b0c7 WHIRLPOOL 44f957756640fddc2fdad9f4d072c1bc51e1f64c11c9f112e578ae1d309f138309416d81ad74ef0aba309a4b6dbacf6e070f27bdb1d0ebc72a25c40a134222e3 +AUX acpid-2.0.23-musl.patch 1548 SHA256 c2f8f53b7ba867556a60c6ca1635d3eddcb71f54ac63eb6e32a8ff5fa42cedbe SHA512 f5bc07703d821c4cb603766d0d4a7a6a60c607610fb72d610b067fb4c4257a9de526159e9195e9425db9f02de32f032e026f872bd24a35037d0feb8bb9f87c1f WHIRLPOOL 831724dd73279318f096f28371f7f5259f1151524356bee816f330875605b8ff3d37435bec70ab5be091705585fefee7a63cde3bb123e85c918d44ac29a1bc0a +AUX systemd/acpid.service 155 SHA256 93edfc49425ed60a4355d85b2c23ad5b0968e90fdf977edb06a20d49f9bd9028 SHA512 51c1e2a10968bd6555debf237c064dec7a347a5adfe0e8612e9ad49168e727d0779744ae8c2842b2e943dd46ab310343aeebb9eb6c9e85cb77123d966e8561b1 WHIRLPOOL 0cbbd618f6e3ac0e4b63d634095d84722caaa84e946b4f1e7036bff9ac05f45e23a8aa9f6101968c2c5af5ed29f1a9c420b7dd2271da3e59d9ecc9d04614f64e +AUX systemd/acpid.socket 119 SHA256 a6ea89749651e38ba79598d286fd252dc814461a2cb3ceba14c25a4d6aa10bc4 SHA512 9a8293166b3818255d39d972dd354e675d23e4d59fb4ce3a8b5dedbf33e809f808ae3020f308426ba8d9d1317396727edc5be5bf51a7a30bc40c809442c96c0a WHIRLPOOL 81dcdb288bc86b97035da911a102b2627b4573302e9dd98076cb4eb41ada564f6ef6751f4b863a54e97f2266010d29afa79ab3ada094a68bdd57b0e96921c507 +DIST acpid-2.0.23.tar.xz 154504 SHA256 4396aaec13510c3a1faa941a15a4b5335b6ae4fbec8438b9249b88c3b66187ee SHA512 b2f01f04a9c5370608016c16ecfbc5b503170c2686e6557ab1463e25d56a3ef1d2093d4701205ec1261564b1073653b404d0ae278c0bd8c8496606be1785963f WHIRLPOOL b9c7d4d64e663ffb9c58d2129b4f599453b4da0111b244269cf89ca50cc2de7ecdbea361825724963ee0b93294cadde12dee06c4816f5b709a23e7d443df0afd +EBUILD acpid-2.0.23.ebuild 1866 SHA256 cdb182bc34af09e8071169e117eb65f79d625f5ef7256b7d9abfae0cd61e4717 SHA512 240131300bdd009a4aa2a8600e2e8ad9a9ffe505c6b30e30b2f3aa2e613c6f534402be9788b322b5876bd1cea23c161feaf62ea4e2c7754eb98a412899728fbf WHIRLPOOL 0c88e4698cac1c8c09478d177074727836e1de0ff5ca68fb5db83f6fcf68710f5c44e55bedaa51094e8f6dc4fc23cae71242ad6c41fc822d0921941f4c724074 +MISC metadata.xml 325 SHA256 23d0fb33e95356f48defcf9d9c9662ee2a2bd32f32cb362679dacc20cfddfdb6 SHA512 0d624100b483b02a7dfa77048c4ca53a3cf22832fde166eee5a87374f2a4c1b655eae57b9b8b3b472a5603f7ca9b8353d00e619a14e618a6a097ffb179f6adf3 WHIRLPOOL 46be7ec7c2de80b33ee4d5e97350d1e0ff9f4c18b25935e3565f28a807edba9adb2352ec6b8f12d0eab5b367d066e8f4c1b449914ecd298ba4efb62b1340152e diff --git a/sys-power/acpid/acpid-2.0.23.ebuild b/sys-power/acpid/acpid-2.0.23.ebuild new file mode 100644 index 0000000..f946b03 --- /dev/null +++ b/sys-power/acpid/acpid-2.0.23.ebuild @@ -0,0 +1,73 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 +inherit linux-info systemd + +DESCRIPTION="Daemon for Advanced Configuration and Power Interface" +HOMEPAGE="https://sourceforge.net/projects/acpid2" +SRC_URI="mirror://sourceforge/${PN}2/${P}.tar.xz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 ia64 x86" +IUSE="selinux" + +RDEPEND="selinux? ( sec-policy/selinux-apm )" +DEPEND=">=sys-kernel/linux-headers-3" + +pkg_pretend() { + local CONFIG_CHECK="~INPUT_EVDEV" + local WARNING_INPUT_EVDEV="CONFIG_INPUT_EVDEV is required for ACPI button event support." + [[ ${MERGE_TYPE} != buildonly ]] && check_extra_config +} + +pkg_setup() { :; } + +src_prepare() { + # Fix for MUSL + epatch "${FILESDIR}"/${P}-musl.patch +} + +src_configure() { + econf --docdir=/usr/share/doc/${PF} +} + +src_install() { + emake DESTDIR="${D}" install + + newdoc kacpimon/README README.kacpimon + dodoc -r samples + rm -f "${D}"/usr/share/doc/${PF}/COPYING || die + + exeinto /etc/acpi + newexe "${FILESDIR}"/${PN}-1.0.6-default.sh default.sh + exeinto /etc/acpi/actions + newexe samples/powerbtn/powerbtn.sh powerbtn.sh + insinto /etc/acpi/events + newins "${FILESDIR}"/${PN}-1.0.4-default default + + newinitd "${FILESDIR}"/${PN}-2.0.16-init.d ${PN} + newconfd "${FILESDIR}"/${PN}-2.0.16-conf.d ${PN} + + systemd_dounit "${FILESDIR}"/systemd/${PN}.{service,socket} +} + +pkg_postinst() { + if [[ -z ${REPLACING_VERSIONS} ]]; then + elog + elog "You may wish to read the Gentoo Linux Power Management Guide," + elog "which can be found online at:" + elog "https://www.gentoo.org/doc/en/power-management-guide.xml" + elog + fi + + # files/systemd/acpid.socket -> ListenStream=/run/acpid.socket + mkdir -p "${ROOT%/}"/run + + if ! grep -qs "^tmpfs.*/run " "${ROOT%/}"/proc/mounts ; then + echo + ewarn "You should reboot the system now to get /run mounted with tmpfs!" + fi +} diff --git a/sys-power/acpid/files/acpid-1.0.4-default b/sys-power/acpid/files/acpid-1.0.4-default new file mode 100644 index 0000000..a07c182 --- /dev/null +++ b/sys-power/acpid/files/acpid-1.0.4-default @@ -0,0 +1,19 @@ +# /etc/acpi/events/default +# This is the ACPID default configuration, it takes all +# events and passes them to /etc/acpi/default.sh for further +# processing. + +# event keeps a regular expression matching the event. To get +# power events only, just use something like "event=button[ /]power.*" +# to catch it. +# action keeps the command to be executed after an event occurs +# In case of the power event above, your entry may look this way: +#event=button[ /]power.* +#action=/sbin/init 0 + +# Optionally you can specify the placeholder %e. It will pass +# through the whole kernel event message to the program you've +# specified. + +event=.* +action=/etc/acpi/default.sh %e diff --git a/sys-power/acpid/files/acpid-1.0.6-default.sh b/sys-power/acpid/files/acpid-1.0.6-default.sh new file mode 100644 index 0000000..8be6f3e --- /dev/null +++ b/sys-power/acpid/files/acpid-1.0.6-default.sh @@ -0,0 +1,59 @@ +#!/bin/sh +# /etc/acpi/default.sh +# Default acpi script that takes an entry for all actions + +set $* + +group=${1%%/*} +action=${1#*/} +device=$2 +id=$3 +value=$4 + +log_unhandled() { + logger "ACPI event unhandled: $*" +} + +case "$group" in + button) + case "$action" in + power) + /etc/acpi/actions/powerbtn.sh + ;; + + # if your laptop doesnt turn on/off the display via hardware + # switch and instead just generates an acpi event, you can force + # X to turn off the display via dpms. note you will have to run + # 'xhost +local:0' so root can access the X DISPLAY. + #lid) + # xset dpms force off + # ;; + + *) log_unhandled $* ;; + esac + ;; + + ac_adapter) + case "$value" in + # Add code here to handle when the system is unplugged + # (maybe change cpu scaling to powersave mode). For + # multicore systems, make sure you set powersave mode + # for each core! + #*0) + # cpufreq-set -g powersave + # ;; + + # Add code here to handle when the system is plugged in + # (maybe change cpu scaling to performance mode). For + # multicore systems, make sure you set performance mode + # for each core! + #*1) + # cpufreq-set -g performance + # ;; + + *) log_unhandled $* ;; + esac + ;; + + *) log_unhandled $* ;; +esac diff --git a/sys-power/acpid/files/acpid-2.0.16-conf.d b/sys-power/acpid/files/acpid-2.0.16-conf.d new file mode 100644 index 0000000..9aadb4c --- /dev/null +++ b/sys-power/acpid/files/acpid-2.0.16-conf.d @@ -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/sys-power/acpid/files/acpid-2.0.16-init.d b/sys-power/acpid/files/acpid-2.0.16-init.d new file mode 100644 index 0000000..cd57da8 --- /dev/null +++ b/sys-power/acpid/files/acpid-2.0.16-init.d @@ -0,0 +1,21 @@ +#!/sbin/openrc-run +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +extra_started_commands="reload" +command="/usr/sbin/acpid" +command_args="${ACPID_ARGS}" +start_stop_daemon_args="--quiet" +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/sys-power/acpid/files/acpid-2.0.23-musl.patch b/sys-power/acpid/files/acpid-2.0.23-musl.patch new file mode 100644 index 0000000..56d7f87 --- /dev/null +++ b/sys-power/acpid/files/acpid-2.0.23-musl.patch @@ -0,0 +1,67 @@ +Portability fixes: + +- Do not use isfdtype()... rather use fstat(2). +- Define TEMP_FAILURE_RETRY if needed. + +--- acpid.h 2014-02-26 01:36:58.788146100 +0100 ++++ acpid.h 2014-12-28 06:58:18.252702509 +0100 +@@ -39,6 +39,15 @@ + + #define PACKAGE "acpid" + ++#ifndef TEMP_FAILURE_RETRY ++# define TEMP_FAILURE_RETRY(expression) \ ++ (__extension__ \ ++ ({ long int __result; \ ++ do __result = (long int) (expression); \ ++ while (__result == -1L && errno == EINTR); \ ++ __result; })) ++#endif ++ + /* + * acpid.c + */ +--- kacpimon/libnetlink.c 2013-02-24 14:20:06.624844873 +0100 ++++ kacpimon/libnetlink.c 2014-12-28 06:59:50.283706615 +0100 +@@ -24,6 +24,7 @@ + #include <time.h> + #include <sys/uio.h> + ++#include "acpid.h" + #include "libnetlink.h" + + void rtnl_close(struct rtnl_handle *rth) +--- libnetlink.c 2012-07-15 00:29:38.168312376 +0200 ++++ libnetlink.c 2014-12-28 06:59:17.379705147 +0100 +@@ -24,6 +24,7 @@ + #include <time.h> + #include <sys/uio.h> + ++#include "acpid.h" + #include "libnetlink.h" + + void rtnl_close(struct rtnl_handle *rth) +--- sock.c 2013-08-15 01:30:44.655673004 +0200 ++++ sock.c 2014-12-28 07:11:31.198737890 +0100 +@@ -30,6 +30,7 @@ + #include <fcntl.h> + #include <stdio.h> + #include <stdlib.h> ++#include <string.h> + #include <errno.h> + #include <grp.h> + +@@ -53,7 +54,12 @@ int non_root_clients; + int + is_socket(int fd) + { +- return (isfdtype(fd, S_IFSOCK) == 1); ++ struct stat st; ++ ++ if (fstat(fd, &st) == 0) ++ return S_ISSOCK(st.st_mode); ++ ++ return -1; + } + + /* accept a new client connection */ diff --git a/sys-power/acpid/files/systemd/acpid.service b/sys-power/acpid/files/systemd/acpid.service new file mode 100644 index 0000000..e4ddacd --- /dev/null +++ b/sys-power/acpid/files/systemd/acpid.service @@ -0,0 +1,10 @@ +[Unit] +Description=ACPI event daemon +Requires=acpid.socket + +[Service] +ExecStart=/usr/sbin/acpid -f + +[Install] +WantedBy=multi-user.target +Also=acpid.socket diff --git a/sys-power/acpid/files/systemd/acpid.socket b/sys-power/acpid/files/systemd/acpid.socket new file mode 100644 index 0000000..1b23f87 --- /dev/null +++ b/sys-power/acpid/files/systemd/acpid.socket @@ -0,0 +1,8 @@ +[Unit] +Description=ACPID Listen Socket + +[Socket] +ListenStream=/var/run/acpid.socket + +[Install] +WantedBy=sockets.target diff --git a/sys-power/acpid/metadata.xml b/sys-power/acpid/metadata.xml new file mode 100644 index 0000000..763c9ef --- /dev/null +++ b/sys-power/acpid/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>[email protected]</email> + <name>Michal Hrušecký</name> + </maintainer> + <upstream> + <remote-id type="sourceforge">acpid2</remote-id> + </upstream> +</pkgmetadata>
