[25149] trunk/dports/net

source_changes at macosforge.org source_changes at macosforge.org
Mon May 14 21:56:39 PDT 2007


Revision: 25149
          http://trac.macosforge.org/projects/macports/changeset/25149
Author:   markd at macports.org
Date:     2007-05-14 21:56:39 -0700 (Mon, 14 May 2007)

Log Message:
-----------
New port.

Added Paths:
-----------
    trunk/dports/net/flow-tools/
    trunk/dports/net/flow-tools/Portfile
    trunk/dports/net/flow-tools/files/
    trunk/dports/net/flow-tools/files/flow_capture.in
    trunk/dports/net/flow-tools/files/patch-configs_Makefile
    trunk/dports/net/flow-tools/files/patch-configure
    trunk/dports/net/flow-tools/files/patch-flow-header.c
    trunk/dports/net/flow-tools/files/patch-ftpaths.h
    trunk/dports/net/flow-tools/files/patch-lib-ftfile.c
    trunk/dports/net/flow-tools/files/patch-lib_Makefile.in
    trunk/dports/net/flow-tools/files/patch-lib_ftchash.c
    trunk/dports/net/flow-tools/files/patch-lib_ftio.c
    trunk/dports/net/flow-tools/files/patch-lib_ftsym.c
    trunk/dports/net/flow-tools/files/patch-lib_fttlv.c
    trunk/dports/net/flow-tools/files/patch-lib_support.c
    trunk/dports/net/flow-tools/files/patch-src_Makefile.in
    trunk/dports/net/flow-tools/files/patch-src_flow-fanout.c
    trunk/dports/net/flow-tools/files/pkg-deinstall.in
    trunk/dports/net/flow-tools/files/pkg-install.in

Added: trunk/dports/net/flow-tools/Portfile
===================================================================
--- trunk/dports/net/flow-tools/Portfile	                        (rev 0)
+++ trunk/dports/net/flow-tools/Portfile	2007-05-15 04:56:39 UTC (rev 25149)
@@ -0,0 +1,59 @@
+# $Id$
+
+PortSystem	1.0
+
+name			flow-tools
+version			0.68
+categories		net
+maintainers		markd at macports.org
+platforms		darwin
+
+description		Suite of tools and library to work with netflow data
+long_description	${description}
+
+homepage		http://www.splintered.net/sw/flow-tools/
+master_sites	        ftp://ftp.eng.oar.net/pub/flow-tools/
+checksums		md5 c9e0a8b53c79611b6bffcb9d510a5a38
+
+patchfiles		patch-configs_Makefile \
+			patch-flow-header.c \
+			patch-ftpaths.h \
+			patch-lib_ftchash.c \
+			patch-lib_ftio.c \
+			patch-lib_ftsym.c \
+			patch-lib_fttlv.c \
+			patch-lib_Makefile.in \
+			patch-lib_support.c \
+			patch-lib-ftfile.c \
+			patch-src_flow-fanout.c \
+			patch-src_Makefile.in
+
+depends_lib		port:openssl \
+			port:zlib
+
+post-patch {
+	reinplace "s|__PREFIX__|${prefix}|g" \
+		${filespath}/patch-ftpaths.h
+
+	reinplace "s|\$WHERE_MYSQL/lib/mysql|\$WHERE_MYSQL/lib/mysql5|g" \
+		${worksrcpath}/configure
+	reinplace "s|\$WHERE_MYSQL/include/mysql|\$WHERE_MYSQL/include/mysql5|g" \
+		${worksrcpath}/configure
+
+	eval reinplace "s|@localstatedir@/sym/|${prefix}/share/flow-tools/|g" \
+		[glob ${worksrcpath}/docs/flow-*.1.in] \
+		[glob ${worksrcpath}/docs/flow-*.html.in]
+
+	eval reinplace "s|@localstatedir@/cfg/|${prefix}/etc/flow-tools/|g" \
+		[glob ${worksrcpath}/docs/flow-*.1.in] \
+		[glob ${worksrcpath}/docs/flow-*.html.in]
+}
+
+configure.args		--with-openssl=${prefix} \
+			--localstatedir=${prefix}
+
+variant mysql5 {
+	configure.args-append	--with-mysql=${prefix}
+	depends_lib-append	port:mysql5
+}
+


