summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuli Suominen <ssuominen@gentoo.org>2013-04-23 01:48:26 +0000
committerSamuli Suominen <ssuominen@gentoo.org>2013-04-23 01:48:26 +0000
commita0e8fc7749b6f906a0fb262eba28dd1d0d00064c (patch)
treebaf530f9bb3b32ebfb59c3b8830a7b2c39384cdb /sys-power
parentHave USE=X require USE=sdl #466584 by Tomáš Chvátal. (diff)
downloadgentoo-2-a0e8fc7749b6f906a0fb262eba28dd1d0d00064c.tar.gz
gentoo-2-a0e8fc7749b6f906a0fb262eba28dd1d0d00064c.tar.bz2
gentoo-2-a0e8fc7749b6f906a0fb262eba28dd1d0d00064c.zip
Version bump. Initial conf.d and init.d files wrt #453794 by "khayyam"
(Portage version: 2.2.0_alpha173/cvs/Linux x86_64, signed Manifest commit with key 4868F14D)
Diffstat (limited to 'sys-power')
-rw-r--r--sys-power/cpupower/ChangeLog8
-rw-r--r--sys-power/cpupower/cpupower-3.8.ebuild67
-rw-r--r--sys-power/cpupower/files/conf.d7
-rw-r--r--sys-power/cpupower/files/init.d39
4 files changed, 120 insertions, 1 deletions
diff --git a/sys-power/cpupower/ChangeLog b/sys-power/cpupower/ChangeLog
index 99612c70b57b..149846d045a9 100644
--- a/sys-power/cpupower/ChangeLog
+++ b/sys-power/cpupower/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for sys-power/cpupower
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-power/cpupower/ChangeLog,v 1.3 2013/01/24 14:05:03 ssuominen Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-power/cpupower/ChangeLog,v 1.4 2013/04/23 01:48:26 ssuominen Exp $
+
+*cpupower-3.8 (23 Apr 2013)
+
+ 23 Apr 2013; Samuli Suominen <ssuominen@gentoo.org> +cpupower-3.8.ebuild,
+ +files/conf.d, +files/init.d:
+ Version bump. Initial conf.d and init.d files wrt #453794 by "khayyam"
24 Jan 2013; Samuli Suominen <ssuominen@gentoo.org> cpupower-3.8_rc4.ebuild:
Missing os-headers and pciutils dependencies wrt #453776 by Mieszko Ślusarczyk
diff --git a/sys-power/cpupower/cpupower-3.8.ebuild b/sys-power/cpupower/cpupower-3.8.ebuild
new file mode 100644
index 000000000000..473f04dca71c
--- /dev/null
+++ b/sys-power/cpupower/cpupower-3.8.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-power/cpupower/cpupower-3.8.ebuild,v 1.1 2013/04/23 01:48:26 ssuominen Exp $
+
+EAPI=5
+inherit multilib toolchain-funcs
+
+DESCRIPTION="Shows and sets processor power related values"
+HOMEPAGE="http://www.kernel.org/"
+SRC_URI="mirror://kernel/linux/kernel/v3.0/linux-${PV}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="cpufreq_bench debug nls"
+
+# cpupower should be a USE flag in linux-misc-apps (ditto for usbip!)
+# but only if the maintainer doesn't agree to drop it completely from
+# there in favour of this one which i'll push to users are replacement
+# for the dead cpufreq tools in tree
+# !sys-apps/linux-misc-apps[cpupower]
+RDEPEND="sys-apps/pciutils
+ !sys-apps/linux-misc-apps"
+DEPEND="${RDEPEND}
+ virtual/os-headers
+ nls? ( sys-devel/gettext )"
+
+S=${WORKDIR}/linux-${PV}/tools/power/${PN}
+
+pkg_setup() {
+ myemakeargs=(
+ DEBUG=$(usex debug true false)
+ V=1
+ CPUFREQ_BENCH=$(usex cpufreq_bench true false)
+ NLS=$(usex nls true false)
+ docdir=/usr/share/doc/${PF}/${PN}
+ mandir=/usr/share/man
+ libdir=/usr/$(get_libdir)
+ AR="$(tc-getAR)"
+ CC="$(tc-getCC)"
+ LD="$(tc-getCC)"
+ STRIP=true
+ LDFLAGS="${LDFLAGS}"
+ OPTIMIZATION="${CFLAGS}"
+ )
+}
+
+src_prepare() {
+ # -Wl,--as-needed compat
+ local libs="-lcpupower -lrt -lpci"
+ sed -i \
+ -e "/$libs/{ s,${libs},,g; s,\$, ${libs},g;}" \
+ -e "s:-O1 -g::" \
+ Makefile || die
+}
+
+src_compile() {
+ emake "${myemakeargs[@]}"
+}
+
+src_install() {
+ emake DESTDIR="${D}" "${myemakeargs[@]}" install
+ dodoc README ToDo
+
+ newconfd "${FILESDIR}"/conf.d ${PN}
+ newinitd "${FILESDIR}"/init.d ${PN}
+}
diff --git a/sys-power/cpupower/files/conf.d b/sys-power/cpupower/files/conf.d
new file mode 100644
index 000000000000..ee10216ec13f
--- /dev/null
+++ b/sys-power/cpupower/files/conf.d
@@ -0,0 +1,7 @@
+# /etc/conf.d/cpupower: config file for /etc/init.d/cpupower
+
+# Options when starting cpufreq (given to the `cpupower` program)
+#START_OPTS=""
+
+# Options when stopping cpufreq (given to the `cpupower` program)
+#STOP_OPTS=""
diff --git a/sys-power/cpupower/files/init.d b/sys-power/cpupower/files/init.d
new file mode 100644
index 000000000000..01ef556bb71e
--- /dev/null
+++ b/sys-power/cpupower/files/init.d
@@ -0,0 +1,39 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-power/cpupower/files/init.d,v 1.1 2013/04/23 01:48:26 ssuominen Exp $
+
+change() {
+ local c ret=0 opts="$1"
+ shift
+ ebegin "Running cpupower -c all frequency-set ${opts}"
+ cpupower -c all frequency-set ${opts} >/dev/null 2>&1
+ : $(( ret += $? ))
+ eend ${ret}
+
+ if [ $# -gt 0 ] ; then
+ c=1
+ einfo "Setting extra options: $*"
+ if cd /sys/devices/system/cpu/cpufreq ; then
+ local o v
+ for o in "$@" ; do
+ v=${o#*=}
+ o=${o%%=*}
+ echo ${v} > ${o} || break
+ done
+ c=0
+ fi
+ eend ${c}
+ : $(( ret += c ))
+ fi
+
+ return ${ret}
+}
+
+start() {
+ change "${START_OPTS}"
+}
+
+stop() {
+ change "${STOP_OPTS}"
+}