diff options
author | V3n3RiX <venerix@koprulu.sector> | 2022-03-20 00:40:44 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2022-03-20 00:40:44 +0000 |
commit | 4cbcc855382a06088e2f016f62cafdbcb7e40665 (patch) | |
tree | 356496503d52354aa6d9f2d36126302fed5f3a73 /net-firewall/nftlb | |
parent | fcc5224904648a8e6eb528d7603154160a20022f (diff) |
gentoo resync : 20.03.2022
Diffstat (limited to 'net-firewall/nftlb')
-rw-r--r-- | net-firewall/nftlb/Manifest | 4 | ||||
-rw-r--r-- | net-firewall/nftlb/files/nftlb-1.0-musl.patch | 73 | ||||
-rw-r--r-- | net-firewall/nftlb/files/nftlb-1.0-tests.patch | 45 | ||||
-rw-r--r-- | net-firewall/nftlb/nftlb-1.0.ebuild | 61 |
4 files changed, 183 insertions, 0 deletions
diff --git a/net-firewall/nftlb/Manifest b/net-firewall/nftlb/Manifest index aa9778daedaa..197abc435bb8 100644 --- a/net-firewall/nftlb/Manifest +++ b/net-firewall/nftlb/Manifest @@ -1,5 +1,9 @@ AUX nftlb-0.6-musl.patch 1887 BLAKE2B fdf12a0f3113e1fff17096195150e387ec44342d67b80d63fff525e8b28222599276bb607b7f21b44953dbeb0f00861b6477b01af24bc990be046b45a169ced5 SHA512 48781ce88c94b7d184764d9b2fb70410310215fe165fa89965293633bc039044e5d34eb10fe382f9d394f36e5960a91efb12c9e7fde24c057ae6ece0f3d75bb9 AUX nftlb-0.6-tests.patch 1037 BLAKE2B 1b26671d49035bb57bfd5f730d40d756017234413f427a94367d571a47a4959f09389d55b95e46e0512003e0eb3022470feadeee00632d64cf6cfa94097e89b4 SHA512 9c57db285efb5a5e12d1099e4f44de17e70eb137e7fa05f9c678cadf43c7eecaab76fdb7a7815e2a22ccb9fb1d3e5c524496a9a87ff10cb64f4ff50c281889ce +AUX nftlb-1.0-musl.patch 1899 BLAKE2B 6c2c51ba355473754ac1aa59e423b367c9eba8c0aef6cc0756533f08e22aa423e397a2216449b25360d625d62ef64173701e0cec40be6bb342094ad81a2ca463 SHA512 e73efbaffa03c9bf762b9335561ae3f905434cd15351e843063c8aeac5cd80db6bbb3916fe0eca04a7699c3bebfb8910e52a2f1f07b068ee1c9951d645bf3e28 +AUX nftlb-1.0-tests.patch 1025 BLAKE2B 1c1a3b363d5896799dbc9c789684bcb407cafeee6b7d7d061f28142a718a77b9a7fc11a59ff40f178047d37a8452c66cab904661d36874efc343677ec4a043a4 SHA512 a013fd84528620e61b93b11218edb5fbf4096d0367d802f697048f544751a0a4c9d64ecfa5198b28d8dc732b195db7d7ed5028423aa26c855f116d11665f096b DIST nftlb-0.6.tar.gz 121216 BLAKE2B 98b69c35070eb733a218ac1b1aaa7816de1e4f149c8447fee298b4cf50c57610c816fb178d4115e1e7af5cea0f5b20df36eb5b79655e0d7c69ff30e363985104 SHA512 95b879cfc187fe94cc6876f4af3fe77795c1e0228850cfb38b95206685d9065076b6905d365da7ec5f92773cf8f72f6e441d9140d9b10b02eaf9b6c862c31006 +DIST nftlb-1.0.tar.gz 195057 BLAKE2B b8237b7ba6f6f61dde726d53b63f2488bf38646984b252317ba0f47727ae91e5f4d58c32c0f0d609b134124efd29fdce2b9c10a981a3892220dac78c84946f48 SHA512 f93db34e4372d8f16e99650f3ade62908ce65722fadd521c6d698ab81b24502f6d82e1945b06b166876ebeb39e1907c97a40776ddf985b035b883e93f62e8766 EBUILD nftlb-0.6.ebuild 1021 BLAKE2B 28e978c5eaa237691d102184761476ef31fab9a0c986825ae87df87599121774c2d1a95963695b52ce7a130d48c9fbf096339b166b3d57998a4a4e95d6414f25 SHA512 fb3e447387fb311569e56075b04e4a6352ee38eb9a5d8d9b2a2690404cb47cf5ff477002d2a715c047728bc203f9fe08af202e40eb5948809fb292a099d20000 +EBUILD nftlb-1.0.ebuild 1037 BLAKE2B 61b6a5e568945cb063f205b39dc43e36aa4ed1001bdadd592e513f813c376f41eab26309f4a2df4827741fa4eacfa88a8b57c5dfcffae53674fe0a824baf62ff SHA512 43a81b0c731563e4d1cf8a3880b722d9c171d7930b1998cb4251d38f756fcd02bc6860e923db776aca3ca24aff3fd8590c195a009d41399bbe3331c8e7ffed1d MISC metadata.xml 256 BLAKE2B e4fb7b4732dc88ff20c10bd7e5425beca8310c14d3934046ad6fcd99d8f401ea8610a6df5444d094f5bae4e5120cb7aedc15b45f0862b73f83bd7d5e54617337 SHA512 d37651285ce883fc1c73b41e09e66788d47b2451a4f96ac4237e6bef59643b3171a7a24900f204f0ca1accdbd5961d74e4bd7c8c41e1d29492874e4cbc737611 diff --git a/net-firewall/nftlb/files/nftlb-1.0-musl.patch b/net-firewall/nftlb/files/nftlb-1.0-musl.patch new file mode 100644 index 000000000000..399136754554 --- /dev/null +++ b/net-firewall/nftlb/files/nftlb-1.0-musl.patch @@ -0,0 +1,73 @@ +diff --git a/configure.ac b/configure.ac +index 84bfd96..3f6f81d 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2,6 +2,7 @@ AC_INIT([nftlb], [1.0], [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 9854f95..8e7df1d 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,7 +26,10 @@ + #include <string.h> + #include <errno.h> + #include <unistd.h> ++ ++#ifdef HAVE_EXECINFO_H + #include <execinfo.h> ++#endif /* HAVE_EXECINFO_H */ + + #include "config.h" + #include "objects.h" +@@ -88,6 +92,7 @@ static void nftlb_sighandler(int signo) + exit(EXIT_SUCCESS); + } + ++#ifdef HAVE_EXECINFO_H + static void nftlb_trace() { + void *buffer[255]; + char **str; +@@ -109,6 +114,7 @@ static void nftlb_trace() { + + exit(EXIT_FAILURE); + } ++#endif /* HAVE_EXECINFO_H */ + + int main(int argc, char *argv[]) + { +@@ -166,9 +172,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 */ + tools_printlog(LOG_ERR, "Error assigning signals"); + return EXIT_FAILURE; + } diff --git a/net-firewall/nftlb/files/nftlb-1.0-tests.patch b/net-firewall/nftlb/files/nftlb-1.0-tests.patch new file mode 100644 index 000000000000..48685074cb83 --- /dev/null +++ b/net-firewall/nftlb/files/nftlb-1.0-tests.patch @@ -0,0 +1,45 @@ +diff --git a/tests/exec_tests.sh b/tests/exec_tests.sh +index 2a30a07..7814f5a 100755 +--- a/tests/exec_tests.sh ++++ b/tests/exec_tests.sh +@@ -36,6 +36,8 @@ fi + + echo "-- Executing configuration tests" + ++retval=0 ++ + for test in `ls -d ${TESTS}`; do + if [[ ! ${test} =~ ^..._ ]]; then + continue; +@@ -58,6 +60,7 @@ for test in `ls -d ${TESTS}`; do + + if [ $statusexec -ne 0 ]; then + echo -e "\e[31mNFT EXEC ERROR\e[0m" ++ retval=1 + continue; + fi + +@@ -65,6 +68,7 @@ for test in `ls -d ${TESTS}`; do + + if [ ! -f ${outputfile} ]; then + echo "Dump file doesn't exist" ++ retval=1 + continue; + fi + +@@ -76,6 +80,7 @@ for test in `ls -d ${TESTS}`; do + rm -f ${reportfile} + else + echo -e "\e[31mNFT DUMP ERROR\e[0m" ++ retval=1 + if [ $APPLY_REPORTS -eq 1 ]; then + cat ${reportfile} > ${outputfile} + echo -e "APPLIED" +@@ -89,4 +94,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/nftlb-1.0.ebuild b/net-firewall/nftlb/nftlb-1.0.ebuild new file mode 100644 index 000000000000..f1e9170bcbc4 --- /dev/null +++ b/net-firewall/nftlb/nftlb-1.0.ebuild @@ -0,0 +1,61 @@ +# Copyright 2020-2022 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://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-1.0-tests.patch" + "${FILESDIR}/nftlb-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() { + 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 +} |