Property changes on: trunk/dports/net/flow-tools/Portfile
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: trunk/dports/net/flow-tools/files/flow_capture.in
===================================================================
--- trunk/dports/net/flow-tools/files/flow_capture.in	                        (rev 0)
+++ trunk/dports/net/flow-tools/files/flow_capture.in	2007-05-15 04:56:39 UTC (rev 25149)
@@ -0,0 +1,110 @@
+#!/bin/sh
+#
+# $FreeBSD: ports/net-mgmt/flow-tools/files/flow_capture.in,v 1.3 2006/12/19 22:44:25 stas Exp $
+#
+
+# PROVIDE: flow_capture
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+
+#
+# Add the following line to /etc/rc.conf to enable flow-capture:
+# flow_capture_enable (bool):	Set it to "YES" to enable flow-capture daemon.
+#				Set to "NO" by default.
+# flow_capture_datadir (str):	Base flow data directory.
+#				Default is "/var/db/flows"
+# flow_capture_localip (str):	IP address to bind to
+#				Default to "0.0.0.0"
+# flow_capture_remoteip (str):	IP address to accept flows from
+#				Default to "0.0.0.0" or all IPs
+# flow_capture_port (int):	Port to accept flow data on
+#				Default is "8787"
+# flow_capture_flags (str):	Custom additional arguments to be passed
+#				to flow-collector (default "-E 128M").
+# flow_capture_profiles (str):	A list of configuration	profiles to enable.
+#				This allows you	to run several instances of
+#				flow-capture with different parameters.
+#				Consider the following example:
+#				flow_capture_enable="YES"
+#				flow_capture_localip="85.172.168.9"
+#				flow_capture_profiles="r1 r2"
+#				flow_capture_r1_datadir="/var/db/flows/r1"
+#				flow_capture_r1_port="4444"
+#				flow_capture_r1_flags="-E20G -n287 -N-2"
+#				flow_capture_r2_datadir="/var/db/flows/r2"
+#				flow_capture_r2_port="4445"
+#				flow_capture_r2_flags="-E5G -n287 -N-2"
+#
+#				This will run two instances of the flow-capture
+#				with parameters taken from appropriate
+#				flow_capture_PROFILENAME_xxx variables. For
+#				unspecified parameters flow_capture_xxx
+#				varialbes will be used.
+
+. /etc/rc.subr
+
+name="flow_capture"
+rcvar=`set_rcvar`
+
+setup_profile_vars()
+{
+	name=flow_capture_$1
+	eval ": \${flow_capture_${1}_datadir=${flow_capture_datadir}}"
+	eval ": \${flow_capture_${1}_localip=${flow_capture_localip}}"
+	eval ": \${flow_capture_${1}_remoteip=${flow_capture_remoteip}}"
+	eval ": \${flow_capture_${1}_port=${flow_capture_port}}"
+	eval ": \${flow_capture_${1}_user=${flow_capture_user}}"
+	eval ": \${flow_capture_${1}_group=${flow_capture_group}}"
+	eval ": \${flow_capture_${1}_flags=${flow_capture_flags}}"
+	eval "pidfile=${flow_capture_pid}.\${flow_capture_${1}_port}"
+	eval "command_args=\"-w \${flow_capture_${1}_datadir} -p ${flow_capture_pid} \${flow_capture_${1}_localip}/\${flow_capture_${1}_remoteip}/\${flow_capture_${1}_port}\""
+}
+
+start_profiles()
+{
+	unset start_cmd
+	for _profile in ${flow_capture_profiles}; do
+		setup_profile_vars $_profile
+		run_rc_command "${rc_arg}"
+	done
+}
+
+stop_profiles()
+{
+	unset stop_cmd
+	for _profile in ${flow_capture_profiles}; do
+		setup_profile_vars $_profile
+		run_rc_command "${rc_arg}"
+	done
+}
+
+load_rc_config $name
+
+: ${flow_capture_enable="NO"}
+: ${flow_capture_datadir="%%FLOW_CAPTURE_SPOOL%%"}
+: ${flow_capture_localip="0.0.0.0"}
+: ${flow_capture_remoteip="0.0.0.0"}
+: ${flow_capture_port="8787"}
+: ${flow_capture_pid="%%FLOW_CAPTURE_PIDDIR%%/flow-capture.pid"}
+: ${flow_capture_user="flowtools"}
+: ${flow_capture_group="flowtools"}
+: ${flow_capture_flags="-E 128M"}
+
+pidfile="${flow_capture_pid}.${flow_capture_port}"
+
+command="%%PREFIX%%/bin/flow-capture"
+command_args="-w ${flow_capture_datadir} -p ${flow_capture_pid} ${flow_capture_localip}/${flow_capture_remoteip}/${flow_capture_port}"
+
+cmd="$1"
+if [ $# -gt 0 ]; then
+	shift
+fi
+
+[ -n "$*" ] && flow_capture_profiles="$*"
+
+if [ "${flow_capture_profiles}" ]; then
+	start_cmd="start_profiles"
+	stop_cmd="stop_profiles"
+fi
+
+run_rc_command "$cmd"

Added: trunk/dports/net/flow-tools/files/patch-configs_Makefile
===================================================================
--- trunk/dports/net/flow-tools/files/patch-configs_Makefile	                        (rev 0)
+++ trunk/dports/net/flow-tools/files/patch-configs_Makefile	2007-05-15 04:56:39 UTC (rev 25149)
@@ -0,0 +1,26 @@
+--- configs/Makefile.am.orig	Tue Jun  7 22:43:47 2005
++++ configs/Makefile.am	Tue Jun  7 22:44:44 2005
+@@ -1,6 +1,6 @@
+-ftsymdir=$(localstatedir)/sym
++ftsymdir=$(localstatedir)/share/flow-tools
+ ftsym_DATA = ip-prot.sym ip-type.sym tcp-port.sym asn.sym tag.sym
+ 
+-ftcfgdir=$(localstatedir)/cfg
++ftcfgdir=$(localstatedir)/etc/flow-tools
+ ftcfg_DATA = map.cfg tag.cfg filter.cfg stat.cfg mask.cfg xlate.cfg
+ 
+--- configs/Makefile.in.orig	Tue Jun  7 22:44:14 2005
++++ configs/Makefile.in	Tue Jun  7 22:45:10 2005
+@@ -88,10 +88,10 @@
+ am__include = @am__include@
+ am__quote = @am__quote@
+ install_sh = @install_sh@
+-ftsymdir = $(localstatedir)/sym
++ftsymdir = $(localstatedir)/share/flow-tools
+ ftsym_DATA = ip-prot.sym ip-type.sym tcp-port.sym asn.sym tag.sym
+ 
+-ftcfgdir = $(localstatedir)/cfg
++ftcfgdir = $(localstatedir)/etc/flow-tools
+ ftcfg_DATA = map.cfg tag.cfg filter.cfg stat.cfg mask.cfg xlate.cfg
+ subdir = configs
+ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs

Added: trunk/dports/net/flow-tools/files/patch-configure
===================================================================
--- trunk/dports/net/flow-tools/files/patch-configure	                        (rev 0)
+++ trunk/dports/net/flow-tools/files/patch-configure	2007-05-15 04:56:39 UTC (rev 25149)
@@ -0,0 +1,59 @@
+--- configure.orig	Wed May 11 18:15:55 2005
++++ configure	Wed Dec 20 01:34:55 2006
+@@ -1662,7 +1662,7 @@
+ 
+ 
+ 
+-CFLAGS="-g -Wall"
++CFLAGS="-fPIC"
+ 
+ ac_ext=c
+ ac_cpp='$CPP $CPPFLAGS'
+@@ -2254,7 +2254,6 @@
+ GCC=`test $ac_compiler_gnu = yes && echo yes`
+ ac_test_CFLAGS=${CFLAGS+set}
+ ac_save_CFLAGS=$CFLAGS
+-CFLAGS="-g"
+ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+ echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+ if test "${ac_cv_prog_cc_g+set}" = set; then
+@@ -2299,21 +2298,6 @@
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+ echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+-if test "$ac_test_CFLAGS" = set; then
+-  CFLAGS=$ac_save_CFLAGS
+-elif test $ac_cv_prog_cc_g = yes; then
+-  if test "$GCC" = yes; then
+-    CFLAGS="-g -O2"
+-  else
+-    CFLAGS="-g"
+-  fi
+-else
+-  if test "$GCC" = yes; then
+-    CFLAGS="-O2"
+-  else
+-    CFLAGS=
+-  fi
+-fi
+ echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+ echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+ if test "${ac_cv_prog_cc_stdc+set}" = set; then
+@@ -3345,7 +3329,7 @@
+ 
+ 
+ if test "x$WHERE_PGSQL" != "x"; then
+-  LIBS="-L$WHERE_PGSQL/lib/pgsql"
++  LIBS="-L$WHERE_PGSQL/lib"
+   echo "$as_me:$LINENO: checking for PQsetdbLogin in -lpq" >&5
+ echo $ECHO_N "checking for PQsetdbLogin in -lpq... $ECHO_C" >&6
+ if test "${ac_cv_lib_pq_PQsetdbLogin+set}" = set; then
+@@ -3402,7 +3386,7 @@
+ echo "${ECHO_T}$ac_cv_lib_pq_PQsetdbLogin" >&6
+ if test $ac_cv_lib_pq_PQsetdbLogin = yes; then
+ 
+-      PGSQLCFLAGS="-L$WHERE_PGSQL/lib -I$WHERE_PGSQL/include/pgsql"
++      PGSQLCFLAGS="-L$WHERE_PGSQL/lib -I$WHERE_PGSQL/include"
+       PGSQLLIB="-lpq"
+       cat >>confdefs.h <<\_ACEOF
+ #define HAVE_PGSQL 1

Added: trunk/dports/net/flow-tools/files/patch-flow-header.c
===================================================================
--- trunk/dports/net/flow-tools/files/patch-flow-header.c	                        (rev 0)
+++ trunk/dports/net/flow-tools/files/patch-flow-header.c	2007-05-15 04:56:39 UTC (rev 25149)
@@ -0,0 +1,10 @@
+--- src/flow-header.c.orig	Mon Jul 26 13:21:36 2004
++++ src/flow-header.c	Mon Jul 26 13:21:45 2004
+@@ -32,6 +32,7 @@
+ 
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <unistd.h>
+ 
+ void usage(void);
+ 

Added: trunk/dports/net/flow-tools/files/patch-ftpaths.h
===================================================================
--- trunk/dports/net/flow-tools/files/patch-ftpaths.h	                        (rev 0)
+++ trunk/dports/net/flow-tools/files/patch-ftpaths.h	2007-05-15 04:56:39 UTC (rev 25149)
@@ -0,0 +1,62 @@
+--- lib/ftpaths.h.orig	Wed Dec  3 22:19:47 2003
++++ lib/ftpaths.h	Wed Jul  7 15:06:42 2004
+@@ -29,17 +29,17 @@
+ #ifndef FTPATHS_H
+ #define FTPATHS_H
+ 
+-#define FT_PATH_CFG_MAP             "/usr/local/netflow/var/cfg/map.cfg"
+-#define FT_PATH_CFG_TAG             "/usr/local/netflow/var/cfg/tag.cfg"
+-#define FT_PATH_CFG_FILTER          "/usr/local/netflow/var/cfg/filter.cfg"
+-#define FT_PATH_CFG_STAT            "/usr/local/netflow/var/cfg/stat.cfg"
+-#define FT_PATH_CFG_MASK            "/usr/local/netflow/var/cfg/mask.cfg"
+-#define FT_PATH_CFG_XLATE           "/usr/local/netflow/var/cfg/xlate.cfg"
++#define FT_PATH_CFG_MAP             "/opt/local/etc/flow-tools/map.cfg"
++#define FT_PATH_CFG_TAG             "/opt/local/etc/flow-tools/tag.cfg"
++#define FT_PATH_CFG_FILTER          "/opt/local/etc/flow-tools/filter.cfg"
++#define FT_PATH_CFG_STAT            "/opt/local/etc/flow-tools/stat.cfg"
++#define FT_PATH_CFG_MASK            "/opt/local/etc/flow-tools/mask.cfg"
++#define FT_PATH_CFG_XLATE           "/opt/local/etc/flow-tools/xlate.cfg"
+ 
+-#define FT_PATH_SYM_IP_PROT         "/usr/local/netflow/var/sym/ip-prot.sym"
+-#define FT_PATH_SYM_IP_TYPE         "/usr/local/netflow/var/sym/ip-type.sym"
+-#define FT_PATH_SYM_TCP_PORT        "/usr/local/netflow/var/sym/tcp-port.sym"
+-#define FT_PATH_SYM_ASN             "/usr/local/netflow/var/sym/asn.sym"
+-#define FT_PATH_SYM_TAG             "/usr/local/netflow/var/sym/tag.sym"
++#define FT_PATH_SYM_IP_PROT         "/opt/local/share/flow-tools/ip-prot.sym"
++#define FT_PATH_SYM_IP_TYPE         "/opt/local/share/flow-tools/ip-type.sym"
++#define FT_PATH_SYM_TCP_PORT        "/opt/local/share/flow-tools/tcp-port.sym"
++#define FT_PATH_SYM_ASN             "/opt/local/share/flow-tools/asn.sym"
++#define FT_PATH_SYM_TAG             "/opt/local/share/flow-tools/tag.sym"
+ 
+ #endif /* FTPATHS_H */
+--- lib/ftpaths.h.in.orig	Tue Nov 11 08:49:14 2003
++++ lib/ftpaths.h.in	Wed Jul  7 15:05:45 2004
+@@ -29,17 +29,17 @@
+ #ifndef FTPATHS_H
+ #define FTPATHS_H
+ 
+-#define FT_PATH_CFG_MAP             "@localstatedir@/cfg/map.cfg"
+-#define FT_PATH_CFG_TAG             "@localstatedir@/cfg/tag.cfg"
+-#define FT_PATH_CFG_FILTER          "@localstatedir@/cfg/filter.cfg"
+-#define FT_PATH_CFG_STAT            "@localstatedir@/cfg/stat.cfg"
+-#define FT_PATH_CFG_MASK            "@localstatedir@/cfg/mask.cfg"
+-#define FT_PATH_CFG_XLATE           "@localstatedir@/cfg/xlate.cfg"
++#define FT_PATH_CFG_MAP             "@localstatedir@/etc/flow-tools/map.cfg"
++#define FT_PATH_CFG_TAG             "@localstatedir@/etc/flow-tools/tag.cfg"
++#define FT_PATH_CFG_FILTER          "@localstatedir@/etc/flow-tools/filter.cfg"
++#define FT_PATH_CFG_STAT            "@localstatedir@/etc/flow-tools/stat.cfg"
++#define FT_PATH_CFG_MASK            "@localstatedir@/etc/flow-tools/mask.cfg"
++#define FT_PATH_CFG_XLATE           "@localstatedir@/etc/flow-tools/xlate.cfg"
+ 
+-#define FT_PATH_SYM_IP_PROT         "@localstatedir@/sym/ip-prot.sym"
+-#define FT_PATH_SYM_IP_TYPE         "@localstatedir@/sym/ip-type.sym"
+-#define FT_PATH_SYM_TCP_PORT        "@localstatedir@/sym/tcp-port.sym"
+-#define FT_PATH_SYM_ASN             "@localstatedir@/sym/asn.sym"
+-#define FT_PATH_SYM_TAG             "@localstatedir@/sym/tag.sym"
++#define FT_PATH_SYM_IP_PROT         "@localstatedir@/share/flow-tools/ip-prot.sym"
++#define FT_PATH_SYM_IP_TYPE         "@localstatedir@/share/flow-tools/ip-type.sym"
++#define FT_PATH_SYM_TCP_PORT        "@localstatedir@/share/flow-tools/tcp-port.sym"
++#define FT_PATH_SYM_ASN             "@localstatedir@/share/flow-tools/asn.sym"
++#define FT_PATH_SYM_TAG             "@localstatedir@/share/flow-tools/tag.sym"
+ 
+ #endif /* FTPATHS_H */

Added: trunk/dports/net/flow-tools/files/patch-lib-ftfile.c
===================================================================
--- trunk/dports/net/flow-tools/files/patch-lib-ftfile.c	                        (rev 0)
+++ trunk/dports/net/flow-tools/files/patch-lib-ftfile.c	2007-05-15 04:56:39 UTC (rev 25149)
@@ -0,0 +1,100 @@
+--- lib/ftfile.c.orig	Thu Feb 13 05:38:42 2003
++++ lib/ftfile.c	Fri Feb 10 10:39:40 2006
+@@ -311,7 +311,7 @@
+ int ftfile_expire (struct ftfile_entries *fte, int doit, int curbytes)
+ {
+   u_int i;
+-  struct ftfile_entry *n1;
++  struct ftfile_entry *n1, *n2;
+   u_int64 bytes;
+ 
+   /*
+@@ -323,15 +323,20 @@
+   bytes = 0;
+ 
+   if (fte->max_files && (fte->num_files > fte->max_files)) {
++    n2 = NULL;
+     FT_TAILQ_FOREACH(n1, &fte->head, chain) {
++      if (n2 != NULL) {
++	ftfile_entry_free(n2);
++	n2 = NULL;
++      }
+       fterr_info("remove/1 %s", n1->name);
+       bytes += n1->size;
+       ++i;
+       if (doit) {
++        n2 = n1;
+         FT_TAILQ_REMOVE(&fte->head, n1, chain);
+         if (unlink(n1->name) == -1) 
+           fterr_warn("unlink(%s)", n1->name);
+-        ftfile_entry_free(n1);
+       } /* doit */
+       if ((fte->num_files - i) <= fte->max_files)
+         break;
+@@ -340,6 +345,10 @@
+       fte->num_files -= i;
+       fte->num_bytes -= bytes;
+     } /* doit */
++    if (n2 != NULL) {
++      ftfile_entry_free(n2);
++      n2 = NULL;
++    }
+   } /* if */
+ 
+   if (debug)
+@@ -354,15 +363,20 @@
+    */
+ 
+   if (fte->max_bytes && (fte->num_bytes+curbytes > fte->max_bytes)) {
++    n2 = NULL;
+     FT_TAILQ_FOREACH(n1, &fte->head, chain) {
++      if (n2 != NULL) {
++	ftfile_entry_free(n2);
++	n2 = NULL;
++      }
+       fterr_info("remove/2 %s", n1->name);
+       bytes += n1->size;
+       ++i;
+       if (doit) {
++        n2 = n1;
+         FT_TAILQ_REMOVE(&fte->head, n1, chain);
+         if (unlink(n1->name) == -1) 
+           fterr_warn("unlink(%s)", n1->name);
+-        ftfile_entry_free(n1);
+       } /* doit */
+       if ((fte->num_bytes+curbytes - bytes) <= fte->max_bytes)
+         break;
+@@ -371,6 +385,10 @@
+       fte->num_files -= i;
+       fte->num_bytes -= bytes;
+     } /* doit */
++    if (n2 != NULL) {
++      ftfile_entry_free(n2);
++      n2 = NULL;
++    }
+   } /* if */
+ 
+   if (debug)
+@@ -762,13 +780,19 @@
+ {
+   struct ftfile_entry *n1, *n2;
+ 
++  n2 = NULL;
+   FT_TAILQ_FOREACH(n1, &fte->head, chain) {
++    if (n2 != NULL) {
++      ftfile_entry_free(n2);
++      n2 = NULL;
++    }
+     FT_TAILQ_REMOVE(&fte->head, n1, chain);
+     n2 = n1;
+-    n1 = FT_TAILQ_NEXT(n1, chain);
++  }
++
++  if (n2 != NULL) {
+     ftfile_entry_free(n2);
+-    if (!n1)
+-      break;
++    n2 = NULL;
+   }
+ 
+ } /* ftfile_free */

