Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 May 2011 02:01:32 GMT
From:      Ryan Steinmetz <rpsfa@rit.edu>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/157363: [update] net/traff to 0.7
Message-ID:  <201105270201.p4R21W1Y051338@red.freebsd.org>
Resent-Message-ID: <201105270210.p4R2A9pP041680@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         157363
>Category:       ports
>Synopsis:       [update] net/traff to 0.7
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Fri May 27 02:10:09 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Ryan Steinmetz
>Release:        8.2-RELEASE
>Organization:
Rochester Institute of Technology
>Environment:
>Description:
-Update to 0.7
-Rename rc.d script
-Maintainership requested if current maintainer is interested in releasing it
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -urN /usr/ports/net/traff/Makefile traff/Makefile
--- /usr/ports/net/traff/Makefile	2011-03-19 09:15:27.000000000 -0400
+++ traff/Makefile	2011-05-26 21:57:16.000000000 -0400
@@ -6,19 +6,22 @@
 #
 
 PORTNAME=	traff
-PORTVERSION=	0.6.1
-PORTREVISION=	1
+PORTVERSION=	0.7
 CATEGORIES=	net net-mgmt
 MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION}
 
 MAINTAINER=	daniel@freebsd.ro
 COMMENT=	Libpcab based fast traffic accounting program
 
-USE_RC_SUBR=	traff.sh
+BUILD_DEPENDS=	${LOCALBASE}/include/argp.h:${PORTSDIR}/devel/argp-standalone
+
+USE_RC_SUBR=	traff
 USE_GMAKE=	yes
+GNU_CONFIGURE=	yes
 
-CFLAGS+=	${PTHREAD_CFLAGS}
+CFLAGS+=	${PTHREAD_CFLAGS} -L${LOCALBASE}/lib
 LFLAGS=		${PTHREAD_LIBS}
+CONFIGURE_ENV+=	"LIBS=-largp"
 
 OPTIONS=	MYSQL	"Enable MYSQL storage" 	on \
 		PGSQL	"Enable PGSQL storage"	off
@@ -27,19 +30,21 @@
 
 .if !defined(WITHOUT_MYSQL)
 USE_MYSQL=	yes
-CFLAGS+=	-DwithMYSQL -I${LOCALBASE}/include
+CFLAGS+=	-DwithMYSQL -I${LOCALBASE}/include -L${LOCALBASE}/lib/mysql
 LFLAGS+=	-L${LOCALBASE}/lib/mysql -lmysqlclient_r
+CONFIGURE_ARGS+=--enable-mysql
 .endif
 
 .if defined(WITH_PGSQL)
 USE_PGSQL=	yes
 CFLAGS+=	-DwithPGSQL -I${LOCALBASE}/include
 LFLAGS+=	-L${LOCALBASE}/lib -lpq
+CONFIGURE_ARGS+=--enable-postgresql
 .endif
 
 MAKE_ARGS+=	EXTRA_LIBS="${LFLAGS}"
 
