diff options
author | Wesley Shields <wxs@FreeBSD.org> | 2011-05-29 01:11:00 +0000 |
---|---|---|
committer | Wesley Shields <wxs@FreeBSD.org> | 2011-05-29 01:11:00 +0000 |
commit | dc179b2937b9cbc51e57c1eb523fba46345ff04a (patch) | |
tree | 9bad7e7361dc43258ec143cfe093303a07d7fb14 /net/traff | |
parent | 7bca0f55506a5559bc78886d3d13bd771a2f775b (diff) | |
download | ports-dc179b2937b9cbc51e57c1eb523fba46345ff04a.tar.gz ports-dc179b2937b9cbc51e57c1eb523fba46345ff04a.zip |
Notes
Diffstat (limited to 'net/traff')
-rw-r--r-- | net/traff/Makefile | 17 | ||||
-rw-r--r-- | net/traff/distinfo | 4 | ||||
-rw-r--r-- | net/traff/files/patch-Makefile | 20 | ||||
-rw-r--r-- | net/traff/files/patch-readconfig.h | 8 | ||||
-rw-r--r-- | net/traff/files/patch-traff.c | 46 | ||||
-rw-r--r-- | net/traff/files/traff.in (renamed from net/traff/files/traff.sh.in) | 0 |
6 files changed, 36 insertions, 59 deletions
diff --git a/net/traff/Makefile b/net/traff/Makefile index 75a80f25e7ef..80c2e46cc6ad 100644 --- a/net/traff/Makefile +++ b/net/traff/Makefile @@ -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 @@ 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 diff --git a/net/traff/distinfo b/net/traff/distinfo index 4ea369f8b19f..10a7fdae16c8 100644 --- a/net/traff/distinfo +++ b/net/traff/distinfo @@ -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 --git a/net/traff/files/patch-Makefile b/net/traff/files/patch-Makefile deleted file mode 100644 index 748e8e238343..000000000000 --- a/net/traff/files/patch-Makefile +++ /dev/null @@ -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 --git a/net/traff/files/patch-readconfig.h b/net/traff/files/patch-readconfig.h index 36d7ea44b00f..0f0af5b4f64f 100644 --- a/net/traff/files/patch-readconfig.h +++ b/net/traff/files/patch-readconfig.h @@ -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 --git a/net/traff/files/patch-traff.c b/net/traff/files/patch-traff.c index 358781742942..3d30a810a69f 100644 --- a/net/traff/files/patch-traff.c +++ b/net/traff/files/patch-traff.c @@ -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 --git a/net/traff/files/traff.sh.in b/net/traff/files/traff.in index 92075b716a2b..92075b716a2b 100644 --- a/net/traff/files/traff.sh.in +++ b/net/traff/files/traff.in |