commit: f2a0e326c6e0043a1b0ce8ea3a2c6a0164e284a3 Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org> AuthorDate: Fri Jan 17 16:57:03 2025 +0000 Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org> CommitDate: Fri Jan 17 16:57:23 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f2a0e326
net-firewall/nftlb: add 1.1.0 Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org> net-firewall/nftlb/Manifest | 1 + net-firewall/nftlb/files/nftlb-1.1.0-musl.patch | 73 +++++++++++++++++++++++++ net-firewall/nftlb/metadata.xml | 2 +- net-firewall/nftlb/nftlb-1.1.0.ebuild | 69 +++++++++++++++++++++++ 4 files changed, 144 insertions(+), 1 deletion(-) diff --git a/net-firewall/nftlb/Manifest b/net-firewall/nftlb/Manifest index d4a85e63f071..8ec890888e6a 100644 --- a/net-firewall/nftlb/Manifest +++ b/net-firewall/nftlb/Manifest @@ -1,2 +1,3 @@ DIST nftlb-1.0.7.tar.gz 201988 BLAKE2B 794778523b3a60a351fd071e6ff129197203ddfb1b80823dd6b05c30cb530040da465a10d2ffbf11cad063c2a453bb9baebd6e689b9166d4fcb0fe9fd17760e8 SHA512 eb1e9847f340e57b75a5b8680774d8208b282faccdef48e316b2bd52b10349eeda70643386e0e899d0f6a2f506964cf1b7a7ec2d86279f83ca87a9afa8f047bc DIST nftlb-1.0.8.gh.tar.gz 256936 BLAKE2B 1ab9fb508c8613304ebde7185a8ad8ddabb483d17c8b872cfb7da8a0b0e5a8d40f74a74361d1d5b8304d45c00357eea1f88f2cc39e5afe537791278277462407 SHA512 f612b7065fb5011f1af34cabe0945b7b0c1479241b4673d86e2e97d06bffdfefcc5ca4ec3ad3752faa92862306ed8ad28754838236476fe9db88099bc389cf7c +DIST nftlb-1.1.0.gh.tar.gz 250421 BLAKE2B 4034032bec80fe43c67af54550fe24f6133ce9b79c769caa678ef351d001ad01b758740df73e149726f00c258a84e3f4cbd6394a86efec0cdb5221a2f374f774 SHA512 e4fd41f5d7251913be457ae9b4e1ca1a1cc25751d1ffbb7fac3e009332ff963fcd5ab141e8cdbd26eee57183bc7663bf153feb5cd2ba8e2b6cc36083c8c12e46 diff --git a/net-firewall/nftlb/files/nftlb-1.1.0-musl.patch b/net-firewall/nftlb/files/nftlb-1.1.0-musl.patch new file mode 100644 index 000000000000..b9cfb315c7e2 --- /dev/null +++ b/net-firewall/nftlb/files/nftlb-1.1.0-musl.patch @@ -0,0 +1,73 @@ +diff --git a/configure.ac b/configure.ac +index ace78db..55f5f68 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2,6 +2,7 @@ AC_INIT([nftlb], [1.1.0], [[email protected]]) + + AC_CONFIG_AUX_DIR([build-aux]) + AC_CONFIG_MACRO_DIR([m4]) ++AC_CONFIG_HEADERS([config.h]) + AM_INIT_AUTOMAKE([-Wall foreign subdir-objects + tar-pax no-dist-gzip dist-bzip2 1.6]) + +@@ -25,5 +26,7 @@ AC_CHECK_HEADER([ev.h], [EVENTINC="-include ev.h"], + [EVENTINC="-include libev/ev.h"], + [AC_MSG_ERROR([ev.h not found])])]) + ++AC_CHECK_HEADERS([execinfo.h]) ++ + AC_CONFIG_FILES([Makefile src/Makefile]) + AC_OUTPUT +diff --git a/src/main.c b/src/main.c +index bca652e..5d7e918 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -18,6 +18,7 @@ + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ ++#include "config.h" + + #include <stdio.h> + #include <stdlib.h> +@@ -25,6 +26,10 @@ + #include <errno.h> + #include <unistd.h> + ++#ifdef HAVE_EXECINFO_H ++ #include <execinfo.h> ++#endif /* HAVE_EXECINFO_H */ ++ + #include "config.h" + #include "objects.h" + #include "server.h" +@@ -88,6 +93,7 @@ static void nftlb_sighandler(int signo) + exit(EXIT_SUCCESS); + } + ++#ifdef HAVE_EXECINFO_H + static void nftlb_trace() { + int level; + +@@ -100,6 +106,7 @@ static void nftlb_trace() { + if (!obj_recovery()) + exit(EXIT_FAILURE); + } ++#endif /* HAVE_EXECINFO_H */ + + static int main_process(const char *config, int mode) + { +@@ -189,9 +196,13 @@ int main(int argc, char *argv[]) + + if (signal(SIGINT, nftlb_sighandler) == SIG_ERR || + signal(SIGTERM, nftlb_sighandler) == SIG_ERR || ++#ifdef HAVE_EXECINFO_H + signal(SIGPIPE, SIG_IGN) == SIG_ERR || + signal(SIGABRT, nftlb_trace) == SIG_ERR || + signal(SIGSEGV, nftlb_trace) == SIG_ERR) { ++#else ++ signal(sigpipe, sig_ign) == sig_err) { ++#endif /* have_execinfo_h */ + u_log_print(LOG_ERR, "Error assigning signals"); + return EXIT_FAILURE; + } diff --git a/net-firewall/nftlb/metadata.xml b/net-firewall/nftlb/metadata.xml index ab906c04250e..6cf207784952 100644 --- a/net-firewall/nftlb/metadata.xml +++ b/net-firewall/nftlb/metadata.xml @@ -6,6 +6,6 @@ <name>Patrick McLean</name> </maintainer> <upstream> - <remote-id type="github">zevenet/nftlb</remote-id> + <remote-id type="github">relianoid/nftlb</remote-id> </upstream> </pkgmetadata> diff --git a/net-firewall/nftlb/nftlb-1.1.0.ebuild b/net-firewall/nftlb/nftlb-1.1.0.ebuild new file mode 100644 index 000000000000..7e90a613b33b --- /dev/null +++ b/net-firewall/nftlb/nftlb-1.1.0.ebuild @@ -0,0 +1,69 @@ +# Copyright 2020-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit linux-info autotools + +DESCRIPTION="nftables load balancer" +HOMEPAGE=" + https://www.relianoid.com/nftlb + https://github.com/relianoid/nftlb +" +SRC_URI="https://github.com/relianoid/${PN}/archive/v${PV}.tar.gz -> ${P}.gh.tar.gz" + +LICENSE="AGPL-3" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +DEPEND=" + net-firewall/nftables:=[modern-kernel(+)] + dev-libs/jansson:= + dev-libs/libev:= +" +RDEPEND=" + ${DEPEND} +" + +# tests need root access +RESTRICT="test" + +PATCHES=( + "${FILESDIR}/nftlb-1.0.8-tests.patch" + "${FILESDIR}/nftlb-1.1.0-musl.patch" +) + +pkg_setup() { + local CONFIG_CHECK=" + ~NF_TABLES + ~NFT_NUMGEN + ~NFT_HASH + ~NF_NAT + ~IP_NF_NAT + " + + linux-info_pkg_setup + + if kernel_is lt 4 19; then + eerror "${PN} requires kernel version 4.19 or newer" + fi +} + +src_prepare() { + # there are some compiler artifacts in the tarball + find "${S}" -name '*.o' -delete || die + + default + eautoreconf +} + +src_test() { + pushd tests >/dev/null || die + + sed -e "s:/var/log/syslog:\"${T}/tests.log\":" \ + -i exec_tests.sh || die + + ./exec_tests.sh || die "tests failed" + + popd >/dev/null || die +}
