--- /var/repositories/gentoo/net-misc/l7-filter/l7-filter-2.13.ebuild 2007-08-09 10:22:39.000000000 +0200 +++ l7-filter-2.13-r1.ebuild 2007-09-25 15:04:33.000000000 +0200 @@ -19,6 +19,35 @@ S=${WORKDIR}/${MY_P} RDEPEND="net-misc/l7-protocols" +kernel_warning() { + ewarn "This may not work with all kernels. If it does not work please enter a bug at bugs.gentoo.org" + ewarn "This only patches the current kernel source code. (${KV_DIR})" + ewarn "Its up to you to recompile the kernel with the l7 options" + ewarn + ewarn "You will also need to emerge iptables with the \"extensions\" or" + ewarn "\"l7filter\" USE flag (depend which version of iptables you emerge)" +} + +nf_ct_acct_check() { + ebegin "Checking for Connection tracking flow accounting support" + linux_chkconfig_present NF_CT_ACCT + eend $? + + if [[ $? -ne 0 ]] ; then + ewarn "To successfully build the l7 patched kernel you need" + ewarn "Connection tracking flow accounting support." + ewarn + ewarn "Please enable Connection tracking flow accounting support" + ewarn "in your kernel config, found at:" + ewarn + ewarn " Networking" + ewarn " Networking Options" + ewarn " Network packet filtering framework (Netfilter)" + ewarn " Core Netfilter Configuration" + ewarn " [*] Connection tracking flow accounting" + fi +} + which_patch() { if kernel_is ge 2 6 22 then @@ -55,7 +84,7 @@ pkg_setup() { linux-info_pkg_setup pkg_preinstall - pkg_postinst + kernel_warning } src_unpack() { @@ -137,12 +166,8 @@ } pkg_postinst() { - ewarn "This may not work with all kernels. If it does not work please enter a bug at bugs.gentoo.org" - ewarn "This only patches the current kernel source code. (${KV_DIR})" - ewarn "Its up to you to recompile the kernel with the l7 options" - ewarn - ewarn 'You will also need to emerge iptables with the "extensions" or' - ewarn '"l7filter" USE flag (depend which version of iptables you emerge)' + kernel_warning + nf_ct_acct_check } #