summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Whyman <thev00d00@gentoo.org>2012-09-24 12:18:04 +0000
committerIan Whyman <thev00d00@gentoo.org>2012-09-24 12:18:04 +0000
commitc60b16640f24049a5831b9be2a6db6d433c94fa0 (patch)
tree72a5109257df9398a87631a907215513af6a8efa /net-firewall
parentLink to upstream bug. (diff)
downloadgentoo-2-c60b16640f24049a5831b9be2a6db6d433c94fa0.tar.gz
gentoo-2-c60b16640f24049a5831b9be2a6db6d433c94fa0.tar.bz2
gentoo-2-c60b16640f24049a5831b9be2a6db6d433c94fa0.zip
Bump to 0.33 (with python 3 support), drop old
(Portage version: 2.2.0_alpha130/cvs/Linux x86_64)
Diffstat (limited to 'net-firewall')
-rw-r--r--net-firewall/ufw/ChangeLog10
-rw-r--r--net-firewall/ufw/files/ufw-0.30.1-encoding.patch15
-rw-r--r--net-firewall/ufw/files/ufw-0.30.1-python-abis.patch21
-rw-r--r--net-firewall/ufw/files/ufw-0.33-dont-check-iptables.patch46
-rw-r--r--net-firewall/ufw/files/ufw-move-path.patch177
-rw-r--r--net-firewall/ufw/ufw-0.30.1-r4.ebuild100
-rw-r--r--net-firewall/ufw/ufw-0.33.ebuild156
7 files changed, 211 insertions, 314 deletions
diff --git a/net-firewall/ufw/ChangeLog b/net-firewall/ufw/ChangeLog
index 37bdaa2559a1..9a3b83dc2299 100644
--- a/net-firewall/ufw/ChangeLog
+++ b/net-firewall/ufw/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for net-firewall/ufw
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-firewall/ufw/ChangeLog,v 1.8 2012/09/23 18:20:24 thev00d00 Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-firewall/ufw/ChangeLog,v 1.9 2012/09/24 12:18:04 thev00d00 Exp $
+
+*ufw-0.33 (24 Sep 2012)
+
+ 24 Sep 2012; Ian Whyman <thev00d00@gentoo.org> -ufw-0.30.1-r4.ebuild,
+ -files/ufw-0.30.1-encoding.patch, -files/ufw-0.30.1-python-abis.patch,
+ +ufw-0.33.ebuild, +files/ufw-0.33-dont-check-iptables.patch,
+ -files/ufw-move-path.patch:
+ Bump to 0.33 (with python 3 support), drop old, thanks to Sławomir Nizio
23 Sep 2012; Ian Whyman <thev00d00@gentoo.org> ufw-0.31.1.ebuild:
Fix for bug #428768 by Sławomir Nizio
diff --git a/net-firewall/ufw/files/ufw-0.30.1-encoding.patch b/net-firewall/ufw/files/ufw-0.30.1-encoding.patch
deleted file mode 100644
index a4626ef0cff0..000000000000
--- a/net-firewall/ufw/files/ufw-0.30.1-encoding.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-Fixes usage with ufw-frontends.
-upstream bug report: https://bugs.launchpad.net/ufw/+bug/921758
---- src/util.py
-+++ src/util.py
-@@ -205,8 +205,9 @@
-
- def open_file_read(f):
- '''Opens the specified file read-only'''
-+ import codecs
- try:
-- orig = open(f, 'r')
-+ orig = codecs.open(f, 'r', "UTF-8")
- except Exception:
- raise
-
diff --git a/net-firewall/ufw/files/ufw-0.30.1-python-abis.patch b/net-firewall/ufw/files/ufw-0.30.1-python-abis.patch
deleted file mode 100644
index b924012790e4..000000000000
--- a/net-firewall/ufw/files/ufw-0.30.1-python-abis.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-This patch fixes strings substitution in common.py during package
-build with ebuild supporting installation for multiple Python versions.
-
-With support for multiple Python versions in the ebuild, seems the
-file isn't copied from staging/ to build-*/lib/ufw/ after being
-modified. That's why the copy needs to be done "manually" here.
-The issue occurs with "setup.py build -b build-XXX" followed by
-"setup.py build -b build-XXX install".
-
-probably related: https://bugs.launchpad.net/ufw/+bug/819600
---- setup.py
-+++ setup.py
-@@ -89,6 +89,8 @@
- "-i",
- "s%#SHARE_DIR#%" + real_sharedir + "%g",
- os.path.join('staging', file)])
-+ self.copy_file(os.path.join('staging', file),
-+ os.path.join(self.build_base, "lib", "ufw"))
-
- # Now byte-compile everything
- super(Install, self).run()
diff --git a/net-firewall/ufw/files/ufw-0.33-dont-check-iptables.patch b/net-firewall/ufw/files/ufw-0.33-dont-check-iptables.patch
new file mode 100644
index 000000000000..b7eae3595cb5
--- /dev/null
+++ b/net-firewall/ufw/files/ufw-0.33-dont-check-iptables.patch
@@ -0,0 +1,46 @@
+diff -ur ufw-0.32/setup.py ufw-0.32.new/setup.py
+--- ufw-0.32/setup.py 2012-07-06 17:46:29.000000000 +0200
++++ ufw-0.32.new/setup.py 2012-07-30 15:28:31.874547818 +0200
+@@ -225,41 +225,7 @@
+ os.unlink(os.path.join('staging', 'ufw-init'))
+ os.unlink(os.path.join('staging', 'ufw-init-functions'))
+
+-iptables_exe = ''
+-iptables_dir = ''
+-
+-for e in ['iptables']:
+- for dir in ['/sbin', '/bin', '/usr/sbin', '/usr/bin', '/usr/local/sbin', \
+- '/usr/local/bin']:
+- if e == "iptables":
+- if os.path.exists(os.path.join(dir, e)):
+- iptables_dir = dir
+- iptables_exe = os.path.join(iptables_dir, "iptables")
+- print("Found '%s'" % iptables_exe)
+- else:
+- continue
+-
+- if iptables_exe != "":
+- break
+-
+-
+-if iptables_exe == '':
+- print("ERROR: could not find required binary 'iptables'", file=sys.stderr)
+- sys.exit(1)
+-
+-for e in ['ip6tables', 'iptables-restore', 'ip6tables-restore']:
+- if not os.path.exists(os.path.join(iptables_dir, e)):
+- print("ERROR: could not find required binary '%s'" % (e), file=sys.stderr)
+- sys.exit(1)
+-
+-(rc, out) = cmd([iptables_exe, '-V'])
+-if rc != 0:
+- raise OSError(errno.ENOENT, "Could not find version for '%s'" % \
+- (iptables_exe))
+-version = re.sub('^v', '', re.split('\s', str(out))[1])
+-print("Found '%s' version '%s'" % (iptables_exe, version))
+-if version < "1.4":
+- print("WARN: version '%s' has limited IPv6 support. See README for details." % (version), file=sys.stderr)
++iptables_dir = '/sbin'
+
+ setup (name='ufw',
+ version=ufw_version,
diff --git a/net-firewall/ufw/files/ufw-move-path.patch b/net-firewall/ufw/files/ufw-move-path.patch
deleted file mode 100644
index ff5f2b39529d..000000000000
--- a/net-firewall/ufw/files/ufw-move-path.patch
+++ /dev/null
@@ -1,177 +0,0 @@
-diff -Naur ufw-0.30.1.orig/doc/ufw-framework.8 ufw-0.30.1/doc/ufw-framework.8
---- ufw-0.30.1.orig/doc/ufw-framework.8 2011-06-10 19:30:18.499000275 +0200
-+++ ufw-0.30.1/doc/ufw-framework.8 2011-06-10 21:44:32.990000351 +0200
-@@ -18,7 +18,7 @@
- parameters and configuration of IPv6. The framework consists of the following
- files:
- .TP
--#STATE_PREFIX#/ufw\-init
-+#SHARE_DIR#/ufw\-init
- initialization script
- .TP
- #CONFIG_PREFIX#/ufw/before[6].rules
-@@ -41,7 +41,7 @@
-
- .SH "BOOT INITIALIZATION"
- .PP
--\fBufw\fR is started on boot with #STATE_PREFIX#/ufw\-init. This script is a
-+\fBufw\fR is started on boot with #SHARE_DIR#/ufw\-init. This script is a
- standard SysV style initscript used by the \fBufw\fR command and should not be
- modified. It supports the following arguments:
- .TP
-diff -Naur ufw-0.30.1.orig/README ufw-0.30.1/README
---- ufw-0.30.1.orig/README 2011-06-10 19:30:18.487000275 +0200
-+++ ufw-0.30.1/README 2011-06-10 21:44:32.844000351 +0200
-@@ -58,7 +58,7 @@
- on your needs, this can be as simple as adding the following to a startup
- script (eg rc.local for systems that use it):
-
--# /lib/ufw/ufw-init start
-+# /usr/share/ufw/ufw-init start
-
- For systems that use SysV initscripts, an example script is provided in
- doc/initscript.example. See doc/upstart.example for an Upstart example. Consult
-@@ -72,9 +72,9 @@
- /etc/defaults/ufw high level configuration
- /etc/ufw/before[6].rules rules evaluated before UI added rules
- /etc/ufw/after[6].rules rules evaluated after UI added rules
--/lib/ufw/user[6].rules UI added rules (not to be modified)
-+/etc/ufw/user/user[6].rules UI added rules (not to be modified)
- /etc/ufw/sysctl.conf kernel network tunables
--/lib/ufw/ufw-init start script
-+/usr/share/ufw/ufw-init start script
-
-
- Usage
-@@ -149,7 +149,7 @@
- that the primary chains don't move around other non-ufw rules and chains. To
- completely flush the built-in chains with this configuration, you can use:
-
--# /lib/ufw/ufw-init flush-all
-+# /usr/share/ufw/ufw-init flush-all
-
- Alternately, ufw may also take full control of the firewall by setting
- MANAGE_BUILTINS=yes in /etc/defaults/ufw. This will flush all the built-in
-@@ -245,7 +245,7 @@
-
- Remote Management
- -----------------
--On /lib/ufw/ufw-init start and 'ufw enable' the chains are flushed, so
-+On /usr/share/ufw/ufw-init start and 'ufw enable' the chains are flushed, so
- ssh may drop. This is needed so ufw is in a consistent state. Once the ufw is
- 'enabled' it will insert rules into the existing chains, and therefore not
- flush the chains (but will when modifying a rule or changing the default
-@@ -288,7 +288,7 @@
-
- Distributions
- -------------
--While it certainly ok to use /lib/ufw/ufw-init as the initscript for
-+While it certainly ok to use /usr/share/ufw/ufw-init as the initscript for
- ufw, this script is meant to be used by ufw itself, and therefore not
- particularly user friendly. See doc/initscript.example for a simple
- implementation that can be adapted to your distribution.
-diff -Naur ufw-0.30.1.orig/setup.py ufw-0.30.1/setup.py
---- ufw-0.30.1.orig/setup.py 2011-06-10 19:30:18.488000275 +0200
-+++ ufw-0.30.1/setup.py 2011-06-10 21:44:32.846000351 +0200
-@@ -54,7 +54,8 @@
- return
-
- real_confdir = os.path.join('/etc')
-- real_statedir = os.path.join('/lib', 'ufw')
-+ # real_statedir = os.path.join('/lib', 'ufw')
-+ real_statedir = os.path.join('/etc', 'ufw', 'user')
- real_prefix = self.prefix
- if self.home != None:
- real_confdir = self.home + real_confdir
-@@ -116,7 +117,7 @@
- self.copy_file('doc/ufw.8', manpage)
- self.copy_file('doc/ufw-framework.8', manpage_f)
-
-- # Install state files and helper scripts
-+ # Install state files
- statedir = real_statedir
- if self.root != None:
- statedir = self.root + real_statedir
-@@ -127,8 +128,14 @@
- self.copy_file('conf/user.rules', user_rules)
- self.copy_file('conf/user6.rules', user6_rules)
-
-- init_helper = os.path.join(statedir, 'ufw-init')
-- init_helper_functions = os.path.join(statedir, 'ufw-init-functions')
-+ # Install helper scripts
-+ sharedir = real_sharedir
-+ if self.root != None:
-+ sharedir = self.root + real_sharedir
-+ self.mkpath(sharedir)
-+
-+ init_helper = os.path.join(sharedir, 'ufw-init')
-+ init_helper_functions = os.path.join(sharedir, 'ufw-init-functions')
- self.copy_file('src/ufw-init', init_helper)
- self.copy_file('src/ufw-init-functions', init_helper_functions)
-
-@@ -199,13 +206,18 @@
-
- subprocess.call(["sed",
- "-i",
-+ "s%#SHARE_DIR#%" + real_sharedir + "%g",
-+ file])
-+
-+ subprocess.call(["sed",
-+ "-i",
- "s%#VERSION#%" + ufw_version + "%g",
- file])
-
- # Install pristine copies of rules files
-- sharedir = real_sharedir
-- if self.root != None:
-- sharedir = self.root + real_sharedir
-+ #sharedir = real_sharedir
-+ #if self.root != None:
-+ # sharedir = self.root + real_sharedir
- rulesdir = os.path.join(sharedir, 'iptables')
- self.mkpath(rulesdir)
- for file in [ before_rules, after_rules, \
-diff -Naur ufw-0.30.1.orig/src/backend_iptables.py ufw-0.30.1/src/backend_iptables.py
---- ufw-0.30.1.orig/src/backend_iptables.py 2011-06-10 19:30:18.502000275 +0200
-+++ ufw-0.30.1/src/backend_iptables.py 2011-06-10 21:44:33.044000351 +0200
-@@ -24,7 +24,7 @@
- import tempfile
- import time
-
--from ufw.common import UFWError, UFWRule, config_dir, state_dir, prefix_dir
-+from ufw.common import UFWError, UFWRule, config_dir, share_dir, state_dir, prefix_dir
- from ufw.util import warn, debug, msg, cmd, cmd_pipe
- import ufw.backend
-
-@@ -40,7 +40,7 @@
- files['rules6'] = os.path.join(state_dir, 'user6.rules')
- files['before6_rules'] = os.path.join(config_dir, 'ufw/before6.rules')
- files['after6_rules'] = os.path.join(config_dir, 'ufw/after6.rules')
-- files['init'] = os.path.join(state_dir, 'ufw-init')
-+ files['init'] = os.path.join(share_dir, 'ufw-init')
-
- ufw.backend.UFWBackend.__init__(self, "iptables", d, files)
-
-diff -Naur ufw-0.30.1.orig/src/ufw-init ufw-0.30.1/src/ufw-init
---- ufw-0.30.1.orig/src/ufw-init 2011-06-10 19:30:18.502000275 +0200
-+++ ufw-0.30.1/src/ufw-init 2011-06-10 21:44:33.054000351 +0200
-@@ -18,8 +18,8 @@
- #
- set -e
-
--if [ -s "#STATE_PREFIX#/ufw-init-functions" ]; then
-- . "#STATE_PREFIX#/ufw-init-functions"
-+if [ -s "#SHARE_DIR#/ufw-init-functions" ]; then
-+ . "#SHARE_DIR#/ufw-init-functions"
- else
- echo "Could not find $s (aborting)"
- exit 1
-@@ -56,7 +56,7 @@
- flush_builtins || exit "$?"
- ;;
- *)
-- echo "Usage: #STATE_PREFIX#/ufw-init {start|stop|restart|force-reload|force-stop|flush-all|status}"
-+ echo "Usage: #SHARE_DIR#/ufw-init {start|stop|restart|force-reload|force-stop|flush-all|status}"
- exit 1
- ;;
- esac
diff --git a/net-firewall/ufw/ufw-0.30.1-r4.ebuild b/net-firewall/ufw/ufw-0.30.1-r4.ebuild
deleted file mode 100644
index b02258903cb6..000000000000
--- a/net-firewall/ufw/ufw-0.30.1-r4.ebuild
+++ /dev/null
@@ -1,100 +0,0 @@
-# Copyright 1999-2012 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-firewall/ufw/ufw-0.30.1-r4.ebuild,v 1.2 2012/06/18 19:39:03 thev00d00 Exp $
-
-EAPI=4
-PYTHON_DEPEND="2:2.5"
-SUPPORT_PYTHON_ABIS="1"
-RESTRICT_PYTHON_ABIS="3.*"
-
-inherit versionator bash-completion-r1 eutils linux-info distutils
-
-MY_PV_12=$(get_version_component_range 1-2)
-DESCRIPTION="A program used to manage a netfilter firewall"
-HOMEPAGE="http://launchpad.net/ufw"
-SRC_URI="http://launchpad.net/ufw/${MY_PV_12}/${PV}/+download/${P}.tar.gz"
-
-LICENSE="GPL-3"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE="examples"
-
-DEPEND="sys-devel/gettext"
-RDEPEND=">=net-firewall/iptables-1.4"
-
-# tests fail; upstream bug: https://bugs.launchpad.net/ufw/+bug/815982
-RESTRICT="test"
-
-pkg_pretend() {
- local CONFIG_CHECK="~PROC_FS
- ~NETFILTER_XT_MATCH_COMMENT ~NETFILTER_XT_MATCH_HL
- ~NETFILTER_XT_MATCH_LIMIT ~NETFILTER_XT_MATCH_MULTIPORT
- ~NETFILTER_XT_MATCH_RECENT ~NETFILTER_XT_MATCH_STATE"
-
- if kernel_is -ge 2 6 39; then
- CONFIG_CHECK+=" ~NETFILTER_XT_MATCH_ADDRTYPE"
- else
- CONFIG_CHECK+=" ~IP_NF_MATCH_ADDRTYPE"
- fi
-
- check_extra_config
-}
-
-pkg_setup() {
- python_pkg_setup
-}
-
-src_prepare() {
- # Allow to remove unnecessary build time dependency
- # on net-firewall/iptables.
- epatch "${FILESDIR}"/${PN}-dont-check-iptables.patch
- # Move files away from /lib/ufw.
- epatch "${FILESDIR}"/${PN}-move-path.patch
- # Allows correct build with SUPPORT_PYTHON_ABIS="1" (see comment in the file).
- epatch "${FILESDIR}"/${P}-python-abis.patch
- # Fixes usage with ufw-frontends (bug ref. inside the patch).
- epatch "${FILESDIR}"/${P}-encoding.patch
- # Set as enabled by default. User can enable or disable
- # the service by adding or removing it to/from a runlevel.
- sed -i 's/^ENABLED=no/ENABLED=yes/' conf/ufw.conf \
- || die "sed failed (ufw.conf)"
-}
-
-src_install() {
- newconfd "${FILESDIR}"/ufw.confd ufw
- newinitd "${FILESDIR}"/ufw-2.initd ufw
-
- # users normally would want it
- insinto /usr/share/doc/${PF}/logging
- doins -r "${FILESDIR}"/syslog-ng
-
- insinto /usr/share/doc/${PF}/logging/rsyslog
- doins "${FILESDIR}"/rsyslog/*
- doins doc/rsyslog.example
-
- if use examples; then
- insinto /usr/share/doc/${PF}/examples
- doins examples/*
- fi
- distutils_src_install
- domo locales/mo/*.mo
- rm -r "${ED}"usr/share/${PN}/messages || die
- newbashcomp shell-completion/bash ${PN}
-}
-
-pkg_postinst() {
- distutils_pkg_postinst
- if path_exists -o "${EROOT}"lib/ufw/user{,6}.rules; then
- ewarn "Attention!"
- ewarn "User configuration from /lib/ufw is now placed in /etc/ufw/user."
- ewarn "Please stop ufw, copy .rules files from ${EROOT}lib/ufw"
- ewarn "to ${EROOT}etc/ufw/user/ and start ufw again."
- fi
- echo
- elog "Remember to enable ufw add it to your boot sequence:"
- elog "-- # ufw enable"
- elog "-- # rc-update add ufw boot"
- echo
- elog "If you want to keep ufw logs in a separate file, take a look at"
- elog "/usr/share/doc/${PF}/logging."
-}
diff --git a/net-firewall/ufw/ufw-0.33.ebuild b/net-firewall/ufw/ufw-0.33.ebuild
new file mode 100644
index 000000000000..0fbfc26a3765
--- /dev/null
+++ b/net-firewall/ufw/ufw-0.33.ebuild
@@ -0,0 +1,156 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-firewall/ufw/ufw-0.33.ebuild,v 1.1 2012/09/24 12:18:04 thev00d00 Exp $
+
+EAPI=4
+PYTHON_DEPEND="2:2.6 3:3.1"
+SUPPORT_PYTHON_ABIS="1"
+RESTRICT_PYTHON_ABIS="2.5 *-jython"
+
+inherit versionator bash-completion-r1 eutils linux-info distutils
+
+MY_PV_12=$(get_version_component_range 1-2)
+DESCRIPTION="A program used to manage a netfilter firewall"
+HOMEPAGE="http://launchpad.net/ufw"
+SRC_URI="http://launchpad.net/ufw/${MY_PV_12}/${PV}/+download/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="examples ipv6"
+
+DEPEND="sys-devel/gettext"
+RDEPEND=">=net-firewall/iptables-1.4[ipv6?]
+ !<kde-misc/kcm-ufw-0.4.2
+ !<net-firewall/ufw-frontends-0.3.2
+"
+
+# tests fail; upstream bug: https://bugs.launchpad.net/ufw/+bug/815982
+RESTRICT="test"
+
+pkg_pretend() {
+ local CONFIG_CHECK="~PROC_FS
+ ~NETFILTER_XT_MATCH_COMMENT ~NETFILTER_XT_MATCH_HL
+ ~NETFILTER_XT_MATCH_LIMIT ~NETFILTER_XT_MATCH_MULTIPORT
+ ~NETFILTER_XT_MATCH_RECENT ~NETFILTER_XT_MATCH_STATE"
+
+ if kernel_is -ge 2 6 39; then
+ CONFIG_CHECK+=" ~NETFILTER_XT_MATCH_ADDRTYPE"
+ else
+ CONFIG_CHECK+=" ~IP_NF_MATCH_ADDRTYPE"
+ fi
+
+ check_extra_config
+
+ # Check for default, useful optional features.
+ if ! linux_config_exists; then
+ ewarn "Cannot determine configuration of your kernel."
+ return
+ fi
+
+ local nf_nat_ftp_ok="yes"
+ local nf_conntrack_ftp_ok="yes"
+ local nf_conntrack_netbios_ns_ok="yes"
+
+ linux_chkconfig_present \
+ NF_NAT_FTP || nf_nat_ftp_ok="no"
+ linux_chkconfig_present \
+ NF_CONNTRACK_FTP || nf_conntrack_ftp_ok="no"
+ linux_chkconfig_present \
+ NF_CONNTRACK_NETBIOS_NS || nf_conntrack_netbios_ns_ok="no"
+
+ # This is better than an essay for each unset option...
+ if [[ ${nf_nat_ftp_ok} = no ]] || [[ ${nf_conntrack_ftp_ok} = no ]] \
+ || [[ ${nf_conntrack_netbios_ns_ok} = no ]]
+ then
+ echo
+ local mod_msg="Kernel options listed below are not set. They are not"
+ mod_msg+=" mandatory, but they are often useful."
+ mod_msg+=" If you don't need some of them, please remove relevant"
+ mod_msg+=" module name(s) from IPT_MODULES in"
+ mod_msg+=" '${EROOT}etc/default/ufw' before (re)starting ufw."
+ mod_msg+=" Otherwise ufw may fail to start!"
+ ewarn "${mod_msg}"
+ if [[ ${nf_nat_ftp_ok} = no ]]; then
+ ewarn "NF_NAT_FTP: for better support for active mode FTP."
+ fi
+ if [[ ${nf_conntrack_ftp_ok} = no ]]; then
+ ewarn "NF_CONNTRACK_FTP: for better support for active mode FTP."
+ fi
+ if [[ ${nf_conntrack_netbios_ns_ok} = no ]]; then
+ ewarn "NF_CONNTRACK_NETBIOS_NS: for better Samba support."
+ fi
+ fi
+}
+
+src_prepare() {
+ # Allow to remove unnecessary build time dependency
+ # on net-firewall/iptables.
+ epatch "${FILESDIR}"/${P}-dont-check-iptables.patch
+ # Move files away from /lib/ufw.
+ epatch "${FILESDIR}"/${PN}-0.31.1-move-path.patch
+ # Contains fixes related to SUPPORT_PYTHON_ABIS="1" (see comment in the
+ # file).
+ epatch "${FILESDIR}"/${PN}-0.31.1-python-abis.patch
+
+ # Set as enabled by default. User can enable or disable
+ # the service by adding or removing it to/from a runlevel.
+ sed -i 's/^ENABLED=no/ENABLED=yes/' conf/ufw.conf \
+ || die "sed failed (ufw.conf)"
+
+ sed -i "s/^IPV6=yes/IPV6=$(usex ipv6)/" conf/ufw.defaults || die
+
+ # If LINGUAS is set install selected translations only.
+ if [[ -n ${LINGUAS+set} ]]; then
+ _EMPTY_LOCALE_LIST="yes"
+ pushd locales/po > /dev/null || die
+
+ local lang
+ for lang in *.po; do
+ if ! has "${lang%.po}" ${LINGUAS}; then
+ rm "${lang}" || die
+ else
+ _EMPTY_LOCALE_LIST="no"
+ fi
+ done
+
+ popd > /dev/null || die
+ else
+ _EMPTY_LOCALE_LIST="no"
+ fi
+}
+
+src_install() {
+ newconfd "${FILESDIR}"/ufw.confd ufw
+ newinitd "${FILESDIR}"/ufw-2.initd ufw
+
+ # users normally would want it
+ insinto /usr/share/doc/${PF}/logging/syslog-ng
+ doins "${FILESDIR}"/syslog-ng/*
+
+ insinto /usr/share/doc/${PF}/logging/rsyslog
+ doins "${FILESDIR}"/rsyslog/*
+ doins doc/rsyslog.example
+
+ if use examples; then
+ insinto /usr/share/doc/${PF}/examples
+ doins examples/*
+ fi
+ distutils_src_install
+ [[ $_EMPTY_LOCALE_LIST != yes ]] && domo locales/mo/*.mo
+ newbashcomp shell-completion/bash ${PN}
+}
+
+pkg_postinst() {
+ distutils_pkg_postinst
+ echo
+ elog "Remember to enable ufw add it to your boot sequence:"
+ elog "-- # ufw enable"
+ elog "-- # rc-update add ufw boot"
+ echo
+ elog "If you want to keep ufw logs in a separate file, take a look at"
+ elog "/usr/share/doc/${PF}/logging."
+ echo
+ ewarn "Note: once enabled, ufw blocks also incoming SSH connections by"
+ ewarn "default. See README, Remote Management section for more information."
+}