1 |
commit: 5b92f67047e6ae788b7e68acd72ca421d4e42d01 |
2 |
Author: Hasan ÇALIŞIR <hasan.calisir <AT> psauxit <DOT> com> |
3 |
AuthorDate: Tue Jun 28 08:25:53 2022 +0000 |
4 |
Commit: Florian Schmaus <flow <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jul 1 08:28:35 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5b92f670 |
7 |
|
8 |
net-firewall/ufw: bump to 0.36.1 |
9 |
|
10 |
* version bump to 0.36.1. |
11 |
* bump to EAPI 8. |
12 |
* python_combat drop 3.7, add 3.11, current range 8,11. |
13 |
* dropped NonexistentBlockers from RDEPEND. |
14 |
!<kde-misc/kcm-ufw-0.4.2 |
15 |
!<net-firewall/ufw-frontends-0.3.2" |
16 |
* Removed RESTRICT="test" --> |
17 |
upstream bug: https://bugs.launchpad.net/ufw/+bug/815982 fixed and commited. |
18 |
* Change mod 0644 for all rules in /etc/ufw. |
19 |
* Drop comparison operator >= for iptables 1.4. |
20 |
Current repo already meets the requirement. |
21 |
* Patches synced with current version that we still need them. |
22 |
|
23 |
[ flow: add Closes bug# 834130 git trailer ] |
24 |
|
25 |
Package-Manager: Portage-3.0.30, Repoman-3.0.3 |
26 |
Signed-off-by: Hasan ÇALIŞIR <hasan.calisir <AT> psauxit.com> |
27 |
Closes: https://bugs.gentoo.org/834130 |
28 |
Closes: https://github.com/gentoo/gentoo/pull/26110 |
29 |
Signed-off-by: Florian Schmaus <flow <AT> gentoo.org> |
30 |
|
31 |
net-firewall/ufw/Manifest | 1 + |
32 |
.../ufw/files/ufw-0.36.1-bash-completion.patch | 16 ++ |
33 |
.../ufw/files/ufw-0.36.1-dont-check-iptables.patch | 50 +++++ |
34 |
net-firewall/ufw/files/ufw-0.36.1-move-path.patch | 124 ++++++++++++ |
35 |
net-firewall/ufw/files/ufw-0.36.1-shebang.patch | 15 ++ |
36 |
net-firewall/ufw/ufw-0.36.1.ebuild | 217 +++++++++++++++++++++ |
37 |
6 files changed, 423 insertions(+) |
38 |
|
39 |
diff --git a/net-firewall/ufw/Manifest b/net-firewall/ufw/Manifest |
40 |
index ab0de6087c34..91de7839ba25 100644 |
41 |
--- a/net-firewall/ufw/Manifest |
42 |
+++ b/net-firewall/ufw/Manifest |
43 |
@@ -1 +1,2 @@ |
44 |
+DIST ufw-0.36.1.tar.gz 583123 BLAKE2B 16e1ee67493d5db10a04667b646a019aa3aeb06345d0facc334fb07eeff4d4f6674a4699b2bd7bd6ed29de1c05c4e14812e9e8ec55c4bfb8579b8e3e2e577f6a SHA512 77d01fef661083eac041be6d6eabffb1d8aedb215f73e44e18a9a63a48da96414b3c0166e3ffd9402c22c72a6de5d774ba14b15368b02997aae8e08d1c5dd4c0 |
45 |
DIST ufw-0.36.tar.gz 580338 BLAKE2B a7e07ac11539061a69bb83d45c0affc54793503b31c9e9f9f8b34fa890a3fe97682f9133102e74e5f6e1eb372a929cfc8619baa2cc9efc1dc289d9f4a1766efd SHA512 b32d7f79f43c203149c48b090ee0d063df78fcf654344ee11066a7363e799a62b046758ffe02b8bd15121545ac2a6b61df21fe56f8b810319fe4dd562cbdadb3 |
46 |
|
47 |
diff --git a/net-firewall/ufw/files/ufw-0.36.1-bash-completion.patch b/net-firewall/ufw/files/ufw-0.36.1-bash-completion.patch |
48 |
new file mode 100644 |
49 |
index 000000000000..927af244eef1 |
50 |
--- /dev/null |
51 |
+++ b/net-firewall/ufw/files/ufw-0.36.1-bash-completion.patch |
52 |
@@ -0,0 +1,16 @@ |
53 |
+--- a/shell-completion/bash 2018-12-14 21:25:55.000000000 +0300 |
54 |
++++ b/shell-completion/bash 2019-03-21 01:26:46.152181981 +0300 |
55 |
+@@ -57,7 +57,6 @@ |
56 |
+ echo "numbered verbose" |
57 |
+ } |
58 |
+ |
59 |
+-_have ufw && |
60 |
+ _ufw() |
61 |
+ { |
62 |
+ cur=${COMP_WORDS[COMP_CWORD]} |
63 |
+@@ -91,4 +90,4 @@ |
64 |
+ fi |
65 |
+ } |
66 |
+ |
67 |
+-_have ufw && complete -F _ufw ufw |
68 |
++complete -F _ufw ufw |
69 |
|
70 |
diff --git a/net-firewall/ufw/files/ufw-0.36.1-dont-check-iptables.patch b/net-firewall/ufw/files/ufw-0.36.1-dont-check-iptables.patch |
71 |
new file mode 100644 |
72 |
index 000000000000..ae0c95525a46 |
73 |
--- /dev/null |
74 |
+++ b/net-firewall/ufw/files/ufw-0.36.1-dont-check-iptables.patch |
75 |
@@ -0,0 +1,50 @@ |
76 |
+--- a/setup.py 2022-06-27 17:33:18.043794598 +0300 |
77 |
++++ b/setup.py 2022-06-27 18:15:18.384463926 +0300 |
78 |
+@@ -256,46 +256,7 @@ |
79 |
+ os.unlink(os.path.join('staging', 'ufw-init')) |
80 |
+ os.unlink(os.path.join('staging', 'ufw-init-functions')) |
81 |
+ |
82 |
+-iptables_exe = '' |
83 |
+-iptables_dir = '' |
84 |
+- |
85 |
+-for e in ['iptables']: |
86 |
+- # Historically iptables was in /sbin, then later also symlinked from |
87 |
+- # /usr/sbin/iptables to /sbin/iptables. Debian bullseye moves iptables |
88 |
+- # to /usr/sbin with no symlink in /sbin except on upgrades. To accomodate |
89 |
+- # buildds that may still have the old iptables, search /usr/sbin first |
90 |
+- for dir in ['/usr/sbin', '/sbin', '/usr/bin', '/bin', '/usr/local/sbin', \ |
91 |
+- '/usr/local/bin']: |
92 |
+- if e == "iptables": |
93 |
+- if os.path.exists(os.path.join(dir, e)): |
94 |
+- iptables_dir = dir |
95 |
+- iptables_exe = os.path.join(iptables_dir, "iptables") |
96 |
+- print("Found '%s'" % iptables_exe) |
97 |
+- else: |
98 |
+- continue |
99 |
+- |
100 |
+- if iptables_exe != "": |
101 |
+- break |
102 |
+- |
103 |
+- |
104 |
+-if iptables_exe == '': |
105 |
+- print("ERROR: could not find required binary 'iptables'", file=sys.stderr) |
106 |
+- sys.exit(1) |
107 |
+- |
108 |
+-for e in ['ip6tables', 'iptables-restore', 'ip6tables-restore']: |
109 |
+- if not os.path.exists(os.path.join(iptables_dir, e)): |
110 |
+- print("ERROR: could not find required binary '%s'" % (e), file=sys.stderr) |
111 |
+- sys.exit(1) |
112 |
+- |
113 |
+-(rc, out) = cmd([iptables_exe, '-V']) |
114 |
+-if rc != 0: |
115 |
+- raise OSError(errno.ENOENT, "Could not find version for '%s'" % \ |
116 |
+- (iptables_exe)) |
117 |
+-version = re.sub('^v', '', re.split('\s', str(out))[1]) |
118 |
+-print("Found '%s' version '%s'" % (iptables_exe, version)) |
119 |
+-if version < "1.4": |
120 |
+- print("WARN: version '%s' has limited IPv6 support. See README for details." % (version), file=sys.stderr) |
121 |
+- |
122 |
++iptables_dir = '/sbin' |
123 |
+ setup (name='ufw', |
124 |
+ version=ufw_version, |
125 |
+ description='front-end for Linux firewalling', |
126 |
|
127 |
diff --git a/net-firewall/ufw/files/ufw-0.36.1-move-path.patch b/net-firewall/ufw/files/ufw-0.36.1-move-path.patch |
128 |
new file mode 100644 |
129 |
index 000000000000..8ace1edc1166 |
130 |
--- /dev/null |
131 |
+++ b/net-firewall/ufw/files/ufw-0.36.1-move-path.patch |
132 |
@@ -0,0 +1,124 @@ |
133 |
+--- a/doc/ufw-framework.8 2021-09-19 04:19:03.000000000 +0300 |
134 |
++++ b/doc/ufw-framework.8 2022-06-27 17:14:11.292890569 +0300 |
135 |
+@@ -18,7 +18,7 @@ |
136 |
+ parameters and configuration of IPv6. The framework consists of the following |
137 |
+ files: |
138 |
+ .TP |
139 |
+-#STATE_PREFIX#/ufw\-init |
140 |
++#SHARE_DIR#/ufw\-init |
141 |
+ initialization script |
142 |
+ .TP |
143 |
+ #CONFIG_PREFIX#/ufw/before.init |
144 |
+@@ -47,7 +47,7 @@ |
145 |
+ |
146 |
+ .SH "BOOT INITIALIZATION" |
147 |
+ .PP |
148 |
+-\fBufw\fR is started on boot with #STATE_PREFIX#/ufw\-init. This script is a |
149 |
++\fBufw\fR is started on boot with #SHARE_DIR#/ufw\-init. This script is a |
150 |
+ standard SysV style initscript used by the \fBufw\fR command and should not be |
151 |
+ modified. The #CONFIG_PREFIX#/before.init and #CONFIG_PREFIX#/after.init |
152 |
+ scripts may be used to perform any additional firewall configuration that is |
153 |
+--- a/setup.py 2021-09-19 04:19:01.000000000 +0300 |
154 |
++++ b/setup.py 2022-06-27 17:33:18.043794598 +0300 |
155 |
+@@ -54,7 +54,7 @@ |
156 |
+ return |
157 |
+ |
158 |
+ real_confdir = os.path.join('/etc') |
159 |
+- real_statedir = os.path.join('/lib', 'ufw') |
160 |
++ real_statedir = os.path.join('/etc', 'ufw', 'user') |
161 |
+ real_prefix = self.prefix |
162 |
+ if self.home != None: |
163 |
+ real_confdir = self.home + real_confdir |
164 |
+@@ -131,14 +131,20 @@ |
165 |
+ self.copy_file('doc/ufw.8', manpage) |
166 |
+ self.copy_file('doc/ufw-framework.8', manpage_f) |
167 |
+ |
168 |
+- # Install state files and helper scripts |
169 |
++ # Install state files |
170 |
+ statedir = real_statedir |
171 |
+ if self.root != None: |
172 |
+ statedir = self.root + real_statedir |
173 |
+ self.mkpath(statedir) |
174 |
+ |
175 |
+- init_helper = os.path.join(statedir, 'ufw-init') |
176 |
+- init_helper_functions = os.path.join(statedir, 'ufw-init-functions') |
177 |
++ # Install helper scripts |
178 |
++ sharedir = real_sharedir |
179 |
++ if self.root != None: |
180 |
++ sharedir = self.root + real_sharedir |
181 |
++ self.mkpath(sharedir) |
182 |
++ |
183 |
++ init_helper = os.path.join(sharedir, 'ufw-init') |
184 |
++ init_helper_functions = os.path.join(sharedir, 'ufw-init-functions') |
185 |
+ self.copy_file('src/ufw-init', init_helper) |
186 |
+ self.copy_file('src/ufw-init-functions', init_helper_functions) |
187 |
+ |
188 |
+@@ -219,14 +225,19 @@ |
189 |
+ f]) |
190 |
+ |
191 |
+ subprocess.call(["sed", |
192 |
++ "-i", |
193 |
++ "s%#SHARE_DIR#%" + real_sharedir + "%g", |
194 |
++ f]) |
195 |
++ |
196 |
++ subprocess.call(["sed", |
197 |
+ "-i", |
198 |
+ "s%#VERSION#%" + ufw_version + "%g", |
199 |
+ f]) |
200 |
+ |
201 |
+ # Install pristine copies of rules files |
202 |
+- sharedir = real_sharedir |
203 |
+- if self.root != None: |
204 |
+- sharedir = self.root + real_sharedir |
205 |
++ #sharedir = real_sharedir |
206 |
++ #if self.root != None: |
207 |
++ # sharedir = self.root + real_sharedir |
208 |
+ rulesdir = os.path.join(sharedir, 'iptables') |
209 |
+ self.mkpath(rulesdir) |
210 |
+ for f in [ before_rules, after_rules, \ |
211 |
+--- a/src/backend_iptables.py 2021-09-19 04:19:01.000000000 +0300 |
212 |
++++ b/src/backend_iptables.py 2022-06-27 17:44:24.880445896 +0300 |
213 |
+@@ -37,6 +37,8 @@ |
214 |
+ |
215 |
+ files = {} |
216 |
+ config_dir = _findpath(ufw.common.config_dir, datadir) |
217 |
++ state_dir = _findpath(ufw.common.state_dir, datadir) |
218 |
++ share_dir = _findpath(ufw.common.share_dir, datadir) |
219 |
+ |
220 |
+ files['rules'] = os.path.join(config_dir, 'ufw/user.rules') |
221 |
+ files['before_rules'] = os.path.join(config_dir, 'ufw/before.rules') |
222 |
+@@ -48,8 +50,7 @@ |
223 |
+ # the lock files (ufw.common.state_dir, aka /lib/ufw), but when set, |
224 |
+ # ufw-init is in rootdir/lib/ufw (ro) and the lockfiles in |
225 |
+ # datadir/lib/ufw (rw) |
226 |
+- files['init'] = os.path.join(_findpath(ufw.common.state_dir, rootdir), |
227 |
+- 'ufw-init') |
228 |
++ files['init'] = os.path.join(share_dir, 'ufw-init') |
229 |
+ |
230 |
+ ufw.backend.UFWBackend.__init__(self, "iptables", dryrun, files, |
231 |
+ rootdir=rootdir, datadir=datadir) |
232 |
+--- a/src/ufw-init 2021-09-19 03:50:19.000000000 +0300 |
233 |
++++ b/src/ufw-init 2022-06-27 17:48:34.352545026 +0300 |
234 |
+@@ -31,10 +31,10 @@ |
235 |
+ fi |
236 |
+ export DATA_DIR="$datadir" |
237 |
+ |
238 |
+-if [ -s "${rootdir}#STATE_PREFIX#/ufw-init-functions" ]; then |
239 |
+- . "${rootdir}#STATE_PREFIX#/ufw-init-functions" |
240 |
++if [ -s "${rootdir}#SHARE_DIR#/ufw-init-functions" ]; then |
241 |
++ . "${rootdir}#SHARE_DIR#/ufw-init-functions" |
242 |
+ else |
243 |
+- echo "Could not find ${rootdir}#STATE_PREFIX#/ufw-init-functions (aborting)" |
244 |
++ echo "Could not find ${rootdir}#SHARE_DIR#/ufw-init-functions (aborting)" |
245 |
+ exit 1 |
246 |
+ fi |
247 |
+ |
248 |
+@@ -83,7 +83,7 @@ |
249 |
+ fi |
250 |
+ ;; |
251 |
+ *) |
252 |
+- echo "Usage: #STATE_PREFIX#/ufw-init {start|stop|restart|force-reload|force-stop|flush-all|status}" |
253 |
++ echo "Usage: #SHARE_DIR#/ufw-init {start|stop|restart|force-reload|force-stop|flush-all|status}" |
254 |
+ exit 1 |
255 |
+ ;; |
256 |
+ esac |
257 |
|
258 |
diff --git a/net-firewall/ufw/files/ufw-0.36.1-shebang.patch b/net-firewall/ufw/files/ufw-0.36.1-shebang.patch |
259 |
new file mode 100644 |
260 |
index 000000000000..aaafaac12ae9 |
261 |
--- /dev/null |
262 |
+++ b/net-firewall/ufw/files/ufw-0.36.1-shebang.patch |
263 |
@@ -0,0 +1,15 @@ |
264 |
+--- a/setup.py 2019-03-21 01:51:55.751971770 +0300 |
265 |
++++ b/setup.py 2019-03-21 01:54:40.142513567 +0300 |
266 |
+@@ -121,12 +121,6 @@ |
267 |
+ for f in [ script, manpage, manpage_f ]: |
268 |
+ self.mkpath(os.path.dirname(f)) |
269 |
+ |
270 |
+- # update the interpreter to that of the one the user specified for setup |
271 |
+- print("Updating staging/ufw to use %s" % (sys.executable)) |
272 |
+- subprocess.call(["sed", |
273 |
+- "-i", |
274 |
+- "1s%^#.*python.*%#! /usr/bin/env " + sys.executable + "%g", |
275 |
+- 'staging/ufw']) |
276 |
+ self.copy_file('staging/ufw', script) |
277 |
+ self.copy_file('doc/ufw.8', manpage) |
278 |
+ self.copy_file('doc/ufw-framework.8', manpage_f) |
279 |
|
280 |
diff --git a/net-firewall/ufw/ufw-0.36.1.ebuild b/net-firewall/ufw/ufw-0.36.1.ebuild |
281 |
new file mode 100644 |
282 |
index 000000000000..8eca27c146a6 |
283 |
--- /dev/null |
284 |
+++ b/net-firewall/ufw/ufw-0.36.1.ebuild |
285 |
@@ -0,0 +1,217 @@ |
286 |
+# Copyright 1999-2022 Gentoo Authors |
287 |
+# Distributed under the terms of the GNU General Public License v2 |
288 |
+ |
289 |
+EAPI=8 |
290 |
+ |
291 |
+PYTHON_COMPAT=( python3_{8..11} ) |
292 |
+DISTUTILS_IN_SOURCE_BUILD=1 |
293 |
+DISTUTILS_USE_SETUPTOOLS=no |
294 |
+ |
295 |
+inherit bash-completion-r1 distutils-r1 linux-info systemd |
296 |
+ |
297 |
+DESCRIPTION="A program used to manage a netfilter firewall" |
298 |
+HOMEPAGE="https://launchpad.net/ufw" |
299 |
+SRC_URI="https://launchpad.net/ufw/${PV%.*}/${PV}/+download/${P}.tar.gz" |
300 |
+ |
301 |
+LICENSE="GPL-3" |
302 |
+SLOT="0" |
303 |
+KEYWORDS="~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86" |
304 |
+IUSE="examples ipv6" |
305 |
+ |
306 |
+RDEPEND="net-firewall/iptables[ipv6(+)?]" |
307 |
+BDEPEND="sys-devel/gettext" |
308 |
+ |
309 |
+PATCHES=( |
310 |
+ # Move files away from /lib/ufw. |
311 |
+ "${FILESDIR}/${P}-move-path.patch" |
312 |
+ # Remove unnecessary build time dependency on net-firewall/iptables. |
313 |
+ "${FILESDIR}/${P}-dont-check-iptables.patch" |
314 |
+ # Remove shebang modification. |
315 |
+ "${FILESDIR}/${P}-shebang.patch" |
316 |
+ # Fix bash completions, bug #526300 |
317 |
+ "${FILESDIR}/${P}-bash-completion.patch" |
318 |
+) |
319 |
+ |
320 |
+pkg_pretend() { |
321 |
+ local CONFIG_CHECK="~PROC_FS |
322 |
+ ~NETFILTER_XT_MATCH_COMMENT ~NETFILTER_XT_MATCH_HL |
323 |
+ ~NETFILTER_XT_MATCH_LIMIT ~NETFILTER_XT_MATCH_MULTIPORT |
324 |
+ ~NETFILTER_XT_MATCH_RECENT ~NETFILTER_XT_MATCH_STATE" |
325 |
+ |
326 |
+ if kernel_is -ge 2 6 39; then |
327 |
+ CONFIG_CHECK+=" ~NETFILTER_XT_MATCH_ADDRTYPE" |
328 |
+ else |
329 |
+ CONFIG_CHECK+=" ~IP_NF_MATCH_ADDRTYPE" |
330 |
+ fi |
331 |
+ |
332 |
+ # https://bugs.launchpad.net/ufw/+bug/1076050 |
333 |
+ if kernel_is -ge 3 4; then |
334 |
+ CONFIG_CHECK+=" ~NETFILTER_XT_TARGET_LOG" |
335 |
+ else |
336 |
+ CONFIG_CHECK+=" ~IP_NF_TARGET_LOG" |
337 |
+ use ipv6 && CONFIG_CHECK+=" ~IP6_NF_TARGET_LOG" |
338 |
+ fi |
339 |
+ |
340 |
+ CONFIG_CHECK+=" ~IP_NF_TARGET_REJECT" |
341 |
+ use ipv6 && CONFIG_CHECK+=" ~IP6_NF_TARGET_REJECT" |
342 |
+ |
343 |
+ check_extra_config |
344 |
+ |
345 |
+ # Check for default, useful optional features. |
346 |
+ if ! linux_config_exists; then |
347 |
+ ewarn "Cannot determine configuration of your kernel." |
348 |
+ return |
349 |
+ fi |
350 |
+ |
351 |
+ local nf_nat_ftp_ok="yes" |
352 |
+ local nf_conntrack_ftp_ok="yes" |
353 |
+ local nf_conntrack_netbios_ns_ok="yes" |
354 |
+ |
355 |
+ linux_chkconfig_present \ |
356 |
+ NF_NAT_FTP || nf_nat_ftp_ok="no" |
357 |
+ linux_chkconfig_present \ |
358 |
+ NF_CONNTRACK_FTP || nf_conntrack_ftp_ok="no" |
359 |
+ linux_chkconfig_present \ |
360 |
+ NF_CONNTRACK_NETBIOS_NS || nf_conntrack_netbios_ns_ok="no" |
361 |
+ |
362 |
+ # This is better than an essay for each unset option... |
363 |
+ if [[ "${nf_nat_ftp_ok}" == "no" ]] || \ |
364 |
+ [[ "${nf_conntrack_ftp_ok}" == "no" ]] || \ |
365 |
+ [[ "${nf_conntrack_netbios_ns_ok}" == "no" ]]; then |
366 |
+ echo |
367 |
+ local mod_msg="Kernel options listed below are not set. They are not" |
368 |
+ mod_msg+=" mandatory, but they are often useful." |
369 |
+ mod_msg+=" If you don't need some of them, please remove relevant" |
370 |
+ mod_msg+=" module name(s) from IPT_MODULES in" |
371 |
+ mod_msg+=" '${EROOT}/etc/default/ufw' before (re)starting ufw." |
372 |
+ mod_msg+=" Otherwise ufw may fail to start!" |
373 |
+ ewarn "${mod_msg}" |
374 |
+ if [[ "${nf_nat_ftp_ok}" == "no" ]]; then |
375 |
+ ewarn "NF_NAT_FTP: for better support for active mode FTP." |
376 |
+ fi |
377 |
+ if [[ "${nf_conntrack_ftp_ok}" == "no" ]]; then |
378 |
+ ewarn "NF_CONNTRACK_FTP: for better support for active mode FTP." |
379 |
+ fi |
380 |
+ if [[ "${nf_conntrack_netbios_ns_ok}" == "no" ]]; then |
381 |
+ ewarn "NF_CONNTRACK_NETBIOS_NS: for better Samba support." |
382 |
+ fi |
383 |
+ fi |
384 |
+} |
385 |
+ |
386 |
+python_prepare_all() { |
387 |
+ # Set as enabled by default. User can enable or disable |
388 |
+ # the service by adding or removing it to/from a runlevel. |
389 |
+ sed -i 's/^ENABLED=no/ENABLED=yes/' conf/ufw.conf \ |
390 |
+ || die "sed failed (ufw.conf)" |
391 |
+ |
392 |
+ sed -i "s/^IPV6=yes/IPV6=$(usex ipv6)/" conf/ufw.defaults || die |
393 |
+ |
394 |
+ # If LINGUAS is set install selected translations only. |
395 |
+ if [[ -n ${LINGUAS+set} ]]; then |
396 |
+ _EMPTY_LOCALE_LIST="yes" |
397 |
+ pushd locales/po > /dev/null || die |
398 |
+ |
399 |
+ local lang |
400 |
+ for lang in *.po; do |
401 |
+ if ! has "${lang%.po}" ${LINGUAS}; then |
402 |
+ rm "${lang}" || die |
403 |
+ else |
404 |
+ _EMPTY_LOCALE_LIST="no" |
405 |
+ fi |
406 |
+ done |
407 |
+ |
408 |
+ popd > /dev/null || die |
409 |
+ else |
410 |
+ _EMPTY_LOCALE_LIST="no" |
411 |
+ fi |
412 |
+ |
413 |
+ distutils-r1_python_prepare_all |
414 |
+} |
415 |
+ |
416 |
+python_install_all() { |
417 |
+ newconfd "${FILESDIR}"/ufw.confd ufw |
418 |
+ newinitd "${FILESDIR}"/ufw-2.initd ufw |
419 |
+ systemd_dounit "${FILESDIR}/ufw.service" |
420 |
+ |
421 |
+ pushd "${ED}" || die |
422 |
+ fperms -R 0644 etc/ufw/*.rules |
423 |
+ popd || die |
424 |
+ |
425 |
+ exeinto /usr/share/${PN} |
426 |
+ doexe tests/check-requirements |
427 |
+ |
428 |
+ # users normally would want it |
429 |
+ insinto "/usr/share/doc/${PF}/logging/syslog-ng" |
430 |
+ doins -r "${FILESDIR}"/syslog-ng/* |
431 |
+ |
432 |
+ insinto "/usr/share/doc/${PF}/logging/rsyslog" |
433 |
+ doins -r "${FILESDIR}"/rsyslog/* |
434 |
+ doins doc/rsyslog.example |
435 |
+ |
436 |
+ if use examples; then |
437 |
+ insinto "/usr/share/doc/${PF}/examples" |
438 |
+ doins -r examples/* |
439 |
+ fi |
440 |
+ newbashcomp shell-completion/bash "${PN}" |
441 |
+ |
442 |
+ [[ $_EMPTY_LOCALE_LIST != "yes" ]] && domo locales/mo/*.mo |
443 |
+ |
444 |
+ distutils-r1_python_install_all |
445 |
+ python_replicate_script "${D}/usr/sbin/ufw" |
446 |
+} |
447 |
+ |
448 |
+pkg_postinst() { |
449 |
+ local print_check_req_warn |
450 |
+ print_check_req_warn=false |
451 |
+ |
452 |
+ local found=() |
453 |
+ local apps=( "net-firewall/arno-iptables-firewall" |
454 |
+ "net-firewall/ferm" |
455 |
+ "net-firewall/firehol" |
456 |
+ "net-firewall/firewalld" |
457 |
+ "net-firewall/ipkungfu" ) |
458 |
+ |
459 |
+ for exe in "${apps[@]}" |
460 |
+ do |
461 |
+ if has_version "${exe}"; then |
462 |
+ found+=( "${exe}" ) |
463 |
+ fi |
464 |
+ done |
465 |
+ |
466 |
+ if [[ -n ${found} ]]; then |
467 |
+ echo "" |
468 |
+ ewarn "WARNING: Detected other firewall applications:" |
469 |
+ ewarn "${found[@]}" |
470 |
+ ewarn "If enabled, these applications may interfere with ufw!" |
471 |
+ fi |
472 |
+ |
473 |
+ if [[ -z "${REPLACING_VERSIONS}" ]]; then |
474 |
+ echo "" |
475 |
+ elog "To enable ufw, add it to boot sequence and activate it:" |
476 |
+ elog "-- # rc-update add ufw boot" |
477 |
+ elog "-- # /etc/init.d/ufw start" |
478 |
+ echo |
479 |
+ elog "If you want to keep ufw logs in a separate file, take a look at" |
480 |
+ elog "/usr/share/doc/${PF}/logging." |
481 |
+ print_check_req_warn=true |
482 |
+ else |
483 |
+ local rv |
484 |
+ for rv in "${REPLACING_VERSIONS}"; do |
485 |
+ local major=${rv%%.*} |
486 |
+ local minor=${rv#${major}.} |
487 |
+ if [[ "${major}" -eq 0 && "${minor}" -lt 34 ]]; then |
488 |
+ print_check_req_warn=true |
489 |
+ fi |
490 |
+ done |
491 |
+ fi |
492 |
+ if [[ "${print_check_req_warn}" == "true" ]]; then |
493 |
+ echo |
494 |
+ elog "/usr/share/ufw/check-requirements script is installed." |
495 |
+ elog "It is useful for debugging problems with ufw. However one" |
496 |
+ elog "should keep in mind that the script assumes IPv6 is enabled" |
497 |
+ elog "on kernel and net-firewall/iptables, and fails when it's not." |
498 |
+ fi |
499 |
+ echo |
500 |
+ ewarn "Note: once enabled, ufw blocks also incoming SSH connections by" |
501 |
+ ewarn "default. See README, Remote Management section for more information." |
502 |
+} |