Added: trunk/dports/net/flow-tools/files/patch-lib_Makefile.in
===================================================================
--- trunk/dports/net/flow-tools/files/patch-lib_Makefile.in	                        (rev 0)
+++ trunk/dports/net/flow-tools/files/patch-lib_Makefile.in	2007-05-15 04:56:39 UTC (rev 25149)
@@ -0,0 +1,11 @@
+--- lib/Makefile.in.orig	Wed Dec 20 01:38:19 2006
++++ lib/Makefile.in	Wed Dec 20 01:38:25 2006
+@@ -91,7 +91,7 @@
+ 
+ #AM_CFLAGS=-g -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs
+ #AM_CFLAGS=-O2
+-AM_CFLAGS = -g -Wall
++#AM_CFLAGS = -g -Wall
+ 
+ DEFS = -I. -I$(srcdir)/lib
+ 

Added: trunk/dports/net/flow-tools/files/patch-lib_ftchash.c
===================================================================
--- trunk/dports/net/flow-tools/files/patch-lib_ftchash.c	                        (rev 0)
+++ trunk/dports/net/flow-tools/files/patch-lib_ftchash.c	2007-05-15 04:56:39 UTC (rev 25149)
@@ -0,0 +1,11 @@
+--- lib/ftchash.c.orig	Mon Oct  2 12:30:55 2006
++++ lib/ftchash.c	Mon Oct  2 12:31:29 2006
+@@ -326,7 +326,7 @@
+       (char*)ftch->traverse_chunk->base+ftch->traverse_chunk->next) {
+ 
+       ret = ftch->traverse_rec;
+-      (char*)ftch->traverse_rec += ftch->d_size;
++      ftch->traverse_rec = (char *)ftch->traverse_rec + ftch->d_size;
+       return ret;
+ 
+     } else {

Added: trunk/dports/net/flow-tools/files/patch-lib_ftio.c
===================================================================
--- trunk/dports/net/flow-tools/files/patch-lib_ftio.c	                        (rev 0)
+++ trunk/dports/net/flow-tools/files/patch-lib_ftio.c	2007-05-15 04:56:39 UTC (rev 25149)
@@ -0,0 +1,20 @@
+--- lib/ftio.c.orig	Mon Oct  2 12:26:19 2006
++++ lib/ftio.c	Mon Oct  2 12:27:53 2006
+@@ -2267,7 +2267,7 @@
+         break;
+ 
+       nleft -= nread;
+-      (char*)ptr += nread;
++      ptr = (char *)ptr + nread;
+   }
+   return (nbytes - nleft);
+ } /* readn */
+@@ -2292,7 +2292,7 @@
+       return(nwritten); /* error */
+ 
+     nleft -= nwritten;
+-    (char*)ptr += nwritten;
++    ptr = (char *)ptr + nwritten;
+   }
+   return(nbytes - nleft);
+ } /* writen */

