summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Volkov <pva@gentoo.org>2008-11-17 11:54:06 +0000
committerPeter Volkov <pva@gentoo.org>2008-11-17 11:54:06 +0000
commitda131b8ba29e38b400d479db2b0cb7c71758ab2b (patch)
tree6e7e4bef0734125d8dfebc6fa96f48f76d7fcf78 /net-analyzer
parentAdded -j1 to emake install as a temporary fix for parallel install problems (... (diff)
downloadgentoo-2-da131b8ba29e38b400d479db2b0cb7c71758ab2b.tar.gz
gentoo-2-da131b8ba29e38b400d479db2b0cb7c71758ab2b.tar.bz2
gentoo-2-da131b8ba29e38b400d479db2b0cb7c71758ab2b.zip
Fixed build issue with libpcap-1.0.0, bug #247128, thank Matthias Liebig for report and fix. Changed a bit patches so everything respect CC, CFLAGS and etc... Added patch from debian to make regexps respect locale.
(Portage version: 2.2_rc14/cvs/Linux 2.6.26-openvz.git-35f41f1 i686)
Diffstat (limited to 'net-analyzer')
-rw-r--r--net-analyzer/ngrep/ChangeLog11
-rw-r--r--net-analyzer/ngrep/files/ngrep-1.45-build-fixes.patch191
-rw-r--r--net-analyzer/ngrep/files/ngrep-1.45-setlocale.patch23
-rw-r--r--net-analyzer/ngrep/ngrep-1.45-r2.ebuild45
4 files changed, 269 insertions, 1 deletions
diff --git a/net-analyzer/ngrep/ChangeLog b/net-analyzer/ngrep/ChangeLog
index d133fa5678a1..7e19f9de6995 100644
--- a/net-analyzer/ngrep/ChangeLog
+++ b/net-analyzer/ngrep/ChangeLog
@@ -1,6 +1,15 @@
# ChangeLog for net-analyzer/ngrep
# Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/ngrep/ChangeLog,v 1.53 2008/09/10 10:42:44 pva Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/ngrep/ChangeLog,v 1.54 2008/11/17 11:54:06 pva Exp $
+
+*ngrep-1.45-r2 (17 Nov 2008)
+
+ 17 Nov 2008; Peter Volkov <pva@gentoo.org>
+ +files/ngrep-1.45-build-fixes.patch, +files/ngrep-1.45-setlocale.patch,
+ +ngrep-1.45-r2.ebuild:
+ Fixed build issue with libpcap-1.0.0, bug #247128, thank Matthias Liebig
+ for report and fix. Changed a bit patches so everything respect CC, CFLAGS
+ and etc... Added patch from debian to make regexps respect locale.
10 Sep 2008; Peter Volkov <pva@gentoo.org> ngrep-1.45-r1.ebuild:
enewuser/enewgroup die on their own, no need to || die
diff --git a/net-analyzer/ngrep/files/ngrep-1.45-build-fixes.patch b/net-analyzer/ngrep/files/ngrep-1.45-build-fixes.patch
new file mode 100644
index 000000000000..1e30ca9a0c80
--- /dev/null
+++ b/net-analyzer/ngrep/files/ngrep-1.45-build-fixes.patch
@@ -0,0 +1,191 @@
+This patch fixes a number of problems with have with build:
+
+ * more clean cut off pcre library; we'll never use bundled pcre library, so
+ some autoconf added REGEX_LIBS to pass correct system libs and header change.
+
+ * We use AC_CONFIG_SUBDIRS to pass make autoconf reconfigure gnuregex library
+ - this way ./configure will be called correctly and correct comipler will be
+ selected automatically.
+
+ * With the previous change some modifications were required to make gnuregex
+ buildable: a) we should not overide CFLAGS in Makefile.in (as they together
+ with -DHAVE_CONFIG_H will be passed to gnuregex and it'll fail to build,
+ since no config.h exist) b) obvious way to remove warning "_GNU_SOURCE"
+ redefined
+
+ * also we don't pass $(MAKEFLAGS) since it caused us problems in the past (bug
+ #178684)
+
+=== modified file 'Makefile.in'
+--- Makefile.in 2008-11-17 09:02:30 +0000
++++ Makefile.in 2008-11-17 10:42:09 +0000
+@@ -7,7 +7,8 @@
+
+ CC=@CC@
+
+-CFLAGS=@CFLAGS@ -D@OS@ @DEFS@ @EXTRA_DEFINES@
++# Never redefine CFLAGS, as it pollutes env and gnuregex build failes
++EXTRA_CFLAGS=@CFLAGS@ -D@OS@ @DEFS@ @EXTRA_DEFINES@
+ INCLUDES=-I@srcdir@ @PCAP_INCLUDE@ @EXTRA_INCLUDES@
+
+ LDFLAGS=@LDFLAGS@ @PCAP_LINK@
+@@ -34,25 +35,25 @@
+
+ REGEX_DIR=@REGEX_DIR@
+ REGEX_OBJS=@REGEX_OBJS@
+-
++REGEX_LIBS=@REGEX_LIBS@
+
+ all: $(TARGET)
+
+ $(TARGET): $(REGEX_OBJS) $(OBJS)
+- $(CC) $(CFLAGS) $(LDFLAGS) $(STRIPFLAG) -o $(TARGET) $(OBJS) $(REGEX_OBJS) $(LIBS)
++ $(CC) $(EXTRA_CFLAGS) $(LDFLAGS) -o $(TARGET) $(OBJS) $(REGEX_OBJS) $(REGEX_LIBS) $(LIBS)
+
+ debug: $(REGEX_OBJS) $(OBJS)
+- $(CC) $(CFLAGS) $(LDFLAGS) -g -o $(TARGET) $(OBJS) $(REGEX_OBJS) $(LIBS)
++ $(CC) $(EXTRA_CFLAGS) $(LDFLAGS) -g -o $(TARGET) $(OBJS) $(REGEX_OBJS) $(REGEX_LIBS) $(LIBS)
+
+ static: $(REGEX_OBJS) $(OBJS)
+- $(CC) $(CFLAGS) $(LDFLAGS) $(STRIPFLAG) -o $(TARGET).static -static $(OBJS) $(REGEX_OBJS) $(LIBS)
++ $(CC) $(EXTRA_CFLAGS) $(LDFLAGS) -o $(TARGET).static -static $(OBJS) $(REGEX_OBJS) $(REGEX_LIBS) $(LIBS)
+
+ install: $(TARGET)
+ $(INSTALL) -c -m 0755 $(TARGET) $(DESTDIR)/$(BINDIR_INSTALL)/$(TARGET)
+ $(INSTALL) -c -m 0644 $(MANPAGE) $(DESTDIR)/$(MANDIR_INSTALL)/$(MANPAGE)
+
+ .c.o:
+- $(CC) $(CFLAGS) $(INCLUDES) -g -c $<
++ $(CC) $(EXTRA_CFLAGS) $(INCLUDES) -g -c $<
+
+ clean:
+ make -C $(REGEX_DIR) clean
+@@ -63,7 +64,7 @@
+ rm -f config.status config.cache config.log config.h Makefile
+
+ $(REGEX_OBJS): $(REGEX_OBJS:.o=.c) $(REGEX_DIR)/*.h
+- $(MAKE) $(MAKEFLAGS) -C $(REGEX_DIR) $(notdir $(REGEX_OBJS))
++ $(MAKE) -C $(REGEX_DIR) $(notdir $(REGEX_OBJS))
+
+ $(OBJS): Makefile ngrep.c ngrep.h
+
+
+=== modified file 'configure.in'
+--- configure.in 2008-11-17 09:02:30 +0000
++++ configure.in 2008-11-17 10:11:29 +0000
+@@ -124,14 +124,16 @@
+ use_pcre="no"
+ ])
+
++REGEX_DIR=""
++REGEX_OBJS=""
++REGEX_LIBS=""
+ if test $use_pcre = yes; then
+
+ echo
+- echo 'Configuring Perl-Compatible Regular Expression (PCRE) library ...'
++ echo 'Using System Perl-Compatible Regular Expression (PCRE) library ...'
+ echo
+
+- REGEX_DIR='pcre-5.0'
+- REGEX_OBJS="$REGEX_DIR/pcre.o $REGEX_DIR/study.o"
++ REGEX_LIBS="`pcre-config --libs`"
+ USE_PCRE="1"
+
+ else
+@@ -144,12 +146,19 @@
+ REGEX_OBJS="$REGEX_DIR/regex.o"
+ USE_PCRE="0"
+
++ AC_CONFIG_SUBDIRS([regex-0.12])
++
++ echo
++ echo 'GNU Regular Expression library is configured...'
++ echo
++
+ fi
+
+-( cd $REGEX_DIR && ./configure )
+
+ AC_SUBST(REGEX_DIR)
+ AC_SUBST(REGEX_OBJS)
++AC_SUBST(REGEX_LIBS)
++
+
+
+ echo
+
+=== modified file 'ngrep.c'
+--- ngrep.c 2008-11-17 09:02:30 +0000
++++ ngrep.c 2008-11-17 09:55:32 +0000
+@@ -92,7 +92,7 @@
+ #endif
+
+ #if USE_PCRE
+-#include "pcre-5.0/pcre.h"
++#include <pcre.h>
+ #else
+ #include "regex-0.12/regex.h"
+ #endif
+
+=== modified file 'regex-0.12/Makefile.in'
+--- regex-0.12/Makefile.in 2008-11-17 09:02:30 +0000
++++ regex-0.12/Makefile.in 2008-11-17 10:20:52 +0000
+@@ -18,23 +18,6 @@
+
+ version = 0.12
+
+-# You can define CPPFLAGS on the command line. Aside from system-specific
+-# flags, you can define:
+-# -DREGEX_MALLOC to use malloc/realloc/free instead of alloca.
+-# -DDEBUG to enable the compiled pattern disassembler and execution
+-# tracing; code runs substantially slower.
+-# -DEXTRACT_MACROS to use the macros EXTRACT_* (as opposed to
+-# the corresponding C procedures). If not -DDEBUG, the macros
+-# are used.
+-CPPFLAGS =
+-
+-# Likewise, you can override CFLAGS to optimize, use -Wall, etc.
+-CFLAGS = -g
+-
+-# Ditto for LDFLAGS and LOADLIBES.
+-LDFLAGS =
+-LOADLIBES =
+-
+ srcdir = @srcdir@
+ VPATH = @srcdir@
+
+@@ -43,7 +26,7 @@
+
+ SHELL = /bin/sh
+
+-subdirs = doc test
++subdirs =
+
+ default all:: regex.o
+ .PHONY: default all
+
+=== modified file 'regex-0.12/configure.in'
+--- regex-0.12/configure.in 2008-11-17 09:02:30 +0000
++++ regex-0.12/configure.in 2008-11-17 10:19:18 +0000
+@@ -34,4 +34,4 @@
+
+ esac
+
+-AC_OUTPUT(Makefile doc/Makefile test/Makefile)
++AC_OUTPUT(Makefile)
+
+=== modified file 'regex-0.12/regex.c'
+--- regex-0.12/regex.c 2008-11-17 09:02:30 +0000
++++ regex-0.12/regex.c 2008-11-17 10:15:58 +0000
+@@ -34,7 +34,9 @@
+ #pragma alloca
+ #endif
+
++#ifndef _GNU_SOURCE
+ #define _GNU_SOURCE
++#endif
+
+ /* We need this for `regex.h', and perhaps for the Emacs include files. */
+ #include <sys/types.h>
+
diff --git a/net-analyzer/ngrep/files/ngrep-1.45-setlocale.patch b/net-analyzer/ngrep/files/ngrep-1.45-setlocale.patch
new file mode 100644
index 000000000000..d43f225cab0c
--- /dev/null
+++ b/net-analyzer/ngrep/files/ngrep-1.45-setlocale.patch
@@ -0,0 +1,23 @@
+Call setlocale to make isprint() decide what's printable depending
+on the current locale. See bugs.debian.org/307496 .
+
+--- ngrep-1.45.ds1.orig/ngrep.c
++++ ngrep-1.45.ds1/ngrep.c
+@@ -97,6 +97,8 @@
+ #include "regex-0.12/regex.h"
+ #endif
+
++#include <locale.h>
++
+ #include "ngrep.h"
+
+
+@@ -195,6 +197,8 @@
+ signal(SIGWINCH, update_windowsize);
+ #endif
+
++ setlocale(LC_ALL, "");
++
+ while ((c = getopt(argc, argv, "LNhXViwqpevxlDtTRMs:n:c:d:A:I:O:S:P:F:W:")) != EOF) {
+ switch (c) {
+ case 'W': {
diff --git a/net-analyzer/ngrep/ngrep-1.45-r2.ebuild b/net-analyzer/ngrep/ngrep-1.45-r2.ebuild
new file mode 100644
index 000000000000..07efb58889a1
--- /dev/null
+++ b/net-analyzer/ngrep/ngrep-1.45-r2.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/ngrep/ngrep-1.45-r2.ebuild,v 1.1 2008/11/17 11:54:06 pva Exp $
+
+inherit eutils autotools
+
+DESCRIPTION="A grep for network layers"
+HOMEPAGE="http://ngrep.sourceforge.net/"
+SRC_URI="mirror://sourceforge/ngrep/${P}.tar.bz2"
+
+LICENSE="as-is"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
+IUSE="ipv6 pcre"
+
+DEPEND="net-libs/libpcap
+ pcre? ( dev-libs/libpcre )"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ # Remove bundled libpcre to avoid occasional linking with them
+ rm -rf pcre-5.0
+ epatch "${FILESDIR}/${P}-build-fixes.patch"
+ epatch "${FILESDIR}/${P}-setlocale.patch"
+ eautoreconf
+}
+
+src_compile() {
+ econf --with-dropprivs-user=ngrep \
+ --with-pcap-includes=/usr/include \
+ $(use_enable pcre) \
+ $(use_enable ipv6)
+ emake || die "emake failed"
+}
+
+pkg_preinst() {
+ enewgroup ngrep
+ enewuser ngrep -1 -1 -1 ngrep
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+ dodoc doc/*.txt
+}