Hello community,

here is the log from the commit of package ngrep for openSUSE:Factory checked 
in at 2014-07-23 22:07:09
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ngrep (Old)
 and      /work/SRC/openSUSE:Factory/.ngrep.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ngrep"

Changes:
--------
--- /work/SRC/openSUSE:Factory/ngrep/ngrep.changes      2013-02-01 
11:00:35.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.ngrep.new/ngrep.changes 2014-07-24 
00:42:34.000000000 +0200
@@ -1,0 +2,17 @@
+Sun Jul 13 21:03:24 UTC 2014 - a...@mizerski.pl
+
+- Copied debian patches
+  - 10_debian-build.diff
+  - 10_man-fixes.diff
+  - 20_setlocale.diff
+  - 40_ipv6-offsets.diff
+- Fixed pcap usage. See
+  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=546596
+- Enabled IPv6 support.
+- Usage of system provided pcre library.
+- Disabled automatic stripping of executable.
+- Added CHANGES.txt CREDITS.txt README.txt and LICENSE.txt files
+  to packaged documentation.
+- Spec file cleanup.
+
+-------------------------------------------------------------------

New:
----
  10_debian-build.diff
  10_man-fixes.diff
  20_setlocale.diff
  40_ipv6-offsets.diff

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ngrep.spec ++++++
--- /var/tmp/diff_new_pack.STP8H8/_old  2014-07-24 00:42:35.000000000 +0200
+++ /var/tmp/diff_new_pack.STP8H8/_new  2014-07-24 00:42:35.000000000 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package ngrep
 #
-# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -24,9 +24,13 @@
 Group:          Productivity/Networking/Diagnostic
 Url:            http://ngrep.sourceforge.net
 Source:         %{name}-%{version}.tar.bz2
+Patch0:         10_debian-build.diff
+Patch1:         10_man-fixes.diff
+Patch2:         20_setlocale.diff
+Patch3:         40_ipv6-offsets.diff
 BuildRequires:  libpcap-devel
+BuildRequires:  pcre-devel
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
-Requires:       libpcap
 
 %description
 ngrep strives to provide most of GNU grep's common features, applying them
@@ -39,23 +43,31 @@
 
 %prep
 %setup -q
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
 
 %build
 %configure \
-    --with-pcap-includes=%{_includedir} \
+    --disable-pcap-restart \
+    --enable-pcre \
+    --with-ipv6 \
+    --with-pcap-includes=%{_includedir}/pcap
 
-make
+make %{?_smp_mflags} \
+    STRIPFLAG=""
 
 %install
-rm -rf %{buildroot}
-%makeinstall
-
-%clean
-rm -rf %{buildroot}
+%make_install
 
 %files
 %defattr(-,root,root)
 %{_bindir}/%{name}
 %{_mandir}/man8/%{name}.8.gz
+%doc doc/CHANGES.txt
+%doc doc/CREDITS.txt
+%doc doc/README.txt
+%doc LICENSE.txt
 
 %changelog

++++++ 10_debian-build.diff ++++++
Change ngrep's build system to use the system's version of PCRE.

---
 Makefile.in  |    6 ++----
 configure    |   11 +++--------
 configure.in |   11 +++--------
 ngrep.c      |    2 +-
 4 files changed, 9 insertions(+), 21 deletions(-)

--- a/configure
+++ b/configure
@@ -3624,13 +3624,10 @@
 
 if test $use_pcre = yes; then
 
-  echo
-  echo 'Configuring Perl-Compatible Regular Expression (PCRE) library ...'
-  echo
-
-  REGEX_DIR='pcre-5.0'
-  REGEX_OBJS="$REGEX_DIR/pcre.o $REGEX_DIR/study.o"
+  REGEX_DIR=''
+  REGEX_OBJS=""
   USE_PCRE="1"
+  EXTRA_LIBS="$EXTRA_LIBS -lpcre"
 
 else
 
@@ -3644,8 +3641,6 @@
 
 fi
 
-( cd $REGEX_DIR && ./configure )
-
 
 
 
--- a/configure.in
+++ b/configure.in
@@ -126,13 +126,10 @@
 
 if test $use_pcre = yes; then
 
-  echo 
-  echo 'Configuring Perl-Compatible Regular Expression (PCRE) library ...' 
-  echo 
-
-  REGEX_DIR='pcre-5.0'
-  REGEX_OBJS="$REGEX_DIR/pcre.o $REGEX_DIR/study.o"
+  REGEX_DIR=''
+  REGEX_OBJS=""
   USE_PCRE="1"
+  EXTRA_LIBS="$EXTRA_LIBS -lpcre"
 
 else
 
@@ -146,8 +143,6 @@
 
 fi
 
-( cd $REGEX_DIR && ./configure )
-
 AC_SUBST(REGEX_DIR)
 AC_SUBST(REGEX_OBJS)
 
--- a/Makefile.in
+++ b/Makefile.in
@@ -7,7 +7,7 @@
 
 CC=@CC@
 
-CFLAGS=@CFLAGS@ -D@OS@ @DEFS@ @EXTRA_DEFINES@ 
+CFLAGS=@CFLAGS@ @CPPFLAGS@ -D@OS@ @DEFS@ @EXTRA_DEFINES@ 
 INCLUDES=-I@srcdir@ @PCAP_INCLUDE@ @EXTRA_INCLUDES@
 
 LDFLAGS=@LDFLAGS@ @PCAP_LINK@
@@ -39,13 +39,13 @@
 all: $(TARGET) 
 
 $(TARGET): $(REGEX_OBJS) $(OBJS) 
