[Midnightbsd-cvs] mports: mports/net: add xferstats, a log parser for several servers
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Tue Feb 26 21:24:55 EST 2008
Log Message:
-----------
add xferstats, a log parser for several servers including Apache, proftpd, etc.
Modified Files:
--------------
mports/net:
Makefile (r1.60 -> r1.61)
Added Files:
-----------
mports/net/xferstats:
Makefile (r1.1)
distinfo (r1.1)
pkg-descr (r1.1)
pkg-plist (r1.1)
mports/net/xferstats/files:
patch-aa (r1.1)
patch-ab (r1.1)
patch-ac (r1.1)
-------------- next part --------------
--- /dev/null
+++ net/xferstats/pkg-descr
@@ -0,0 +1,2 @@
+Xferstats is a utility that parses wu-ftpd, ncftpd, and (special) apache
+xferlogs and gives various information and totals about the data transferred.
--- /dev/null
+++ net/xferstats/pkg-plist
@@ -0,0 +1,2 @@
+bin/xferstats
+etc/xferstats.cfg.sample
--- /dev/null
+++ net/xferstats/Makefile
@@ -0,0 +1,27 @@
+# New ports collection makefile for: xferstats
+# Date created: 19 February 1999
+# Whom: Dima Sivachenko
+#
+# $MidnightBSD: mports/net/xferstats/Makefile,v 1.1 2008/02/27 02:24:52 laffer1 Exp $
+# $FreeBSD: ports/net/xferstats/Makefile,v 1.16 2006/03/07 08:27:10 ade Exp $
+#
+
+PORTNAME= xferstats
+PORTVERSION= 2.16
+CATEGORIES= net
+MASTER_SITES= ftp://ftp.wu-ftpd.org/pub/support/
+
+MAINTAINER= ports at MidnightBSD.org
+COMMENT= Compiles information about file transfers from logfiles
+
+USE_GNOME= glib12
+GNU_CONFIGURE= yes
+
+MAN8= xferstats.8
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/xferstats ${PREFIX}/bin
+ ${INSTALL_MAN} ${WRKSRC}/xferstats.8 ${MAN8PREFIX}/man/man8
+ ${INSTALL_DATA} ${WRKSRC}/xferstats.cfg ${PREFIX}/etc/xferstats.cfg.sample
+
+.include <bsd.port.mk>
--- /dev/null
+++ net/xferstats/distinfo
@@ -0,0 +1,3 @@
+MD5 (xferstats-2.16.tar.gz) = d3281d6eeef8d04856a17f6d05c326a2
+SHA256 (xferstats-2.16.tar.gz) = 19b032709d4d473f9ed8cfe1134cc46254bf4eb39c4eee025d07dec1d0596819
+SIZE (xferstats-2.16.tar.gz) = 79327
Index: Makefile
===================================================================
RCS file: /home/cvs/mports/net/Makefile,v
retrieving revision 1.60
retrieving revision 1.61
diff -L net/Makefile -L net/Makefile -u -r1.60 -r1.61
--- net/Makefile
+++ net/Makefile
@@ -63,6 +63,7 @@
SUBDIR += ulxmlrpcpp
SUBDIR += vncreflector
SUBDIR += x11vnc
+ SUBDIR += xferstats
SUBDIR += xmlrpc++
SUBDIR += xmlrpc-c
SUBDIR += xmlrpc-epi
--- /dev/null
+++ net/xferstats/files/patch-ac
@@ -0,0 +1,84 @@
+--- parselog.c.orig Sun Oct 13 17:39:55 2002
++++ parselog.c Sun Oct 13 17:42:12 2002
+@@ -202,15 +202,11 @@
+
+ while (1) {
+ if (pointers->config->use_stdin) {
+- if (feof(stdin))
++ if (fgets(foo, sizeof(foo), stdin) == NULL)
+ break;
+- /* there's probably a better way to do this :) */
+- fgets(foo, sizeof(foo), stdin);
+ } else {
+- if (feof(log_stream))
++ if (fgets(foo, sizeof(foo), log_stream) == NULL)
+ break;
+-
+- fgets(foo, sizeof(foo), log_stream);
+ }
+
+ if ((len = strlen(foo)) < 42)
+@@ -455,10 +451,8 @@
+ #ifdef HAVE_MMAP
+ if (pointers->config->use_stdin)
+ {
+- if (feof(stdin))
++ if (fgets(foo, sizeof(foo), stdin) == NULL)
+ break;
+- /* there's probably a better way to do this :) */
+- fgets(foo, sizeof(foo), stdin);
+ }
+ else
+ {
+@@ -497,17 +491,13 @@
+ #else /* HAVE_MMAP */
+ if (pointers->config->use_stdin)
+ {
+- if (feof(stdin))
++ if (fgets(foo, sizeof(foo), stdin) == NULL)
+ break;
+- /* there's probably a better way to do this :) */
+- fgets(foo, sizeof(foo), stdin);
+ }
+ else
+ {
+- if (feof(log_stream))
++ if (fgets(foo, sizeof(foo), log_stream) == NULL)
+ break;
+-
+- fgets(foo, sizeof(foo), log_stream);
+ }
+ #endif /* HAVE_MMAP */
+
+@@ -770,10 +760,8 @@
+ #ifdef HAVE_MMAP
+ if (pointers->config->use_stdin)
+ {
+- if (feof(stdin))
++ if (fgets(foo, sizeof(foo), stdin) == NULL)
+ break;
+- /* there's probably a better way to do this :) */
+- fgets(foo, 2047, stdin);
+ }
+ else
+ {
+@@ -812,17 +800,13 @@
+ #else /* HAVE_MMAP */
+ if (pointers->config->use_stdin)
+ {
+- if (feof(stdin))
++ if (fgets(foo, sizeof(foo), stdin) == NULL)
+ break;
+- /* there's probably a better way to do this :) */
+- fgets(foo, 2047, stdin);
+ }
+ else
+ {
+- if (feof(log_stream))
++ if (fgets(foo, sizeof(foo), log_stream) == NULL)
+ break;
+-
+- fgets(foo, sizeof(foo), log_stream);
+ }
+ #endif /* HAVE_MMAP */
+
--- /dev/null
+++ net/xferstats/files/patch-ab
@@ -0,0 +1,23 @@
+--- xferstats.x Thu Jan 11 19:49:22 2001
++++ xferstats.c Thu Jan 11 19:50:31 2001
+@@ -2486,6 +2486,7 @@
+ {
+ pointers_t * pointers;
+ char * default_logfile;
++ int first = 1;
+
+ /* unbuffer stdout and stderr so output isn't lost */
+ setbuf(stdout, NULL);
+@@ -2559,10 +2560,11 @@
+
+ G_BLOW_CHUNKS();
+
+- if (!pointers->first_ftp_line) {
++ if (first && !pointers->first_ftp_line) {
+ fprintf(stderr, "No data to process.\n");
+ exit(0);
+ }
++ first = 0;
+
+ generate_daily_data(pointers, pointers->first_ftp_line);
+ if (pointers->config->dow_traffic)
--- /dev/null
+++ net/xferstats/files/patch-aa
@@ -0,0 +1,10 @@
+--- xferstats.x Thu Jan 11 19:35:18 2001
++++ xferstats.h Thu Jan 11 19:35:52 2001
+@@ -39,6 +39,7 @@
+
+ /* glibc's malloc is so damn efficient, chunks actually slow it down. so only
+ * use g_mem_chunks on non-glibc systems */
++#define __GLIBC__
+ #ifdef __GLIBC__
+ # define G_MEM_CHUNK_ALLOC(bar) g_malloc(bar)
+ # define G_MEM_CHUNK_ALLOC0(bar) g_malloc0(bar)
More information about the Midnightbsd-cvs
mailing list