diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 13:49:04 -0700 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 17:38:18 -0700 |
commit | 56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch) | |
tree | 3f91093cdb475e565ae857f1c5a7fd339e2d781e /net-firewall/ufw-frontends | |
download | gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2 gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip |
proj/gentoo: Initial commit
This commit represents a new era for Gentoo:
Storing the gentoo-x86 tree in Git, as converted from CVS.
This commit is the start of the NEW history.
Any historical data is intended to be grafted onto this point.
Creation process:
1. Take final CVS checkout snapshot
2. Remove ALL ChangeLog* files
3. Transform all Manifests to thin
4. Remove empty Manifests
5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$
5.1. Do not touch files with -kb/-ko keyword flags.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests
X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project
X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration
X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn
X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts
X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration
X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging
X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'net-firewall/ufw-frontends')
5 files changed, 166 insertions, 0 deletions
diff --git a/net-firewall/ufw-frontends/Manifest b/net-firewall/ufw-frontends/Manifest new file mode 100644 index 000000000000..9957816b8343 --- /dev/null +++ b/net-firewall/ufw-frontends/Manifest @@ -0,0 +1 @@ +DIST ufw-frontends-0.3.2.tar.gz 85472 SHA256 7ff838d1f20a122307ef5e2bc94f6cbb5ea019a1d3d7ec72f7493c5f8c0a7910 SHA512 9f311596a3bad71562ca98acb8bf4d0d55990520cb5373c299dad05d1a1986e791eac984385013a511af4693a9988351ec37d8735ae6748818a9570db416b274 WHIRLPOOL 8b12a19c3338210d388b3d5ed24e22cbb49357d9fa9c768ad7b9ff8bcb6481cf4888048ec4c60266915a69095a90e2ce776a81f92f0f9692d8c2ef3fc4b669ed 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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE policyconfig PUBLIC + "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN" + "http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd"> +<policyconfig> + + <vendor>Gentoo</vendor> + <vendor_url>http://www.gentoo.org/</vendor_url> + + <action id="org.gentoo.pkexec.ufw-gtk"> + <message>Authentication is required to run the ufw configuration tool</message> + <defaults> + <allow_any>auth_admin</allow_any> + <allow_inactive>auth_admin</allow_inactive> + <allow_active>auth_admin</allow_active> + </defaults> + <annotate key="org.freedesktop.policykit.exec.path">/usr/sbin/ufw-gtk</annotate> + <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate> + </action> + +</policyconfig> 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?= <slawomir.nizio@sabayon.org> +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..9558d7412c05 --- /dev/null +++ b/net-firewall/ufw-frontends/metadata.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>proxy-maintainers</herd> + <maintainer> + <email>slawomir.nizio@sabayon.org</email> + <name>Sławomir Nizio</name> + </maintainer> + <longdescription lang="en">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).</longdescription> + <upstream> + <remote-id type="google-code">ufw-frontends</remote-id> + </upstream> + <use><flag name="policykit">Use pkexec to gain root privileges</flag></use> + <use><flag name="kde">Use kdesu to gain root privileges (note: the flag has lower priority than "policykit")</flag></use> +</pkgmetadata> diff --git a/net-firewall/ufw-frontends/ufw-frontends-0.3.2-r3.ebuild b/net-firewall/ufw-frontends/ufw-frontends-0.3.2-r3.ebuild new file mode 100644 index 000000000000..f4cb9480cc1d --- /dev/null +++ b/net-firewall/ufw-frontends/ufw-frontends-0.3.2-r3.ebuild @@ -0,0 +1,66 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 +PYTHON_COMPAT=( python2_7 ) +inherit distutils-r1 + +DESCRIPTION="Provides graphical frontend to ufw" +HOMEPAGE="http://code.google.com/p/ufw-frontends/" +SRC_URI="http://ufw-frontends.googlecode.com/files/${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-apps/kdesu ) ) + policykit? ( sys-auth/polkit ) +" + +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 + + # fix crash when no ufw logs in supported locations can + # be found + epatch "${FILESDIR}/${P}-no-log-crash.patch" +} + +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 "${D}usr/share/applications/ufw-gtk.desktop" || die + fi +} |