-       $(CC) $(CFLAGS) $(LDFLAGS) $(STRIPFLAG) -o $(TARGET) $(OBJS) 
$(REGEX_OBJS) $(LIBS) 
+       $(CC) $(CFLAGS) $(LDFLAGS) -o $(TARGET) $(OBJS) $(REGEX_OBJS) $(LIBS) 
 
 debug: $(REGEX_OBJS) $(OBJS)
        $(CC) $(CFLAGS) $(LDFLAGS) -g -o $(TARGET) $(OBJS) $(REGEX_OBJS) 
$(LIBS) 
 
 static: $(REGEX_OBJS) $(OBJS)
-       $(CC) $(CFLAGS) $(LDFLAGS) $(STRIPFLAG) -o $(TARGET).static -static 
$(OBJS) $(REGEX_OBJS) $(LIBS) 
+       $(CC) $(CFLAGS) $(LDFLAGS) -o $(TARGET).static -static $(OBJS) 
$(REGEX_OBJS) $(LIBS) 
 
 install: $(TARGET)
        $(INSTALL) -c -m 0755 $(TARGET)  $(DESTDIR)/$(BINDIR_INSTALL)/$(TARGET)
@@ -55,11 +55,9 @@
        $(CC) $(CFLAGS) $(INCLUDES) -g -c $<
 
 clean:
-       make -C $(REGEX_DIR) clean
        rm -f *~ $(OBJS) $(REGEX_OBJS) $(TARGET) $(TARGET).static
 
 distclean: clean 
-       make -C $(REGEX_DIR) distclean
        rm -f config.status config.cache config.log config.h Makefile 
 
 $(REGEX_OBJS): $(REGEX_OBJS:.o=.c) $(REGEX_DIR)/*.h
--- a/ngrep.c
+++ b/ngrep.c
@@ -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
++++++ 10_man-fixes.diff ++++++
Misc fixes to the man page.
---
 ngrep.8 |   21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)

--- a/ngrep.8
+++ b/ngrep.8
@@ -144,13 +144,13 @@
 .IP "-W normal|byline|single|none"
 Specify an alternate manner for displaying packets, when not in
 hexadecimal mode.  The ``byline'' mode honors embedded linefeeds,
-wrapping text only when a linefeed is encountered.  The ``none'' mode
-doesn't wrap under any circumstance (entire payload is displayed on
-one line).  The ``single'' mode is conceptually the same as ``none'',
-except that everything including IP and source/destination header
-information is all on one line.  ``normal'' is the default mode and is
-only included for completeness.  This option is incompatible with
-``-x''.
+wrapping text only when a linefeed is encountered (useful for observing
+HTTP transactions, for instance).  The ``none'' mode doesn't wrap under
+any circumstance (entire payload is displayed on one line).  The
+``single'' mode is conceptually the same as ``none'', except that
+everything including IP and source/destination header information is all
+on one line.  ``normal'' is the default mode and is only included for
+completeness.  This option is incompatible with ``-x''.
 
 .IP "-s snaplen"
 Set the bpf caplen to snaplen (default 65536).
@@ -181,13 +181,6 @@
 .IP "-A num"
 Dump \fInum\fP packets of trailing context after matching a packet.
 
-.IP "-W normal|byline|none"
-Alter the method by which ngrep displays packet payload.  ``normal''
-mode represents the standard behaviour, ``byline'' instructs ngrep to
-respect embedded linefeeds (useful for observing HTTP transactions,
-for instance), and ``none'' results in the payload on one single line
-(useful for scripted processing of ngrep output).
-
 .IP "-c cols"
 Ignore the detected terminal width and force the column width to the
 specified size.
++++++ 20_setlocale.diff ++++++
Call setlocale to make isprint() decide what's printable depending
on the current locale.  See #307496.

---
 ngrep.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/ngrep.c
+++ b/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': {
++++++ 40_ipv6-offsets.diff ++++++
commit ca90da66ac237005af6fbdbdc16837ba41f19beb
Author: Jordan Ritter <j...@darkridge.com>
Date:   Tue Jun 19 10:12:08 2007 +0000

    Fix for bug #1738953: why would I subtract the payload's length from a
    variable that is supposed to describe exactly that??  Removed ip6_plen
    from TCP, UDP and ICMPv6 calculations.

diff --git a/ngrep.c b/ngrep.c
index fd95cbe..6c3c902 100644
--- a/ngrep.c
+++ b/ngrep.c
@@ -721,11 +721,6 @@ void process(u_char *d, struct pcap_pkthdr *h, u_char *p) {
             data = (unsigned char *)(tcp_pkt) + tcphdr_offset;
             len -= link_offset + ip_hl + tcphdr_offset;
 
-#if USE_IPv6
-            if (ip_ver == 6)
-                len -= ntohs(ip6_pkt->ip6_plen);
-#endif
-
             if ((int32_t)len < 0)
                 len = 0;
 
@@ -741,11 +736,6 @@ void process(u_char *d, struct pcap_pkthdr *h, u_char *p) {
             data = (unsigned char *)(udp_pkt) + udphdr_offset;
             len -= link_offset + ip_hl + udphdr_offset;
 
-#if USE_IPv6
-            if (ip_ver == 6)
-                len -= ntohs(ip6_pkt->ip6_plen);
-#endif
-
             if ((int32_t)len < 0)
                 len = 0;
 
@@ -779,7 +769,7 @@ void process(u_char *d, struct pcap_pkthdr *h, u_char *p) {
             uint16_t icmp6hdr_offset    = (frag_offset) ? 0 : 4;
 
             data = (unsigned char *)(icmp6_pkt) + icmp6hdr_offset;
-            len -= link_offset + ip_hl + ntohs(ip6_pkt->ip6_plen) + 
icmp6hdr_offset;
+            len -= link_offset + ip_hl + icmp6hdr_offset;
 
             if ((int32_t)len < 0)
                 len = 0;
-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to