-post-patch:
+post-configure:
 	@${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|g" \
 		${WRKSRC}/Makefile ${WRKSRC}/traff.c
 
diff -urN /usr/ports/net/traff/distinfo traff/distinfo
--- /usr/ports/net/traff/distinfo	2011-03-20 08:53:08.000000000 -0400
+++ traff/distinfo	2011-05-26 21:03:53.000000000 -0400
@@ -1,2 +1,2 @@
-SHA256 (traff-0.6.1.tar.gz) = 577acbeaebdc8695fab89877f9afd935321cd1976edf71f1c2d786edc83e4190
-SIZE (traff-0.6.1.tar.gz) = 26371
+SHA256 (traff-0.7.tar.gz) = a0274f0dd0919190183eafae3ca68ad047759ddd75d61d5d574d80914bc200a7
+SIZE (traff-0.7.tar.gz) = 95530
diff -urN /usr/ports/net/traff/files/patch-Makefile traff/files/patch-Makefile
--- /usr/ports/net/traff/files/patch-Makefile	2005-09-28 12:34:40.000000000 -0400
+++ traff/files/patch-Makefile	1969-12-31 19:00:00.000000000 -0500
@@ -1,20 +0,0 @@
---- Makefile.orig	Tue Sep 27 19:11:33 2005
-+++ Makefile	Tue Sep 27 19:12:24 2005
-@@ -5,13 +5,13 @@
- #LFLAGS= -lcurses
- 
- # Directories
--BINDIR = /usr/local/sbin
--ETCDIR = /etc
-+BINDIR = %%PREFIX%%/sbin
-+ETCDIR = %%PREFIX%%/etc
- 
- # fuer i386 auskommentieren
--CFLAGS = -g -D_REENTRANT -DwithMYSQL -DwithPGSQL
-+#CFLAGS = -g -D_REENTRANT -DwithMYSQL -DwithPGSQL
- 
--LFLAGS =  -lpcap -lpthread -lpq -lmysqlclient
-+LFLAGS = -lpcap $(EXTRA_LIBS)
- 
- MODULES = traff.o readconfig.o ip_table.o
- 
diff -urN /usr/ports/net/traff/files/patch-readconfig.h traff/files/patch-readconfig.h
--- /usr/ports/net/traff/files/patch-readconfig.h	2005-09-28 12:34:40.000000000 -0400
+++ traff/files/patch-readconfig.h	2011-05-26 21:06:35.000000000 -0400
@@ -1,6 +1,6 @@
---- readconfig.h.orig	Wed Feb 13 06:54:06 2002
-+++ readconfig.h	Tue Sep 27 19:33:19 2005
-@@ -14,7 +14,7 @@
+--- readconfig.h.orig	2009-11-10 20:55:07.000000000 -0500
++++ readconfig.h	2011-05-26 21:06:12.000000000 -0400
+@@ -13,7 +13,7 @@
  #endif
  
  #if withPGSQL
@@ -8,4 +8,4 @@
 +#include <libpq-fe.h>
  #endif
  
- #include <pcap.h> 
+ #include <stdlib.h>
diff -urN /usr/ports/net/traff/files/patch-traff.c traff/files/patch-traff.c
--- /usr/ports/net/traff/files/patch-traff.c	2005-09-28 12:34:40.000000000 -0400
+++ traff/files/patch-traff.c	2011-05-26 21:46:00.000000000 -0400
@@ -1,28 +1,20 @@
---- traff.c.orig	Fri Feb  1 16:10:22 2002
-+++ traff.c	Tue Sep 27 18:04:32 2005
-@@ -135,7 +135,7 @@
-   DEBUG(printf("Reading Config\n");)
-   config = (t_config *) malloc(sizeof(t_config));
-   // reading config file
--  config_init(config,"/etc/traff.conf"); // this function will initialize configuration
-+  config_init(config,"%%PREFIX%%/etc/traff.conf"); // this function will initialize configuration
-   config->dt = time(0);
+--- traff.c.orig	2009-11-10 20:55:07.000000000 -0500
++++ traff.c	2011-05-26 21:17:58.000000000 -0400
+@@ -121,7 +121,7 @@
+ /* The options we understand. */
+ static struct argp_option options[] = {
+ {"debug",  'd', 0,       0, "Produce debug output" },
+-{"config",  'c', "FILE",       0, "Configuration File default: /etc/traff.conf" },
++{"config",  'c', "FILE",       0, "Configuration File default: %%PREFIX%%/etc/traff.conf" },
+ { 0 }
+ };
  
-   DEBUG(print_config();)
-@@ -467,14 +467,8 @@
-   bzero(my_query, QUERYLENGTH);
-   DEBUG(printf("Initializing Mysql\n");)
-   mysql_init(&mysql);
--  DEBUG(printf("Connecting to host %s, db %s, table %s using login %s, password %s\n",cat->sql->host,cat->sql->db, cat->sql->table,cat->sql->user,cat->sql->password);)
--  mysql_connect(&mysql,cat->sql->host,cat->sql->user,cat->sql->password);
--  if (mysql_errno(&mysql)) {
--    fprintf(stderr,"Error connecting to Mysql-Database in category %s:\n%d, %s\n",cat->name,  mysql_errno(&mysql),mysql_error(&mysql));
--    syslog(LOG_ERR,"Error connecting to Mysql-Database in category %s:\n%d, %s\n",cat->name, mysql_errno(&mysql),mysql_error(&mysql));
--    return 1;
--  }
--  mysql_select_db(&mysql,cat->sql->db); 
-+  DEBUG(printf("Connecting to host %s, db %s, table %s using login %s, password %s\n",cat->sql->host,cat->sql->db, cat->sql->table,cat->sql->user,cat->sql->password,cat->sql->db,0,NULL,0);)
-+  mysql_real_connect(&mysql,cat->sql->host,cat->sql->user,cat->sql->password,cat->sql->db,0,NULL,0);
-   if (mysql_errno(&mysql)) {
-     fprintf(stderr,"Error connecting to Mysql-Database in category %s:\n%d, %s\n",cat->name,  mysql_errno(&mysql),mysql_error(&mysql));
-     syslog(LOG_ERR,"Error connecting to Mysql-Database in category %s:\n%d, %s\n",cat->name, mysql_errno(&mysql),mysql_error(&mysql));
+@@ -174,7 +174,7 @@
+   
+   /* Default values. */
+   arguments.debug = 0;
+-  arguments.config = "/etc/traff.conf";
++  arguments.config = "%%PREFIX%%/etc/traff.conf";
+   
+   /* Parse our arguments; every option seen by parse_opt will be
+     reflected in arguments. */
diff -urN /usr/ports/net/traff/files/traff.in traff/files/traff.in
--- /usr/ports/net/traff/files/traff.in	1969-12-31 19:00:00.000000000 -0500
+++ traff/files/traff.in	2011-05-26 21:00:37.000000000 -0400
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+#
+# PROVIDE: traff
+# REQUIRE: DAEMON
+# BEFORE: LOGIN
+# KEYWORD: shutdown
+
+#
+# Add the following lines to /etc/rc.conf to enable traff:
+#
+# traff_enable="YES"
+#
+#
+
+. /etc/rc.subr
+
+name=traff
+rcvar=`set_rcvar`
+
+
+command=%%PREFIX%%/sbin/traff
+pidfile=/var/run/traff.pid
+required_files=%%PREFIX%%/etc/traff.conf
+
+stop_postcmd=stop_postcmd
+
+stop_postcmd()
+{
+	rm -f $pidfile
+}
+
+# set defaults
+
+traff_enable=${traff_enable:-"NO"}
+
+load_rc_config $name
+run_rc_command "$1"
+
diff -urN /usr/ports/net/traff/files/traff.sh.in traff/files/traff.sh.in
--- /usr/ports/net/traff/files/traff.sh.in	2010-03-26 20:14:08.000000000 -0400
+++ traff/files/traff.sh.in	1969-12-31 19:00:00.000000000 -0500
@@ -1,39 +0,0 @@
-#!/bin/sh
-#
-#
-# PROVIDE: traff
-# REQUIRE: DAEMON
-# BEFORE: LOGIN
-# KEYWORD: shutdown
-
-#
-# Add the following lines to /etc/rc.conf to enable traff:
-#
-# traff_enable="YES"
-#
-#
-
-. /etc/rc.subr
-
-name=traff
-rcvar=`set_rcvar`
-
-
-command=%%PREFIX%%/sbin/traff
-pidfile=/var/run/traff.pid
-required_files=%%PREFIX%%/etc/traff.conf
-
-stop_postcmd=stop_postcmd
-
-stop_postcmd()
-{
-	rm -f $pidfile
-}
-
-# set defaults
-
-traff_enable=${traff_enable:-"NO"}
-
-load_rc_config $name
-run_rc_command "$1"
-


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105270201.p4R21W1Y051338>