1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-23 09:10:43 +00:00

- Update to 0.7

- Rename rc.d script

PR:		ports/157363
Submitted by:	Ryan Steinmetz <rpsfa@rit.edu>
Approved by:	Dan Caescu <dan.caescu@multitel.ro> (maintainer)
This commit is contained in:
Wesley Shields 2011-05-29 01:11:00 +00:00
parent 7bca0f5550
commit dc179b2937
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=274773
6 changed files with 37 additions and 60 deletions

View File

@ -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
USE_GMAKE= yes
BUILD_DEPENDS= ${LOCALBASE}/include/argp.h:${PORTSDIR}/devel/argp-standalone
CFLAGS+= ${PTHREAD_CFLAGS}
USE_RC_SUBR= traff
USE_GMAKE= yes
GNU_CONFIGURE= yes
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 @@ OPTIONS= MYSQL "Enable MYSQL storage" on \
.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

View File

@ -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

View File

@ -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

View File

@ -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>

View File

@ -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. */