added my Recipes

This commit is contained in:
2024-07-11 14:16:35 +02:00
parent 38bc4f53ac
commit 09b621d929
7118 changed files with 525762 additions and 3 deletions

View File

@@ -0,0 +1,38 @@
From 92fcdbc1a57086e4decc1597217c0739dc16342a Mon Sep 17 00:00:00 2001
From: Silcet <camorga1@gmail.com>
Date: Tue, 27 Apr 2021 05:34:59 +0000
Subject: [PATCH] Author: Jamie Strandboge <jamie@canonical.com>
Description:
to improve boot speed when disabled, don't source all of ufw-init-functions
(which also sources in other files).
Upstream-Status: Inappropriate [ not author ]
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
The patch was imported from the OpenEmbedded git server
(git://git.openembedded.org/openembedded) as of commit id
2cc1bd9dd060f5002c2fde7aacba86fe230c12af.
Signed-off-by: Silcet <camorga1@gmail.com>
---
src/ufw-init | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/ufw-init b/src/ufw-init
index 3505a02..dde37f0 100755
--- a/src/ufw-init
+++ b/src/ufw-init
@@ -31,6 +31,12 @@ if [ "$1" = "--datadir" ] && [ -s "$2" ]; then
fi
export DATA_DIR="$datadir"
+# Debian/Ubuntu: small boot speed improvement
+. "#CONFIG_PREFIX#/ufw/ufw.conf"
+if [ "$1" = "start" ] && [ "$2" = "quiet" ] && [ "$ENABLED" = "no" ]; then
+ exit 0
+fi
+
if [ -s "${rootdir}#STATE_PREFIX#/ufw-init-functions" ]; then
. "${rootdir}#STATE_PREFIX#/ufw-init-functions"
else

View File

@@ -0,0 +1,112 @@
From 808577f8464f542076840d0d93fe168a5f79442c Mon Sep 17 00:00:00 2001
From: Silcet <camorga1@gmail.com>
Date: Tue, 27 Apr 2021 05:40:03 +0000
Subject: [PATCH] setup: add an option to specify iptables location
When cross-compiling it isn't certain that the location of iptables on the
target will be the same as on the host. It also doesn't make sense the
test the version of the host during setup. We provide an option to
specify an alternate iptables directory. This is assumed to be a
cross-compile environment and therefore no attempt is made to verify the
version of iptables to be used.
Upstream-Status: Pending
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
The patch was imported from the OpenEmbedded git server
(git://git.openembedded.org/openembedded) as of commit id
2cc1bd9dd060f5002c2fde7aacba86fe230c12af.
Signed-off-by: Silcet <camorga1@gmail.com>
---
setup.py | 65 ++++++++++++++++++++++++++++++++------------------------
1 file changed, 37 insertions(+), 28 deletions(-)
--- a/setup.py
+++ b/setup.py
@@ -245,45 +245,50 @@ shutil.copytree('src', 'staging')
os.unlink(os.path.join('staging', 'ufw-init'))
os.unlink(os.path.join('staging', 'ufw-init-functions'))
+iptables_set = 0
iptables_exe = ''
iptables_dir = ''
-for e in ['iptables']:
- # Historically iptables was in /sbin, then later also symlinked from
- # /usr/sbin/iptables to /sbin/iptables. Debian bullseye moves iptables
- # to /usr/sbin with no symlink in /sbin except on upgrades. To accomodate
- # buildds that may still have the old iptables, search /usr/sbin first
- for dir in ['/usr/sbin', '/sbin', '/usr/bin', '/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)
+if "--iptables-dir" in sys.argv:
+ iptables_dir = sys.argv[sys.argv.index("--iptables-dir") + 1]
+ iptables_exe = os.path.join(iptables_dir, "iptables")
+ iptables_set = 1
+ print("INFO: iptables manually set: '%s'" % (iptables_exe))
+ sys.argv.remove(iptables_dir)
+ sys.argv.remove("--iptables-dir")
+
+if not iptables_set:
+ for e in ['iptables']:
+ for dir in ['/usr/sbin', '/sbin', '/usr/bin', '/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)
-(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)
+ 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)
setup (name='ufw',
version=ufw_version,

View File

@@ -0,0 +1,73 @@
From 42170d379eddc12bd2d1fe84dc268882d8eb4d64 Mon Sep 17 00:00:00 2001
From: Silcet <camorga1@gmail.com>
Date: Mon, 3 May 2021 08:59:28 +0000
Subject: [PATCH] setup: only make one reference to env
If sys.executable happens to be '/usr/bin/env python' or something
similar, the setup script will result in 'ufw' getting /usr/bin/env
repeated on the top line. This causes an error at runtime. Perform a
quick sanity check on sys.executable before doing the substitution.
While we're at it, change the default value of 'exe' to the one we either
detected or specified on the build line.
Upstream-Status: Inappropriate [ embedded specific ]
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
The patch was imported from the OpenEmbedded git server
(git://git.openembedded.org/openembedded) as of commit id
2cc1bd9dd060f5002c2fde7aacba86fe230c12af.
A previous change had modified the way the python shebang was updated to
follow the same version as the one used to call setup.py. However, it
used a regex that was not matching anymore. To fix this, the regex
condition is removed so the shebang line is substituted with the sys.executable
value. Later in the installation distutils finds the string with the path
of sys.executable and replaces it with "#! /usr/bin/env python3".
Signed-off-by: Silcet <camorga1@gmail.com>
---
setup.py | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/setup.py b/setup.py
index 2343bc9..f8a638b 100644
--- a/setup.py
+++ b/setup.py
@@ -64,7 +64,7 @@ class Install(_install, object):
real_sharedir = os.path.join(real_prefix, 'share', 'ufw')
# Update the modules' paths
- for fn in [ 'common.py' ]:
+ for fn in [ 'common.py', 'util.py' ]:
# 'staging' is used with just 'install' but build_lib is used when
# using 'build'. We could probably override 'def build()' but this
# at least works
@@ -97,6 +97,12 @@ class Install(_install, object):
"-i",
"s%#SHARE_DIR#%" + real_sharedir + "%g",
f])
+
+ subprocess.call(["sed",
+ "-i.jjm",
+ "s%/sbin/iptables%" + iptables_exe + "%g",
+ f])
+
if fn == 'common.py' and 'UFW_SKIP_CHECKS' in os.environ and \
os.environ['UFW_SKIP_CHECKS'] != '':
@@ -123,10 +129,12 @@ class Install(_install, object):
self.mkpath(os.path.dirname(f))
# update the interpreter to that of the one the user specified for setup
+ # Distutils searches for the string of sys.executable and replaces it
+ # with the "#! /usr/bin/env pythonX" shebang on a later step
print("Updating staging/ufw to use %s" % (sys.executable))
subprocess.call(["sed",
"-i",
- "1s%^#.*python.*%#! /usr/bin/env " + sys.executable + "%g",
+ "1s%/.*python.*%" + sys.executable + "%g",
'staging/ufw'])
self.copy_file('staging/ufw', script)
self.copy_file('doc/ufw.8', manpage)

View File

@@ -0,0 +1,20 @@
Move to setuptools as distutils is now deprecated.
Upstream-Status: Submitted [https://code.launchpad.net/~tgamblin/ufw/distutils-to-setuptools]
Signed-off-by: Ross Burton <ross.burton@arm.com>
diff --git a/setup.py b/setup.py
index cb67a6a..de648d3 100644
--- a/setup.py
+++ b/setup.py
@@ -25,8 +25,8 @@
#
from __future__ import print_function
-from distutils.command.install import install as _install
-from distutils.core import setup
+from setuptools.command.install import install as _install
+from setuptools import setup
import errno
import os
import re

View File

@@ -0,0 +1,74 @@
SUMMARY = "Uncomplicated Firewall"
DESCRIPTION = "UFW stands for Uncomplicated Firewall, and is program for \
managing a netfilter firewall. It provides a command line interface and aims \
to be uncomplicated and easy to use."
HOMEPAGE = "https://launchpad.net/ufw"
SECTION = "net"
LICENSE = "GPL-3.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949"
SRC_URI = "https://launchpad.net/ufw/0.36/0.36.1/+download/ufw-0.36.1.tar.gz \
file://0001-optimize-boot.patch \
file://0002-add-an-option-to-specify-iptables-location.patch \
file://0003-only-make-one-reference-to-env.patch \
file://setuptools.patch \
"
SRC_URI[sha256sum] = "1c57e78fbf2970f0cc9c56ea87a231e6d83d825e55b9e31e2c88b91b0ea03c8c"
UPSTREAM_CHECK_URI = "https://launchpad.net/ufw"
inherit setuptools3_legacy features_check systemd update-rc.d
RDEPENDS:${PN} = " \
iptables \
python3 \
python3-modules \
"
RRECOMMENDS:${PN} = " \
kernel-module-ipv6 \
kernel-module-nf-conntrack-ipv6 \
kernel-module-nf-log-common \
kernel-module-nf-log-ipv4 \
kernel-module-nf-log-ipv6 \
kernel-module-nf-addrtype \
kernel-module-nf-limit \
kernel-module-nf-log \
kernel-module-nf-recent \
"
do_configure:prepend() {
if ${@bb.utils.contains('DISTRO_FEATURES','usrmerge','true','false',d)}; then
sed -i -e 's|/lib|${nonarch_base_libdir}|' ${S}/setup.py
fi
}
do_install:append() {
install -d ${D}${systemd_unitdir}/system/
install -m 0644 ${S}/doc/systemd.example ${D}${systemd_unitdir}/system/ufw.service
install -d ${D}${sysconfdir}/init.d/
install -m 0755 ${S}/doc/initscript.example ${D}${sysconfdir}/init.d/ufw
}
SYSTEMD_SERVICE:${PN} = "ufw.service"
INITSCRIPT_NAME = "ufw"
INITSCRIPT_PARAMS = "defaults"
# Certain items are explicitly put under /lib, not base_libdir when installed.
#
FILES:${PN} += " \
${sbindir}/* \
${datadir}/ufw/* \
${nonarch_base_libdir}/ufw/* \
${sysconfdir}/ufw/* \
${sysconfdir}/default/ufw \
"
REQUIRED_DISTRO_FEATURES = "ipv6"
SETUPTOOLS_BUILD_ARGS:append = " --iptables-dir /usr/sbin"
SETUPTOOLS_INSTALL_ARGS:append = " --iptables-dir /usr/sbin"