Tue Dec 17 15:05:23 2013 UTC ()
Small fixes:
1.) Comment out "MASTER_SITES". The URL no longer works and all copies
    that Google can find are "pkgsrc" distfile mirrors.
2.) Fix various "pkglint" errors.


(tron)
diff -r1.20 -r1.21 pkgsrc/benchmarks/ttcp/Makefile
diff -r1.11 -r1.12 pkgsrc/benchmarks/ttcp/distinfo
diff -r1.3 -r1.4 pkgsrc/benchmarks/ttcp/patches/patch-aa
diff -r1.8 -r1.9 pkgsrc/benchmarks/ttcp/patches/patch-ab

cvs diff -r1.20 -r1.21 pkgsrc/benchmarks/ttcp/Makefile (switch to unified diff)

--- pkgsrc/benchmarks/ttcp/Makefile 2012/09/11 22:37:15 1.20
+++ pkgsrc/benchmarks/ttcp/Makefile 2013/12/17 15:05:23 1.21
@@ -1,39 +1,40 @@ @@ -1,39 +1,40 @@
1# $NetBSD: Makefile,v 1.20 2012/09/11 22:37:15 asau Exp $ 1# $NetBSD: Makefile,v 1.21 2013/12/17 15:05:23 tron Exp $
2 2
3DISTNAME= ttcp 3DISTNAME= ttcp
4PKGNAME= ${DISTNAME}-1.12 4PKGNAME= ${DISTNAME}-1.12
5PKGREVISION= 2 5PKGREVISION= 2
6CATEGORIES= benchmarks net 6CATEGORIES= benchmarks net
7MASTER_SITES= ftp://ftp.ptb.de/pub/benchmarks/ 7#MASTER_SITES= ftp://ftp.ptb.de/pub/benchmarks/
8EXTRACT_SUFX= .tar.Z 8EXTRACT_SUFX= .tar.Z
9 9
10MAINTAINER= pkgsrc-users@NetBSD.org 10MAINTAINER= pkgsrc-users@NetBSD.org
11HOMEPAGE= http://www.ccci.com/tools/ttcp/ 11HOMEPAGE= http://www.ccci.com/tools/ttcp/
12COMMENT= TCP testing and performance measuring tool 12COMMENT= TCP testing and performance measuring tool
13LICENSE= public-domain 13LICENSE= public-domain
14 14
15PKG_INSTALLATION_TYPES= overwrite pkgviews 15PKG_INSTALLATION_TYPES= overwrite pkgviews
16 16
17USE_BSD_MAKEFILE= yes 17USE_BSD_MAKEFILE= yes
 18USE_TOOLS+= nroff
18MAKE_ENV+= NOGCCERROR=yes 19MAKE_ENV+= NOGCCERROR=yes
19WRKSRC= ${WRKDIR} 20WRKSRC= ${WRKDIR}
20 21
21.include "../../mk/bsd.prefs.mk" 22.include "../../mk/bsd.prefs.mk"
22 23
23MANCOMPRESSED_IF_MANZ= YES 24MANCOMPRESSED_IF_MANZ= YES
24 25
25#.if (${OPSYS} == Darwin) 26#.if (${OPSYS} == Darwin)
26#CFLAGS+= "-Din_addr_t=\"unsigned long\"" 27#CFLAGS+= "-Din_addr_t=\"unsigned long\""
27#MAKE_FLAGS+= CFLAGS=${CFLAGS:Q} 28#MAKE_FLAGS+= CFLAGS=${CFLAGS:Q}
28#.endif 29#.endif
29 30
30INSTALLATION_DIRS= bin ${PKGMANDIR}/cat1 ${PKGMANDIR}/man1 31INSTALLATION_DIRS= bin ${PKGMANDIR}/cat1 ${PKGMANDIR}/man1
31 32
32.if (${OPSYS} == SunOS) 33.if (${OPSYS} == SunOS)
33do-build: 34do-build:
34 cd ${WRKSRC} && \ 35 cd ${WRKSRC} && \
35 ${CC} ttcp.c ${CFLAGS} ${LDFLAGS} -lsocket -lnsl -o ttcp && \ 36 ${CC} ttcp.c ${CFLAGS} ${LDFLAGS} -lsocket -lnsl -o ttcp && \
36 nroff -man ttcp.1 >ttcp.cat1 37 nroff -man ttcp.1 >ttcp.cat1
37.endif 38.endif
38 39
39.include "../../mk/bsd.pkg.mk" 40.include "../../mk/bsd.pkg.mk"

