summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuli Suominen <ssuominen@gentoo.org>2010-04-28 15:21:07 +0000
committerSamuli Suominen <ssuominen@gentoo.org>2010-04-28 15:21:07 +0000
commit671e9d78746f01489c373eed52900c753ffee4a4 (patch)
treeb080f0c0286049ab56e584bc4457d8d74bab8fd2 /sys-power
parentx86 stable wrt bug #316299 (diff)
downloadhistorical-671e9d78746f01489c373eed52900c753ffee4a4.tar.gz
historical-671e9d78746f01489c373eed52900c753ffee4a4.tar.bz2
historical-671e9d78746f01489c373eed52900c753ffee4a4.zip
New powerbtn.sh (power button script forked from fedora) wrt #317421.
Package-Manager: portage-2.2_rc67/cvs/Linux x86_64
Diffstat (limited to 'sys-power')
-rw-r--r--sys-power/acpid/ChangeLog8
-rw-r--r--sys-power/acpid/Manifest6
-rw-r--r--sys-power/acpid/acpid-2.0.4-r1.ebuild64
-rw-r--r--sys-power/acpid/files/acpid-2.0.4-powerbtn.sh30
-rw-r--r--sys-power/acpid/metadata.xml5
5 files changed, 109 insertions, 4 deletions
diff --git a/sys-power/acpid/ChangeLog b/sys-power/acpid/ChangeLog
index 922b0e6dc7ee..fe5e30074ab1 100644
--- a/sys-power/acpid/ChangeLog
+++ b/sys-power/acpid/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for sys-power/acpid
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-power/acpid/ChangeLog,v 1.46 2010/04/26 12:55:42 ssuominen Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-power/acpid/ChangeLog,v 1.47 2010/04/28 15:21:07 ssuominen Exp $
+
+*acpid-2.0.4-r1 (28 Apr 2010)
+
+ 28 Apr 2010; Samuli Suominen <ssuominen@gentoo.org>
+ +acpid-2.0.4-r1.ebuild, +files/acpid-2.0.4-powerbtn.sh:
+ New powerbtn.sh (power button script forked from fedora) wrt #317421.
*acpid-2.0.4 (26 Apr 2010)
diff --git a/sys-power/acpid/Manifest b/sys-power/acpid/Manifest
index da3a81071090..3aeed17a99c7 100644
--- a/sys-power/acpid/Manifest
+++ b/sys-power/acpid/Manifest
@@ -5,6 +5,7 @@ AUX acpid-1.0.6-init.d 818 RMD160 f840ae1b287d303076fcb1b553a53dd7c0664fc0 SHA1
AUX acpid-2.0.3-init.d 668 RMD160 66d460850e02e8e817c3dbabef120a0d0e53758f SHA1 f4fc04c345215eb4c1ec971d284cb18a9405a0e8 SHA256 70d0ffc4cc11046e4445619784e187c009a97273b9826e7f62a0b7c92aa330d0
AUX acpid-2.0.3.patch 881 RMD160 81a32d23d72e3104d67c37863f14aa88fe8b5b39 SHA1 ea9c629cbfed5f2e3e34c4d242fcff2b69fda51d SHA256 d313d9645e705221ef9f4610a0b127ee38240125d5e2f39554537bde38a7a813
AUX acpid-2.0.4-default.sh 1223 RMD160 b1330c8ead1dc178539458913149fd2bf18723d1 SHA1 aaeb6e48d26a99942780940f6b7e09618e569880 SHA256 da6912652012d202d833810616c2ce5021e2e17f1c086395e439aad836b14e00
+AUX acpid-2.0.4-powerbtn.sh 657 RMD160 fe8578984fced622e726cf8212db2630722b26cd SHA1 f2268124fc7cc955e4c8b265f70baf2e2857ba70 SHA256 5d36b6900083c05c57b0a88a6ece2be9b6c16293ffbedcadc96a5831ac681f38
DIST acpid-1.0.10-netlink3.tar.bz2 84647 RMD160 e677ce9a4c1a3bb3412c72b4afbfbf8336f0442e SHA1 fd01f9cb7856ab40c8f5ce6467944982e3202e59 SHA256 883a95e08c32fd7864de83ec3f5b51082bb16e7b200a40aa518be6de7d84d66e
DIST acpid-1.0.10-netlink4.tar.gz 53761 RMD160 48eb7fe7f27935ff0aa69dd5c5798a89e5523723 SHA1 5f4875f194a2c893f9786e5bd9e7604f8c60ad43 SHA256 175697b9aaa6659cb375d0289cc56d8f8c19fe9de6bdfaafa1302d5f523758f7
DIST acpid-2.0.3.tar.gz 72787 RMD160 ffc747d4aea905ddc979f6ad2cc350b7d080ca58 SHA1 f2663db294d91a35dd07cfb78ef77bf1bab545c0 SHA256 be5f85a0bffa954a6c0f82f9a90914cbe78d8863a05b110a6683566964e053b8
@@ -12,6 +13,7 @@ DIST acpid-2.0.4.tar.gz 73730 RMD160 59db3e5926beebfa6ff131c79cbbecf0a9e72027 SH
EBUILD acpid-1.0.10_p3.ebuild 1544 RMD160 f95fda8c9bff2af92bb8086fd2357fc06ed7849b SHA1 b7d30edd0925ae487569c674aca4ed7a028a0242 SHA256 6ffc0b5f7c44ed749a3fc9af810d830516d12e05e5e64d536bb8e6de15865745
EBUILD acpid-1.0.10_p4.ebuild 1786 RMD160 06df9b51d06d2bd08ccd5a8826d5c5de19e596ef SHA1 40e20f70e02c3293c6744714f830dde67692813b SHA256 73b1a0b15cbeaf5e08b0e9a32c3c3662e8742d36e1191bf5ba05cf2dbf1412e0
EBUILD acpid-2.0.3-r1.ebuild 1294 RMD160 7a56a5f3377d416b4da800757d0bf7361c76eb72 SHA1 a2969720303b34ffea66d2bd0619076d6970023a SHA256 1518b5470cbc4ba5c121f78a9b71612e946391747febaa245a38784503c3c8a7
+EBUILD acpid-2.0.4-r1.ebuild 1634 RMD160 df08d2f542ad307b128e69c564f30d4ca8405c14 SHA1 7185aa2ee9677f4a0bd0f194e530d69e1719ea7e SHA256 9c42952c1a82aa5b3a7e8475c089e79caaf2032d0790a9a728e559220c9d0ce2
EBUILD acpid-2.0.4.ebuild 1342 RMD160 9a14da70ccb9d811b09d16e818c0977f988cc196 SHA1 bc99284eda219511c2a704cfe7eb81d1d8ac8f9f SHA256 f426472d7277450018d284d4e1b61f714be1407ce017d0bab863449c92806a9c
-MISC ChangeLog 10582 RMD160 fb8e06f084ef6a73b685c2203242d693e598e289 SHA1 3e42e6218079f0349ad93811f9e21d41bab211ec SHA256 10a02c1d270b0e68d5d7fd394ac360697b4afa672d8f7204976dc1f0e34ac343
-MISC metadata.xml 159 RMD160 54af1e9a61e5ed1b49b2bbbf3ef2278999c66b13 SHA1 bce3da4745192397c9a08bdbcf7e4914eac9b77b SHA256 ed3a0d440cfa5672284f4172ebde0ea6506c1a38e9a3ed9f14f3d2c093aac42f
+MISC ChangeLog 10798 RMD160 515b4c28b7eac3ce14996f191109ab4874dffdab SHA1 41940e8cf034ef7753cf222791e06554aacc6bee SHA256 cbccd6dd3bcab98484e537fc8f142d9eef2c2fccedb3809c7e9283dbfcc16912
+MISC metadata.xml 272 RMD160 7d401536d693a7c82381765d21ac483be2fd78d6 SHA1 7e487f920eb77c7c2c69857c7fd3be0f7a50a0b8 SHA256 a98346ae16bb95d356f0800eb3f6df63cdfad5b7539357a3681237306658b5f3
diff --git a/sys-power/acpid/acpid-2.0.4-r1.ebuild b/sys-power/acpid/acpid-2.0.4-r1.ebuild
new file mode 100644
index 000000000000..9838b6bcf547
--- /dev/null
+++ b/sys-power/acpid/acpid-2.0.4-r1.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-power/acpid/acpid-2.0.4-r1.ebuild,v 1.1 2010/04/28 15:21:07 ssuominen Exp $
+
+EAPI=2
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Daemon for Advanced Configuration and Power Interface"
+HOMEPAGE="http://tedfelix.com/linux/acpid-netlink.html"
+SRC_URI="http://tedfelix.com/linux/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~ia64 -ppc ~x86"
+IUSE="consolekit"
+
+RDEPEND="consolekit? ( sys-auth/consolekit )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.0.3.patch
+ cp "${FILESDIR}"/${PN}-2.0.4-default.sh "${T}" || die
+
+ if ! use consolekit; then
+ sed -i \
+ -e 's:/etc/acpi/powerbtn.sh:/sbin/init 0:' \
+ "${T}"/${PN}-2.0.4-default.sh || die
+ fi
+}
+
+src_compile() {
+ tc-export CC CPP
+ emake || die
+ emake -C kacpimon || die
+}
+
+src_install() {
+ emake DESTDIR="${D}" DOCDIR="/usr/share/doc/${PF}" install || die
+
+ dobin kacpimon/kacpimon || die
+ newdoc kacpimon/README README.kacpimon
+
+ exeinto /etc/acpi
+ newexe "${T}"/${PN}-2.0.4-default.sh default.sh || die
+
+ if use consolekit; then
+ newexe "${FILESDIR}"/${PN}-2.0.4-powerbtn.sh powerbtn.sh || die
+ fi
+
+ insinto /etc/acpi/events
+ newins "${FILESDIR}"/${PN}-1.0.4-default default || die
+
+ newinitd "${FILESDIR}"/${PN}-2.0.3-init.d acpid || die
+ newconfd "${FILESDIR}"/${PN}-1.0.6-conf.d acpid || die
+
+ prepalldocs
+}
+
+pkg_postinst() {
+ echo
+ elog "You may wish to read the Gentoo Linux Power Management Guide,"
+ elog "which can be found online at:"
+ elog "http://www.gentoo.org/doc/en/power-management-guide.xml"
+ echo
+}
diff --git a/sys-power/acpid/files/acpid-2.0.4-powerbtn.sh b/sys-power/acpid/files/acpid-2.0.4-powerbtn.sh
new file mode 100644
index 000000000000..5d248db73cb3
--- /dev/null
+++ b/sys-power/acpid/files/acpid-2.0.4-powerbtn.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+PATH=/sbin:/bin:/usr/bin
+
+# Get the ID of the first active X11 session:
+uid_session=$(
+ck-list-sessions | \
+awk '
+/^Session[0-9]+:$/ { uid = active = x11 = "" ; next }
+{ gsub(/'\''/, "", $3) }
+$1 == "unix-user" { uid = $3 }
+$1 == "active" { active = $3 }
+$1 == "x11-display" { x11 = $3 }
+active == "TRUE" && x11 != "" {
+ print uid
+ exit
+}')
+
+# Check that there is a power manager, otherwise shut down.
+[ "$uid_session" ] &&
+ps axo uid,cmd | \
+awk '
+ $1 == '$uid_session' &&
+ ($2 ~ /gnome-power-manager/ || $2 ~ /kded4/ ||
+ $3 ~ /kded4/ || $3 ~ /guidance-power-manager/) \
+ { found = 1; exit }
+ END { exit !found }
+' ||
+ shutdown -h now
+
diff --git a/sys-power/acpid/metadata.xml b/sys-power/acpid/metadata.xml
index b27ff8eb4ed6..ceafcb6b0f3c 100644
--- a/sys-power/acpid/metadata.xml
+++ b/sys-power/acpid/metadata.xml
@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
-<herd>mobile</herd>
+ <herd>mobile</herd>
+ <use>
+ <flag name="consolekit">Install consolekit based powerbtn.sh (power button) script</flag>
+ </use>
</pkgmetadata>