From 24664c14c6911fe150c8c3d5bd4495422bcf1d66 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Wed, 2 Dec 2009 02:44:00 +0100 Subject: [PATCH] Added acpid-1.0.10 build template. --HG-- extra : convert_revision : 95ca6a9f541ec73b9debaa8cd60cfafdf27ef61a --- srcpkgs/acpid/files/acpid.confd | 6 ++++ srcpkgs/acpid/files/acpid.rc | 39 ++++++++++++++++++++++ srcpkgs/acpid/files/default.sh | 59 +++++++++++++++++++++++++++++++++ srcpkgs/acpid/template | 29 ++++++++++++++++ 4 files changed, 133 insertions(+) create mode 100644 srcpkgs/acpid/files/acpid.confd create mode 100644 srcpkgs/acpid/files/acpid.rc create mode 100644 srcpkgs/acpid/files/default.sh create mode 100644 srcpkgs/acpid/template diff --git a/srcpkgs/acpid/files/acpid.confd b/srcpkgs/acpid/files/acpid.confd new file mode 100644 index 00000000000..30329760fc1 --- /dev/null +++ b/srcpkgs/acpid/files/acpid.confd @@ -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_OPTIONS="" diff --git a/srcpkgs/acpid/files/acpid.rc b/srcpkgs/acpid/files/acpid.rc new file mode 100644 index 00000000000..c92be09f7ea --- /dev/null +++ b/srcpkgs/acpid/files/acpid.rc @@ -0,0 +1,39 @@ +#!/sbin/runscript +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/www/viewcvs.gentoo.org/raw_cvs/gentoo-x86/sys-power/acpid/files/acpid-1.0.6-init.d,v 1.3 2009/01/19 04:48:49 vapier Exp $ + +opts="reload" + +depend() { + need localmount + use logger + before hald +} + +checkconfig() { + if [ ! -e /proc/acpi ] ; then + eerror "ACPI support has not been compiled into the kernel" + return 1 + fi +} + +start() { + checkconfig || return 1 + + ebegin "Starting acpid" + start-stop-daemon --start --quiet --exec /usr/sbin/acpid -- ${ACPID_OPTIONS} + eend $? +} + +stop() { + ebegin "Stopping acpid" + start-stop-daemon --stop --exec /usr/sbin/acpid + eend $? +} + +reload() { + ebegin "Reloading acpid configuration" + start-stop-daemon --stop --oknodo --exec /usr/sbin/acpid --signal HUP + eend $? +} diff --git a/srcpkgs/acpid/files/default.sh b/srcpkgs/acpid/files/default.sh new file mode 100644 index 00000000000..9fe26a168cc --- /dev/null +++ b/srcpkgs/acpid/files/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) + /sbin/init 0 + ;; + + # 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/srcpkgs/acpid/template b/srcpkgs/acpid/template new file mode 100644 index 00000000000..30907aaea48 --- /dev/null +++ b/srcpkgs/acpid/template @@ -0,0 +1,29 @@ +# Template file for 'acpid' +pkgname=acpid +version=1.0.10 +distfiles="${SOURCEFORGE_SITE}/$pkgname/$pkgname-$version.tar.gz" +build_style=gnu_makefile +make_install_args="INSTPREFIX=$XBPS_DESTDIR/$pkgname-$version +MAN8DIR=$XBPS_DESTDIR/$pkgname-$version/usr/share/man/man8" +short_desc="A daemon for delivering ACPI power management events" +maintainer="Juan RP " +checksum=22703ce0dd7305aca01bc9ac741659c32b1593f1d6fde492df7f01067a534760 +long_desc=" + ACPID used to try to handle events internally. Rather than try to climb + an ever-growing mountain, ACPID now lets YOU define what events to handle. + Any event that publishes itself to /proc/acpi/event can be handled." + +openrc_services="acpid default" +conf_files="/etc/conf.d/acpid" +Add_dependency full glibc + +post_install() +{ + chmod 755 ${DESTDIR}/usr/sbin/acpid || return 1 + install -D -m755 ${FILESDIR}/acpid.rc \ + ${DESTDIR}/etc/init.d/acpid || return 1 + install -D -m644 ${FILESDIR}/acpid.confd \ + ${DESTDIR}/etc/conf.d/acpid || return 1 + install -D -m755 ${FILESDIR}/default.sh \ + ${DESTDIR}/etc/acpi/default.sh || return 1 +}