summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuli Suominen <ssuominen@gentoo.org>2013-12-25 11:46:32 +0000
committerSamuli Suominen <ssuominen@gentoo.org>2013-12-25 11:46:32 +0000
commitaf8b0ec2eae4f889479c198362b0bfe882d323e7 (patch)
treedbeacef2e41a814a1196fb97085769044dae7ea5 /sys-power
parentVersion bump. (diff)
downloadgentoo-2-af8b0ec2eae4f889479c198362b0bfe882d323e7.tar.gz
gentoo-2-af8b0ec2eae4f889479c198362b0bfe882d323e7.tar.bz2
gentoo-2-af8b0ec2eae4f889479c198362b0bfe882d323e7.zip
Version bump with updated init.d script wrt #453794#c23 by Lars Wendler
(Portage version: 2.2.7/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.12.ebuild71
-rw-r--r--sys-power/cpupower/files/init.d-r442
3 files changed, 120 insertions, 1 deletions
diff --git a/sys-power/cpupower/ChangeLog b/sys-power/cpupower/ChangeLog
index 902ffc610cda..4e17a513b8ba 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.11 2013/10/20 14:20:10 ssuominen Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-power/cpupower/ChangeLog,v 1.12 2013/12/25 11:46:32 ssuominen Exp $
+
+*cpupower-3.12 (25 Dec 2013)
+
+ 25 Dec 2013; Samuli Suominen <ssuominen@gentoo.org> +cpupower-3.12.ebuild,
+ +files/init.d-r4:
+ Version bump with updated init.d script wrt #453794#c23 by Lars Wendler
*cpupower-3.11-r1 (20 Oct 2013)
diff --git a/sys-power/cpupower/cpupower-3.12.ebuild b/sys-power/cpupower/cpupower-3.12.ebuild
new file mode 100644
index 000000000000..14224ed7d78c
--- /dev/null
+++ b/sys-power/cpupower/cpupower-3.12.ebuild
@@ -0,0 +1,71 @@
+# 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.12.ebuild,v 1.1 2013/12/25 11:46:32 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.x/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]
+
+# header collision with cpufrequtils
+RDEPEND="sys-apps/pciutils
+ !sys-apps/linux-misc-apps
+ !sys-power/cpufrequtils"
+DEPEND="${RDEPEND}
+ virtual/os-headers
+ virtual/pkgconfig
+ 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 $($(tc-getPKG_CONFIG) --libs-only-l libpci)"
+ 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-r2 ${PN}
+ newinitd "${FILESDIR}"/init.d-r4 ${PN}
+}
diff --git a/sys-power/cpupower/files/init.d-r4 b/sys-power/cpupower/files/init.d-r4
new file mode 100644
index 000000000000..789945b00a5d
--- /dev/null
+++ b/sys-power/cpupower/files/init.d-r4
@@ -0,0 +1,42 @@
+#!/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-r4,v 1.1 2013/12/25 11:46:32 ssuominen Exp $
+
+CPUFREQ_SYSFS=/sys/devices/system/cpu/cpufreq
+
+change() {
+ local c ret=0 opts="$1"
+ if [ -n "$opts" ] ; then
+ ebegin "Running cpupower -c all frequency-set ${opts}"
+ cpupower -c all frequency-set ${opts} >/dev/null 2>&1
+ : $(( ret += $? ))
+ eend ${ret}
+
+ if [ -d ${CPUFREQ_SYSFS} ] && [ -n "${SYSFS_EXTRA}" ] ; then
+ c=1
+ einfo "Setting extra options: ${SYSFS_EXTRA}"
+ if cd ${CPUFREQ_SYSFS} ; then
+ local o v
+ for o in ${SYSFS_EXTRA} ; do
+ v=${o#*=}
+ o=${o%%=*}
+ echo ${v} > ${o} || break
+ done
+ c=0
+ fi
+ eend ${c}
+ : $(( ret += c ))
+ fi
+ fi
+
+ return ${ret}
+}
+
+start() {
+ change "${START_OPTS}"
+}
+
+stop() {
+ change "${STOP_OPTS}"
+}