Added: trunk/dports/net/flow-tools/files/patch-lib_ftsym.c
===================================================================
--- trunk/dports/net/flow-tools/files/patch-lib_ftsym.c	                        (rev 0)
+++ trunk/dports/net/flow-tools/files/patch-lib_ftsym.c	2007-05-15 04:56:39 UTC (rev 25149)
@@ -0,0 +1,10 @@
+--- lib/ftsym.c.orig	Wed Nov  8 03:51:51 2006
++++ lib/ftsym.c	Wed Nov  8 03:51:56 2006
+@@ -35,6 +35,7 @@
+ #include <ctype.h>
+ #include <stddef.h>
+ #include <stdlib.h>
++#include <unistd.h>
+ 
+ #if HAVE_STRINGS_H
+  #include <strings.h>

Added: trunk/dports/net/flow-tools/files/patch-lib_fttlv.c
===================================================================
--- trunk/dports/net/flow-tools/files/patch-lib_fttlv.c	                        (rev 0)
+++ trunk/dports/net/flow-tools/files/patch-lib_fttlv.c	2007-05-15 04:56:39 UTC (rev 25149)
@@ -0,0 +1,100 @@
+--- lib/fttlv.c.orig	Mon Oct  2 12:27:59 2006
++++ lib/fttlv.c	Mon Oct  2 12:30:50 2006
+@@ -68,10 +68,10 @@
+   }
+ 
+   bcopy(&t, buf, 2);
+-  (char*)buf+= 2;
++  buf = (char *)buf + 2;
+ 
+   bcopy(&len, buf, 2);
+-  (char*)buf+= 2;
++  buf = (char *)buf + 2;
+ 
+   bcopy(&v, buf, 4);
+ 
+@@ -107,10 +107,10 @@
+   }
+ 
+   bcopy(&t, buf, 2);
+-  (char*)buf+= 2;
++  buf = (char *)buf + 2;
+ 
+   bcopy(&len, buf, 2);
+-  (char*)buf+= 2;
++  buf = (char *)buf + 2;
+ 
+   bcopy(&v, buf, 2);
+ 
+@@ -145,10 +145,10 @@
+   }
+ 
+   bcopy(&t, buf, 2);
+-  (char*)buf+= 2;
++  buf = (char *)buf + 2;
+ 
+   bcopy(&len, buf, 2);
+-  (char*)buf+= 2;
++  buf = (char *)buf + 2;
+ 
+   bcopy(&v, buf, 1);
+ 
+@@ -183,10 +183,10 @@
+   }
+ 
+   bcopy(&t, buf, 2);
+-  (char*)buf+= 2;
++  buf = (char *)buf + 2;
+ 
+   bcopy(&len, buf, 2);
+-  (char*)buf+= 2;
++  buf = (char *)buf + 2;
+ 
+   bcopy(v, buf, len);
+ 
+@@ -230,16 +230,16 @@
+     return -1;
+ 
+   bcopy(&t, buf, 2);
+-  (char*)buf+= 2;
++  buf = (char *)buf + 2;
+ 
+   bcopy(&len, buf, 2);
+-  (char*)buf+= 2;
++  buf = (char *)buf + 2;
+ 
+   bcopy(&ip, buf, 4);
+-  (char*)buf += 4;
++  buf = (char *)buf + 4;
+ 
+   bcopy(&ifIndex, buf, 2);
+-  (char*)buf += 2;
++  buf = (char *)buf + 2;
+ 
+   bcopy(name, buf, n);
+ 
+@@ -287,19 +287,19 @@
+   }
+ 
+   bcopy(&t, buf, 2);
+-  (char*)buf+= 2;
++  buf = (char *)buf + 2;
+ 
+   bcopy(&len, buf, 2);
+-  (char*)buf+= 2;
++  buf = (char *)buf + 2;
+ 
+   bcopy(&ip, buf, 4);
+-  (char*)buf += 4;
++  buf = (char *)buf + 4;
+ 
+   bcopy(&entries, buf, 2);
+-  (char*)buf += 2;
++  buf = (char *)buf + 2;
+ 
+   bcopy(ifIndex_list, buf, esize);
+-  (char*)buf += esize;
++  buf = (char *)buf + esize;
+ 
+   bcopy(name, buf, n);
+ 

