aboutsummaryrefslogtreecommitdiffstats
path: root/community/cpufreqd
diff options
context:
space:
mode:
authorLeo <thinkabit.ukim@gmail.com>2020-03-16 02:26:02 -0300
committerLeo <thinkabit.ukim@gmail.com>2020-03-23 12:07:30 -0300
commit41ab224df12b8487004a1522b4f671680c082954 (patch)
tree9ebbc4ea5d1cfb82757ca1fd862b67e444a712a2 /community/cpufreqd
parent1f40937c55d742c7ae05db34c966c3dd2d6595e7 (diff)
downloadaports-41ab224df12b8487004a1522b4f671680c082954.tar.bz2
aports-41ab224df12b8487004a1522b4f671680c082954.tar.xz
community/*: move lots of stuff from main and modernize
Diffstat (limited to 'community/cpufreqd')
-rw-r--r--community/cpufreqd/APKBUILD34
-rw-r--r--community/cpufreqd/cpufreqd.initd43
2 files changed, 77 insertions, 0 deletions
diff --git a/community/cpufreqd/APKBUILD b/community/cpufreqd/APKBUILD
new file mode 100644
index 0000000000..7a1204b4c8
--- /dev/null
+++ b/community/cpufreqd/APKBUILD
@@ -0,0 +1,34 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=cpufreqd
+pkgver=2.4.2
+pkgrel=5
+pkgdesc="A small daemon to adjust cpu speed (and indeed voltage)"
+url="https://sourceforge.net/projects/cpufreqd"
+arch="all"
+license="GPL-2.0-or-later"
+subpackages="$pkgname-doc $pkgname-openrc"
+makedepends="cpufrequtils-dev sysfsutils-dev"
+source="https://downloads.sourceforge.net/cpufreqd/cpufreqd-$pkgver.tar.bz2
+ cpufreqd.initd"
+
+prepare() {
+ default_prepare
+ update_config_sub
+}
+
+build() {
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc
+ make LIBS=-lpthread
+}
+
+package() {
+ make DESTDIR="$pkgdir" install
+ install -Dm 755 ../cpufreqd.initd "$pkgdir"/etc/init.d/cpufreqd
+}
+
+sha512sums="42067a28c1901cb2c45f21f918169648db77f553db1fbd44e2aae64e7092b530a1e3697a0cc4b4b70e0d474966671e924950501a0feb5d0ada166aa369dbc33b cpufreqd-2.4.2.tar.bz2
+cc5769f2f06ffeefe54ddde4d8829f8c1b9ddb82f32d883bf5df403c6386cac6ae8067cc7fa63c2b685b47bb88e6460b1f08bbf8ddf1c1fa392ecd6a17bea493 cpufreqd.initd"
diff --git a/community/cpufreqd/cpufreqd.initd b/community/cpufreqd/cpufreqd.initd
new file mode 100644
index 0000000000..39b8b73ea4
--- /dev/null
+++ b/community/cpufreqd/cpufreqd.initd
@@ -0,0 +1,43 @@
+#!/sbin/openrc-run
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-power/cpufreqd/files/cpufreqd-init.d,v 1.1 2007/05/17 08:51:45 phreak Exp $
+
+CONFIGFILE=/etc/cpufreqd.conf
+
+depend() {
+ need localmount
+ use logger lm_sensors
+}
+
+checkconfig() {
+ if [ ! -f ${CONFIGFILE} ]; then
+ eerror "Configuration file ${CONFIGFILE} not found"
+ return 1
+ fi
+
+ if [ ! -e /proc/cpufreq ] ; then
+ for cpu in /sys/devices/system/cpu/cpu[0-9]* ; do
+ # We need just one cpu supporting freq scaling.
+ [ -e ${cpu}/cpufreq ] && return 0
+ done
+ eerror "cpufreqd requires the kernel to be configured with CONFIG_CPU_FREQ"
+ eerror "Make sure that the appropiate drivers for your CPU are available."
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting CPU Frequency Daemon"
+ start-stop-daemon --start --exec /usr/sbin/cpufreqd -- \
+ -f ${CONFIGFILE}
+ eend ${?}
+}
+
+stop() {
+ ebegin "Stopping CPU Frequency Daemon"
+ start-stop-daemon --stop --exec /usr/sbin/cpufreqd
+ eend ${?}
+}