sys-power/intel-undervolt: new package
authorGeorgy Yakovlev <gyakovlev@gentoo.org>
Thu, 23 May 2019 20:32:50 +0000 (13:32 -0700)
committerGeorgy Yakovlev <gyakovlev@gentoo.org>
Thu, 23 May 2019 20:33:02 +0000 (13:33 -0700)
Intel CPU undervolting and throttling configuration tool

Package-Manager: Portage-2.3.66, Repoman-2.3.12
Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
sys-power/intel-undervolt/Manifest [new file with mode: 0644]
sys-power/intel-undervolt/files/confd [new file with mode: 0644]
sys-power/intel-undervolt/files/initd [new file with mode: 0644]
sys-power/intel-undervolt/intel-undervolt-1.6.ebuild [new file with mode: 0644]
sys-power/intel-undervolt/metadata.xml [new file with mode: 0644]

diff --git a/sys-power/intel-undervolt/Manifest b/sys-power/intel-undervolt/Manifest
new file mode 100644 (file)
index 0000000..6b09153
--- /dev/null
@@ -0,0 +1 @@
+DIST intel-undervolt-1.6.tar.gz 22465 BLAKE2B 947f3e3f94316a9988fc0311faa23b07e8e0a99afb737232e6e581f45cca89124a49e47bbc85eb0e836b7fc7f966869910fe4d42581e47d98d8c036390c3dec2 SHA512 1c1de1083654085d6711aad28d2815f2aa05d08b7fddbee425b59ab8109dc1e635c2a9bdda8ba0221420e9e00fcd61013bd4a4633d05ede87808c49898772db3
diff --git a/sys-power/intel-undervolt/files/confd b/sys-power/intel-undervolt/files/confd
new file mode 100644 (file)
index 0000000..0911f6a
--- /dev/null
@@ -0,0 +1 @@
+# /etc/conf.d/intel-undervolt: config file for /etc/init.d/intel-undervolt
diff --git a/sys-power/intel-undervolt/files/initd b/sys-power/intel-undervolt/files/initd
new file mode 100644 (file)
index 0000000..0a43656
--- /dev/null
@@ -0,0 +1,23 @@
+#!/sbin/openrc-run
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+       after thermald
+}
+
+command="/usr/bin/intel-undervolt"
+command_args="daemon"
+command_background="true"
+pidfile="/run/${RC_SVCNAME}.pid"
+required_files="/etc/intel-undervolt.conf"
+
+start_pre() {
+       if service_started thermald; then
+               eerror "thermald conflits with ${RC_SVCNAME}, exiting"
+       fi
+
+       ebegin "${RC_SVCNAME} -> apply initial voltage"
+               "${command}" apply
+       eend $?
+}
diff --git a/sys-power/intel-undervolt/intel-undervolt-1.6.ebuild b/sys-power/intel-undervolt/intel-undervolt-1.6.ebuild
new file mode 100644 (file)
index 0000000..74c44d3
--- /dev/null
@@ -0,0 +1,62 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit linux-info systemd toolchain-funcs
+
+DESCRIPTION="Intel CPU undervolting and throttling configuration tool"
+HOMEPAGE="https://github.com/kitsunyan/intel-undervolt"
+
+if [ ${PV} == "9999" ] ; then
+       inherit git-r3
+       EGIT_REPO_URI="https://github.com/kitsunyan/${PN}.git"
+else
+       SRC_URI="https://github.com/kitsunyan/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+       KEYWORDS="-* ~amd64"
+fi
+
+LICENSE="GPL-3"
+SLOT="0"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
+BDEPEND=""
+
+CONFIG_CHECK="~INTEL_RAPL ~X86_MSR"
+
+src_prepare() {
+       # respect CC, CFLAGS and avoid calling pkg-config
+       sed -i \
+               -e 's/^CC=/CC?=/' \
+               -e 's/^CFLAGS=/CFLAGS?=/' \
+               -e '/^UNITDIR=/d' \
+               Makefile || die
+
+       default
+}
+
+src_compile() {
+
+       tc-export CC
+
+       myemakeargs=(
+               BINDIR="${EPREFIX}"/usr/bin
+               SYSCONFDIR="${EPREFIX}"/etc
+               UNITDIR="$(systemd_get_systemunitdir)"
+       )
+       emake "${myemakeargs[@]}"
+}
+
+src_install() {
+       myemakeargs+=(
+               DESTDIR="${D}"
+       )
+       emake "${myemakeargs[@]}" install
+
+       newinitd "${FILESDIR}"/initd "${PN}"
+       newconfd "${FILESDIR}"/confd "${PN}"
+
+       einstalldocs
+}
diff --git a/sys-power/intel-undervolt/metadata.xml b/sys-power/intel-undervolt/metadata.xml
new file mode 100644 (file)
index 0000000..52dabf8
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+       <maintainer type="person">
+               <email>gyakovlev@gentoo.org</email>
+               <name>Georgy Yakovlev</name>
+       </maintainer>
+       <longdescription lang="en">
+               Tool for undervolting and throttling limits alteration for Intel CPUs
+       </longdescription>
+       <upstream>
+               <remote-id type="github">kitsunyan/intel-undervolt</remote-id>
+       </upstream>
+</pkgmetadata>