aboutsummaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorMartin Wilke <miwi@FreeBSD.org>2008-11-23 13:43:09 +0000
committerMartin Wilke <miwi@FreeBSD.org>2008-11-23 13:43:09 +0000
commit489b8f436cb95d2f83f72eda41806a1b88f83cc0 (patch)
tree89dd5d03eba187c4cd040ce39dbc53135aab1782 /sysutils
parentb7f7b23e62eae6d1da0b755fa06c044945eb1566 (diff)
downloadports-489b8f436cb95d2f83f72eda41806a1b88f83cc0.tar.gz
ports-489b8f436cb95d2f83f72eda41806a1b88f83cc0.zip
Notes
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/Makefile1
-rw-r--r--sysutils/cpupowerd/Makefile50
-rw-r--r--sysutils/cpupowerd/distinfo3
-rw-r--r--sysutils/cpupowerd/files/cpupowerd.in37
-rw-r--r--sysutils/cpupowerd/files/patch-libcpupowerd.c10
-rw-r--r--sysutils/cpupowerd/pkg-descr7
-rw-r--r--sysutils/cpupowerd/pkg-message15
-rw-r--r--sysutils/cpupowerd/pkg-plist8
8 files changed, 131 insertions, 0 deletions
diff --git a/sysutils/Makefile b/sysutils/Makefile
index a224710b0c7d..4899b3344608 100644
--- a/sysutils/Makefile
+++ b/sysutils/Makefile
@@ -115,6 +115,7 @@
SUBDIR += cpdup
SUBDIR += cpu
SUBDIR += cpuburn
+ SUBDIR += cpupowerd
SUBDIR += cramfs
SUBDIR += crashme
SUBDIR += cromwell
diff --git a/sysutils/cpupowerd/Makefile b/sysutils/cpupowerd/Makefile
new file mode 100644
index 000000000000..a2558b19a514
--- /dev/null
+++ b/sysutils/cpupowerd/Makefile
@@ -0,0 +1,50 @@
+# New ports collection makefile for: cpupowerd
+# Date created: 2008-06-01
+# Whom: Bernhard Fr__hlich <decke@bluelife.at>
+#
+# $FreeBSD$
+#
+
+PORTNAME= cpupowerd
+PORTVERSION= 0.2.0
+CATEGORIES= sysutils
+MASTER_SITES= SF
+
+MAINTAINER= decke@bluelife.at
+COMMENT= A CPU over- and undervolting daemon
+
+USE_RC_SUBR= cpupowerd
+ONLY_FOR_ARCHS= i386 amd64
+WRKSRC= ${WRKDIR}/${DISTNAME}/src
+MAKE_ENV+= GROUP=wheel \
+ RIGHTS=555
+
+OPTIONS= CREATELOAD "Install createload.sh for stability testing" Off
+
+.include <bsd.port.pre.mk>
+
+.if ${OSVERSION} < 800042
+BUILD_DEPENDS+= ${LOCALBASE}/include/cpu.h:${PORTSDIR}/sysutils/devcpu
+.endif
+
+.if defined(WITH_CREATELOAD)
+RUN_DEPENDS+= burnMMX:${PORTSDIR}/sysutils/cpuburn
+PLIST_SUB+= CREATELOAD=""
+.else
+PLIST_SUB+= CREATELOAD="@comment "
+.endif
+
+post-install:
+.if defined(WITH_CREATELOAD)
+ ${INSTALL_SCRIPT} ${WRKSRC}/../tools/createload.sh ${PREFIX}/bin/createload.sh
+.endif
+.if !defined(NOPORTDOCS)
+ @${MKDIR} ${DOCSDIR}
+ ${INSTALL_DATA} ${WRKSRC}/../CHANGELOG ${DOCSDIR}/CHANGELOG
+ ${INSTALL_DATA} ${WRKSRC}/../COPYING ${DOCSDIR}/COPYING
+ ${INSTALL_DATA} ${WRKSRC}/../README ${DOCSDIR}/README
+ ${INSTALL_DATA} ${WRKSRC}/../TODO ${DOCSDIR}/TODO
+.endif
+ @${CAT} ${PKGMESSAGE}
+
+.include <bsd.port.post.mk>
diff --git a/sysutils/cpupowerd/distinfo b/sysutils/cpupowerd/distinfo
new file mode 100644
index 000000000000..5b9173ced00e
--- /dev/null
+++ b/sysutils/cpupowerd/distinfo
@@ -0,0 +1,3 @@
+MD5 (cpupowerd-0.2.0.tar.gz) = 008eaf562f59c9d0fcf79de231948e4f
+SHA256 (cpupowerd-0.2.0.tar.gz) = 86ad76e9611bd60ac6e9ee3a800ec72cc9d129b5b61750e07a9e015f89d1e849
+SIZE (cpupowerd-0.2.0.tar.gz) = 42794
diff --git a/sysutils/cpupowerd/files/cpupowerd.in b/sysutils/cpupowerd/files/cpupowerd.in
new file mode 100644
index 000000000000..db71d31fd77b
--- /dev/null
+++ b/sysutils/cpupowerd/files/cpupowerd.in
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+# PROVIDE: cpupowerd
+# REQUIRE: DAEMON
+# BEFORE: LOGIN
+# KEYWORD: nojail
+#
+# Add the following line to /etc/rc.conf[.local] to enable cpupowerd
+#
+# cpupowerd_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable cpupowerd.
+# cpupowerd_config (str): Custom config file for cpupowerd.
+# (default /usr/local/etc/cpupowerd.conf)
+# cpupowerd_flags (str): Custom additional arguments to be passed
+# to cpupowerd (default -d -c cpupowerd.conf).
+#
+
+. %%RC_SUBR%%
+
+name="cpupowerd"
+rcvar=`set_rcvar`
+command=%%PREFIX%%/sbin/${name}
+
+load_rc_config $name
+
+if [ ! -c "/dev/cpu0" -a ! -c "/dev/cpuctl0" ]; then
+ kldload cpu
+fi
+
+# set default
+: ${cpupowerd_enable="NO"}
+: ${cpupowerd_config="%%PREFIX%%/etc/cpupowerd.conf"}
+: ${cpupowerd_flags=""}
+
+command_args="-d -c ${cpupowerd_config} ${cpupowerd_flags}"
+
+run_rc_command "$1"
diff --git a/sysutils/cpupowerd/files/patch-libcpupowerd.c b/sysutils/cpupowerd/files/patch-libcpupowerd.c
new file mode 100644
index 000000000000..494e4c0ff730
--- /dev/null
+++ b/sysutils/cpupowerd/files/patch-libcpupowerd.c
@@ -0,0 +1,10 @@
+--- libcpupowerd.c.orig 2008-11-13 22:38:33.000000000 +0100
++++ libcpupowerd.c 2008-11-13 22:39:19.000000000 +0100
+@@ -33,6 +33,7 @@
+ #include <sys/ioctl.h>
+ #include <sys/sysctl.h>
+ #ifdef __FreeBSD__
++#include <sys/param.h>
+ #if __FreeBSD_version < 800042
+ #include <cpu.h>
+ #define RDMSR CPU_RDMSR
diff --git a/sysutils/cpupowerd/pkg-descr b/sysutils/cpupowerd/pkg-descr
new file mode 100644
index 000000000000..276ccb523982
--- /dev/null
+++ b/sysutils/cpupowerd/pkg-descr
@@ -0,0 +1,7 @@
+A daemon which controls the frequency and voltage of CPUs.
+
+This userland program adjusts the frequency and voltage
+according to the CPUs load. Its capabilities include
+overvolting as well as undervolting.
+
+WWW: http://cpupowerd.sourceforge.net/
diff --git a/sysutils/cpupowerd/pkg-message b/sysutils/cpupowerd/pkg-message
new file mode 100644
index 000000000000..730f875a1d0a
--- /dev/null
+++ b/sysutils/cpupowerd/pkg-message
@@ -0,0 +1,15 @@
+=============================================================================
+
+cpupowerd was installed.
+
+To generate a safe dafault config for you cpu you can use the "-a" or
+"--autoconfig" switch.
+
+cpupowerd -a /usr/local/etc/cpupowerd.conf
+
+Please follow the README to customize this values for your CPU but be
+carefully because you can REALLY DAMAGE YOUR CPU with that!
+
+Please, report any problems to maintainer. Thanks!
+
+=============================================================================
diff --git a/sysutils/cpupowerd/pkg-plist b/sysutils/cpupowerd/pkg-plist
new file mode 100644
index 000000000000..2635c67e9b7c
--- /dev/null
+++ b/sysutils/cpupowerd/pkg-plist
@@ -0,0 +1,8 @@
+@comment $FreeBSD$
+sbin/cpupowerd
+%%CREATELOAD%%bin/createload.sh
+%%PORTDOCS%%%%DOCSDIR%%/CHANGELOG
+%%PORTDOCS%%%%DOCSDIR%%/COPYING
+%%PORTDOCS%%%%DOCSDIR%%/README
+%%PORTDOCS%%%%DOCSDIR%%/TODO
+%%PORTDOCS%%@dirrm %%DOCSDIR%%