Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-firewall/xtables-addons/
Date: Sat, 07 Mar 2020 14:04:15
Message-Id: 1583589820.696dd253d308635661c5d9404c6397e0d246043a.blueness@gentoo
1 commit: 696dd253d308635661c5d9404c6397e0d246043a
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Sat Mar 7 14:03:40 2020 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Sat Mar 7 14:03:40 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=696dd253
7
8 net-firewall/xtables-addons: version bump to 3.8 and 3.9
9
10 Package-Manager: Portage-2.3.84, Repoman-2.3.20
11 Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org>
12
13 net-firewall/xtables-addons/Manifest | 2 +
14 .../xtables-addons/xtables-addons-3.8.ebuild | 189 +++++++++++++++++++++
15 .../xtables-addons/xtables-addons-3.9.ebuild | 189 +++++++++++++++++++++
16 3 files changed, 380 insertions(+)
17
18 diff --git a/net-firewall/xtables-addons/Manifest b/net-firewall/xtables-addons/Manifest
19 index 2127f3c55f9..0021a7e2232 100644
20 --- a/net-firewall/xtables-addons/Manifest
21 +++ b/net-firewall/xtables-addons/Manifest
22 @@ -1,2 +1,4 @@
23 DIST xtables-addons-2.13.tar.xz 322116 BLAKE2B 31d12adcfdf2043b44b5789f3ba3215197ff48d378b20fd6406f6afd22739e04069f08f32214a2230ec797469b236788dbebef079855539994db69be358ec421 SHA512 51cfa963d6f2f931b0361746e0b48f5ecf43a14e9e8d5297ef55faf0e9f8d1deb4641e88e3fea2afdbb3e39dd06d414de6057fb4a21e5184d4ea3d21b8028497
24 DIST xtables-addons-3.7.tar.xz 325124 BLAKE2B e7f0bff03f0b77b55cd578c5a77ab4a306fa5a5cfd3b7e5b801b60d4ccc2c5a476fee2b04f4cb8db4b3ab34c7dab353ec13cba1fe98a714cfbb2e89e3110841d SHA512 336f19596251507a88d7c399f9a3e6f517e4b72787ff7e7108e20e42e68932bca0eed79c54ddfa92112daae73a94a7349a874bcf993bd4abea1d875d7f2b8565
25 +DIST xtables-addons-3.8.tar.xz 324468 BLAKE2B e460e0dc7fcd7037610b44132628b3c39c81477c2e1ef345d939f1c4d5981517789f240d1d2233c6a8e962e326ff9a25c5e66dcf829fb23db66dc8cd78b076d6 SHA512 2e0594ee0e654a19e6bae4f7acb7efd142957418ed44ce92ecd7474bb2f0bfd8dad684be937e8f6ed28395f9d7a6dbea61e7c3259d7b89c05ab10bcad3c04264
26 +DIST xtables-addons-3.9.tar.xz 324380 BLAKE2B d78afec65647c9b83b16e591b3cf6827748d70c02b381c30ee1751aadca6397fcbbe4e7f8e1e9199ae93b07e37ae333358e677b89d2b2c62adeb01e345ce2a33 SHA512 ec7d2ec97c433eb94b893aedfd346393986ef140d7ff95cd8be070cfa397efd87df7d73d36359b81c80618eb8575282a1ea8624c3bf182ddd60d8975f58579b5
27
28 diff --git a/net-firewall/xtables-addons/xtables-addons-3.8.ebuild b/net-firewall/xtables-addons/xtables-addons-3.8.ebuild
29 new file mode 100644
30 index 00000000000..ef77b6f7711
31 --- /dev/null
32 +++ b/net-firewall/xtables-addons/xtables-addons-3.8.ebuild
33 @@ -0,0 +1,189 @@
34 +# Copyright 1999-2020 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI="7"
38 +
39 +MODULES_OPTIONAL_USE=modules
40 +MODULES_OPTIONAL_USE_IUSE_DEFAULT=1
41 +inherit eutils linux-info linux-mod multilib toolchain-funcs
42 +
43 +DESCRIPTION="iptables extensions not yet accepted in the main kernel"
44 +HOMEPAGE="http://xtables-addons.sourceforge.net/"
45 +SRC_URI="mirror://sourceforge/xtables-addons/${P}.tar.xz"
46 +
47 +LICENSE="GPL-2"
48 +SLOT="0"
49 +KEYWORDS="~amd64 ~x86"
50 +
51 +MODULES="quota2 psd pknock lscan length2 ipv4options ipp2p iface gradm geoip fuzzy condition tarpit sysrq logmark ipmark echo dnetmap dhcpmac delude chaos account"
52 +
53 +for mod in ${MODULES}; do
54 + IUSE="${IUSE} xtables_addons_${mod}"
55 +done
56 +
57 +DEPEND=">=net-firewall/iptables-1.6.0"
58 +
59 +RDEPEND="${DEPEND}
60 + xtables_addons_geoip? (
61 + app-arch/unzip
62 + dev-perl/Net-CIDR-Lite
63 + dev-perl/Text-CSV_XS
64 + virtual/perl-Getopt-Long
65 + )
66 +"
67 +
68 +DEPEND="${DEPEND}
69 + virtual/linux-sources"
70 +
71 +SKIP_MODULES=""
72 +
73 +XA_check4internal_module() {
74 + local mod=${1}
75 + local version=${3}
76 + local kconfigname=${3}
77 +
78 + if use xtables_addons_${mod} && kernel_is -gt ${version}; then
79 + ewarn "${kconfigname} should be provided by the kernel. Skipping its build..."
80 + if ! linux_chkconfig_present ${kconfigname}; then
81 + ewarn "Please enable ${kconfigname} target in your kernel
82 + configuration or disable checksum module in ${PN}."
83 + fi
84 + # SKIP_MODULES in case we need to disable building of everything
85 + # like having this USE disabled
86 + SKIP_MODULES+=" ${mod}"
87 + fi
88 +}
89 +
90 +pkg_setup() {
91 + if use modules; then
92 + get_version
93 + check_modules_supported
94 + CONFIG_CHECK="NF_CONNTRACK NF_CONNTRACK_MARK ~CONNECTOR"
95 + ERROR_CONNECTOR="Please, enable CONFIG_CONNECTOR if you wish to receive userspace notifications from pknock through netlink/connector"
96 + linux-mod_pkg_setup
97 +
98 + if ! linux_chkconfig_present IPV6; then
99 + SKIP_IPV6_MODULES="ip6table_rawpost"
100 + ewarn "No IPV6 support in kernel. Disabling: ${SKIP_IPV6_MODULES}"
101 + fi
102 + kernel_is -lt 4 18 && die "${P} requires kernel version >= 4.18"
103 + fi
104 +}
105 +
106 +# Helper for maintainer: cheks if all possible MODULES are listed.
107 +XA_qa_check() {
108 + local all_modules
109 + all_modules=$(sed -n '/^build_/{s/build_\(.*\)=.*/\L\1/;G;s/\n/ /;s/ $//;h}; ${x;p}' "${S}/mconfig")
110 + if [[ ${all_modules} != ${MODULES} ]]; then
111 + ewarn "QA: Modules in mconfig differ from \$MODULES in ebuild."
112 + ewarn "Please, update MODULES in ebuild."
113 + ewarn "'${all_modules}'"
114 + fi
115 +}
116 +
117 +# Is there any use flag set?
118 +XA_has_something_to_build() {
119 + local mod
120 + for mod in ${MODULES}; do
121 + use xtables_addons_${mod} && return
122 + done
123 +
124 + eerror "All modules are disabled. What do you want me to build?"
125 + eerror "Please, set XTABLES_ADDONS to any combination of"
126 + eerror "${MODULES}"
127 + die "All modules are disabled."
128 +}
129 +
130 +# Parse Kbuid files and generates list of sources
131 +XA_get_module_name() {
132 + [[ $# != 1 ]] && die "XA_get_sources_for_mod: needs exactly one argument."
133 + local mod objdir build_mod sources_list
134 + mod=${1}
135 + objdir=${S}/extensions
136 + # Take modules name from mconfig
137 + build_mod=$(sed -n "s/\(build_${mod}\)=.*/\1/Ip" "${S}/mconfig")
138 + # strip .o, = and everything before = and print
139 + sources_list=$(sed -n "/^obj-[$][{]${build_mod}[}]/\
140 + {s:obj-[^+]\+ [+]=[[:space:]]*::;s:[.]o::g;p}" \
141 + "${objdir}/Kbuild")
142 +
143 + if [[ -d ${S}/extensions/${sources_list} ]]; then
144 + objdir=${S}/extensions/${sources_list}
145 + sources_list=$(sed -n "/^obj-m/\
146 + {s:obj-[^+]\+ [+]=[[:space:]]*::;s:[.]o::g;p}" \
147 + "${objdir}/Kbuild")
148 + fi
149 + for mod_src in ${sources_list}; do
150 + has ${mod_src} ${SKIP_IPV6_MODULES} || \
151 + echo " ${mod_src}(xtables_addons:${S}/extensions:${objdir})"
152 + done
153 +}
154 +
155 +# Die on modules known to fail on certain kernel version.
156 +XA_known_failure() {
157 + local module_name=$1
158 + local KV_max=$2
159 +
160 + if use xtables_addons_${module_name} && kernel_is ge ${KV_max//./ }; then
161 + eerror
162 + eerror "XTABLES_ADDONS=${module_name} fails to build on linux ${KV_max} or above."
163 + eerror "Either remove XTABLES_ADDONS=${module_name} or use an earlier version of the kernel."
164 + eerror
165 + die
166 + fi
167 +}
168 +
169 +src_prepare() {
170 + XA_qa_check
171 + XA_has_something_to_build
172 +
173 + # Bug #553630#c2. echo fails on linux-4 and above.
174 + # This appears to be fixed, at least as of linux-4.2
175 + # XA_known_failure "echo" 4
176 +
177 + local mod module_name
178 + if use modules; then
179 + MODULE_NAMES="compat_xtables(xtables_addons:${S}/extensions:)"
180 + fi
181 + for mod in ${MODULES}; do
182 + if ! has ${mod} ${SKIP_MODULES} && use xtables_addons_${mod}; then
183 + sed "s/\(build_${mod}=\).*/\1m/I" -i mconfig || die
184 + if use modules; then
185 + for module_name in $(XA_get_module_name ${mod}); do
186 + MODULE_NAMES+=" ${module_name}"
187 + done
188 + fi
189 + else
190 + sed "s/\(build_${mod}=\).*/\1n/I" -i mconfig || die
191 + fi
192 + done
193 + einfo "${MODULE_NAMES}" # for debugging
194 +
195 + sed -e 's/depmod -a/true/' -i Makefile.in || die
196 + sed -e '/^all-local:/{s: modules::}' \
197 + -e '/^install-exec-local:/{s: modules_install::}' \
198 + -i extensions/Makefile.in || die
199 +
200 + use xtables_addons_geoip || sed -e '/^SUBDIRS/{s/geoip//}' -i Makefile.in
201 +
202 + eapply_user
203 +}
204 +
205 +src_configure() {
206 + set_arch_to_kernel # .. or it'll look for /arch/amd64/Makefile
207 + econf --prefix="${EPREFIX}/" \
208 + --libexecdir="${EPREFIX}/$(get_libdir)/" \
209 + --with-kbuild="${KV_OUT_DIR}"
210 +}
211 +
212 +src_compile() {
213 + emake CFLAGS="${CFLAGS}" CC="$(tc-getCC)" V=1
214 + use modules && BUILD_PARAMS="V=1" BUILD_TARGETS="modules" linux-mod_src_compile
215 +}
216 +
217 +src_install() {
218 + emake DESTDIR="${D}" install
219 + use modules && linux-mod_src_install
220 + dodoc -r README doc/*
221 + find "${ED}" -type f -name '*.la' -exec rm -rf '{}' '+'
222 +}
223
224 diff --git a/net-firewall/xtables-addons/xtables-addons-3.9.ebuild b/net-firewall/xtables-addons/xtables-addons-3.9.ebuild
225 new file mode 100644
226 index 00000000000..ef77b6f7711
227 --- /dev/null
228 +++ b/net-firewall/xtables-addons/xtables-addons-3.9.ebuild
229 @@ -0,0 +1,189 @@
230 +# Copyright 1999-2020 Gentoo Authors
231 +# Distributed under the terms of the GNU General Public License v2
232 +
233 +EAPI="7"
234 +
235 +MODULES_OPTIONAL_USE=modules
236 +MODULES_OPTIONAL_USE_IUSE_DEFAULT=1
237 +inherit eutils linux-info linux-mod multilib toolchain-funcs
238 +
239 +DESCRIPTION="iptables extensions not yet accepted in the main kernel"
240 +HOMEPAGE="http://xtables-addons.sourceforge.net/"
241 +SRC_URI="mirror://sourceforge/xtables-addons/${P}.tar.xz"
242 +
243 +LICENSE="GPL-2"
244 +SLOT="0"
245 +KEYWORDS="~amd64 ~x86"
246 +
247 +MODULES="quota2 psd pknock lscan length2 ipv4options ipp2p iface gradm geoip fuzzy condition tarpit sysrq logmark ipmark echo dnetmap dhcpmac delude chaos account"
248 +
249 +for mod in ${MODULES}; do
250 + IUSE="${IUSE} xtables_addons_${mod}"
251 +done
252 +
253 +DEPEND=">=net-firewall/iptables-1.6.0"
254 +
255 +RDEPEND="${DEPEND}
256 + xtables_addons_geoip? (
257 + app-arch/unzip
258 + dev-perl/Net-CIDR-Lite
259 + dev-perl/Text-CSV_XS
260 + virtual/perl-Getopt-Long
261 + )
262 +"
263 +
264 +DEPEND="${DEPEND}
265 + virtual/linux-sources"
266 +
267 +SKIP_MODULES=""
268 +
269 +XA_check4internal_module() {
270 + local mod=${1}
271 + local version=${3}
272 + local kconfigname=${3}
273 +
274 + if use xtables_addons_${mod} && kernel_is -gt ${version}; then
275 + ewarn "${kconfigname} should be provided by the kernel. Skipping its build..."
276 + if ! linux_chkconfig_present ${kconfigname}; then
277 + ewarn "Please enable ${kconfigname} target in your kernel
278 + configuration or disable checksum module in ${PN}."
279 + fi
280 + # SKIP_MODULES in case we need to disable building of everything
281 + # like having this USE disabled
282 + SKIP_MODULES+=" ${mod}"
283 + fi
284 +}
285 +
286 +pkg_setup() {
287 + if use modules; then
288 + get_version
289 + check_modules_supported
290 + CONFIG_CHECK="NF_CONNTRACK NF_CONNTRACK_MARK ~CONNECTOR"
291 + ERROR_CONNECTOR="Please, enable CONFIG_CONNECTOR if you wish to receive userspace notifications from pknock through netlink/connector"
292 + linux-mod_pkg_setup
293 +
294 + if ! linux_chkconfig_present IPV6; then
295 + SKIP_IPV6_MODULES="ip6table_rawpost"
296 + ewarn "No IPV6 support in kernel. Disabling: ${SKIP_IPV6_MODULES}"
297 + fi
298 + kernel_is -lt 4 18 && die "${P} requires kernel version >= 4.18"
299 + fi
300 +}
301 +
302 +# Helper for maintainer: cheks if all possible MODULES are listed.
303 +XA_qa_check() {
304 + local all_modules
305 + all_modules=$(sed -n '/^build_/{s/build_\(.*\)=.*/\L\1/;G;s/\n/ /;s/ $//;h}; ${x;p}' "${S}/mconfig")
306 + if [[ ${all_modules} != ${MODULES} ]]; then
307 + ewarn "QA: Modules in mconfig differ from \$MODULES in ebuild."
308 + ewarn "Please, update MODULES in ebuild."
309 + ewarn "'${all_modules}'"
310 + fi
311 +}
312 +
313 +# Is there any use flag set?
314 +XA_has_something_to_build() {
315 + local mod
316 + for mod in ${MODULES}; do
317 + use xtables_addons_${mod} && return
318 + done
319 +
320 + eerror "All modules are disabled. What do you want me to build?"
321 + eerror "Please, set XTABLES_ADDONS to any combination of"
322 + eerror "${MODULES}"
323 + die "All modules are disabled."
324 +}
325 +
326 +# Parse Kbuid files and generates list of sources
327 +XA_get_module_name() {
328 + [[ $# != 1 ]] && die "XA_get_sources_for_mod: needs exactly one argument."
329 + local mod objdir build_mod sources_list
330 + mod=${1}
331 + objdir=${S}/extensions
332 + # Take modules name from mconfig
333 + build_mod=$(sed -n "s/\(build_${mod}\)=.*/\1/Ip" "${S}/mconfig")
334 + # strip .o, = and everything before = and print
335 + sources_list=$(sed -n "/^obj-[$][{]${build_mod}[}]/\
336 + {s:obj-[^+]\+ [+]=[[:space:]]*::;s:[.]o::g;p}" \
337 + "${objdir}/Kbuild")
338 +
339 + if [[ -d ${S}/extensions/${sources_list} ]]; then
340 + objdir=${S}/extensions/${sources_list}
341 + sources_list=$(sed -n "/^obj-m/\
342 + {s:obj-[^+]\+ [+]=[[:space:]]*::;s:[.]o::g;p}" \
343 + "${objdir}/Kbuild")
344 + fi
345 + for mod_src in ${sources_list}; do
346 + has ${mod_src} ${SKIP_IPV6_MODULES} || \
347 + echo " ${mod_src}(xtables_addons:${S}/extensions:${objdir})"
348 + done
349 +}
350 +
351 +# Die on modules known to fail on certain kernel version.
352 +XA_known_failure() {
353 + local module_name=$1
354 + local KV_max=$2
355 +
356 + if use xtables_addons_${module_name} && kernel_is ge ${KV_max//./ }; then
357 + eerror
358 + eerror "XTABLES_ADDONS=${module_name} fails to build on linux ${KV_max} or above."
359 + eerror "Either remove XTABLES_ADDONS=${module_name} or use an earlier version of the kernel."
360 + eerror
361 + die
362 + fi
363 +}
364 +
365 +src_prepare() {
366 + XA_qa_check
367 + XA_has_something_to_build
368 +
369 + # Bug #553630#c2. echo fails on linux-4 and above.
370 + # This appears to be fixed, at least as of linux-4.2
371 + # XA_known_failure "echo" 4
372 +
373 + local mod module_name
374 + if use modules; then
375 + MODULE_NAMES="compat_xtables(xtables_addons:${S}/extensions:)"
376 + fi
377 + for mod in ${MODULES}; do
378 + if ! has ${mod} ${SKIP_MODULES} && use xtables_addons_${mod}; then
379 + sed "s/\(build_${mod}=\).*/\1m/I" -i mconfig || die
380 + if use modules; then
381 + for module_name in $(XA_get_module_name ${mod}); do
382 + MODULE_NAMES+=" ${module_name}"
383 + done
384 + fi
385 + else
386 + sed "s/\(build_${mod}=\).*/\1n/I" -i mconfig || die
387 + fi
388 + done
389 + einfo "${MODULE_NAMES}" # for debugging
390 +
391 + sed -e 's/depmod -a/true/' -i Makefile.in || die
392 + sed -e '/^all-local:/{s: modules::}' \
393 + -e '/^install-exec-local:/{s: modules_install::}' \
394 + -i extensions/Makefile.in || die
395 +
396 + use xtables_addons_geoip || sed -e '/^SUBDIRS/{s/geoip//}' -i Makefile.in
397 +
398 + eapply_user
399 +}
400 +
401 +src_configure() {
402 + set_arch_to_kernel # .. or it'll look for /arch/amd64/Makefile
403 + econf --prefix="${EPREFIX}/" \
404 + --libexecdir="${EPREFIX}/$(get_libdir)/" \
405 + --with-kbuild="${KV_OUT_DIR}"
406 +}
407 +
408 +src_compile() {
409 + emake CFLAGS="${CFLAGS}" CC="$(tc-getCC)" V=1
410 + use modules && BUILD_PARAMS="V=1" BUILD_TARGETS="modules" linux-mod_src_compile
411 +}
412 +
413 +src_install() {
414 + emake DESTDIR="${D}" install
415 + use modules && linux-mod_src_install
416 + dodoc -r README doc/*
417 + find "${ED}" -type f -name '*.la' -exec rm -rf '{}' '+'
418 +}