diff options
author | Michael Weber <xmw@gentoo.org> | 2010-04-09 22:17:51 +0000 |
---|---|---|
committer | Michael Weber <xmw@gentoo.org> | 2010-04-09 22:17:51 +0000 |
commit | f376a9857b6fa9fd2faa00c0717f2197f1891f82 (patch) | |
tree | f0d51294151251706ecdd267d9410b3769d520f4 /sys-power | |
parent | sys-power/phc-intel: New Ebuild for bug 283472 (diff) | |
download | sunrise-f376a9857b6fa9fd2faa00c0717f2197f1891f82.tar.gz sunrise-f376a9857b6fa9fd2faa00c0717f2197f1891f82.tar.bz2 sunrise-f376a9857b6fa9fd2faa00c0717f2197f1891f82.zip |
sys-power/phctool: New Ebuild (userland) for bug 272212
svn path=/sunrise/; revision=10425
Diffstat (limited to 'sys-power')
-rw-r--r-- | sys-power/phctool/ChangeLog | 10 | ||||
-rw-r--r-- | sys-power/phctool/Manifest | 7 | ||||
-rw-r--r-- | sys-power/phctool/files/phctool-0.5.2.2_all_paths_tool_no_sudo.patch | 17 | ||||
-rw-r--r-- | sys-power/phctool/files/phctool-0.5.2.2_all_paths_tool_sudo.patch | 18 | ||||
-rw-r--r-- | sys-power/phctool/files/phctool-0.5.2.2_all_paths_tray.patch | 32 | ||||
-rw-r--r-- | sys-power/phctool/metadata.xml | 8 | ||||
-rw-r--r-- | sys-power/phctool/phctool-0.5.2.2.ebuild | 78 |
7 files changed, 170 insertions, 0 deletions
diff --git a/sys-power/phctool/ChangeLog b/sys-power/phctool/ChangeLog new file mode 100644 index 000000000..99260a238 --- /dev/null +++ b/sys-power/phctool/ChangeLog @@ -0,0 +1,10 @@ +# ChangeLog for sys-power/phctool +# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 +# $Header: $ + + 09 Apr 2010; Michael Weber (xmw) <gentoo@xmw.de> +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: + New Ebuild (userland) for bug 272212 + diff --git a/sys-power/phctool/Manifest b/sys-power/phctool/Manifest new file mode 100644 index 000000000..5c897de25 --- /dev/null +++ b/sys-power/phctool/Manifest @@ -0,0 +1,7 @@ +AUX phctool-0.5.2.2_all_paths_tool_no_sudo.patch 530 RMD160 8474572b7b0392bfff4e2ce16d5a2400ed8e3866 SHA1 b5d68d9e8ec03686f8e34171976dada2ad02a4eb SHA256 9776704c00d5733b94a73c57a9755ba747958fc0551fecc6d5fb79627a93eb77 +AUX phctool-0.5.2.2_all_paths_tool_sudo.patch 543 RMD160 00050722ee5bf3642f5291d05c1d994cdc9dde47 SHA1 36297990d40abbfff73b512f54d687c562d31fbf SHA256 15bf6e039b12414058be70569cd6a6d9519b55e569805bd1ad7c6d2ee3d0b7b5 +AUX phctool-0.5.2.2_all_paths_tray.patch 1031 RMD160 c785823cc3eed3dad3c8b762e2a8b21bed9c4099 SHA1 d4da8505a73733a03286eeeeceac6ef475306ba4 SHA256 abddf36fd0cdd6e9b00392a4dadfb1853528edeb39afdeaba6b00d568e2598ac +DIST phctool-0.5.2.2.tar.gz 941587 RMD160 3b4b496428fcb1951f5510ee7b4435f7725dc24a SHA1 8f0f2b6dd8023746a308cc2a7cab8a22a8e1ebab SHA256 ef60b13a74e7a123008a93d02759e99537a58c40091774a7e70e3e1d5960fa4a +EBUILD phctool-0.5.2.2.ebuild 1842 RMD160 f42e858bb49910e301d55d800ef2720c91b14069 SHA1 29e8a7b36dc7dde79c59a1d73a6da4d1d902372c SHA256 abfe204330702cb3723c0af05c96f448b976b8089e1af974ad4a649afd34bbb2 +MISC ChangeLog 403 RMD160 fcef51ab8bbeb03cb1eaa74aea98f3cd75427c46 SHA1 f6db707dcac99d9138bb2962afa50fbcabe9a51a SHA256 797f5b77802d87782972b2c1ce11cfdef9c08872fc99d802a00b6d3094077df6 +MISC metadata.xml 262 RMD160 a7baf38feffbf09e36d7a9ea3aec192c28f0886a SHA1 2a25eb0f55b6f06f504cb21e54d9bb5f08289221 SHA256 197fbc5ac4e820730e816fe836988f69769949d43ed637d0b1b0343459bf5547 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 000000000..2c4de7d32 --- /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 000000000..3ec8a9172 --- /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 000000000..992ed5c7e --- /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 000000000..a680806a5 --- /dev/null +++ b/sys-power/phctool/metadata.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>no-herd</herd> + <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 000000000..b30bc3151 --- /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: $ + +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} +} |