summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-03-24 23:00:22 +0000
committerSam James <sam@gentoo.org>2022-03-24 23:02:31 +0000
commit295836b2ebe44f18f8c06fcb56e1e22e96da1a55 (patch)
tree63bb1bbc78973be5741668e06d2a6b9dd984d638
parentnet-analyzer/nfdump: fix autoreconf (diff)
downloadgentoo-295836b2ebe44f18f8c06fcb56e1e22e96da1a55.tar.gz
gentoo-295836b2ebe44f18f8c06fcb56e1e22e96da1a55.tar.bz2
gentoo-295836b2ebe44f18f8c06fcb56e1e22e96da1a55.zip
net-analyzer/nfdump: add additional autoconf 2.69+ patches
Let's do a new revision for the more comprehensive upstream autoconf 2.69+ patches (and throwing in the upstream-sent variant of the automake patch given the previous version added to 1.6.23 was partly done upstream already). Could affect installed files and such too of course with major build system changes. Closes: https://bugs.gentoo.org/832420 Signed-off-by: Sam James <sam@gentoo.org>
-rw-r--r--net-analyzer/nfdump/files/nfdump-1.6.23-autotools.patch216
-rw-r--r--net-analyzer/nfdump/files/nfdump-1.6.23-m4-dir-automake.patch23
-rw-r--r--net-analyzer/nfdump/nfdump-1.6.23-r1.ebuild84
3 files changed, 323 insertions, 0 deletions
diff --git a/net-analyzer/nfdump/files/nfdump-1.6.23-autotools.patch b/net-analyzer/nfdump/files/nfdump-1.6.23-autotools.patch
new file mode 100644
index 000000000000..65558bbe7dfa
--- /dev/null
+++ b/net-analyzer/nfdump/files/nfdump-1.6.23-autotools.patch
@@ -0,0 +1,216 @@
+https://github.com/phaag/nfdump/commit/e6261098570f69ad973a7a4ea7aaebb1663712e8
+https://github.com/phaag/nfdump/commit/67da975f20076751bce49caf57c89ed21ed92ad0
+https://github.com/phaag/nfdump/commit/4652c2014012a81438f53cb590687c8c93419140
+
+From: Peter Haag <flow-dev@pyxis.ch>
+Date: Tue, 22 Feb 2022 10:54:19 +0100
+Subject: [PATCH] Fix issue #304 - accept CFLAGS
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -8,8 +8,11 @@ AC_INIT(nfdump, 1.6.23, peter@people.ops-trust.net)
+ AC_CONFIG_HEADER([config.h])
+ AM_INIT_AUTOMAKE([subdir-objects])
+
++if test "x$CFLAGS" = "x"; then
++ CFLAGS="-g -O3"
++fi
++
+ # Checks for programs.
+-CFLAGS="-g -O3"
+ AC_PROG_CC([clang gcc])
+ AX_CHECK_C11
+ CFLAGS="$CFLAGS -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn -fno-strict-aliasing"
+
+From: Peter Haag <peter@people.ops-trust.net>
+Date: Fri, 25 Feb 2022 09:12:27 +0100
+Subject: [PATCH] Cleanup automake files. Fixes #304.
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -1,12 +1,13 @@
+ # -*- Autoconf -*-
+ # Process this file with autoconf to produce a configure script.
+
+-AC_PREREQ(2.59)
++AC_PREREQ([2.71])
+ AC_REVISION($Revision: 244 $)dnl
+-AC_INIT(nfdump, 1.6.23, peter@people.ops-trust.net)
++AC_INIT([nfdump],[1.6.23],[peter@people.ops-trust.net])
+
+-AC_CONFIG_HEADER([config.h])
++AC_CONFIG_HEADERS([config.h])
+ AM_INIT_AUTOMAKE([subdir-objects])
++AC_CONFIG_MACRO_DIRS([m4])
+
+ if test "x$CFLAGS" = "x"; then
+ CFLAGS="-g -O3"
+@@ -15,7 +16,12 @@ fi
+ # Checks for programs.
+ AC_PROG_CC([clang gcc])
+ AX_CHECK_C11
+-CFLAGS="$CFLAGS -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn -fno-strict-aliasing"
++AX_APPEND_FLAG([-Wall], [CFLAGS])
++AX_APPEND_FLAG([-Wstrict-prototypes], [CFLAGS])
++AX_APPEND_FLAG([-Wmissing-prototypes], [CFLAGS])
++AX_APPEND_FLAG([-Wmissing-declarations], [CFLAGS])
++AX_APPEND_FLAG([-Wmissing-noreturn], [CFLAGS])
++AX_APPEND_FLAG([-fno-strict-aliasing], [CFLAGS])
+
+ LT_INIT
+
+@@ -59,7 +65,7 @@ if test "${enable_fixtimebug}" = "yes" ; then
+ fi
+
+ AC_PROG_YACC
+-AC_PROG_LEX
++AC_PROG_LEX(yywrap)
+ which $LEX > /dev/null 2>&1
+ if test $? = 1; then
+ AC_MSG_ERROR(No lex or flex found on system)
+@@ -312,7 +318,11 @@ AC_LINK_IFELSE(
+
+ # Checks for header files.
+ AC_HEADER_DIRENT
+-AC_HEADER_STDC
++# Autoupdate added the next two lines to ensure that your configure
++# script's behavior did not change. They are probably safe to remove.
++AC_CHECK_INCLUDES_DEFAULT
++AC_PROG_EGREP
++
+ AC_CHECK_HEADERS(stdio_ext.h)
+ AC_CHECK_HEADERS([nameser8_compat.h])
+ AC_CHECK_HEADERS([features.h arpa/inet.h fcntl.h netinet/in.h fts.h stdint.h stdlib.h stddef.h string.h sys/socket.h syslog.h unistd.h iso/limits_iso.h])
+@@ -404,17 +414,14 @@ AC_CHECK_FUNCS(memcmp memcpy memmove memset)
+ AC_MSG_CHECKING([for union semun])
+ AC_CACHE_VAL(ac_cv_struct_semun,
+ [
+- AC_TRY_COMPILE(
+- [
++ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ #include <sys/types.h>
+ #include <sys/ipc.h>
+ #include <sys/sem.h>;
+- ],
+- [
++ ]], [[
+ union semun semdat;
+- ],
+- ac_cv_struct_semun=yes, ac_cv_struct_semun=no
+- )
++ ]])],[ac_cv_struct_semun=yes],[ac_cv_struct_semun=no
++ ])
+ ]
+ )
+
+@@ -424,7 +431,7 @@ if test "$ac_cv_struct_semun" = "yes"; then
+ fi
+
+ AC_MSG_CHECKING(for the %z format string in printf())
+-AC_TRY_RUN([
++AC_RUN_IFELSE([AC_LANG_SOURCE([[
+ #include <stdio.h>
+ #include <sys/types.h>
+
+@@ -438,28 +445,38 @@ char string[16];
+
+ return i == 5 ? 0 : 1;
+ }
+-],
+-[
++]])],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE([HAVE_SIZE_T_Z_FORMAT], [1],
+ [Define to 1 if you have a printf() that supports the %z format string.])
+-],
+-[
++],[
+ AC_MSG_RESULT(no)
+-],
+-[
++],[
+ AC_MSG_RESULT(no)
+-]
+-)
+
++])
++
++AC_CONFIG_FILES([Makefile bin/Makefile man/Makefile])
++AC_CONFIG_FILES([doc/Makefile])
+ AC_PATH_PROG([DOXYGEN], [doxygen], [])
+ AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])
+ AM_COND_IF([HAVE_DOXYGEN], AC_CONFIG_FILES([doc/Doxyfile]))
+-AC_OUTPUT(doc/Makefile)
+-
+-#AC_CONFIG_FILES([Makefile])
+-AC_OUTPUT(Makefile bin/Makefile man/Makefile)
++AC_OUTPUT
+
++echo ""
++echo "----------------------------------"
++echo " Build Settings for ${PACKAGE_TARNAME} v${PACKAGE_VERSION}"
++echo "----------------------------------"
++echo " host type = $host_os"
++echo " install dir = $prefix"
++echo " CC = $CC"
++echo " CFLAGS = $AM_CFLAGS $CFLAGS"
++echo " CPPFLAGS = $AM_CPPFLAGS $CPPFLAGS"
++echo " LDFLAGS = $AM_LDFLAGS $LDFLAGS"
++echo " LIBS = $LIBS"
++echo "----------------------------------"
++echo ""
++echo " You can run ./make now."
+ echo ""
+ echo "* Many thanks for using nfdump tools"
+ echo "* Please send bug reports back to me: peter@people.ops-trust.net"
+
+From: Peter Haag <peter@people.ops-trust.net>
+Date: Thu, 3 Mar 2022 09:25:15 +0100
+Subject: [PATCH] Make configure.ac autoconf 2.69 compatible
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -1,7 +1,7 @@
+ # -*- Autoconf -*-
+ # Process this file with autoconf to produce a configure script.
+
+-AC_PREREQ([2.71])
++AC_PREREQ([2.69])
+ AC_REVISION($Revision: 244 $)dnl
+ AC_INIT([nfdump],[1.6.23],[peter@people.ops-trust.net])
+
+@@ -47,7 +47,7 @@ if test "${enable_jnat}" = "yes" ; then
+ fi
+
+ if test "${enable_nsel}" = "yes" -a "${enable_jnat}" = "yes"; then
+- AC_MSG_ERROR(You can use only one of --enable-nsel or --enable-jnat. CISCO and Juniper are not compatible.)
++ AC_MSG_ERROR([You can use only one of --enable-nsel or --enable-jnat. CISCO and Juniper are not compatible.])
+ fi
+
+ AC_ARG_ENABLE(nel,
+@@ -287,7 +287,6 @@ AC_SUBST(FT_INCLUDES)
+ AC_SUBST(FT_LDFLAGS)
+ AC_SUBST(LFLAGS)
+
+-
+ # Checks for libraries.
+ AC_CHECK_FUNCS(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname,,[AC_CHECK_LIB(socket,gethostbyname)])])
+ AC_CHECK_FUNCS(setsockopt,,[AC_CHECK_LIB(socket,setsockopt)])
+@@ -447,8 +446,7 @@ char string[16];
+ }
+ ]])],[
+ AC_MSG_RESULT(yes)
+- AC_DEFINE([HAVE_SIZE_T_Z_FORMAT], [1],
+- [Define to 1 if you have a printf() that supports the %z format string.])
++ AC_DEFINE([HAVE_SIZE_T_Z_FORMAT], [1], [Define to 1 if you have a printf() that supports the %z format string.])
+ ],[
+ AC_MSG_RESULT(no)
+ ],[
+--- /dev/null
++++ b/m4/extensions.m4
+@@ -0,0 +1,4 @@
++dnl Define to empty for the benefit of Autoconf 2.69
++dnl AC_USE_SYSTEM_EXTENSIONS (below) can be used unchanged from Autoconf 2.70+.
++m4_ifndef([AC_CHECK_INCLUDES_DEFAULT],
++ [AC_DEFUN([AC_CHECK_INCLUDES_DEFAULT], [])])
+
diff --git a/net-analyzer/nfdump/files/nfdump-1.6.23-m4-dir-automake.patch b/net-analyzer/nfdump/files/nfdump-1.6.23-m4-dir-automake.patch
new file mode 100644
index 000000000000..755db8b7cf5d
--- /dev/null
+++ b/net-analyzer/nfdump/files/nfdump-1.6.23-m4-dir-automake.patch
@@ -0,0 +1,23 @@
+https://github.com/phaag/nfdump/pull/336
+
+From e882722e4e006d0440fb5a37fb051d4747e4f225 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Thu, 24 Mar 2022 22:50:13 +0000
+Subject: [PATCH] Makefile.am: add ACLOCAL_AMFLAGS
+
+Per autoconf docs [0], if using automake and AC_CONFIG_MACRO_DIR,
+we need to include ACLOCAL_AMFLAGS in Makefile.am.
+
+So, let's set ACLOCAL_AMFLAGS = -I m4.
+
+This sorts out an automake warning.
+
+Signed-off-by: Sam James <sam@gentoo.org>
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1,3 +1,4 @@
++ACLOCAL_AMFLAGS = -I m4
+
+ SUBDIRS = . bin man doc
+
+
diff --git a/net-analyzer/nfdump/nfdump-1.6.23-r1.ebuild b/net-analyzer/nfdump/nfdump-1.6.23-r1.ebuild
new file mode 100644
index 000000000000..198f7e8eb909
--- /dev/null
+++ b/net-analyzer/nfdump/nfdump-1.6.23-r1.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools toolchain-funcs
+
+DESCRIPTION="A set of tools to collect and process netflow data"
+HOMEPAGE="https://github.com/phaag/nfdump"
+SRC_URI="https://github.com/phaag/nfdump/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0/${PV}"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc jnat ftconv nfpcapd nfprofile nftrack nsel readpcap sflow"
+
+REQUIRED_USE="?? ( jnat nsel )"
+
+RDEPEND="
+ app-arch/bzip2
+ sys-libs/zlib
+ ftconv? ( net-analyzer/flow-tools )
+ nfpcapd? ( net-libs/libpcap )
+ nfprofile? ( net-analyzer/rrdtool )
+ nftrack? ( net-analyzer/rrdtool )
+ readpcap? ( net-libs/libpcap )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ sys-devel/flex
+ virtual/yacc
+ doc? (
+ app-doc/doxygen
+ media-gfx/graphviz
+ )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-autotools.patch
+ "${FILESDIR}"/${P}-m4-dir-automake.patch
+ "${FILESDIR}"/${PN}-1.6.19-libft.patch
+)
+
+DOCS=( AUTHORS ChangeLog README.md )
+
+src_prepare() {
+ default
+
+ eautoreconf
+
+ if use doc; then
+ doxygen -u doc/Doxyfile.in || die
+ fi
+}
+
+src_configure() {
+ tc-export CC
+
+ # --without-ftconf is not handled well, bug #322201
+ econf \
+ $(use ftconv && echo "--enable-ftconv --with-ftpath=/usr") \
+ $(use nfpcapd && echo --enable-nfpcapd) \
+ $(use nfprofile && echo --enable-nfprofile) \
+ $(use nftrack && echo --enable-nftrack) \
+ $(use_enable debug devel) \
+ $(use_enable jnat) \
+ $(use_enable nsel) \
+ $(use_enable readpcap) \
+ $(use_enable sflow) \
+ --disable-static
+}
+
+src_install() {
+ default
+
+ find "${ED}" -name '*.la' -delete || die
+
+ newinitd "${FILESDIR}"/nfcapd.initd nfcapd
+ newconfd "${FILESDIR}"/nfcapd.confd nfcapd
+
+ if use doc; then
+ dodoc -r doc/html
+ fi
+}