diff options
author | Ben Lutgens <lamer@gentoo.org> | 2001-07-31 04:29:56 +0000 |
---|---|---|
committer | Ben Lutgens <lamer@gentoo.org> | 2001-07-31 04:29:56 +0000 |
commit | 92ff28b23b5770d7a7085a43e2109b213af852e0 (patch) | |
tree | d698b638592d9f69c416f82665f9ff9fc1d878e8 /sys-apps/apmd | |
parent | old (slightly broken) mplayer ebuild removed (diff) | |
download | gentoo-2-92ff28b23b5770d7a7085a43e2109b213af852e0.tar.gz gentoo-2-92ff28b23b5770d7a7085a43e2109b213af852e0.tar.bz2 gentoo-2-92ff28b23b5770d7a7085a43e2109b213af852e0.zip |
added apmd
Diffstat (limited to 'sys-apps/apmd')
-rw-r--r-- | sys-apps/apmd/apmd-3.0.1.ebuild | 42 | ||||
-rw-r--r-- | sys-apps/apmd/files/apmd | 48 | ||||
-rw-r--r-- | sys-apps/apmd/files/digest-apmd-3.0.1 | 1 | ||||
-rw-r--r-- | sys-apps/apmd/files/run | 11 | ||||
-rw-r--r-- | sys-apps/apmd/files/svc-apmd | 44 |
5 files changed, 146 insertions, 0 deletions
diff --git a/sys-apps/apmd/apmd-3.0.1.ebuild b/sys-apps/apmd/apmd-3.0.1.ebuild new file mode 100644 index 000000000000..47bdb21c6db5 --- /dev/null +++ b/sys-apps/apmd/apmd-3.0.1.ebuild @@ -0,0 +1,42 @@ +# Copyright 1999-2000 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License, v2 or later +# Author Craig Joly <joly@ee.ualberta.ca> + +S=${WORKDIR}/${P} +DESCRIPTION="Advanced Power Management Daemon" +SRC_URI="ftp://ftp.debian.org/debian/pool/main/a/apmd/apmd_3.0.1-1.tar.gz" +HOMEPAGE="http://www.worldvisions.ca/~apenwarr/apmd/" + +src_unpack() { + unpack ${A} + cd ${S} + sed -e "s:PREFIX=\/usr:PREFIX=\$\{DESTDIR\}\/usr:" Makefile | cat > Makefile + sed -e "s:install\ \-b \-Vt:\#install\ \-b \-Vt:" Makefile | cat > Makefile +} + +src_compile() { + + try emake + +} + +src_install () { + + try make DESTDIR=${D} install + + insinto /etc/apm + insopts -m 0755 + doins ${S}/debian/apmd_proxy + + insinto /etc/rc.d/init.d + insopts -m 0755 + doins ${FILESDIR}/apmd + doins ${FILESDIR}/svc-apmd + + insinto /var/lib/supervise/services/apmd + insopts -m 0755 + doins ${FILESDIR}/run + + dodoc ANNOUNCE BUGS.apmsleep COPYING COPYING.LIB ChangeLog LSM \ + README README.transfer +} diff --git a/sys-apps/apmd/files/apmd b/sys-apps/apmd/files/apmd new file mode 100644 index 000000000000..2f9722a8cc0e --- /dev/null +++ b/sys-apps/apmd/files/apmd @@ -0,0 +1,48 @@ +#!/bin/sh +#RCUPDATE:2 3 4:60:This line is required for script management + +# Based on apmd.init by Dirk Eddelbuettel <edd@debian.org> and +# Avery Pennarun <apenwarr@debian.org> +# Rewritten for gentoo by Craig Joly <joly@ee.ualberta.ca> + +. /etc/rc.d/config/functions + +SERVICE="apmd" +opts="start stop restart" + +PIDFILE=/var/run/apmd.pid +EXEC=/usr/sbin/apmd + +# apmd arguments variable. See the manual page apmd(8) for details. +APMD="" + +check_kernel() { + if [ ! -e /proc/apm ] + then + eerror "APM support has not been compiled into the kernel." + exit 1 + fi +} + +start() { + check_kernel + + ebegin "Starting $SERVICE" + start-stop-daemon --start --quiet --pidfile $PIDFILE --exec \ + $EXEC -- -P /etc/apm/apmd_proxy $APMD + eend $? "Started $SERVICE." "Error starting $SERVICE." +} + +stop() { + ebegin "Stopping $SERVICE" + start-stop-daemon --stop --quiet --pidfile $PIDFILE --exec $EXEC + eend $? "Stopped $SERVICE." "Error stopping $SERVICE." +} + +restart() { + stop + start +} + +doservice ${@} + diff --git a/sys-apps/apmd/files/digest-apmd-3.0.1 b/sys-apps/apmd/files/digest-apmd-3.0.1 new file mode 100644 index 000000000000..67e9a7925a22 --- /dev/null +++ b/sys-apps/apmd/files/digest-apmd-3.0.1 @@ -0,0 +1 @@ +MD5 cf3fb2c7165bfa5c963b38fa150527d3 apmd_3.0.1-1.tar.gz diff --git a/sys-apps/apmd/files/run b/sys-apps/apmd/files/run new file mode 100644 index 000000000000..8503392dbbb6 --- /dev/null +++ b/sys-apps/apmd/files/run @@ -0,0 +1,11 @@ +#!/bin/sh + +# apmd arguments variable. See the manual page apmd(8) for detals. +APMD="" + +if [ ! -e /var/run/apmd.pid ] +then + /usr/sbin/apmd -- P /etc/apm/apmd_proxy $APMD + sleep 2 +fi +exec envuidgid daemon /usr/bin/watchpid `cat /var/run/apmd.pid` diff --git a/sys-apps/apmd/files/svc-apmd b/sys-apps/apmd/files/svc-apmd new file mode 100644 index 000000000000..85b57f70ec77 --- /dev/null +++ b/sys-apps/apmd/files/svc-apmd @@ -0,0 +1,44 @@ +#!/bin/sh +#RCUPDATE:2 3 4:60:This line is required for script management + +# Based on apmd.init by Dirk Eddelbuettel <edd@debian.org> and +# Avery Pennarun <apenwarr@debian.org> +# Rewritten for gentoo by Craig Joly <joly@ee.ualberta.ca> + +. /etc/rc.d/config/functions + +SERVICE="apmd" +opts="start stop" + +# apmd arguments go in /var/lib/supervise/services/apmd/run. +# See the manual page apmd(8) for details. +# APMD="" + +check_kernel() { + if [ ! -e /proc/apm ] + then + eerror "APM support has not been compiled into the kernel." + exit 1 + fi +} + +start() { + check_kernel + + ebegin "Starting $SERVICE" + ln -sf ../services/${SERVICE} ${SVCDIR}/control/${SERVICE} + eend $? +} + +stop() { + ebegin "Stopping $SERVICE" + if [ -e ${SVCDIR}/control/${SERVICE} ] + then + /usr/bin/svc -dx ${SVCDIR}/control/${SERVICE} + rm ${SVCDIR}/control/${SERVICE} + fi + eend $? +} + +doservice ${@} + |