From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- net-firewall/ufw-frontends/Manifest | 7 +++ .../files/org.gentoo.pkexec.ufw-gtk.policy | 21 +++++++ .../files/ufw-frontends-0.3.2-no-log-crash.patch | 61 +++++++++++++++++++++ net-firewall/ufw-frontends/metadata.xml | 22 ++++++++ .../ufw-frontends/ufw-frontends-0.3.2-r5.ebuild | 64 ++++++++++++++++++++++ 5 files changed, 175 insertions(+) create mode 100644 net-firewall/ufw-frontends/Manifest create mode 100644 net-firewall/ufw-frontends/files/org.gentoo.pkexec.ufw-gtk.policy create mode 100644 net-firewall/ufw-frontends/files/ufw-frontends-0.3.2-no-log-crash.patch create mode 100644 net-firewall/ufw-frontends/metadata.xml create mode 100644 net-firewall/ufw-frontends/ufw-frontends-0.3.2-r5.ebuild (limited to 'net-firewall/ufw-frontends') diff --git a/net-firewall/ufw-frontends/Manifest b/net-firewall/ufw-frontends/Manifest new file mode 100644 index 000000000000..ec97642e36e7 --- /dev/null +++ b/net-firewall/ufw-frontends/Manifest @@ -0,0 +1,7 @@ +AUX org.gentoo.pkexec.ufw-gtk.policy 778 SHA256 abeae0fbfffbc09f6f208c713612e8425d8a11268baeae774fd12ee8aacae1c0 SHA512 f2b47a01535d565d2d3f40266f61b5b0ee3ad5befa4aa9f704000000f111980ac219eccea7d22fe3b0995d91aa794c278daa4f6a6d36649cd0db7b53772bd61f WHIRLPOOL 7119bad2f11779a3beb8c2267c918d31048eb9d70e949cb14b0e3068594b148ca88fca46cd46ff3b6e17216c1be208596eee1be9d8d182396769dac1d892c8fd +AUX ufw-frontends-0.3.2-no-log-crash.patch 2224 SHA256 4e0120c76321900bc8ede1acb5c2aaad8e37d1989365e0576da718f15bace2b1 SHA512 a68e414c92d6570ba7368526ddefae30897d79f7b352e841f69fa95435a1b14c26b551b37b3431830ee3df700d3a48fc62d454c9be8f8e59d070f5e47ece7ea7 WHIRLPOOL 1a3550ee0e1cde3740a5d56515181822bf46f349741572eeb76e2cc53be74ec0b0220b2eab3d4f0c7bedb414d4138f49b489b503db24d6a6951aa5988ad4de9a +DIST ufw-frontends-0.3.2.tar.gz 85472 SHA256 7ff838d1f20a122307ef5e2bc94f6cbb5ea019a1d3d7ec72f7493c5f8c0a7910 SHA512 9f311596a3bad71562ca98acb8bf4d0d55990520cb5373c299dad05d1a1986e791eac984385013a511af4693a9988351ec37d8735ae6748818a9570db416b274 WHIRLPOOL 8b12a19c3338210d388b3d5ed24e22cbb49357d9fa9c768ad7b9ff8bcb6481cf4888048ec4c60266915a69095a90e2ce776a81f92f0f9692d8c2ef3fc4b669ed +EBUILD ufw-frontends-0.3.2-r5.ebuild 1732 SHA256 1900583650e29f64fb526cb93709186cbdc10fe86620f5f8d1c7b81a0f8fb5cc SHA512 c72a46f0cd68c533fb4c573130fbc7d1ed5c7fe29ee9b0e93a336daf6f5f5392bb0488ac52d8c8fabd8a50fe81402381f6429dcc525b2b28ed6da0a8b6a1cd94 WHIRLPOOL 304a34b19abc464a551f8dc24a2b833f6252bfbed6b118705ba381e3974017da287a244e4ff4e1a2c360fb9f850c3df4ef0ddc39b20f78edc0956643cfd8aa8f +MISC ChangeLog 3306 SHA256 a5ec494b04a01454594d451bfd595e1c9b4e54e145f744c33ce66b9fd1bb4075 SHA512 8c0dfc30631c5922800ba0ba789063bbbb3566647bb0b564745cd5c1affb1d2887e287b22c9519009366ba27da2e92521e6155b40b2219d800bd086c1d0b84ee WHIRLPOOL dffa4a7c355aac8b968c1bdc6e38cdb05851bf415a59504bd674042bfe03367b6f41312b2f3e60f0c76611e0f3a9ec40ad56f4180479f5d4c4436cf00521ff3d +MISC ChangeLog-2015 2522 SHA256 ee4ac21cd338acbfece37091459f375aaba514d61a6f99b7ff84bfbda89fff08 SHA512 9c072320ae0523c34a26232ee181aae5cac8b10a61d81d53c088312220b1c1a01392defc5733ef86cda08b739b3644461da4a0501b746d43c32b31a881279e37 WHIRLPOOL 25cc8064cc516c855b48ebbe413fc666dc4db8cca98020042fd7508fa0e263815f2a9e0a6d3b019ceabbbff107e69acd0603a6e8832ce6f07eac739a06f6acd6 +MISC metadata.xml 917 SHA256 27898a6e1baa0c7b79728884555b1ac20f37472476684a50745d911ef8dbf0be SHA512 e61b8a84c60861b69cae3a0f0748e5ab7d730ab0b9356ba29f991bfe1656cefdcc5f7395058003ac073daf71c4f58e484fcdbf9278e991bc92d8a7badcf453a9 WHIRLPOOL 9ae029eb71c35d6ef0aa0006a9f78c53a2ce6da9daf6236c5d21f6586ce05e982c3f6f5a35d4bef30705a9e133395d60910cd25faa19d1ce0f0db31b04fe3be3 diff --git a/net-firewall/ufw-frontends/files/org.gentoo.pkexec.ufw-gtk.policy b/net-firewall/ufw-frontends/files/org.gentoo.pkexec.ufw-gtk.policy new file mode 100644 index 000000000000..7410debbc818 --- /dev/null +++ b/net-firewall/ufw-frontends/files/org.gentoo.pkexec.ufw-gtk.policy @@ -0,0 +1,21 @@ + + + + + Gentoo + http://www.gentoo.org/ + + + Authentication is required to run the ufw configuration tool + + auth_admin + auth_admin + auth_admin + + /usr/sbin/ufw-gtk + true + + + diff --git a/net-firewall/ufw-frontends/files/ufw-frontends-0.3.2-no-log-crash.patch b/net-firewall/ufw-frontends/files/ufw-frontends-0.3.2-no-log-crash.patch new file mode 100644 index 000000000000..f4adb49826ec --- /dev/null +++ b/net-firewall/ufw-frontends/files/ufw-frontends-0.3.2-no-log-crash.patch @@ -0,0 +1,61 @@ +From e7bcf87788588c3a38ce18c9a8d69bbe156860e9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?S=C5=82awomir=20Nizio?= +Date: Mon, 3 Mar 2014 08:31:47 +0100 +Subject: [PATCH] Fix crash when no log in supported location can be found + +This can happen for example on systems that use Journal +from systemd. + +In this case, ufw-gtk exits with a traceback containing: +IOError: [Errno 2] No such file or directory: '/var/log/messages.log' +(this is the last log file tried). + +The patch works around the issue by handling the error +and disabling the widget in the "Events" tab. +--- + gfw/frontend_gtk.py | 18 +++++++++++++----- + 1 file changed, 13 insertions(+), 5 deletions(-) + +diff --git a/gfw/frontend_gtk.py b/gfw/frontend_gtk.py +index 75ebb33..75dfde0 100644 +--- a/gfw/frontend_gtk.py ++++ b/gfw/frontend_gtk.py +@@ -33,14 +33,21 @@ from gfw.frontend import Frontend + + class Notifier(gfw.event.Notifier): + +- def __init__(self, callback): +- gfw.event.Notifier.__init__(self, callback) ++ def __init__(self, callback, inactive_handler): ++ self._active = False ++ try: ++ gfw.event.Notifier.__init__(self, callback) ++ except IOError: ++ inactive_handler() ++ return ++ self._active = True + self._w = gobject.io_add_watch(self._fd, gobject.IO_IN | gobject.IO_PRI, + self._trigger) + + def __del__(self): +- gfw.event.Notifier.__del__(self) +- gobject.source_remove(self._w) ++ if self._active: ++ gfw.event.Notifier.__del__(self) ++ gobject.source_remove(self._w) + + + class Builder(gtk.Builder): +@@ -90,7 +97,8 @@ class GtkFrontend(Frontend): + data = (timestamp, event, conn['IN'], conn['OUT'], conn['PROTO'], + conn['SRC'], spt, conn['DST'], dpt) + self.ui.events_model.append(data) +- self._notifier = Notifier(callback) ++ self._notifier = Notifier(callback, ++ lambda: self.ui.events_view.set_sensitive(False)) + self.ui.main_window.show_all() + ## FIXME: for the 0.3.0 release, hide the tab for the connections view + page = self.ui.view.get_nth_page(2) +-- +1.9.0 + diff --git a/net-firewall/ufw-frontends/metadata.xml b/net-firewall/ufw-frontends/metadata.xml new file mode 100644 index 000000000000..a3ab739d57cd --- /dev/null +++ b/net-firewall/ufw-frontends/metadata.xml @@ -0,0 +1,22 @@ + + + + + slawomir.nizio@sabayon.org + SÅ‚awomir Nizio + + + proxy-maint@gentoo.org + Proxy Maintainers + + Currently, UFW provides only a command-line interface (CLI) for user + interaction--the ufw command. This project implements graphical frontends + for UFW using PyGTK and PyQt (the latter in early stage of development). + + baudm/ufw-frontends + + + Use pkexec to gain root privileges + Use kdesu to gain root privileges (note: the flag has lower priority than "policykit") + + diff --git a/net-firewall/ufw-frontends/ufw-frontends-0.3.2-r5.ebuild b/net-firewall/ufw-frontends/ufw-frontends-0.3.2-r5.ebuild new file mode 100644 index 000000000000..6110449589c7 --- /dev/null +++ b/net-firewall/ufw-frontends/ufw-frontends-0.3.2-r5.ebuild @@ -0,0 +1,64 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +PYTHON_COMPAT=( python2_7 ) +inherit distutils-r1 + +DESCRIPTION="Provides graphical frontend to ufw" +HOMEPAGE="https://github.com/baudm/ufw-frontends" +SRC_URI="https://github.com/baudm/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" + +# CC-BY-NC-SA-3.0 is for a png file +LICENSE="GPL-3 CC-BY-NC-SA-3.0" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="kde policykit" + +DEPEND="" +RDEPEND="${DEPEND} + dev-python/pygobject:2[${PYTHON_USEDEP}] + dev-python/pygtk[${PYTHON_USEDEP}] + dev-python/pyinotify[${PYTHON_USEDEP}] + net-firewall/ufw[${PYTHON_USEDEP}] + !policykit? ( kde? ( kde-plasma/kde-cli-tools[kdesu] ) ) + policykit? ( sys-auth/polkit ) +" + +# fix crash when no ufw logs in supported locations can be found +PATCHES=( "${FILESDIR}/${P}-no-log-crash.patch" ) + +python_prepare_all() { + if use policykit; then + sed -i 's/^Exec=su-to-root -X -c/Exec=pkexec/' \ + share/ufw-gtk.desktop || die + elif use kde; then + sed -i 's/^Exec=su-to-root -X -c/Exec=kdesu/' \ + share/ufw-gtk.desktop || die + fi + + # don't try to override run() to install the script + # under /usr/sbin; it does not work with distutils-r1 + # and so it is handled differently (in python_install) + sed -i '/cmdclass=/d' setup.py || die + + # Qt version is unusable + rm gfw/frontend_qt.py || die + distutils-r1_python_prepare_all +} + +python_install() { + distutils-r1_python_install --install-scripts="/usr/sbin" +} + +python_install_all() { + distutils-r1_python_install_all + + if use policykit; then + insinto /usr/share/polkit-1/actions/ + doins "${FILESDIR}"/org.gentoo.pkexec.ufw-gtk.policy + elif ! use kde; then + rm "${ED}usr/share/applications/ufw-gtk.desktop" || die + fi +} -- cgit v1.2.3