commit: 193b53dca90ec68fedb6dd81220b3c28b9eb8ec1 Author: Sam James <sam <AT> gentoo <DOT> org> AuthorDate: Fri Jun 20 03:30:35 2025 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Fri Jun 20 03:31:12 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=193b53dc
net-firewall/xtables-addons: add 3.28 Closes: https://bugs.gentoo.org/958208 Signed-off-by: Sam James <sam <AT> gentoo.org> net-firewall/xtables-addons/Manifest | 1 + .../xtables-addons/xtables-addons-3.28.ebuild | 115 +++++++++++++++++++++ 2 files changed, 116 insertions(+) diff --git a/net-firewall/xtables-addons/Manifest b/net-firewall/xtables-addons/Manifest index 3432fbfae213..af0d0f3e28df 100644 --- a/net-firewall/xtables-addons/Manifest +++ b/net-firewall/xtables-addons/Manifest @@ -1 +1,2 @@ DIST xtables-addons-3.27.tar.xz 340360 BLAKE2B 5b82069e21464bc293d76c6cd298e6beafdda57bc07582be64d7ff9a5511741bd1acd9a54a7b1caa08631d108a17b51dc7e7c2926003e6a893b1df0f6b360b62 SHA512 1938342914c24621743d0460e4057ffa6d3b6d01f3d0ca5feaa3852675f18c309f57fcb73725972d4aa87b7da92667efffa16e203f4cd1362cb8bb03a116636a +DIST xtables-addons-3.28.tar.xz 340112 BLAKE2B ee4455e3f57549c7dfcf3871782617e22806d5862d22a791aca9579188e735d070504caaf72b4ceaa516a4a77c809cd6cb12c964214a56d9df0a3ba047683b81 SHA512 11d7ffc62d41d9f86c51a0c35fb4bc91581e8c4f2fb8e0c6309ea1381a8bd5567612dbcdfed041bfeed300bfe19fd7f36d9af0d4c76d36b2275fa840cfa5342d diff --git a/net-firewall/xtables-addons/xtables-addons-3.28.ebuild b/net-firewall/xtables-addons/xtables-addons-3.28.ebuild new file mode 100644 index 000000000000..ef451cea3ad4 --- /dev/null +++ b/net-firewall/xtables-addons/xtables-addons-3.28.ebuild @@ -0,0 +1,115 @@ +# Copyright 2023-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +MODULES_OPTIONAL_IUSE="+modules" +inherit flag-o-matic linux-mod-r1 toolchain-funcs + +XTABLES_MODULES=( + account chaos delude dhcpmac dnetmap echo ipmark logmark + proto sysrq tarpit asn condition fuzzy geoip gradm iface + ipp2p ipv4options length2 lscan pknock psd quota2 +) + +MODULES_KERNEL_MIN=4.15 + +DESCRIPTION="iptables extensions not yet accepted in the main kernel" +HOMEPAGE=" + https://inai.de/projects/xtables-addons/ + https://codeberg.org/jengelh/xtables-addons/ +" +SRC_URI="https://inai.de/files/xtables-addons/${P}.tar.xz" + +LICENSE="GPL-2+" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="${XTABLES_MODULES[*]/#/xtables_addons_}" + +XTABLES_SCRIPTS_DEPEND=" + app-arch/unzip + dev-perl/Net-CIDR-Lite + dev-perl/Text-CSV_XS +" +DEPEND="net-firewall/iptables:=" +RDEPEND=" + ${DEPEND} + xtables_addons_asn? ( ${XTABLES_SCRIPTS_DEPEND} ) + xtables_addons_geoip? ( ${XTABLES_SCRIPTS_DEPEND} ) +" +BDEPEND="virtual/pkgconfig" + +pkg_setup() { + local CONFIG_CHECK="NF_CONNTRACK NF_CONNTRACK_MARK" + + if use xtables_addons_ipp2p; then + CONFIG_CHECK+=" TEXTSEARCH_BM" + local ERROR_TEXTSEARCH_BM="CONFIG_TEXTSEARCH_BM: is not set but is needed to use xt_ipp2p" + fi + + if use xtables_addons_pknock; then + CONFIG_CHECK+=" ~CONNECTOR" + local ERROR_CONNECTOR="CONFIG_CONNECTOR: is not set but is needed to receive userspace + notifications from pknock through netlink/connector" + fi + + linux-mod-r1_pkg_setup +} + +src_prepare() { + default + + local mod modules + mapfile -t modules < <(sed -En 's/^build_(.+)=.*/\L\1/p' mconfig || die) + [[ ${modules[*]} == "${XTABLES_MODULES[*]}" ]] || + die "XTABLES_MODULES needs to be updated to: '${modules[*]}'" + + for mod in "${modules[@]}"; do + use xtables_addons_${mod} || sed -i "/^build_${mod}=/Id" mconfig || die + done +} + +src_configure() { + # Uses CFLAGS for tools, and it may mismatch with the kernel's CC + # FIXME?: ideally would want to build tools with normal CC + use modules && CC=${KERNEL_CC} strip-unsupported-flags + + local econfargs=( + # TODO?: should move to ${EPREFIX}/usr + use default libexecdir by now + # (matching documentation), but could be a disruptive change for users + # with xt_asn/geoip_* paths they may have hardcoded in scripts + --prefix="${EPREFIX:-/}" + --libexecdir="${EPREFIX}"/$(get_libdir) + $(usex modules --with-kbuild="${KV_OUT_DIR}" --without-kbuild) + + # Needed for cross-compiling and to avoid a clash with the Gentoo ARCH. + ARCH="$(tc-arch-kernel)" + ) + + econf "${econfargs[@]}" +} + +src_compile() { + use modules || MODULES_MAKEARGS=() + + emake "${MODULES_MAKEARGS[@]}" +} + +src_install() { + MODULES_MAKEARGS+=( + DESTDIR="${D}" + INSTALL_MOD_DIR=xtables_addons + ) + + emake "${MODULES_MAKEARGS[@]}" install + modules_post_process + + dodoc -r README.rst doc/. + + use xtables_addons_asn || + find "${ED}" -type f -name '*_asn*' -delete || die + use xtables_addons_geoip || + find "${ED}" -type f -name '*_geoip*' -delete || die + + find "${ED}" -type f -name '*.la' -delete || die +}
