Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-firewall/ipset/
Date: Tue, 24 Aug 2021 13:17:56
Message-Id: 1629809753.3ceb1c94794704204aa5ee883a26e2b297efeac9.whissi@gentoo
1 commit: 3ceb1c94794704204aa5ee883a26e2b297efeac9
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Tue Aug 24 12:55:53 2021 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Tue Aug 24 12:55:53 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3ceb1c94
7
8 net-firewall/ipset: bump to v7.15
9
10 Package-Manager: Portage-3.0.22, Repoman-3.0.3
11 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
12
13 net-firewall/ipset/Manifest | 1 +
14 net-firewall/ipset/ipset-7.15.ebuild | 114 +++++++++++++++++++++++++++++++++++
15 2 files changed, 115 insertions(+)
16
17 diff --git a/net-firewall/ipset/Manifest b/net-firewall/ipset/Manifest
18 index 0ce4248892d..7ce421de4ea 100644
19 --- a/net-firewall/ipset/Manifest
20 +++ b/net-firewall/ipset/Manifest
21 @@ -1 +1,2 @@
22 DIST ipset-7.11.tar.bz2 674100 BLAKE2B 97f2e3372e963654ece511960e8c22d0dd9e29376d087a3767d89544dfbd85f9f9e75e0cc6c4eb9e1d813d1a472a410033a76feef3319b1d87fd51b0c3fd97cd SHA512 20890de32c17c04d9d3ae42fff64acfe21a252974bee5843ae39bdda707fcef55fde11cffccab9f987bf7e18f5445443c46c50eb854fb6f93f172f7bad07f922
23 +DIST ipset-7.15.tar.bz2 680383 BLAKE2B 10acff9741370ad80a2845605be1be4f691e987b271f4dcf1fab3abfe158c63c7d39e6b3453ba7cd361dee3df92f85419cfb70806a71b6806555f6571c70b1ed SHA512 0fc936d971c30a0925c585d506c8840e782fdaeec09bc8fd249e874fe838fa55a4dbb697f6e1423a6769abf07a1ce2195abc37cb641e8e4ad70f1b4c7130916a
24
25 diff --git a/net-firewall/ipset/ipset-7.15.ebuild b/net-firewall/ipset/ipset-7.15.ebuild
26 new file mode 100644
27 index 00000000000..b37a716c182
28 --- /dev/null
29 +++ b/net-firewall/ipset/ipset-7.15.ebuild
30 @@ -0,0 +1,114 @@
31 +# Copyright 1999-2021 Gentoo Authors
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI="7"
35 +MODULES_OPTIONAL_USE=modules
36 +inherit autotools linux-info linux-mod systemd
37 +
38 +DESCRIPTION="IPset tool for iptables, successor to ippool"
39 +HOMEPAGE="https://ipset.netfilter.org/"
40 +SRC_URI="https://ipset.netfilter.org/${P}.tar.bz2"
41 +
42 +LICENSE="GPL-2"
43 +SLOT="0"
44 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~x86"
45 +
46 +BDEPEND="virtual/pkgconfig"
47 +
48 +RDEPEND=">=net-firewall/iptables-1.4.7
49 + net-libs/libmnl:="
50 +DEPEND="${RDEPEND}"
51 +
52 +DOCS=( ChangeLog INSTALL README UPGRADE )
53 +
54 +PATCHES=( "${FILESDIR}"/${PN}-7.4-fix-pkgconfig-dir.patch )
55 +
56 +# configurable from outside, e.g. /etc/portage/make.conf
57 +IP_NF_SET_MAX=${IP_NF_SET_MAX:-256}
58 +
59 +BUILD_TARGETS="modules"
60 +MODULE_NAMES_ARG="kernel/net/netfilter/ipset/:${S}/kernel/net/netfilter/ipset"
61 +MODULE_NAMES="xt_set(kernel/net/netfilter/ipset/:${S}/kernel/net/netfilter/)"
62 +MODULE_NAMES+=" em_ipset(kernel/net/sched/:${S}/kernel/net/sched/)"
63 +for i in ip_set{,_bitmap_{ip{,mac},port},_hash_{ip{,mac,mark,port{,ip,net}},mac,net{,port{,net},iface,net}},_list_set}; do
64 + MODULE_NAMES+=" ${i}(${MODULE_NAMES_ARG})"
65 +done
66 +
67 +pkg_setup() {
68 + get_version
69 + CONFIG_CHECK="NETFILTER"
70 + ERROR_NETFILTER="ipset requires NETFILTER support in your kernel."
71 + CONFIG_CHECK+=" NETFILTER_NETLINK"
72 + ERROR_NETFILTER_NETLINK="ipset requires NETFILTER_NETLINK support in your kernel."
73 + # It does still build without NET_NS, but it may be needed in future.
74 + #CONFIG_CHECK="${CONFIG_CHECK} NET_NS"
75 + #ERROR_NET_NS="ipset requires NET_NS (network namespace) support in your kernel."
76 + CONFIG_CHECK+=" !PAX_CONSTIFY_PLUGIN"
77 + ERROR_PAX_CONSTIFY_PLUGIN="ipset contains constified variables (#614896)"
78 +
79 + build_modules=0
80 + if use modules; then
81 + if linux_config_src_exists && linux_chkconfig_builtin "MODULES" ; then
82 + if linux_chkconfig_present "IP_NF_SET" || \
83 + linux_chkconfig_present "IP_SET"; then #274577
84 + eerror "There is IP{,_NF}_SET or NETFILTER_XT_SET support in your kernel."
85 + eerror "Please either build ipset with modules USE flag disabled"
86 + eerror "or rebuild kernel without IP_SET support and make sure"
87 + eerror "there is NO kernel ip_set* modules in /lib/modules/<your_kernel>/... ."
88 + die "USE=modules and in-kernel ipset support detected."
89 + else
90 + einfo "Modular kernel detected. Gonna build kernel modules..."
91 + build_modules=1
92 + fi
93 + else
94 + eerror "Nonmodular kernel detected, but USE=modules. Either build"
95 + eerror "modular kernel (without IP_SET) or disable USE=modules"
96 + die "Nonmodular kernel detected, will not build kernel modules"
97 + fi
98 + fi
99 + [[ ${build_modules} -eq 1 ]] && linux-mod_pkg_setup
100 +}
101 +
102 +src_prepare() {
103 + default
104 +
105 + eautoreconf
106 +}
107 +
108 +src_configure() {
109 + econf \
110 + $(use_with modules kmod) \
111 + --disable-static \
112 + --with-maxsets=${IP_NF_SET_MAX} \
113 + --libdir="${EPREFIX}/$(get_libdir)" \
114 + --with-ksource="${KV_DIR}" \
115 + --with-kbuild="${KV_OUT_DIR}"
116 +}
117 +
118 +src_compile() {
119 + einfo "Building userspace"
120 + emake
121 +
122 + if [[ ${build_modules} -eq 1 ]]; then
123 + einfo "Building kernel modules"
124 + set_arch_to_kernel
125 + emake modules
126 + fi
127 +}
128 +
129 +src_install() {
130 + einfo "Installing userspace"
131 + default
132 +
133 + find "${ED}" -name '*.la' -delete || die
134 +
135 + newinitd "${FILESDIR}"/ipset.initd-r4 ${PN}
136 + newconfd "${FILESDIR}"/ipset.confd ${PN}
137 + systemd_newunit "${FILESDIR}"/ipset.systemd ${PN}.service
138 + keepdir /var/lib/ipset
139 +
140 + if [[ ${build_modules} -eq 1 ]]; then
141 + einfo "Installing kernel modules"
142 + linux-mod_src_install
143 + fi
144 +}