Added: trunk/dports/net/flow-tools/files/patch-lib_support.c
===================================================================
--- trunk/dports/net/flow-tools/files/patch-lib_support.c	                        (rev 0)
+++ trunk/dports/net/flow-tools/files/patch-lib_support.c	2007-05-15 04:56:39 UTC (rev 25149)
@@ -0,0 +1,10 @@
+--- lib/support.c.orig	Wed Nov  8 03:50:31 2006
++++ lib/support.c	Wed Nov  8 03:51:27 2006
+@@ -40,6 +40,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <syslog.h>
++#include <unistd.h>
+ #include <time.h>
+ #include <fcntl.h>
+ 

Added: trunk/dports/net/flow-tools/files/patch-src_Makefile.in
===================================================================
--- trunk/dports/net/flow-tools/files/patch-src_Makefile.in	                        (rev 0)
+++ trunk/dports/net/flow-tools/files/patch-src_Makefile.in	2007-05-15 04:56:39 UTC (rev 25149)
@@ -0,0 +1,11 @@
+--- src/Makefile.in.orig	Wed Dec 20 01:37:38 2006
++++ src/Makefile.in	Wed Dec 20 01:37:57 2006
+@@ -97,7 +97,7 @@
+ 
+ #AM_CFLAGS=-g -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs
+ #AM_CFLAGS=-O2
+-AM_CFLAGS = -g -Wall
++#AM_CFLAGS = -g -Wall
+ 
+ bin_PROGRAMS = flow-capture flow-cat flow-stat flow-print flow-dscan \
+         flow-send flow-receive flow-gen flow-expire \

