summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-power')
-rw-r--r--sys-power/cpufrequtils/ChangeLog10
-rw-r--r--sys-power/cpufrequtils/cpufrequtils-008-r2.ebuild64
-rw-r--r--sys-power/cpufrequtils/files/cpufrequtils-change.sh26
-rw-r--r--sys-power/cpufrequtils/files/cpufrequtils-init.d-00718
-rw-r--r--sys-power/cpufrequtils/files/cpufrequtils.service11
5 files changed, 128 insertions, 1 deletions
diff --git a/sys-power/cpufrequtils/ChangeLog b/sys-power/cpufrequtils/ChangeLog
index bd162a42034b..99d15ea1b73a 100644
--- a/sys-power/cpufrequtils/ChangeLog
+++ b/sys-power/cpufrequtils/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for sys-power/cpufrequtils
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-power/cpufrequtils/ChangeLog,v 1.71 2013/02/18 09:31:44 zmedico Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-power/cpufrequtils/ChangeLog,v 1.72 2013/04/21 09:21:07 lxnay Exp $
+
+*cpufrequtils-008-r2 (21 Apr 2013)
+
+ 21 Apr 2013; Fabio Erculiani <lxnay@gentoo.org>
+ +files/cpufrequtils-init.d-007, +cpufrequtils-008-r2.ebuild,
+ +files/cpufrequtils.service, +files/cpufrequtils-change.sh:
+ add systemd support, create a new helper script
+ /usr/libexec/cpufrequtils-change.sh, close bug #466472
18 Feb 2013; Zac Medico <zmedico@gentoo.org> cpufrequtils-008-r1.ebuild:
Add ~arm-linux keyword.
diff --git a/sys-power/cpufrequtils/cpufrequtils-008-r2.ebuild b/sys-power/cpufrequtils/cpufrequtils-008-r2.ebuild
new file mode 100644
index 000000000000..d5ee5b5e7aef
--- /dev/null
+++ b/sys-power/cpufrequtils/cpufrequtils-008-r2.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-power/cpufrequtils/cpufrequtils-008-r2.ebuild,v 1.1 2013/04/21 09:21:07 lxnay Exp $
+
+EAPI=4
+
+inherit eutils toolchain-funcs multilib systemd
+
+DESCRIPTION="Userspace utilities for the Linux kernel cpufreq subsystem"
+HOMEPAGE="http://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils.html"
+SRC_URI="mirror://kernel/linux/utils/kernel/cpufreq/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="debug nls"
+
+DEPEND="nls? ( virtual/libintl )"
+RDEPEND=""
+
+ft() { use $1 && echo true || echo false ; }
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-007-build.patch
+ epatch "${FILESDIR}"/${PN}-007-nls.patch #205576 #292246
+ epatch "${FILESDIR}"/${PN}-008-remove-pipe-from-CFLAGS.patch #362523
+ epatch "${FILESDIR}"/${PN}-008-cpuid.patch
+ epatch "${FILESDIR}"/${PN}-008-fix-msr-read.patch
+ epatch "${FILESDIR}"/${PN}-008-increase-MAX_LINE_LEN.patch
+ epatch "${FILESDIR}"/${PN}-008-fix-compilation-on-x86-32-with-fPIC.patch #375967
+}
+
+src_configure() {
+ export DEBUG=$(ft debug) V=true NLS=$(ft nls)
+ unset bindir sbindir includedir localedir confdir
+ export mandir="/usr/share/man"
+ export libdir="/usr/$(get_libdir)"
+ export docdir="/usr/share/doc/${PF}"
+}
+
+src_compile() {
+ emake \
+ CC="$(tc-getCC)" \
+ LD="$(tc-getCC)" \
+ AR="$(tc-getAR)" \
+ STRIP=: \
+ RANLIB="$(tc-getRANLIB)" \
+ LIBTOOL="${EPREFIX}"/usr/bin/libtool \
+ INSTALL="${EPREFIX}"/usr/bin/install
+}
+
+src_install() {
+ # There's no configure script, so in this case we have to use emake
+ # DESTDIR="${ED}" instead of the usual econf --prefix="${EPREFIX}".
+ emake DESTDIR="${ED}" install
+ dodoc AUTHORS README
+
+ exeinto /usr/libexec
+ doexe "${FILESDIR}/cpufrequtils-change.sh"
+
+ systemd_dounit "${FILESDIR}/cpufrequtils.service"
+ newinitd "${FILESDIR}"/${PN}-init.d-007 ${PN}
+ newconfd "${FILESDIR}"/${PN}-conf.d-006 ${PN}
+}
diff --git a/sys-power/cpufrequtils/files/cpufrequtils-change.sh b/sys-power/cpufrequtils/files/cpufrequtils-change.sh
new file mode 100644
index 000000000000..d6f3e21eef8a
--- /dev/null
+++ b/sys-power/cpufrequtils/files/cpufrequtils-change.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-power/cpufrequtils/files/cpufrequtils-change.sh,v 1.1 2013/04/21 09:21:06 lxnay Exp $
+
+ret=0 opts="${1}"
+shift
+for c in $(cpufreq-info -o | awk '$1 == "CPU" { print $2 }') ; do
+ cpufreq-set -c ${c} ${opts}
+ : $(( ret += $? ))
+done
+
+if [ $# -gt 0 ] ; then
+ c=1
+ if cd /sys/devices/system/cpu/cpufreq ; then
+ for o in "${@}"; do
+ v=${o#*=}
+ o=${o%%=*}
+ echo ${v} > ${o} || break
+ done
+ c=0
+ fi
+ : $(( ret += c ))
+fi
+
+exit ${ret}
diff --git a/sys-power/cpufrequtils/files/cpufrequtils-init.d-007 b/sys-power/cpufrequtils/files/cpufrequtils-init.d-007
new file mode 100644
index 000000000000..3849e9fd5671
--- /dev/null
+++ b/sys-power/cpufrequtils/files/cpufrequtils-init.d-007
@@ -0,0 +1,18 @@
+#!/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/cpufrequtils/files/cpufrequtils-init.d-007,v 1.1 2013/04/21 09:21:06 lxnay Exp $
+
+change() {
+ ebegin "Running cpufreq-set ${opts}"
+ /usr/libexec/cpufrequtils-change.sh "${@}"
+ eend $?
+}
+
+start() {
+ change "${START_OPTS}" ${SYSFS_EXTRA}
+}
+
+stop() {
+ change "${STOP_OPTS}"
+}
diff --git a/sys-power/cpufrequtils/files/cpufrequtils.service b/sys-power/cpufrequtils/files/cpufrequtils.service
new file mode 100644
index 000000000000..e969a357cc7a
--- /dev/null
+++ b/sys-power/cpufrequtils/files/cpufrequtils.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=CPU frequency scaling via cpufrequtils
+
+[Service]
+EnvironmentFile=/etc/conf.d/cpufrequtils
+ExecStart=/usr/libexec/cpufrequtils-change.sh $START_OPTS $SYSFS_EXTRA
+ExecReload=/usr/libexec/cpufrequtils-change.sh $STOP_OPTS
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target \ No newline at end of file