ver bump #53507
authorMike Frysinger <vapier@gentoo.org>
Sun, 10 Oct 2004 06:42:10 +0000 (06:42 +0000)
committerMike Frysinger <vapier@gentoo.org>
Sun, 10 Oct 2004 06:42:10 +0000 (06:42 +0000)
sys-apps/cpudyn/ChangeLog
sys-apps/cpudyn/cpudyn-1.0.ebuild [new file with mode: 0644]
sys-apps/cpudyn/files/cpudyn.init
sys-apps/cpudyn/files/digest-cpudyn-1.0 [new file with mode: 0644]

index 080a98fde43fd4630a43011552fc4820bdeeb35e..19bf2c4d28bc7641c84de6c253ef30554c53f640 100644 (file)
@@ -1,6 +1,12 @@
 # ChangeLog for sys-apps/cpudyn
 # Copyright 2000-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/cpudyn/ChangeLog,v 1.11 2004/09/03 21:03:23 pvdabeel Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/cpudyn/ChangeLog,v 1.12 2004/10/10 06:42:10 vapier Exp $
+
+*cpudyn-1.0 (10 Oct 2004)
+
+  10 Oct 2004; Mike Frysinger <vapier@gentoo.org> files/cpudyn.init,
+  +cpudyn-1.0.ebuild:
+  Version bump #53507 by Jakob Schiotz.
 
   03 Sep 2004; Pieter Van den Abeele <pvdabeel@gentoo.org>
   cpudyn-0.4.7-r1.ebuild, cpudyn-0.5.0.ebuild, cpudyn-0.6.1.ebuild,
diff --git a/sys-apps/cpudyn/cpudyn-1.0.ebuild b/sys-apps/cpudyn/cpudyn-1.0.ebuild
new file mode 100644 (file)
index 0000000..8b60f8b
--- /dev/null
@@ -0,0 +1,41 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/cpudyn/cpudyn-1.0.ebuild,v 1.1 2004/10/10 06:42:10 vapier Exp $
+
+inherit eutils
+
+DESCRIPTION="A daemon to control laptop power consumption via cpufreq and disk standby"
+HOMEPAGE="http://mnm.uib.es/~gallir/${PN}/"
+SRC_URI="http://mnm.uib.es/~gallir/${PN}/download/${P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+S=${WORKDIR}/${PN}
+
+src_unpack() {
+       unpack ${A}
+       cd ${S}/debian
+       epatch ${FILESDIR}/${PN}-0.99.0-init_conf_updates.patch
+}
+
+src_compile() {
+       emake cpudynd || die "Compilation failed."
+}
+
+src_install() {
+       dosbin cpudynd || die "dosbin"
+
+       doman cpudynd.8
+       dodoc INSTALL README VERSION changelog
+       dohtml *.html
+
+       exeinto /etc/init.d ; newexe ${FILESDIR}/cpudyn.init cpudyn
+       insinto /etc/conf.d ; newins debian/cpudyn.conf cpudyn
+}
+
+pkg_postinst() {
+       einfo "Configuration file is /etc/conf.d/cpudyn."
+}
index f23a0553772a5e050d5fc2bfe4aec16e1a940ec6..9ad3f2ddd7ba659216a1adf56d2344fd5bfc7b0a 100644 (file)
@@ -1,17 +1,20 @@
 #!/sbin/runscript
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/cpudyn/files/cpudyn.init,v 1.4 2004/07/15 00:38:51 agriffis Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/cpudyn/files/cpudyn.init,v 1.5 2004/10/10 06:42:10 vapier Exp $
 #
 # Based on the Debian init script written by Celso Gonzalez <celso@bulma.net>,
 # and on the cpufreqd Gentoo init script written by Robert Gogolok <robertgogolok@web.de>.
 # Heavily modified by Robin H. Johnson <robbat2@gentoo.org> to ensure correct
 # start only under support conditions
+# More preconditions by Karl Trygve Kalleberg <karltk@gentoo.org> 
 # 
 
 DAEMON=/usr/sbin/cpudynd
 PIDFILE=/var/run/cpudynd.pid
 
+opts="${opts} min max dynamic"
+
 depend() {
        need localmount
 }
@@ -41,6 +44,25 @@ checkconfig() {
                        return 1
                fi
        fi
+       # CPUFREQ_25 has more than one entry, hence the grep -- karltk
+       if [ ! -z "$(echo ${CPUFREQ_25} | grep ${CPUFREQ_FILE})" ]; then
+               # Silently try to load the governors; shouldn't hurt if they're already there
+               modprobe -q cpufreq_performance
+               modprobe -q cpufreq_powersave
+               # Check that all governors required are actually present
+               missing=""
+               for x in userspace performance powersave ; do
+                       if [ -z "$(grep ${x} ${CPUFREQ_FILE}/scaling_available_governors)" ]; then
+                               missing="${missing} ${x}"
+                       fi
+               done
+               # If some are missing, report which, then bail
+               if [ ! -z "${missing}" ]; then
+                       eerror "2.5/2.6 CPUfreq support needs userspace, performance and powersave governors"
+                       eerror "Missing${missing}"
+                       return 1
+               fi
+       fi
 }
 
 
@@ -51,6 +73,7 @@ start() {
        if [ -n "$THROTTLING_LOW" ]; then CPUDYN_OPTS="$CPUDYN_OPTS -l $THROTTLING_LOW"; fi
        if [ -n "$TIMEOUT" ]; then CPUDYN_OPTS="$CPUDYN_OPTS -t $TIMEOUT"; fi
        if [ -n "$DISKS" ]; then CPUDYN_OPTS="$CPUDYN_OPTS -h $DISKS"; fi
+       if [ "$NICE" == "yes" ]; then CPUDYN_OPTS="$CPUDYN_OPTS -nice"; fi
 
        ebegin "Starting cpudynd"
        if checkconfig; then
@@ -69,4 +92,20 @@ stop() {
        eend $?
 }
 
+min() {
+       ebegin "Forcing minimal speed"
+       kill -USR2 $(cat ${PIDFILE})
+       eend $?
+}
+max() {
+       ebegin "Forcing maximal speed"
+       kill -USR1 $(cat ${PIDFILE})
+       eend $?
+}
+dynamic() {
+       ebegin "Resetting to default dynamic speed"
+       kill -HUP $(cat ${PIDFILE})
+       eend $?
+}
+
 # vim:ts=4 noexpandtab:
diff --git a/sys-apps/cpudyn/files/digest-cpudyn-1.0 b/sys-apps/cpudyn/files/digest-cpudyn-1.0
new file mode 100644 (file)
index 0000000..d2da76b
--- /dev/null
@@ -0,0 +1 @@
+MD5 2922149f624a07b3d6f012a084e89e7a cpudyn-1.0.tgz 32017