Added: trunk/dports/net/flow-tools/files/patch-src_flow-fanout.c
===================================================================
--- trunk/dports/net/flow-tools/files/patch-src_flow-fanout.c	                        (rev 0)
+++ trunk/dports/net/flow-tools/files/patch-src_flow-fanout.c	2007-05-15 04:56:39 UTC (rev 25149)
@@ -0,0 +1,10 @@
+--- src/flow-fanout.c.orig	Tue Jun  7 22:52:16 2005
++++ src/flow-fanout.c	Tue Jun  7 22:52:39 2005
+@@ -855,6 +855,7 @@
+     } /* if FD_ISSET */
+ 
+ skip1:
++	;
+ 
+     if (sig_quit_flag) {
+       fterr_info("SIGQUIT");

Added: trunk/dports/net/flow-tools/files/pkg-deinstall.in
===================================================================
--- trunk/dports/net/flow-tools/files/pkg-deinstall.in	                        (rev 0)
+++ trunk/dports/net/flow-tools/files/pkg-deinstall.in	2007-05-15 04:56:39 UTC (rev 25149)
@@ -0,0 +1,37 @@
+#!/bin/sh
+#
+# $FreeBSD: ports/net-mgmt/flow-tools/files/pkg-deinstall.in,v 1.1 2006/11/08 01:06:16 stas Exp $
+#
+
+PATH=/bin:/usr/sbin:/usr/bin:/usr/sbin
+
+FLOW_CAPTURE_SPOOL="%%FLOW_CAPTURE_SPOOL%%"
+FLOW_CAPTURE_USER="%%FLOW_CAPTURE_USER%%"
+FLOW_CAPTURE_GROUP="%%FLOW_CAPTURE_GROUP%%"
+FLOW_CAPTURE_PIDDIR="%%FLOW_CAPTURE_PIDDIR%%"
+
+post-deinstall() {
+	rmdir ${FLOW_CAPTURE_SPOOL} > /dev/null 2>&1
+	if [ $? -ne 0 ]; then
+		echo "WARNING: If you will NOT use this package anymore, please"
+		echo " remove the following directory manually:"
+		echo " ${FLOW_CAPTURE_SPOOL}"
+		echo
+		echo "Also flow-tools related user accounts and groups were not"
+		echo "removed (${FLOW_CAPTURE_USER}:${FLOW_CAPTURE_GROUP})."
+		echo "Do it manually, if needed."
+		echo
+	fi
+
+#
+# Remove pid directory
+#
+	rm -rf ${FLOW_CAPTURE_PIDDIR} > /dev/null 2>&1
+}
+
+
+case $2 in
+	POST-DEINSTALL)
+		post-deinstall
+		;;
+esac

