summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Weber <xmw@gentoo.org>2010-08-24 14:03:15 +0000
committerMichael Weber <xmw@gentoo.org>2010-08-24 14:03:15 +0000
commit386ea74554d43f6271b7498744ffa1f2098e0876 (patch)
tree493973882c9a3c30a72d3c60f4ca4199c5002f0a /sys-power
parentBlock compilation against older boost, bug #334259. (diff)
downloadgentoo-2-386ea74554d43f6271b7498744ffa1f2098e0876.tar.gz
gentoo-2-386ea74554d43f6271b7498744ffa1f2098e0876.tar.bz2
gentoo-2-386ea74554d43f6271b7498744ffa1f2098e0876.zip
Initial import for phctool
(Portage version: 2.1.8.3/cvs/Linux x86_64)
Diffstat (limited to 'sys-power')
-rw-r--r--sys-power/phctool/ChangeLog18
-rw-r--r--sys-power/phctool/files/phctool-0.5.2.2_all_paths_tool_no_sudo.patch17
-rw-r--r--sys-power/phctool/files/phctool-0.5.2.2_all_paths_tool_sudo.patch18
-rw-r--r--sys-power/phctool/files/phctool-0.5.2.2_all_paths_tray.patch32
-rw-r--r--sys-power/phctool/metadata.xml12
-rw-r--r--sys-power/phctool/phctool-0.5.2.2.ebuild78
6 files changed, 175 insertions, 0 deletions
diff --git a/sys-power/phctool/ChangeLog b/sys-power/phctool/ChangeLog
new file mode 100644
index 000000000000..9d55ff2505d4
--- /dev/null
+++ b/sys-power/phctool/ChangeLog
@@ -0,0 +1,18 @@
+# ChangeLog for sys-power/phctool
+# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-power/phctool/ChangeLog,v 1.1 2010/08/24 14:03:15 xmw Exp $
+
+ 24 Aug 2010; Michael Weber (xmw) <xmw@gentoo.org> +phctool-0.5.2.2.ebuild,
+ +files/phctool-0.5.2.2_all_paths_tool_no_sudo.patch,
+ +files/phctool-0.5.2.2_all_paths_tool_sudo.patch,
+ +files/phctool-0.5.2.2_all_paths_tray.patch, +metadata.xml:
+ Initial commit for phctool. Fixes bug 283472.
+
+*phctool-0.5.2.2 (24 Aug 2010)
+
+ 24 Aug 2010; Michael Weber (xmw) <xmw@gentoo.org> +phctool-0.5.2.2.ebuild,
+ +files/phctool-0.5.2.2_all_paths_tool_no_sudo.patch,
+ +files/phctool-0.5.2.2_all_paths_tool_sudo.patch,
+ +files/phctool-0.5.2.2_all_paths_tray.patch, +metadata.xml:
+ Initial commit for phctool. Fixes bug 283472.
+
diff --git a/sys-power/phctool/files/phctool-0.5.2.2_all_paths_tool_no_sudo.patch b/sys-power/phctool/files/phctool-0.5.2.2_all_paths_tool_no_sudo.patch
new file mode 100644
index 000000000000..2c4de7d32b6a
--- /dev/null
+++ b/sys-power/phctool/files/phctool-0.5.2.2_all_paths_tool_no_sudo.patch
@@ -0,0 +1,17 @@
+--- phctool.sh 2007-10-27 22:32:35.000000000 +0200
++++ phctool.sh 2009-09-05 23:20:18.000000000 +0200
+@@ -1,10 +1,7 @@
+ #!/bin/sh
+-#this shellscript is just a wrapper to subphctool.sh
+-#but necessary to run phctool with sudo even from the tray icon
+-PROGPATH=`dirname "$0"`
+-cd $PROGPATH
+-if test -e /usr/bin/gksu
+- then gksu ./subphctool.sh $1
+- else sudo ./subphctool.sh $1
+-fi
++#this shellscript is just a wrapper to phctool.py
++#but necessary to run phctool from another directory
++
++cd /usr/share/phctool
++./phctool.py $1
diff --git a/sys-power/phctool/files/phctool-0.5.2.2_all_paths_tool_sudo.patch b/sys-power/phctool/files/phctool-0.5.2.2_all_paths_tool_sudo.patch
new file mode 100644
index 000000000000..3ec8a9172403
--- /dev/null
+++ b/sys-power/phctool/files/phctool-0.5.2.2_all_paths_tool_sudo.patch
@@ -0,0 +1,18 @@
+--- phctool.sh 2007-10-27 22:32:35.000000000 +0200
++++ phctool.sh 2009-09-05 23:20:18.000000000 +0200
+@@ -1,10 +1,7 @@
+ #!/bin/sh
+-#this shellscript is just a wrapper to subphctool.sh
+-#but necessary to run phctool with sudo even from the tray icon
+-PROGPATH=`dirname "$0"`
+-cd $PROGPATH
+-if test -e /usr/bin/gksu
+- then gksu ./subphctool.sh $1
+- else sudo ./subphctool.sh $1
+-fi
++#this shellscript is just a wrapper to subphctool.py
++#but necessary to run phctool from another directory
++
++cd /usr/share/phctool
++sudo ./subphctool.sh $1
+
diff --git a/sys-power/phctool/files/phctool-0.5.2.2_all_paths_tray.patch b/sys-power/phctool/files/phctool-0.5.2.2_all_paths_tray.patch
new file mode 100644
index 000000000000..992ed5c7ef15
--- /dev/null
+++ b/sys-power/phctool/files/phctool-0.5.2.2_all_paths_tray.patch
@@ -0,0 +1,32 @@
+--- phctray.sh 2007-09-08 08:29:31.000000000 +0200
++++ phctray.sh 2009-09-05 23:16:54.000000000 +0200
+@@ -2,6 +2,5 @@
+ #this shellscript is just a wrapper to phctray.py
+ #but necessary to run phctray from another directory
+
+-PROGPATH=`dirname "$0"`
+-cd $PROGPATH
++cd /usr/share/phctool
+ ./phctray.py
+--- phctray.py 2009-09-08 12:17:11.000000000 +0200
++++ phctray.py 2009-09-08 12:17:33.000000000 +0200
+@@ -61,7 +61,7 @@
+ t.show_all()
+
+ ##call phctool without GUI to set stored values
+-cmd=[sys.path[0]+"/phctool.sh","background"] ##command
++cmd=["/usr/bin/phctool","background"] ##command
+ subprocess.Popen(cmd, shell=False) ##call the affinated programm
+
+ gtk.main()
+--- phctray.py 2009-09-08 12:22:28.000000000 +0200
++++ phctray.py 2009-09-08 12:23:44.000000000 +0200
+@@ -11,7 +11,7 @@
+ return;
+
+ def run_phctool( *args ):
+- cmd=[sys.path[0]+"/phctool.sh"] ##command
++ cmd=["/usr/bin/phctool"] ##command
+ subprocess.Popen(cmd, shell=False) ##call the affinated programm
+
+ def applet_face_click( window, event, *data ):
diff --git a/sys-power/phctool/metadata.xml b/sys-power/phctool/metadata.xml
new file mode 100644
index 000000000000..21d0c9ac17f3
--- /dev/null
+++ b/sys-power/phctool/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd></herd>
+<maintainer>
+<email>xmw@gentoo.org</email>
+<name>Michael Weber (xmw)</name>
+</maintainer>
+<use>
+ <flag name="sudo">Enable support for sudo to run gui from non-root user</flag>
+</use>
+</pkgmetadata>
diff --git a/sys-power/phctool/phctool-0.5.2.2.ebuild b/sys-power/phctool/phctool-0.5.2.2.ebuild
new file mode 100644
index 000000000000..5e7f0e12d3e9
--- /dev/null
+++ b/sys-power/phctool/phctool-0.5.2.2.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-power/phctool/phctool-0.5.2.2.ebuild,v 1.1 2010/08/24 14:03:15 xmw Exp $
+
+EAPI=2
+
+PYTHON_DEPEND="2"
+inherit eutils python
+
+DESCRIPTION="Processor Hardware Control userland configuration tool"
+HOMEPAGE="http://www.linux-phc.org/"
+SRC_URI="http://www.linux-phc.org/forum/download/file.php?id=50 -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc sudo"
+
+RDEPEND="dev-python/egg-python
+ dev-python/pygtk:2
+ sudo? ( app-admin/sudo )"
+
+S="${WORKDIR}/${PV%.*}-${PV##*.}/${PN}"
+
+pkg_setup() {
+ MY_PROGDIR="/usr/share/${PN}"
+ if use sudo ; then
+ MY_GROUPNAME="phcusers"
+ enewgroup ${MY_GROUPNAME} || die
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PF}_all_paths_tray.patch"
+ if use sudo; then
+ epatch "${FILESDIR}/${PF}_all_paths_tool_sudo.patch"
+ else
+ epatch "${FILESDIR}/${PF}_all_paths_tool_no_sudo.patch"
+ fi
+ find . -name "*.pyc" -exec rm {} +
+}
+
+src_install() {
+ newbin phctool.sh phctool || die
+ newbin phctray.sh phctray || die
+
+ exeinto ${MY_PROGDIR}
+ doexe phc{tool,tray}.py subphctool.sh || die
+ insinto ${MY_PROGDIR}
+ doins -r inc || die
+
+ if use sudo ; then
+ fowners -R :${MY_GROUPNAME} "${MY_PROGDIR}" || die
+ fperms g+rX "${MY_PROGDIR}" || die
+ fi
+
+ dodoc CHANGELOG || die
+ if use doc; then
+ dohtml -r doc/docfiles doc/index.htm || die
+ fi
+}
+
+pkg_postinst() {
+ if use sudo; then
+ einfo "You have to add a line to /etc/sudoers to get access to"
+ einfo "/sys/devices/system/cpu/cpu1/cpufreq/phc_controls from the phctool/phctray"
+ einfo "Please check following line and add it to /etc/sudoser using visudo:"
+ einfo " %${MY_GROUPNAME} ALL=(root) NOPASSWD:${MY_PROGDIR}/subphctool.sh"
+ else
+ einfo "Group not automatically added. Please run phctool as root."
+ fi
+
+ python_mod_optimize ${MY_PROGDIR}
+}
+
+pkg_postrm() {
+ python_mod_cleanup ${MY_PROGDIR}
+}