summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Goldstein <cardoe@gentoo.org>2012-11-07 08:14:00 +0000
committerDoug Goldstein <cardoe@gentoo.org>2012-11-07 08:14:00 +0000
commit4535332d84075955242d1fa38c20072ae8475697 (patch)
treef948aeabb79f8f2e1eace688768b394e64570889 /net-firewall/firewalld
parentVersion bump and move to EAPI 4. (diff)
downloadgentoo-2-4535332d84075955242d1fa38c20072ae8475697.tar.gz
gentoo-2-4535332d84075955242d1fa38c20072ae8475697.tar.bz2
gentoo-2-4535332d84075955242d1fa38c20072ae8475697.zip
Simplify init script and depend on D-Bus being started. Add the network module that newer OpenRC's will ship with for older OpenRC support.
(Portage version: 2.1.11.31/cvs/Linux x86_64, unsigned Manifest commit)
Diffstat (limited to 'net-firewall/firewalld')
-rw-r--r--net-firewall/firewalld/ChangeLog7
-rw-r--r--net-firewall/firewalld/files/firewalld.init20
-rw-r--r--net-firewall/firewalld/files/firewalld.module38
-rw-r--r--net-firewall/firewalld/firewalld-0.2.9.ebuild11
4 files changed, 59 insertions, 17 deletions
diff --git a/net-firewall/firewalld/ChangeLog b/net-firewall/firewalld/ChangeLog
index a9c85733ae8e..312248ba6530 100644
--- a/net-firewall/firewalld/ChangeLog
+++ b/net-firewall/firewalld/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for net-firewall/firewalld
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-firewall/firewalld/ChangeLog,v 1.3 2012/11/06 07:30:01 cardoe Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-firewall/firewalld/ChangeLog,v 1.4 2012/11/07 08:13:59 cardoe Exp $
+
+ 07 Nov 2012; Doug Goldstein <cardoe@gentoo.org> firewalld-0.2.9.ebuild,
+ +files/firewalld.module, files/firewalld.init:
+ Simplify init script and depend on D-Bus being started. Add the network
+ module that newer OpenRC's will ship with for older OpenRC support.
06 Nov 2012; Doug Goldstein <cardoe@gentoo.org> firewalld-0.2.9.ebuild:
Fix GSettings schema not being installed.
diff --git a/net-firewall/firewalld/files/firewalld.init b/net-firewall/firewalld/files/firewalld.init
index 871384d4d87d..06613f3aabd3 100644
--- a/net-firewall/firewalld/files/firewalld.init
+++ b/net-firewall/firewalld/files/firewalld.init
@@ -1,21 +1,13 @@
#!/sbin/runscript
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-firewall/firewalld/files/firewalld.init,v 1.1 2012/11/02 22:15:21 cardoe Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-firewall/firewalld/files/firewalld.init,v 1.2 2012/11/07 08:14:00 cardoe Exp $
+
+description="FirewallD"
+command=/usr/sbin/firewalld
+pidfile=/var/run/firewalld.pid
depend() {
+ need dbus
provide iptables ip6tables ebtables
}
-
-start() {
- ebegin "Starting FirewallD"
- start-stop-daemon --start --quiet --exec /usr/sbin/firewalld \
- --pidfile /var/run/firewalld.pid
- eend $?
-}
-
-stop() {
- ebegin "Stopping FirewallD"
- start-stop-daemon --stop --quiet --pidfile /var/run/firewalld.pid
- eend $?
-}
diff --git a/net-firewall/firewalld/files/firewalld.module b/net-firewall/firewalld/files/firewalld.module
new file mode 100644
index 000000000000..8760a30c6361
--- /dev/null
+++ b/net-firewall/firewalld/files/firewalld.module
@@ -0,0 +1,38 @@
+# Copyright (c) 2012 Doug Goldstein <cardoe@cardoe.com>
+# Released under the 2-clause BSD license.
+
+firewalld_depend()
+{
+ after interface
+ before dhcp
+ program start firewall-cmd
+ [ "$IFACE" != "lo" ] && need firewalld
+}
+
+_config_vars="$_config_vars firewalld_zone"
+
+firewalld_post_start()
+{
+ local firewalld_zone=
+ eval firewalld_zone=\$firewalld_zone_${IFVAR}
+
+ _exists || return 0
+
+ if [ "${IFACE}" != "lo" ]; then
+ firewall-cmd --zone="${firewalld_zone}" \
+ --change-interface="${IFACE}" > /dev/null 2>&1
+ fi
+
+ return 0
+}
+
+firewalld_pre_stop()
+{
+ _exists || return 0
+
+ if [ "${IFACE}" != "lo" ]; then
+ firewall-cmd --remove-interface="${IFACE}" > /dev/null 2>&1
+ fi
+
+ return 0
+} \ No newline at end of file
diff --git a/net-firewall/firewalld/firewalld-0.2.9.ebuild b/net-firewall/firewalld/firewalld-0.2.9.ebuild
index 9422a5b7b109..14084b7add5b 100644
--- a/net-firewall/firewalld/firewalld-0.2.9.ebuild
+++ b/net-firewall/firewalld/firewalld-0.2.9.ebuild
@@ -1,12 +1,12 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-firewall/firewalld/firewalld-0.2.9.ebuild,v 1.3 2012/11/06 07:30:01 cardoe Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-firewall/firewalld/firewalld-0.2.9.ebuild,v 1.4 2012/11/07 08:13:59 cardoe Exp $
EAPI=4
PYTHON_COMPAT=( python{2_6,2_7} )
BACKPORTS=3ab6b297
-inherit autotools eutils gnome2-utils python-r1 systemd
+inherit autotools eutils gnome2-utils python-r1 systemd multilib
DESCRIPTION="A firewall daemon with D-BUS interface providing a dynamic firewall"
HOMEPAGE="http://fedorahosted.org/firewalld"
@@ -25,6 +25,7 @@ RDEPEND="${PYTHON_DEPS}
dev-python/pygobject:3
net-firewall/ebtables
net-firewall/iptables[ipv6]
+ || ( sys-apps/openrc sys-apps/systemd )
gui? (
dev-python/pygtk:2
>=x11-libs/gtk+-2.6:2
@@ -71,6 +72,12 @@ src_install() {
fi
newinitd "${FILESDIR}"/firewalld.init firewalld
+
+ # Work around until OpenRC starts carrying our module
+ if has_version '<=sys-apps/openrc-0.11.4'; then
+ insinto $(get_libdir)/rc/net
+ newins "${FILESDIR}"/firewalld.module firewalld.sh
+ fi
}
pkg_preinst() {