Added: trunk/dports/net/flow-tools/files/pkg-install.in
===================================================================
--- trunk/dports/net/flow-tools/files/pkg-install.in	                        (rev 0)
+++ trunk/dports/net/flow-tools/files/pkg-install.in	2007-05-15 04:56:39 UTC (rev 25149)
@@ -0,0 +1,81 @@
+#!/bin/sh
+#
+# $FreeBSD: ports/net-mgmt/flow-tools/files/pkg-install.in,v 1.2 2007/04/10 19:32:35 stas Exp $
+#
+
+PATH=/bin:/usr/sbin:/usr/bin:/usr/sbin
+
+FLOW_CAPTURE_SPOOL="%%FLOW_CAPTURE_SPOOL%%"
+FLOW_CAPTURE_USER="%%FLOW_CAPTURE_USER%%"
+FLOW_CAPTURE_GROUP="%%FLOW_CAPTURE_GROUP%%"
+FLOW_CAPTURE_UID="%%FLOW_CAPTURE_UID%%"
+FLOW_CAPTURE_GID="%%FLOW_CAPTURE_GID%%"
+FLOW_CAPTURE_PIDDIR="%%FLOW_CAPTURE_PIDDIR%%"
+
+if [ -x /usr/sbin/nologin ]; then
+	NOLOGIN=/usr/sbin/nologin
+else
+	NOLOGIN=/sbin/nologin
+fi
+
+pre-install() {
+#
+# Create group
+#
+	pw groupshow ${FLOW_CAPTURE_GROUP} > /dev/null 2>&1
+	if [ $? -ne 0 ]; then
+		echo -n "Creating '${FLOW_CAPTURE_GROUP}' group... "
+		pw groupadd -n ${FLOW_CAPTURE_GROUP} -g ${FLOW_CAPTURE_GID} -q
+
+		if  [ $? -eq 0 ]; then
+			echo "ok"
+		else
+			echo "failed"
+			echo "Cannot create group '${FLOW_CAPTURE_GROUP}'" >&2
+			echo "Please, create it manually." >&2
+			exit 1
+		fi
+	else
+		echo "Using existing group '${FLOW_CAPTURE_GROUP}'"
+	fi
+
+#
+# Create user
+#
+	pw usershow ${FLOW_CAPTURE_USER} > /dev/null 2>&1
+	if [ $? -ne 0 ]; then
+		echo -n "Creating '${FLOW_CAPTURE_USER}' user... "
+		pw useradd -n ${FLOW_CAPTURE_USER} -g ${FLOW_CAPTURE_GROUP} \
+			-u ${FLOW_CAPTURE_UID} \
+			-c "Flow-tools collector pseudo-user" \
+			-d "/var/empty" -s "${NOLOGIN}" -h - -q
+
+		if  [ $? -eq 0 ]; then
+			echo "ok"
+		else
+			echo "failed"
+			echo "Cannot create user '${FLOW_CAPTURE_USER}'" >&2
+			echo "Please, create it manually." >&2
+			exit 1
+		fi
+	else
+		echo "Using existing group '${FLOW_CAPTURE_USER}'"
+	fi
+}
+
+post-install() {
+	/usr/bin/install -d -m 700 -o ${FLOW_CAPTURE_USER} \
+		-g ${FLOW_CAPTURE_GROUP} ${FLOW_CAPTURE_PIDDIR}
+	/usr/bin/install -d -m 1700 -o ${FLOW_CAPTURE_USER} \
+		-g ${FLOW_CAPTURE_GROUP} ${FLOW_CAPTURE_SPOOL}
+}
+
+
+case $2 in
+	PRE-INSTALL)
+		pre-install
+		;;
+	POST-INSTALL)
+		post-install
+		;;
+esac

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070514/01197658/attachment.html


More information about the macports-changes mailing list