cvs diff -r1.11 -r1.12 pkgsrc/benchmarks/ttcp/distinfo (switch to unified diff)

--- pkgsrc/benchmarks/ttcp/distinfo 2007/01/18 11:28:00 1.11
+++ pkgsrc/benchmarks/ttcp/distinfo 2013/12/17 15:05:23 1.12
@@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
1$NetBSD: distinfo,v 1.11 2007/01/18 11:28:00 rillig Exp $ 1$NetBSD: distinfo,v 1.12 2013/12/17 15:05:23 tron Exp $
2 2
3SHA1 (ttcp.tar.Z) = 33a60af208eff3dc9ae745060f44b24c4e74aa7e 3SHA1 (ttcp.tar.Z) = 33a60af208eff3dc9ae745060f44b24c4e74aa7e
4RMD160 (ttcp.tar.Z) = b5cb1a8efe0f716d25d58a4950f35bac47b17668 4RMD160 (ttcp.tar.Z) = b5cb1a8efe0f716d25d58a4950f35bac47b17668
5Size (ttcp.tar.Z) = 18163 bytes 5Size (ttcp.tar.Z) = 18163 bytes
6SHA1 (patch-aa) = 4ef0fe369d4836a4de758a4cd62fda4785a471b7 6SHA1 (patch-aa) = 96e3a9136bae4057682d2b3cfea2ec8c8bb21eaa
7SHA1 (patch-ab) = a4419e0ee02a8b6d30ac13913f45fc9f5f9d7746 7SHA1 (patch-ab) = 265c19e05e22ce9fff7596b7b1efca0c07a7f4e0

cvs diff -r1.3 -r1.4 pkgsrc/benchmarks/ttcp/patches/patch-aa (switch to unified diff)

--- pkgsrc/benchmarks/ttcp/patches/patch-aa 2007/01/18 11:28:00 1.3
+++ pkgsrc/benchmarks/ttcp/patches/patch-aa 2013/12/17 15:05:23 1.4
@@ -1,8 +1,10 @@ @@ -1,8 +1,10 @@
1$NetBSD: patch-aa,v 1.3 2007/01/18 11:28:00 rillig Exp $ 1$NetBSD: patch-aa,v 1.4 2013/12/17 15:05:23 tron Exp $
 2
 3Fix build.
2 4
3--- Makefile.orig Tue Mar 26 16:19:05 2002 5--- Makefile.orig Tue Mar 26 16:19:05 2002
4+++ Makefile 6+++ Makefile
5@@ -0,0 +1,3 @@ 7@@ -0,0 +1,3 @@
6+PROG= ttcp 8+PROG= ttcp
7+ 9+
8+.include <bsd.prog.mk> 10+.include <bsd.prog.mk>

cvs diff -r1.8 -r1.9 pkgsrc/benchmarks/ttcp/patches/patch-ab (switch to unified diff)

--- pkgsrc/benchmarks/ttcp/patches/patch-ab 2005/12/21 11:49:51 1.8
+++ pkgsrc/benchmarks/ttcp/patches/patch-ab 2013/12/17 15:05:23 1.9
@@ -1,179 +1,181 @@ @@ -1,179 +1,181 @@
1$NetBSD: patch-ab,v 1.8 2005/12/21 11:49:51 tron Exp $ 1$NetBSD: patch-ab,v 1.9 2013/12/17 15:05:23 tron Exp $
 2
 3Fix build.
