summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Whyman <thev00d00@gentoo.org>2012-06-13 21:14:52 +0000
committerIan Whyman <thev00d00@gentoo.org>2012-06-13 21:14:52 +0000
commit4d80cf6eba2406d8a81f1ddfc82ff5e6752f99eb (patch)
treef9329d9398c14f029a157a840a85933a48eeedb6 /net-firewall/ufw
parentVersion bump and tidy old version, thanks to Sławomir Nizio (diff)
downloadhistorical-4d80cf6eba2406d8a81f1ddfc82ff5e6752f99eb.tar.gz
historical-4d80cf6eba2406d8a81f1ddfc82ff5e6752f99eb.tar.bz2
historical-4d80cf6eba2406d8a81f1ddfc82ff5e6752f99eb.zip
Version bump, portability fix in init script, thanks Sławomir Nizio.
Package-Manager: portage-2.2.0_alpha110/cvs/Linux x86_64
Diffstat (limited to 'net-firewall/ufw')
-rw-r--r--net-firewall/ufw/ChangeLog9
-rw-r--r--net-firewall/ufw/Manifest28
-rw-r--r--net-firewall/ufw/files/ufw-0.31.1-move-path.patch177
-rw-r--r--net-firewall/ufw/files/ufw-0.31.1-python-abis.patch42
-rw-r--r--net-firewall/ufw/files/ufw-2.initd8
-rw-r--r--net-firewall/ufw/ufw-0.31.1.ebuild118
6 files changed, 355 insertions, 27 deletions
diff --git a/net-firewall/ufw/ChangeLog b/net-firewall/ufw/ChangeLog
index d9fd0120c96b..8c02887451df 100644
--- a/net-firewall/ufw/ChangeLog
+++ b/net-firewall/ufw/ChangeLog
@@ -1,6 +1,13 @@
# 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.5 2012/02/28 11:42:22 scarabeus Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-firewall/ufw/ChangeLog,v 1.6 2012/06/13 21:14:52 thev00d00 Exp $
+
+*ufw-0.31.1 (13 Jun 2012)
+
+ 13 Jun 2012; Ian Whyman <thev00d00@gentoo.org> +ufw-0.31.1.ebuild,
+ +files/ufw-0.31.1-move-path.patch, +files/ufw-0.31.1-python-abis.patch,
+ files/ufw-2.initd:
+ Version bump, portability fix in init script, thanks Sławomir Nizio.
*ufw-0.30.1-r4 (28 Feb 2012)
diff --git a/net-firewall/ufw/Manifest b/net-firewall/ufw/Manifest
index f8864b157b66..5e98cb1cbf0f 100644
--- a/net-firewall/ufw/Manifest
+++ b/net-firewall/ufw/Manifest
@@ -1,33 +1,17 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
AUX rsyslog/ufw.logrotate 178 RMD160 3797baf7ddf541e338b27ef3275bd28db03fa179 SHA1 aeedd795ed99ad20f03bc36056da07ca51838dd0 SHA256 02d1a00ca68446fbe056a4c3aede319f77b3262e26092cc04ea46de8923d03f8
AUX syslog-ng/syslog-ng.example 381 RMD160 e8b26557f5c7985d52b27f5a0bb3a2d459727063 SHA1 dfe3b055396156d3111e3283bd6e3f5f25b78566 SHA256 70a795c1b20e2cdef38565d74b9de042c6666f860a2fd1b3bdc6f31dd451bc68
AUX syslog-ng/ufw.logrotate 269 RMD160 589a17944e28df50ba2822b1025ed2124f689b04 SHA1 fb9eb8fc41029a08323da0ec0a708a946338c432 SHA256 cddd86613bde19b45f0f935c65bb43721f69aefc14e7d629612b23ea3b5c5c97
AUX ufw-0.30.1-encoding.patch 363 RMD160 db8a6a061df59f64c4521202bd7b364c87aa5bfa SHA1 9271a58fc6f17c00f70c2ddacea1c33acd2c2751 SHA256 9f679761dd53a12f630c1331dbcf471ecd11b6334b6cee6765297af7c0eca803
AUX ufw-0.30.1-python-abis.patch 921 RMD160 b3232aed2698d42054b4bd1cc852a325bfc5f489 SHA1 90d490e9c91e3cdc4a08b4f821bea9652655dd1f SHA256 bcb6d1846cac9677114fd18058c1acd92c912a92901dfc2f9f52cb11e3e23eaa
-AUX ufw-2.initd 2726 RMD160 91c510dabf76eb6f7e416dc5af27ce52ffbe09ec SHA1 81148f04f44a3194588e6a63a99676d46dc63f8e SHA256 3136432d91dfa6bcfde81590b628dbef59b8ff4b8b01118838be5e9e3c37e1d9
+AUX ufw-0.31.1-move-path.patch 7071 RMD160 ee22819f6cf766a0343fbbd53e4b181182db22b5 SHA1 0ae1508c94011a109d4f6bd58e72d6570754af46 SHA256 88a7b20696b731bac01b3c5d88b0353842b1228d3239cfebe1f2a47c1bdb6768
+AUX ufw-0.31.1-python-abis.patch 1872 RMD160 72434cc1f0f5f461b25585e492b5af20986c21b2 SHA1 cdf4e8018ad7181810c28e832f37b0ef54c266e9 SHA256 1e3094135d71e7e7129b2d268d79c73990f0a6f61f2bb6456d3f3654b4975463
+AUX ufw-2.initd 2722 RMD160 3f2fbe0dc1a94037ce66d22644689d38feeaafc9 SHA1 14020c2c710f546c5ba498931b76fa50de82dd8e SHA256 657b5305923b2a5de9eb96931aaaa28d6e997ace6c40793d905887798094258c
AUX ufw-dont-check-iptables.patch 1572 RMD160 76245c0aa6adc3edbadd311c2482aa9cad5e7824 SHA1 268d86725e202b2c1a8243907d143085f92aff53 SHA256 2ea0f9525baa82386690577525631f468e56a0fbde0e7e5a65fba36c922ea96f
AUX ufw-move-path.patch 7135 RMD160 c4dba2bbc70072d4ffe270ffb70176a4cabd696c SHA1 10a95973b4c6b9ea271691993157e1b9193d435d SHA256 f8036c343f52e12493d1019e83dfdda505fae68bbc4b46144ec73033a9d4a578
AUX ufw.confd 219 RMD160 cce23a5af2c48845fde0bed837e0a2faaeb3f5c4 SHA1 b88ef87f18dbe154545a427fbf155c22c23ace1a SHA256 069aa7382b40aecebf26ef53f3f4c49890314e0357925c84b3c15f1d0b913be0
DIST ufw-0.30.1.tar.gz 297322 RMD160 7e1fc1bb77495d9d24e058546edcb2ea3832f04b SHA1 a128685ea560f2de27d5d311b6dd07f590f1dafb SHA256 98da13fe3e9aa8ff29611f20ef6e8b15be42bcdc43c8ef3145755b220f3bae1a
+DIST ufw-0.31.1.tar.gz 322448 RMD160 d9295a35f39285be459110b638c5b62a1f79f5d5 SHA1 8f77a7c5615774f3607385dca27ced239f8dfb82 SHA256 ccf5e00aa76841b9467ad9506fbf96373fb24a4b26bffd858ea1eb2522491dcb
EBUILD ufw-0.30.1-r4.ebuild 2964 RMD160 4c52800234091406c3d79b4d0374228a88a65478 SHA1 d695b30deebf7fa918040854a2d5628a6ba3f71e SHA256 a0e6b960244c3da181e7db9c55d392807081f49e7ef1dc0e1b14afe5fb8cc120
-MISC ChangeLog 1514 RMD160 dc08c6714dede44ad4b449cfa939fd7506984e6a SHA1 dae82e0fdf1ac06acb52c58f3ae2ef14b8abca83 SHA256 ab6f716406a3258f6ef8de7935c067cc9cfdc2499ae5d6aa51f5d2001c5fc4f5
+EBUILD ufw-0.31.1.ebuild 3343 RMD160 3e0eb2c2f45fbf95c4f1771cb93e0f2daacc78fb SHA1 254c3f371f477ba8e3811861d9257bb6410f52a4 SHA256 8aeb3d5bfcbee58b209edfe6dd6db0e54d62d9fe1e0b192079db250b4a676c62
+MISC ChangeLog 1778 RMD160 9362c4d7de2ad047ee6d06dbd063b7ab731433dd SHA1 00ffceabc821986650a5dcfafe2b82ef6160e439 SHA256 f99a49bac19f7cd80c88992f53fbb44a6ee372fc55df12c97d25689d986da017
MISC metadata.xml 622 RMD160 cc250e699c5508a3e5ea12a0dd185c831bec7bd1 SHA1 7eea3cc02842a8b3b8dc053fbeaa4ab4ae5b592e SHA256 e504f88d893e02ac0bf5aa71b5b153da69205bcc72463a24b551918686afdcc4
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.17 (GNU/Linux)
-
-iQIcBAEBAgAGBQJPTL2sAAoJEOSiRoyO7jvoQnoP/iw1Uwj8S7l4IS3b0MXlt92p
-9gnLlJz1Xx+t+n/1JQZYB+eIi3BxuqkF7MeMpCS/f852ITYFuU6O0kOJOVA1OaIN
-QRxrX5WnKE1RLM/VSuPusFYjjZAZiYQF9eRmksL6EYVSi0L0MStLWTcS7bMV2W5b
-zVm6jFJpSjOP0sH1+K81457yMAt5p58Ss8nK6JIf/AhFVLlL2skgbrpgYuU2BCQo
-XAEnkszB+a4a5onOAtVr4ierZJlDA8q/ckRfixTySWU/qFoV+C8g9trS9X/jVkjq
-0xdN0r6Y+rzekUhNhl5y86sdoUFKq767yTkxor6Aboi/wvHK2rS+IsJJpyepB28e
-Oc7+fOYY2Fd1W9OiwF2hoiaPF7cPLXSkttnD0qtjlDvOZd0O9e5PA73RYMrivq2e
-X+b5wokiNe/49JgRtL8S+rH+Ky6d4QOgHjO2pU7JSNpr8aa3OUkptq28xFndxudx
-kbOb15MJ1BVoxycGSQnv3bfSsq7T/B2iNldYchUPGK67SBLU0LjhpFL4oJCW+Inq
-og9EZbsU9+1bo1e33fzV9kVzybwJ91fab8TPsjyXRTnMsMQzULJsBV9hX3KBQC6j
-1iVopTMtygHFmUO5mxWdHr6OzG1124dum8sj/VIk4JxoOQ1gle3TW/LS6ECvKxDO
-GfPn04ic1hP57ap1uOh/
-=uHFB
------END PGP SIGNATURE-----
diff --git a/net-firewall/ufw/files/ufw-0.31.1-move-path.patch b/net-firewall/ufw/files/ufw-0.31.1-move-path.patch
new file mode 100644
index 000000000000..24d00ea68ccd
--- /dev/null
+++ b/net-firewall/ufw/files/ufw-0.31.1-move-path.patch
@@ -0,0 +1,177 @@
+diff -Naur ufw-0.31.orig/doc/ufw-framework.8 ufw-0.31/doc/ufw-framework.8
+--- ufw-0.31.orig/doc/ufw-framework.8 2012-03-10 00:07:11.000000000 +0100
++++ ufw-0.31/doc/ufw-framework.8 2012-03-12 16:55:50.680992962 +0100
+@@ -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.31.orig/README ufw-0.31/README
+--- ufw-0.31.orig/README 2012-03-10 00:07:11.000000000 +0100
++++ ufw-0.31/README 2012-03-12 16:55:50.681993089 +0100
+@@ -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
+@@ -247,7 +247,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
+@@ -290,7 +290,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.31.orig/setup.py ufw-0.31/setup.py
+--- ufw-0.31.orig/setup.py 2012-03-10 00:07:11.000000000 +0100
++++ ufw-0.31/setup.py 2012-03-12 16:55:50.682993216 +0100
+@@ -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.31.orig/src/backend_iptables.py ufw-0.31/src/backend_iptables.py
+--- ufw-0.31.orig/src/backend_iptables.py 2012-03-10 00:07:11.000000000 +0100
++++ ufw-0.31/src/backend_iptables.py 2012-03-12 16:58:36.879115890 +0100
+@@ -22,7 +22,7 @@
+ import sys
+ import time
+
+-from ufw.common import UFWError, UFWRule, config_dir, state_dir
++from ufw.common import UFWError, UFWRule, config_dir, state_dir, share_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", dryrun, files)
+
+diff -Naur ufw-0.31.orig/src/ufw-init ufw-0.31/src/ufw-init
+--- ufw-0.31.orig/src/ufw-init 2012-03-10 00:07:11.000000000 +0100
++++ ufw-0.31/src/ufw-init 2012-03-12 16:55:50.687993851 +0100
+@@ -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/files/ufw-0.31.1-python-abis.patch b/net-firewall/ufw/files/ufw-0.31.1-python-abis.patch
new file mode 100644
index 000000000000..2c04284ad50c
--- /dev/null
+++ b/net-firewall/ufw/files/ufw-0.31.1-python-abis.patch
@@ -0,0 +1,42 @@
+This patch fixes issues during package build with ebuild supporting
+installation for Python versions: sed substitutions in common.py and location
+of ufw script in Python ABIs which have prefix different than /usr.
+Also makes .mo files not to be installed in wrong paths.
+
+More info about the first issue:
+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
+@@ -90,6 +90,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()
+@@ -99,7 +101,8 @@
+ if self.root != None:
+ prefix = self.root + real_prefix
+
+- script = os.path.join(prefix, 'sbin', 'ufw')
++ # PyPy (and Jython?) has different prefix. Without the change the binary would end up in a wrong path.
++ script = os.path.join(self.root, 'usr', 'sbin', 'ufw')
+ manpage = os.path.join(prefix, 'share', 'man', 'man8', 'ufw.8')
+ manpage_f = os.path.join(prefix, 'share', 'man', 'man8', \
+ 'ufw-framework.8')
+@@ -147,7 +150,6 @@
+ self.mkpath(i18ndir)
+ if len(os.listdir('locales/mo')) == 0:
+ subprocess.call(["make", "mo"])
+- self.copy_tree('locales/mo', i18ndir)
+
+ # Install configuration files
+ confdir = real_confdir
diff --git a/net-firewall/ufw/files/ufw-2.initd b/net-firewall/ufw/files/ufw-2.initd
index 79e9fc682289..1ffd1c596c92 100644
--- a/net-firewall/ufw/files/ufw-2.initd
+++ b/net-firewall/ufw/files/ufw-2.initd
@@ -1,7 +1,7 @@
#!/sbin/runscript
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-firewall/ufw/files/ufw-2.initd,v 1.1 2011/07/24 11:18:22 pva Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-firewall/ufw/files/ufw-2.initd,v 1.2 2012/06/13 21:14:52 thev00d00 Exp $
depend() {
before net
@@ -99,7 +99,7 @@ _source_file() {
fi
local _path=$PATH
- if ! source "$sourced_f"; then
+ if ! . "$sourced_f"; then
# PATH can be broken here, fix it...
PATH=$_path
eerror "Error sourcing file $sourced_f"
@@ -124,7 +124,7 @@ _check_if_enabled_in_cfg() {
return 2
fi
- if ! source "$sourced_f"; then
+ if ! . "$sourced_f"; then
eerror "Error sourcing file $sourced_f"
return 2
fi
diff --git a/net-firewall/ufw/ufw-0.31.1.ebuild b/net-firewall/ufw/ufw-0.31.1.ebuild
new file mode 100644
index 000000000000..7548a8a40ffe
--- /dev/null
+++ b/net-firewall/ufw/ufw-0.31.1.ebuild
@@ -0,0 +1,118 @@
+# 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.31.1.ebuild,v 1.1 2012/06/13 21:14:52 thev00d00 Exp $
+
+EAPI=4
+PYTHON_DEPEND="2:2.5"
+SUPPORT_PYTHON_ABIS="1"
+RESTRICT_PYTHON_ABIS="3.* *-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 ~IP6_NF_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
+}
+
+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}"/${P}-move-path.patch
+ # Contains fixes related to SUPPORT_PYTHON_ABIS="1" (see comment in the
+ # file).
+ epatch "${FILESDIR}"/${P}-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
+ 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."
+}