From deba8115d2c2af26df42966b91ef04ff4dd79cde Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Thu, 14 May 2020 11:09:11 +0100 Subject: gentoo resync : 14.05.2020 --- net-firewall/nftlb/Manifest | 5 ++ net-firewall/nftlb/files/nftlb-0.6-musl.patch | 72 ++++++++++++++++++++++++++ net-firewall/nftlb/files/nftlb-0.6-tests.patch | 47 +++++++++++++++++ net-firewall/nftlb/metadata.xml | 8 +++ net-firewall/nftlb/nftlb-0.6.ebuild | 56 ++++++++++++++++++++ 5 files changed, 188 insertions(+) create mode 100644 net-firewall/nftlb/Manifest create mode 100644 net-firewall/nftlb/files/nftlb-0.6-musl.patch create mode 100644 net-firewall/nftlb/files/nftlb-0.6-tests.patch create mode 100644 net-firewall/nftlb/metadata.xml create mode 100644 net-firewall/nftlb/nftlb-0.6.ebuild (limited to 'net-firewall/nftlb') diff --git a/net-firewall/nftlb/Manifest b/net-firewall/nftlb/Manifest new file mode 100644 index 000000000000..b26a0311e8ae --- /dev/null +++ b/net-firewall/nftlb/Manifest @@ -0,0 +1,5 @@ +AUX nftlb-0.6-musl.patch 1887 BLAKE2B fdf12a0f3113e1fff17096195150e387ec44342d67b80d63fff525e8b28222599276bb607b7f21b44953dbeb0f00861b6477b01af24bc990be046b45a169ced5 SHA512 48781ce88c94b7d184764d9b2fb70410310215fe165fa89965293633bc039044e5d34eb10fe382f9d394f36e5960a91efb12c9e7fde24c057ae6ece0f3d75bb9 +AUX nftlb-0.6-tests.patch 1037 BLAKE2B 1b26671d49035bb57bfd5f730d40d756017234413f427a94367d571a47a4959f09389d55b95e46e0512003e0eb3022470feadeee00632d64cf6cfa94097e89b4 SHA512 9c57db285efb5a5e12d1099e4f44de17e70eb137e7fa05f9c678cadf43c7eecaab76fdb7a7815e2a22ccb9fb1d3e5c524496a9a87ff10cb64f4ff50c281889ce +DIST nftlb-0.6.tar.gz 121216 BLAKE2B 98b69c35070eb733a218ac1b1aaa7816de1e4f149c8447fee298b4cf50c57610c816fb178d4115e1e7af5cea0f5b20df36eb5b79655e0d7c69ff30e363985104 SHA512 95b879cfc187fe94cc6876f4af3fe77795c1e0228850cfb38b95206685d9065076b6905d365da7ec5f92773cf8f72f6e441d9140d9b10b02eaf9b6c862c31006 +EBUILD nftlb-0.6.ebuild 1021 BLAKE2B 28e978c5eaa237691d102184761476ef31fab9a0c986825ae87df87599121774c2d1a95963695b52ce7a130d48c9fbf096339b166b3d57998a4a4e95d6414f25 SHA512 fb3e447387fb311569e56075b04e4a6352ee38eb9a5d8d9b2a2690404cb47cf5ff477002d2a715c047728bc203f9fe08af202e40eb5948809fb292a099d20000 +MISC metadata.xml 255 BLAKE2B 2bb3830b8cec850703f7912f4c22f5b0abeabeed0715222bc56141779d02160773cfd0f85417c553c1cd8f2738bfeb78c56dffb8e648e572019319657646d1ba SHA512 522158915afe67937f81ba572a918a2de8ca1f8591e097da56799c97870d7c44756c1acd8224d63bd3375c2b9ebc0e1ce50816899117948a48065a27804883bf diff --git a/net-firewall/nftlb/files/nftlb-0.6-musl.patch b/net-firewall/nftlb/files/nftlb-0.6-musl.patch new file mode 100644 index 000000000000..99990726f05e --- /dev/null +++ b/net-firewall/nftlb/files/nftlb-0.6-musl.patch @@ -0,0 +1,72 @@ +diff --git a/configure.ac b/configure.ac +index 4e7b0a9..2396857 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2,6 +2,7 @@ AC_INIT([nftlb], [0.6], [netfilter-devel@vger.kernel.org]) + + 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 b6b5ec4..b2a080f 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -18,6 +18,7 @@ + * along with this program. If not, see . + * + */ ++#include "config.h" + + #include + #include +@@ -26,7 +27,10 @@ + #include + #include + #include ++ ++#ifdef HAVE_EXECINFO_H + #include ++#endif /* HAVE_EXECINFO_H */ + + #include "config.h" + #include "objects.h" +@@ -85,6 +89,7 @@ static void nftlb_sighandler(int signo) + exit(EXIT_SUCCESS); + } + ++#ifdef HAVE_EXECINFO_H + static void nftlb_trace() { + void *buffer[255]; + char **str; +@@ -106,6 +111,7 @@ static void nftlb_trace() { + + exit(EXIT_FAILURE); + } ++#endif /* HAVE_EXECINFO_H */ + + int main(int argc, char *argv[]) + { +@@ -157,8 +163,12 @@ 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(SIGSEGV, nftlb_trace) == SIG_ERR) { ++#else ++ signal(SIGPIPE, SIG_IGN) == SIG_ERR) { ++#endif /* HAVE_EXECINFO_H */ + fprintf(stderr, "Error assigning signals\n"); + syslog(LOG_ERR, "Error assigning signals"); + return EXIT_FAILURE; diff --git a/net-firewall/nftlb/files/nftlb-0.6-tests.patch b/net-firewall/nftlb/files/nftlb-0.6-tests.patch new file mode 100644 index 000000000000..05baa7ee03a3 --- /dev/null +++ b/net-firewall/nftlb/files/nftlb-0.6-tests.patch @@ -0,0 +1,47 @@ +diff --git a/tests/exec_tests.sh b/tests/exec_tests.sh +index d96eaa3..b7f812d 100755 +--- a/tests/exec_tests.sh ++++ b/tests/exec_tests.sh +@@ -33,6 +33,8 @@ fi + + echo "-- Executing configuration tests" + ++retval=0 ++ + for test in `ls -d ${TESTS}`; do + if [[ ! ${test} =~ ^..._ ]]; then + continue; +@@ -55,14 +57,16 @@ for test in `ls -d ${TESTS}`; do + + if [ $statusexec -ne 0 ]; then + echo -e "\e[31mNFT EXEC ERROR\e[0m" ++ retval=1 + continue; + fi + + #~ nftfile=`echo ${file} | awk -F'.' '{ print $1 }'` +- $NFTBIN list ruleset > ${reportfile} ++ $NFTBIN list ruleset > ${reportfile} || retval=1 + + if [ ! -f ${outputfile} ]; then + echo "Dump file doesn't exist" ++ retval=1 + continue; + fi + +@@ -74,6 +78,7 @@ for test in `ls -d ${TESTS}`; do + rm -f ${reportfile} + else + echo -e "\e[31mNFT DUMP ERROR\e[0m" ++ retval=1 + fi + done + +@@ -83,4 +88,7 @@ fi + + if [ "`grep 'nft command error' /var/log/syslog`" != "" ]; then + echo -e "\e[33m* command errors found, please check syslog\e[0m" ++ retval=1 + fi ++ ++exit ${retval} diff --git a/net-firewall/nftlb/metadata.xml b/net-firewall/nftlb/metadata.xml new file mode 100644 index 000000000000..56cae167d372 --- /dev/null +++ b/net-firewall/nftlb/metadata.xml @@ -0,0 +1,8 @@ + + + + + chutzpah@gentoo.org + Patrick McLean + + diff --git a/net-firewall/nftlb/nftlb-0.6.ebuild b/net-firewall/nftlb/nftlb-0.6.ebuild new file mode 100644 index 000000000000..99822681780a --- /dev/null +++ b/net-firewall/nftlb/nftlb-0.6.ebuild @@ -0,0 +1,56 @@ +# Copyright 2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit linux-info autotools + +DESCRIPTION="nftables load balancer" +HOMEPAGE="https://github.com/zevenet/nftlb" +SRC_URI="https://github.com/zevenet/${PN}/archive/v${PV}.tar.gz -> ${P}.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-0.6-tests.patch" + "${FILESDIR}/nftlb-0.6-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() { + 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 +} -- cgit v1.2.3