summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcin Nowak2020-01-15 00:31:55 +0100
committerMarcin Nowak2020-01-15 00:31:55 +0100
commitedc80f23710535f2e28dbb061262afb14a8f357f (patch)
treecaee46bc9684ddf1fcb0aff72cf7a6f5330e645e
downloadaur-edc80f23710535f2e28dbb061262afb14a8f357f.tar.gz
initial commit
-rw-r--r--.SRCINFO17
-rw-r--r--.gitignore5
-rw-r--r--PKGBUILD40
-rw-r--r--cpufreqctl.patch8
-rw-r--r--policy.patch21
5 files changed, 91 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..daf93aa5bcec
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,17 @@
+pkgbase = cpufreqctl
+ pkgdesc = A intel_pstate CPU freq controller for regular user (extracted from extension 'CPU Power Manager for Gnome')
+ pkgver = 8
+ pkgrel = 1
+ url = https://github.com/martin31821/cpupower
+ arch = x86_64
+ license = GPL
+ provides = cpufreqctl
+ source = https://github.com/martin31821/cpupower/archive/v8.tar.gz
+ source = policy.patch
+ source = cpufreqctl.patch
+ sha256sums = a11696e2486620baf550f004a046d7c19938ca2c6dcdf698c6906c1d8bcba541
+ sha256sums = b62e356b1d17bc2f14bf3369ff7f45d251032b200198b95371cac34fcced274b
+ sha256sums = d4f1f34de1b146897d1c74fbefbc6577b397d7b47380de5255493f4a4fd38124
+
+pkgname = cpufreqctl
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..3aa0845e780d
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+/src
+/pkg
+/*.tar
+/*.tgz
+/*.tar.gz
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..78f1511d4cc4
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,40 @@
+# Maintainer: Marcin Nowak < marcin dot j dot nowak at gmail dot com >
+
+pkgname=cpufreqctl
+pkgver=8
+pkgrel=1
+pkgdesc="A intel_pstate CPU freq controller for regular user (extracted from extension 'CPU Power Manager for Gnome')"
+arch=('x86_64')
+url="https://github.com/martin31821/cpupower"
+source=(
+ https://github.com/martin31821/cpupower/archive/v$pkgver.tar.gz
+ policy.patch
+ cpufreqctl.patch
+ )
+sha256sums=(
+ 'a11696e2486620baf550f004a046d7c19938ca2c6dcdf698c6906c1d8bcba541'
+ 'b62e356b1d17bc2f14bf3369ff7f45d251032b200198b95371cac34fcced274b'
+ 'd4f1f34de1b146897d1c74fbefbc6577b397d7b47380de5255493f4a4fd38124'
+ )
+license=('GPL')
+provides=('cpufreqctl')
+depends=()
+makedepends=()
+
+build() {
+ cd "$srcdir/cpupower-${pkgver}"
+ cp mko.cpupower.policy.in ${pkgname}.policy
+ patch -p0 ${pkgname}.policy < $srcdir/policy.patch
+ patch -p0 ${pkgname} < $srcdir/cpufreqctl.patch
+}
+
+package() {
+ cd "$srcdir/cpupower-${pkgver}"
+
+ install -dm755 "$pkgdir/usr/bin"
+ install -Dm755 cpufreqctl "$pkgdir/usr/bin"
+
+ install -dm755 "$pkgdir/usr/share/polkit-1/actions"
+ install -Dm755 ${pkgname}.policy "$pkgdir/usr/share/polkit-1/actions/"
+
+}
diff --git a/cpufreqctl.patch b/cpufreqctl.patch
new file mode 100644
index 000000000000..a34bf6c2c0e6
--- /dev/null
+++ b/cpufreqctl.patch
@@ -0,0 +1,8 @@
+--- src/cpupower-8/cpufreqctl 2017-02-25 18:01:09.000000000 +0100
++++ ./cpufreqctl 2020-01-15 00:18:19.885481690 +0100
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/usr/bin/pkexec /bin/bash
+ if [ $# -lt 2 ]
+ then
+ echo "Usage: cpufreqctl.sh {turbo|min|max} {value}"
diff --git a/policy.patch b/policy.patch
new file mode 100644
index 000000000000..bce580907982
--- /dev/null
+++ b/policy.patch
@@ -0,0 +1,21 @@
+--- src/cpupower-8/mko.cpupower.policy.in 2017-02-25 18:01:09.000000000 +0100
++++ cpufreqctl.policy 2020-01-15 00:22:32.619348148 +0100
+@@ -6,7 +6,7 @@
+ <vendor>MKO Systems</vendor>
+ <vendor_url>http://mko-sl.de</vendor_url>
+
+- <action id="mko.cpupower.setcpufreq">
++ <action id="cpufreqctl.setcpufreq">
+ <description>Set a new CPU Frequency to intel_pstate</description>
+ <description xml:lang="de">Neue CPU-Frequenzgrenzen an intel_pstate senden</description>
+ <message>No Authorization required to set frequency bounds.</message>
+@@ -16,7 +16,8 @@
+ <allow_inactive>yes</allow_inactive>
+ <allow_active>yes</allow_active>
+ </defaults>
+- <annotate key="org.freedesktop.policykit.exec.path">xxxPATHxxx</annotate>
++ <annotate key="org.freedesktop.policykit.exec.path">/bin/bash</annotate>
++ <annotate key="org.freedesktop.policykit.exec.argv1">/usr/bin/cpufreqctl</annotate>
+ </action>
+
+ </policyconfig>