summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Roovers <jer@gentoo.org>2010-09-16 16:31:59 +0000
committerJeroen Roovers <jer@gentoo.org>2010-09-16 16:31:59 +0000
commit9bad1fd881aa602c81cefe92db725e95eeaa9477 (patch)
tree59495592677b3e0c96a37245a0a1255b2f651a39 /net-analyzer/sniffit/files
parentvirtual/glut -> media-libs/glut (diff)
downloadgentoo-2-9bad1fd881aa602c81cefe92db725e95eeaa9477.tar.gz
gentoo-2-9bad1fd881aa602c81cefe92db725e95eeaa9477.tar.bz2
gentoo-2-9bad1fd881aa602c81cefe92db725e95eeaa9477.zip
Respect LDFLAGS (bug #336981). Apply more recent Debian patch. Clean up code. Clean up ebuild.
(Portage version: 2.2_rc82/cvs/Linux i686)
Diffstat (limited to 'net-analyzer/sniffit/files')
-rw-r--r--net-analyzer/sniffit/files/sniffit-0.3.7-flags.patch30
-rw-r--r--net-analyzer/sniffit/files/sniffit-0.3.7-gentoo.patch6
-rw-r--r--net-analyzer/sniffit/files/sniffit-0.3.7-misc.patch120
3 files changed, 153 insertions, 3 deletions
diff --git a/net-analyzer/sniffit/files/sniffit-0.3.7-flags.patch b/net-analyzer/sniffit/files/sniffit-0.3.7-flags.patch
new file mode 100644
index 000000000000..fe9c14c15f94
--- /dev/null
+++ b/net-analyzer/sniffit/files/sniffit-0.3.7-flags.patch
@@ -0,0 +1,30 @@
+Do not build or link against included libpcap.
+Respect CFLAGS and LDFLAGS.
+
+--- a/Makefile.in 1998-07-16 18:17:10.000000000 +0200
++++ b/Makefile.in 2010-09-13 00:10:51.000000000 +0200
+@@ -10,10 +10,10 @@
+ LIBS = @LIBS@
+ DEFS = @DEFS@
+ OS_OPT = @OS_OPT@
+-OBJ_FLAG = -w -O2 -c
+-OBJ_OPT = -I./libpcap -L./libpcap
+-EXE_FLAG = -w -O2 -o sniffit
+-EXE_OPT = -I./libpcap -L./libpcap -lpcap
++OBJ_FLAG = $(CFLAGS) -c
++OBJ_OPT = -I/usr/include/pcap -L/usr/lib
++EXE_FLAG = $(CFLAGS) $(LDFLAGS) -o sniffit
++EXE_OPT = -I/usr/include/pcap -lpcap
+ EXE_OBJ = sn_packets.o sn_generation.o sn_interface.o sn_cfgfile.o \
+ sn_logfile.o sn_resolv.o
+ DEP_FILES = sn_config.h ./libpcap/pcap.h sn_data.h sn_defines.h sn_plugins.h \
+@@ -26,9 +26,7 @@
+ @echo "Succesfull compilation..."
+
+ sniffit: $(SNIFFIT) $(DEP_FILES)
+- cd libpcap; make; cd ..
+ $(CC) $(EXE_FLAG) $(SNIFFIT) $(EXE_OBJ) $(EXE_OPT) $(LIBS) $(DEFS) $(OS_OPT)
+- strip sniffit
+
+ sn_cfgfile.o: sn_cfgfile.h sn_cfgfile.c sn_defines.h sn_structs.h sn_config.h
+ $(CC) $(OBJ_FLAG) sn_cfgfile.c $(OBJ_OPT) $(DEFS)
diff --git a/net-analyzer/sniffit/files/sniffit-0.3.7-gentoo.patch b/net-analyzer/sniffit/files/sniffit-0.3.7-gentoo.patch
index 680eb07a6833..19a759578a43 100644
--- a/net-analyzer/sniffit/files/sniffit-0.3.7-gentoo.patch
+++ b/net-analyzer/sniffit/files/sniffit-0.3.7-gentoo.patch
@@ -1,5 +1,5 @@
---- sniffit.0.3.7.beta/Makefile.in.orig 2009-01-15 07:28:39.000000000 +0100
-+++ sniffit.0.3.7.beta/Makefile.in 2009-01-15 07:28:26.000000000 +0100
+--- a/sniffit.0.3.7.beta/Makefile.in 2009-01-15 07:28:39.000000000 +0100
++++ b/sniffit.0.3.7.beta/Makefile.in 2009-01-15 07:28:26.000000000 +0100
@@ -10,9 +10,9 @@
LIBS = @LIBS@
DEFS = @DEFS@
@@ -8,7 +8,7 @@
+OBJ_FLAG = $(CFLAGS) -c
OBJ_OPT = -I./libpcap -L./libpcap
-EXE_FLAG = -w -O2 -o sniffit
-+EXE_FLAG = $(CFLAGS) -o sniffit
++EXE_FLAG = $(CFLAGS) $(LDFLAGS) -o sniffit
EXE_OPT = -I./libpcap -L./libpcap -lpcap
EXE_OBJ = sn_packets.o sn_generation.o sn_interface.o sn_cfgfile.o \
sn_logfile.o sn_resolv.o
diff --git a/net-analyzer/sniffit/files/sniffit-0.3.7-misc.patch b/net-analyzer/sniffit/files/sniffit-0.3.7-misc.patch
new file mode 100644
index 000000000000..aecf0da28050
--- /dev/null
+++ b/net-analyzer/sniffit/files/sniffit-0.3.7-misc.patch
@@ -0,0 +1,120 @@
+--- a/sn_cfgfile.h 1998-07-16 18:17:10.000000000 +0200
++++ b/sn_cfgfile.h 2010-09-16 18:14:53.000000000 +0200
+@@ -10,3 +10,4 @@
+ void make_nr_dot (char *);
+ void interprete_line (char *);
+ void read_cfg_file (char *);
++char *strlower (char *);
+--- a/sn_structs.h 1998-07-16 18:17:10.000000000 +0200
++++ b/sn_structs.h 2010-09-16 18:14:53.000000000 +0200
+@@ -67,7 +67,7 @@
+ struct snif_mask /* struct for mask */
+ {
+ _32_bit source_ip, destination_ip;
+- _32_bit short source_port, destination_port;
++ _32_bit source_port, destination_port;
+ };
+
+ /* (packet generation) */
+--- a/sn_analyse.c 1998-07-16 18:17:10.000000000 +0200
++++ b/sn_analyse.c 2010-09-16 18:14:53.000000000 +0200
+@@ -1,6 +1,9 @@
+ /* Analyse traffic for logging mode */
+ /* - by: Brecht Claerhout */
+
++#include <stdlib.h>
++#include <string.h>
++
+ const unsigned char *data;
+ memcpy(&tcphead,header,sizeof(struct TCP_header));
+
+--- a/sn_cfgfile.c 1998-07-16 18:17:10.000000000 +0200
++++ b/sn_cfgfile.c 2010-09-16 18:14:53.000000000 +0200
+@@ -3,6 +3,11 @@
+ /* - improvements: Shudoh Kazuyuki */
+
+ #include <stdio.h>
++#include <stdlib.h>
++#include "sn_interface.h"
++#include <string.h>
++#include <ctype.h>
++#include <time.h>
+ #include <netdb.h> /* for getservbyname() */
+
+ #include "sn_config.h"
+--- a/sn_conn_desc.c 1998-07-16 18:17:10.000000000 +0200
++++ b/sn_conn_desc.c 2010-09-16 18:14:53.000000000 +0200
+@@ -1,6 +1,8 @@
+ /* Connection description detection file */
+ /* - by: Brecht Claerhout */
+
++#include <ctype.h>
++#include <string.h>
+
+ /* Simple PORT BASED detection */
+
+--- a/sn_generation.c 1998-07-16 18:17:10.000000000 +0200
++++ b/sn_generation.c 2010-09-16 18:18:31.000000000 +0200
+@@ -6,12 +6,16 @@
+ #ifdef INCLUDE_INTERFACE
+ #ifdef GENERATION
+ #include <unistd.h>
++#include <stdlib.h>
++#include <string.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include "sn_curses.h"
+ #include "sn_defines.h"
+ #include "sn_structs.h"
+ #include "sn_generation.h"
++#include "sn_interface.h" /* input_field() */
++#include "sn_packets.h" /* in_cksum() */
+
+ extern volatile int screen_busy;
+
+--- a/sniffit.0.3.7.c 1998-07-16 18:17:10.000000000 +0200
++++ b/sniffit.0.3.7.c 2010-09-16 18:14:53.000000000 +0200
+@@ -4,6 +4,9 @@
+ #include "sn_config.h" /* Config header file */
+
+ #include <unistd.h>
++#include <stdlib.h>
++#include <string.h>
++#include <ctype.h>
+ #include <signal.h>
+ #include <stdio.h>
+ #include <fcntl.h>
+--- a/sn_interface.c 1998-07-16 18:17:10.000000000 +0200
++++ b/sn_interface.c 2010-09-16 18:15:59.000000000 +0200
+@@ -6,6 +6,9 @@
+ #ifdef INCLUDE_INTERFACE
+ #include <signal.h>
+ #include <unistd.h>
++#include <stdlib.h>
++#include <string.h>
++#include <ctype.h>
+ #include <sys/ipc.h>
+ #include <sys/shm.h>
+ #include "sn_curses.h"
+--- a/sn_logfile.c 1998-07-16 18:17:10.000000000 +0200
++++ b/sn_logfile.c 2010-09-16 18:16:44.000000000 +0200
+@@ -4,6 +4,9 @@
+ #include "sn_config.h"
+
+ #include <stdio.h>
++#include <stdlib.h> /* exit() */
++#include <string.h> /* strcpy() */
++#include <time.h> /* time() ctime() */
+ #include <sys/stat.h>
+ #include <sys/time.h>
+ #include "sn_defines.h"
+--- a/sn_packets.c 1998-07-16 18:17:10.000000000 +0200
++++ b/sn_packets.c 2010-09-16 18:14:53.000000000 +0200
+@@ -5,6 +5,7 @@
+ #include "sn_defines.h"
+ #include "sn_structs.h"
+ #include <netinet/in.h>
++#include <string.h> /* memcpy() strcpy() */
+
+ extern int PROTO_HEAD;
+ extern char NO_CHKSUM;