From b51a5102f0d92684ce1fb6e81c6ba82091211b53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Mon, 20 Feb 2017 00:20:25 +0100 Subject: sys-power/phctool: python-single-r1, EAPI=6 --- .../phctool-0.5.2.2_all_paths_tool_no_sudo.patch | 4 +- .../phctool-0.5.2.2_all_paths_tool_sudo.patch | 4 +- .../files/phctool-0.5.2.2_all_paths_tray.patch | 12 +-- .../files/phctool-0.5.2.2_kernel_2.6.36.patch | 4 +- sys-power/phctool/phctool-0.5.2.2-r2.ebuild | 78 -------------------- sys-power/phctool/phctool-0.5.2.2-r3.ebuild | 85 ++++++++++++++++++++++ 6 files changed, 97 insertions(+), 90 deletions(-) delete mode 100644 sys-power/phctool/phctool-0.5.2.2-r2.ebuild create mode 100644 sys-power/phctool/phctool-0.5.2.2-r3.ebuild (limited to 'sys-power') 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 index 2c4de7d32b6a..316e538abe0d 100644 --- 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 @@ -1,5 +1,5 @@ ---- phctool.sh 2007-10-27 22:32:35.000000000 +0200 -+++ phctool.sh 2009-09-05 23:20:18.000000000 +0200 +--- a/phctool.sh 2007-10-27 22:32:35.000000000 +0200 ++++ b/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 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 index 3ec8a9172403..11b64c3bab07 100644 --- 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 @@ -1,5 +1,5 @@ ---- phctool.sh 2007-10-27 22:32:35.000000000 +0200 -+++ phctool.sh 2009-09-05 23:20:18.000000000 +0200 +--- a/phctool.sh 2007-10-27 22:32:35.000000000 +0200 ++++ b/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 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 index 992ed5c7ef15..1d2053a9c4b7 100644 --- 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 @@ -1,5 +1,5 @@ ---- phctray.sh 2007-09-08 08:29:31.000000000 +0200 -+++ phctray.sh 2009-09-05 23:16:54.000000000 +0200 +--- a/phctray.sh 2007-09-08 08:29:31.000000000 +0200 ++++ b/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 @@ -8,8 +8,8 @@ -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 +--- a/phctray.py 2009-09-08 12:17:11.000000000 +0200 ++++ b/phctray.py 2009-09-08 12:17:33.000000000 +0200 @@ -61,7 +61,7 @@ t.show_all() @@ -19,8 +19,8 @@ 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 +--- a/phctray.py 2009-09-08 12:22:28.000000000 +0200 ++++ b/phctray.py 2009-09-08 12:23:44.000000000 +0200 @@ -11,7 +11,7 @@ return; diff --git a/sys-power/phctool/files/phctool-0.5.2.2_kernel_2.6.36.patch b/sys-power/phctool/files/phctool-0.5.2.2_kernel_2.6.36.patch index beb9efa7e5c5..c3a2432aea2d 100644 --- a/sys-power/phctool/files/phctool-0.5.2.2_kernel_2.6.36.patch +++ b/sys-power/phctool/files/phctool-0.5.2.2_kernel_2.6.36.patch @@ -1,5 +1,5 @@ ---- phctool-0.5.2-2/phctool/inc/libs/cpuinfo.py -+++ phctool-0.5.2-2/phctool/inc/libs/cpuinfo.py +--- phctool/inc/libs/cpuinfo.py ++++ phctool/inc/libs/cpuinfo.py @@ -14,33 +14,49 @@ diff --git a/sys-power/phctool/phctool-0.5.2.2-r2.ebuild b/sys-power/phctool/phctool-0.5.2.2-r2.ebuild deleted file mode 100644 index 638eda14b61b..000000000000 --- a/sys-power/phctool/phctool-0.5.2.2-r2.ebuild +++ /dev/null @@ -1,78 +0,0 @@ -# Copyright 1999-2012 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Id$ - -EAPI=4 - -PYTHON_DEPEND="2" -inherit eutils python user - -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} - fi - python_pkg_setup -} - -src_prepare() { - epatch "${FILESDIR}"/${P}_all_paths_tray.patch - if use sudo ; then - epatch "${FILESDIR}"/${P}_all_paths_tool_sudo.patch - else - epatch "${FILESDIR}"/${P}_all_paths_tool_no_sudo.patch - fi - epatch "${FILESDIR}"/${P}_kernel_2.6.36.patch - epatch "${FILESDIR}"/${P}_gui_kernel_2.6.38.patch - find . -name "*.pyc" -delete || die -} - -src_install() { - newbin phctool.sh phctool - newbin phctray.sh phctray - - exeinto ${MY_PROGDIR} - doexe phc{tool,tray}.py subphctool.sh - insinto ${MY_PROGDIR} - doins -r inc - - if use sudo ; then - fowners -R ":${MY_GROUPNAME}" "${MY_PROGDIR}" - fperms g+rX "${MY_PROGDIR}" - dodir /etc/sudoers.d - echo "#%${MY_GROUPNAME} ALL=(root) NOPASSWD:${MY_PROGDIR}/subphctool.sh" \ - > "${ED}"/etc/sudoers.d/${PN} || die - fperms a-w,o-r /etc/sudoers.d/${PN} - fi - - dodoc CHANGELOG - if use doc; then - dohtml -r doc/docfiles doc/index.htm - 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 and uncomment the content of /etc/sudoers.d/${PN}" - else - einfo "Group not automatically added. Please run phctool as root." - fi -} diff --git a/sys-power/phctool/phctool-0.5.2.2-r3.ebuild b/sys-power/phctool/phctool-0.5.2.2-r3.ebuild new file mode 100644 index 000000000000..c1447a7e8123 --- /dev/null +++ b/sys-power/phctool/phctool-0.5.2.2-r3.ebuild @@ -0,0 +1,85 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=6 + +PYTHON_COMPAT=( python2_7 ) +inherit python-single-r1 user + +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" + +DEPEND="${PYTHON_DEPS} + dev-python/egg-python[${PYTHON_USEDEP}] + dev-python/pygtk:2[${PYTHON_USEDEP}]" +RDEPEND="${DEPEND} + sudo? ( app-admin/sudo )" + +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +S="${WORKDIR}/${PV%.*}-${PV##*.}/${PN}" + +pkg_setup() { + MY_PROGDIR="/usr/share/${PN}" + if use sudo ; then + MY_GROUPNAME="phcusers" + enewgroup ${MY_GROUPNAME} + fi + python-single-r1_pkg_setup +} + +src_prepare() { + eapply "${FILESDIR}"/${P}_all_paths_tray.patch + if use sudo ; then + eapply "${FILESDIR}"/${P}_all_paths_tool_sudo.patch + else + eapply "${FILESDIR}"/${P}_all_paths_tool_no_sudo.patch + fi + eapply "${FILESDIR}"/${P}_kernel_2.6.36.patch + eapply "${FILESDIR}"/${P}_gui_kernel_2.6.38.patch + eapply_user + find . -name "*.pyc" -delete || die + python_fix_shebang . +} + +src_install() { + newbin phctool.sh phctool + newbin phctray.sh phctray + + exeinto ${MY_PROGDIR} + doexe phc{tool,tray}.py subphctool.sh + python_moduleinto ${MY_PROGDIR} + python_domodule inc + + if use sudo ; then + fowners -R ":${MY_GROUPNAME}" "${MY_PROGDIR}" + fperms g+rX "${MY_PROGDIR}" + dodir /etc/sudoers.d + echo "#%${MY_GROUPNAME} ALL=(root) NOPASSWD:${MY_PROGDIR}/subphctool.sh" \ + > "${ED}"/etc/sudoers.d/${PN} || die + fperms a-w,o-r /etc/sudoers.d/${PN} + fi + + dodoc CHANGELOG + if use doc; then + docinto html + dodoc -r doc/docfiles doc/index.htm + 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 and uncomment the content of /etc/sudoers.d/${PN}" + else + einfo "Group not automatically added. Please run phctool as root." + fi +} -- cgit v1.2.3