summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorhans <hans@pkgsrc.org>2012-03-07 18:27:30 +0000
committerhans <hans@pkgsrc.org>2012-03-07 18:27:30 +0000
commit43483012d686ab2b0384e2125d5dd8f4c36215aa (patch)
tree24ae9b9272e36e5564acaa7f923b3449d9872344 /net
parent6ecfc588e5203512492c4aa05a7bfbc21417f3c5 (diff)
downloadpkgsrc-43483012d686ab2b0384e2125d5dd8f4c36215aa.tar.gz
Fix build on SunOS.
Diffstat (limited to 'net')
-rw-r--r--net/tcpdstat/Makefile10
-rw-r--r--net/tcpdstat/distinfo6
-rw-r--r--net/tcpdstat/patches/patch-Makefile12
-rw-r--r--net/tcpdstat/patches/patch-aa11
-rw-r--r--net/tcpdstat/patches/patch-ip_flow.c61
5 files changed, 96 insertions, 4 deletions
diff --git a/net/tcpdstat/Makefile b/net/tcpdstat/Makefile
index efb593bb357..4afe071cbb8 100644
--- a/net/tcpdstat/Makefile
+++ b/net/tcpdstat/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.14 2011/03/17 22:08:37 zafer Exp $
+# $NetBSD: Makefile,v 1.15 2012/03/07 18:27:30 hans Exp $
DISTNAME= tcpd-tools-0.8
PKGNAME= tcpdstat-0.8
@@ -12,6 +12,13 @@ PKG_DESTDIR_SUPPORT= user-destdir
NOT_FOR_PLATFORM= Interix-*-*
+CFLAGS.SunOS+= -Du_int64_t=uint64_t -Du_int32_t=uint32_t
+CFLAGS.SunOS+= -Du_int16_t=uint16_t -Du_int8_t=uint8_t
+
+LIBS.SunOS+= -lsocket -lnsl
+
+MAKE_ENV+= SYS_LIBS=${LIBS:Q}
+
WRKSRC= ${WRKDIR}/${DISTNAME}/tcpdstat
INSTALLATION_DIRS= bin
@@ -19,4 +26,5 @@ INSTALLATION_DIRS= bin
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/tcpdstat ${DESTDIR}${PREFIX}/bin
+.include "../../net/libpcap/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/net/tcpdstat/distinfo b/net/tcpdstat/distinfo
index 1c3f194da17..7c9694be38b 100644
--- a/net/tcpdstat/distinfo
+++ b/net/tcpdstat/distinfo
@@ -1,6 +1,8 @@
-$NetBSD: distinfo,v 1.4 2007/05/30 17:47:04 minskim Exp $
+$NetBSD: distinfo,v 1.5 2012/03/07 18:27:30 hans Exp $
SHA1 (tcpd-tools-0.8.tar.gz) = fe2abe15bbf9062833af9bec3745c751a8aa06df
RMD160 (tcpd-tools-0.8.tar.gz) = 876842cbb37ca65d4b955718abd5ef5c14810dee
Size (tcpd-tools-0.8.tar.gz) = 468856 bytes
-SHA1 (patch-aa) = 9895d6f2386ef561ac8502b787035f79fa44e771
+SHA1 (patch-Makefile) = b77ceb25ed320a221ce3a8fd3b0ccc64d35b4b25
+SHA1 (patch-aa) = 1d4eb35cc8231321325e40b5bc265eaa0e78ff0f
+SHA1 (patch-ip_flow.c) = a1b35b10b055e6da0a4e12b6226a1fa6b06c1154
diff --git a/net/tcpdstat/patches/patch-Makefile b/net/tcpdstat/patches/patch-Makefile
new file mode 100644
index 00000000000..24949d0fd76
--- /dev/null
+++ b/net/tcpdstat/patches/patch-Makefile
@@ -0,0 +1,12 @@
+$NetBSD: patch-Makefile,v 1.1 2012/03/07 18:27:30 hans Exp $
+
+--- Makefile.orig 2000-04-16 18:26:25.000000000 +0200
++++ Makefile 2012-03-07 18:55:43.383385719 +0100
+@@ -4,7 +4,6 @@ OBJS= stat.o net_read.o ip_flow.o
+
+ SYS_DEFINES?= -DINET6
+
+-CFLAGS= -g -Wall
+ DEFINES= $(SYS_DEFINES)
+ INCLUDES= -I. $(SYS_INCLUDES)
+
diff --git a/net/tcpdstat/patches/patch-aa b/net/tcpdstat/patches/patch-aa
index 36cebf763c9..c685fa9d687 100644
--- a/net/tcpdstat/patches/patch-aa
+++ b/net/tcpdstat/patches/patch-aa
@@ -1,7 +1,16 @@
-$NetBSD: patch-aa,v 1.1 2007/05/30 17:47:04 minskim Exp $
+$NetBSD: patch-aa,v 1.2 2012/03/07 18:27:30 hans Exp $
--- tcpdstat.h.orig 2000-06-30 04:16:39.000000000 -0700
+++ tcpdstat.h
+@@ -28,7 +28,7 @@
+
+ struct pkt_cnt {
+ int packets;
+- quad_t bytes;
++ int64_t bytes;
+ };
+
+ enum protos {
@@ -70,7 +70,6 @@ enum protos {
extern int read_count;
extern struct timeval start_time, end_time;
diff --git a/net/tcpdstat/patches/patch-ip_flow.c b/net/tcpdstat/patches/patch-ip_flow.c
new file mode 100644
index 00000000000..62e35d8e343
--- /dev/null
+++ b/net/tcpdstat/patches/patch-ip_flow.c
@@ -0,0 +1,61 @@
+$NetBSD: patch-ip_flow.c,v 1.1 2012/03/07 18:27:30 hans Exp $
+
+--- ip_flow.c.orig 2000-06-30 13:16:26.000000000 +0200
++++ ip_flow.c 2012-03-07 19:03:35.308708989 +0100
+@@ -66,14 +66,14 @@ struct flow_entry {
+
+ struct flow f_flow;
+ int f_packets;
+- quad_t f_bytes;
++ int64_t f_bytes;
+ };
+
+ #define FLOW_HASHSIZE 256
+
+ static LIST_HEAD(flow_head, flow_entry) flow_hash[FLOW_HASHSIZE];
+ int total_packets;
+-quad_t total_bytes;
++int64_t total_bytes;
+
+ static __inline int ip_hash4 __P((struct in_addr *, struct in_addr *));
+ #ifdef INET6
+@@ -229,7 +229,7 @@ void ipflow_show(void)
+ */
+ for (j = 0; j < NTOP; j++) {
+ if (big_flows[j] == NULL ||
+- (quad_t)flow->f_bytes > big_flows[j]->f_bytes) {
++ (int64_t)flow->f_bytes > big_flows[j]->f_bytes) {
+ /* insert the entry */
+ for (k = NTOP-1; k > j; k--)
+ big_flows[k] = big_flows[k-1];
+@@ -312,7 +312,7 @@ struct addr_entry {
+ #endif
+ } a_un;
+ int addr_packets;
+- quad_t addr_bytes;
++ int64_t addr_bytes;
+ };
+
+ #define addr_ip a_un.ua_ip
+@@ -324,18 +324,18 @@ struct addr_entry {
+
+ static LIST_HEAD(addr_head, addr_entry) addr_hash[FLOW_HASHSIZE];
+ static int total_addr = 0;
+-static quad_t v4_total_bytes = 0;
++static int64_t v4_total_bytes = 0;
+ #ifdef INET6
+ static LIST_HEAD(addr_head6, addr_entry) addr_hash6[FLOW_HASHSIZE];
+ static int total_addr6 = 0;
+-static quad_t v6_total_bytes = 0;
++static int64_t v6_total_bytes = 0;
+ #endif
+
+ static int addr_count(af, ip_addr, packets, bytes)
+ int af;
+ struct in_addr *ip_addr;
+ int packets;
+- quad_t bytes;
++ int64_t bytes;
+ {
+ struct addr_entry *addr;
+ int hash;