2 4
3--- ttcp.c.orig 1997-02-27 21:30:23.000000000 +0000 5--- ttcp.c.orig 1997-02-27 21:30:23.000000000 +0000
4+++ ttcp.c 2005-12-21 11:40:39.000000000 +0000 6+++ ttcp.c 2005-12-21 11:40:39.000000000 +0000
5@@ -44,17 +44,19 @@ 7@@ -44,17 +44,19 @@
6 /* #define BSD41a */ 8 /* #define BSD41a */
7 /* #define SYSV */ /* required on SGI IRIX releases before 3.3 */ 9 /* #define SYSV */ /* required on SGI IRIX releases before 3.3 */
8  10
9-#include <stdio.h> 11-#include <stdio.h>
10-#include <signal.h> 12-#include <signal.h>
11-#include <ctype.h> 13-#include <ctype.h>
12-#include <errno.h> 14-#include <errno.h>
13 #include <sys/types.h> 15 #include <sys/types.h>
14 #include <sys/socket.h> 16 #include <sys/socket.h>
15 #include <netinet/in.h> 17 #include <netinet/in.h>
16 #include <netinet/tcp.h> 18 #include <netinet/tcp.h>
17 #include <arpa/inet.h> 19 #include <arpa/inet.h>
18+#include <stdio.h> 20+#include <stdio.h>
19+#include <signal.h> 21+#include <signal.h>
20+#include <ctype.h> 22+#include <ctype.h>
21+#include <errno.h> 23+#include <errno.h>
22 #include <netdb.h> 24 #include <netdb.h>
23 #include <sys/time.h> /* struct timeval */ 25 #include <sys/time.h> /* struct timeval */
24+#include <stdlib.h> 26+#include <stdlib.h>
25+#include <string.h> 27+#include <string.h>
26  28
27 #if defined(SYSV) 29 #if defined(SYSV)
28 #include <sys/times.h> 30 #include <sys/times.h>
29@@ -71,7 +73,8 @@ 31@@ -71,7 +73,8 @@
30 struct sockaddr_in sinhim; 32 struct sockaddr_in sinhim;
31 struct sockaddr_in frominet; 33 struct sockaddr_in frominet;
32  34
33-int domain, fromlen; 35-int domain, fromlen;
34+int domain; 36+int domain;
35+socklen_t fromlen; 37+socklen_t fromlen;
36 int fd; /* fd of network socket */ 38 int fd; /* fd of network socket */
37  39
38 int buflen = 8 * 1024; /* length of buffer */ 40 int buflen = 8 * 1024; /* length of buffer */
39@@ -99,7 +102,6 @@ 41@@ -99,7 +102,6 @@
40 int touchdata = 0; /* access data after reading */ 42 int touchdata = 0; /* access data after reading */
41  43
42 struct hostent *addr; 44 struct hostent *addr;
43-extern int errno; 45-extern int errno;
44 extern int optind; 46 extern int optind;
45 extern char *optarg; 47 extern char *optarg;
46  48
47@@ -151,7 +153,7 @@ 49@@ -151,7 +153,7 @@
48 int argc; 50 int argc;
49 char **argv; 51 char **argv;
50 { 52 {
51- unsigned long addr_tmp; 53- unsigned long addr_tmp;
52+ in_addr_t addr_tmp; 54+ in_addr_t addr_tmp;
53 int c; 55 int c;
54  56
55 if (argc < 2) goto usage; 57 if (argc < 2) goto usage;
56@@ -263,29 +265,30 @@ 58@@ -263,29 +265,30 @@
57 if ( (buf = (char *)malloc(buflen+bufalign)) == (char *)NULL) 59 if ( (buf = (char *)malloc(buflen+bufalign)) == (char *)NULL)
58 err("malloc"); 60 err("malloc");
59 if (bufalign != 0) 61 if (bufalign != 0)
60- buf +=(bufalign - ((int)buf % bufalign) + bufoffset) % bufalign; 62- buf +=(bufalign - ((int)buf % bufalign) + bufoffset) % bufalign;
61+ buf +=(bufalign - ((u_long)buf % bufalign) + bufoffset) % bufalign; 63+ buf +=(bufalign - ((u_long)buf % bufalign) + bufoffset) % bufalign;
62  64
63 if (trans) { 65 if (trans) {
64- fprintf(stdout, 66- fprintf(stdout,
65+ fprintf(stderr, 67+ fprintf(stderr,
66 "ttcp-t: buflen=%d, nbuf=%d, align=%d/%d, port=%d", 68 "ttcp-t: buflen=%d, nbuf=%d, align=%d/%d, port=%d",
67 buflen, nbuf, bufalign, bufoffset, port); 69 buflen, nbuf, bufalign, bufoffset, port);
68 if (sockbufsize) 70 if (sockbufsize)
69- fprintf(stdout, ", sockbufsize=%d", sockbufsize); 71- fprintf(stdout, ", sockbufsize=%d", sockbufsize);
70+ fprintf(stderr, ", sockbufsize=%d", sockbufsize); 72+ fprintf(stderr, ", sockbufsize=%d", sockbufsize);
71 fprintf(stdout, " %s -> %s\n", udp?"udp":"tcp", host); 73 fprintf(stdout, " %s -> %s\n", udp?"udp":"tcp", host);
72 } else { 74 } else {
73- fprintf(stdout, 75- fprintf(stdout,
74+ fprintf(stderr, 76+ fprintf(stderr,
75 "ttcp-r: buflen=%d, nbuf=%d, align=%d/%d, port=%d", 77 "ttcp-r: buflen=%d, nbuf=%d, align=%d/%d, port=%d",
76 buflen, nbuf, bufalign, bufoffset, port); 78 buflen, nbuf, bufalign, bufoffset, port);
77 if (sockbufsize) 79 if (sockbufsize)
78- fprintf(stdout, ", sockbufsize=%d", sockbufsize); 80- fprintf(stdout, ", sockbufsize=%d", sockbufsize);
79- fprintf(stdout, " %s\n", udp?"udp":"tcp"); 81- fprintf(stdout, " %s\n", udp?"udp":"tcp");
80+ fprintf(stderr, ", sockbufsize=%d", sockbufsize); 82+ fprintf(stderr, ", sockbufsize=%d", sockbufsize);
81+ fprintf(stderr, " %s\n", udp?"udp":"tcp"); 83+ fprintf(stderr, " %s\n", udp?"udp":"tcp");
82 } 84 }
83  85
84 if ((fd = socket(AF_INET, udp?SOCK_DGRAM:SOCK_STREAM, 0)) < 0) 86 if ((fd = socket(AF_INET, udp?SOCK_DGRAM:SOCK_STREAM, 0)) < 0)
85 err("socket"); 87 err("socket");
86 mes("socket"); 88 mes("socket");
87  89
88- if (bind(fd, &sinme, sizeof(sinme)) < 0) 90- if (bind(fd, &sinme, sizeof(sinme)) < 0)
89+ sinme.sin_family = AF_INET; 91+ sinme.sin_family = AF_INET;
90+ if (bind(fd, (struct sockaddr *)&sinme, sizeof(sinme)) < 0) 92+ if (bind(fd, (struct sockaddr *)&sinme, sizeof(sinme)) < 0)
91 err("bind"); 93 err("bind");
92  94
93 #if defined(SO_SNDBUF) || defined(SO_RCVBUF) 95 #if defined(SO_SNDBUF) || defined(SO_RCVBUF)
94@@ -326,7 +329,7 @@ 96@@ -326,7 +329,7 @@
95 mes("nodelay"); 97 mes("nodelay");
96 } 98 }
97 #endif 99 #endif
98- if(connect(fd, &sinhim, sizeof(sinhim) ) < 0) 100- if(connect(fd, &sinhim, sizeof(sinhim) ) < 0)
99+ if(connect(fd, (struct sockaddr *)&sinhim, sizeof(sinhim) ) < 0) 101+ if(connect(fd, (struct sockaddr *)&sinhim, sizeof(sinhim) ) < 0)
100 err("connect"); 102 err("connect");
101 mes("connect"); 103 mes("connect");
102 } else { 104 } else {
103@@ -348,11 +351,11 @@ 105@@ -348,11 +351,11 @@
104 } 106 }
105 fromlen = sizeof(frominet); 107 fromlen = sizeof(frominet);
106 domain = AF_INET; 108 domain = AF_INET;
107- if((fd=accept(fd, &frominet, &fromlen) ) < 0) 109- if((fd=accept(fd, &frominet, &fromlen) ) < 0)
108+ if((fd=accept(fd, (struct sockaddr *)&frominet, &fromlen) ) < 0) 110+ if((fd=accept(fd, (struct sockaddr *)&frominet, &fromlen) ) < 0)
109 err("accept"); 111 err("accept");
110 { struct sockaddr_in peer; 112 { struct sockaddr_in peer;
111- int peerlen = sizeof(peer); 113- int peerlen = sizeof(peer);
112- if (getpeername(fd, (struct sockaddr_in *) &peer,  114- if (getpeername(fd, (struct sockaddr_in *) &peer,
113+ socklen_t peerlen = sizeof(peer); 115+ socklen_t peerlen = sizeof(peer);
114+ if (getpeername(fd, (struct sockaddr *) &peer,  116+ if (getpeername(fd, (struct sockaddr *) &peer,
115 &peerlen) < 0) { 117 &peerlen) < 0) {
116 err("getpeername"); 118 err("getpeername");
117 } 119 }
118@@ -412,25 +415,25 @@ 120@@ -412,25 +415,25 @@
119 } 121 }
120 if( cput <= 0.0 ) cput = 0.001; 122 if( cput <= 0.0 ) cput = 0.001;
121 if( realt <= 0.0 ) realt = 0.001; 123 if( realt <= 0.0 ) realt = 0.001;
122- fprintf(stdout, 124- fprintf(stdout,
123+ fprintf(stderr, 125+ fprintf(stderr,
124 "ttcp%s: %.0f bytes in %.2f real seconds = %s/sec +++\n", 126 "ttcp%s: %.0f bytes in %.2f real seconds = %s/sec +++\n",
125 trans?"-t":"-r", 127 trans?"-t":"-r",
126 nbytes, realt, outfmt(nbytes/realt)); 128 nbytes, realt, outfmt(nbytes/realt));
127 if (verbose) { 129 if (verbose) {
128- fprintf(stdout, 130- fprintf(stdout,
129+ fprintf(stderr, 131+ fprintf(stderr,
130 "ttcp%s: %.0f bytes in %.2f CPU seconds = %s/cpu sec\n", 132 "ttcp%s: %.0f bytes in %.2f CPU seconds = %s/cpu sec\n",
131 trans?"-t":"-r", 133 trans?"-t":"-r",
132 nbytes, cput, outfmt(nbytes/cput)); 134 nbytes, cput, outfmt(nbytes/cput));
133 } 135 }
134- fprintf(stdout, 136- fprintf(stdout,
135+ fprintf(stderr, 137+ fprintf(stderr,
136 "ttcp%s: %d I/O calls, msec/call = %.2f, calls/sec = %.2f\n", 138 "ttcp%s: %d I/O calls, msec/call = %.2f, calls/sec = %.2f\n",
137 trans?"-t":"-r", 139 trans?"-t":"-r",
138 numCalls, 140 numCalls,
139 1024.0 * realt/((double)numCalls), 141 1024.0 * realt/((double)numCalls),
140 ((double)numCalls)/realt); 142 ((double)numCalls)/realt);
141- fprintf(stdout,"ttcp%s: %s\n", trans?"-t":"-r", stats); 143- fprintf(stdout,"ttcp%s: %s\n", trans?"-t":"-r", stats);
142+ fprintf(stderr,"ttcp%s: %s\n", trans?"-t":"-r", stats); 144+ fprintf(stderr,"ttcp%s: %s\n", trans?"-t":"-r", stats);
143 if (verbose) { 145 if (verbose) {
144- fprintf(stdout, 146- fprintf(stdout,
145+ fprintf(stderr, 147+ fprintf(stderr,
146 "ttcp%s: buffer address %#x\n", 148 "ttcp%s: buffer address %#x\n",
147 trans?"-t":"-r", 149 trans?"-t":"-r",
148 buf); 150 buf);
149@@ -749,10 +752,10 @@ 151@@ -749,10 +752,10 @@
150 int count; 152 int count;
151 { 153 {
152 struct sockaddr_in from; 154 struct sockaddr_in from;
153- int len = sizeof(from); 155- int len = sizeof(from);
154+ socklen_t len = sizeof(from); 156+ socklen_t len = sizeof(from);
155 register int cnt; 157 register int cnt;
156 if( udp ) { 158 if( udp ) {
157- cnt = recvfrom( fd, buf, count, 0, &from, &len ); 159- cnt = recvfrom( fd, buf, count, 0, &from, &len );
158+ cnt = recvfrom( fd, buf, count, 0, (struct sockaddr *)&from, &len ); 160+ cnt = recvfrom( fd, buf, count, 0, (struct sockaddr *)&from, &len );
159 numCalls++; 161 numCalls++;
160 } else { 162 } else {
161 if( b_flag ) 163 if( b_flag )
162@@ -782,7 +785,7 @@ 164@@ -782,7 +785,7 @@
163 register int cnt; 165 register int cnt;
164 if( udp ) { 166 if( udp ) {
165 again: 167 again:
166- cnt = sendto( fd, buf, count, 0, &sinhim, sizeof(sinhim) ); 168- cnt = sendto( fd, buf, count, 0, &sinhim, sizeof(sinhim) );
167+ cnt = sendto( fd, buf, count, 0, (struct sockaddr *)&sinhim, sizeof(sinhim) ); 169+ cnt = sendto( fd, buf, count, 0, (struct sockaddr *)&sinhim, sizeof(sinhim) );
168 numCalls++; 170 numCalls++;
169 if( cnt<0 && errno == ENOBUFS ) { 171 if( cnt<0 && errno == ENOBUFS ) {
170 delay(18000); 172 delay(18000);
171@@ -803,7 +806,7 @@ 173@@ -803,7 +806,7 @@
172  174
173 tv.tv_sec = 0; 175 tv.tv_sec = 0;
174 tv.tv_usec = us; 176 tv.tv_usec = us;
175- (void)select( 1, (char *)0, (char *)0, (char *)0, &tv ); 177- (void)select( 1, (char *)0, (char *)0, (char *)0, &tv );
176+ (void)select( 1, (void *)0, (void *)0, (void *)0, &tv ); 178+ (void)select( 1, (void *)0, (void *)0, (void *)0, &tv );
177 } 179 }
178  180
179 /* 181 /*