aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/netams
diff options
context:
space:
mode:
authorEdwin Groothuis <edwin@FreeBSD.org>2003-04-05 08:20:27 +0000
committerEdwin Groothuis <edwin@FreeBSD.org>2003-04-05 08:20:27 +0000
commit336ae31855b2c03f448d456e65294c4af46ec1b4 (patch)
treeb882420483c1bbfe2bc0c2384c9cd94112f929f2 /net-mgmt/netams
parentf116d0ee57273c0aad821f4f702910d9f2968d81 (diff)
downloadports-336ae31855b2c03f448d456e65294c4af46ec1b4.tar.gz
ports-336ae31855b2c03f448d456e65294c4af46ec1b4.zip
Notes
Diffstat (limited to 'net-mgmt/netams')
-rw-r--r--net-mgmt/netams/Makefile72
-rw-r--r--net-mgmt/netams/distinfo1
-rw-r--r--net-mgmt/netams/files/netams.sh26
-rw-r--r--net-mgmt/netams/files/patch-Makefile20
-rw-r--r--net-mgmt/netams/files/patch-addon::netams-startup.sh22
-rw-r--r--net-mgmt/netams/pkg-descr9
-rw-r--r--net-mgmt/netams/pkg-message15
-rw-r--r--net-mgmt/netams/pkg-plist27
-rw-r--r--net-mgmt/netams/scripts/configure26
9 files changed, 218 insertions, 0 deletions
diff --git a/net-mgmt/netams/Makefile b/net-mgmt/netams/Makefile
new file mode 100644
index 000000000000..0b20fbadd79d
--- /dev/null
+++ b/net-mgmt/netams/Makefile
@@ -0,0 +1,72 @@
+# New ports collection makefile for: NetAMS
+# Date created: 9 December 2002
+# Whom: jura@happychance.com
+#
+# $FreeBSD$
+#
+
+PORTNAME= netams
+PORTVERSION= 3.1
+CATEGORIES= net
+MASTER_SITES= http://www.netams.com/
+DISTNAME= netams-3.1.1376
+
+MAINTAINER= jura@happychance.com
+COMMENT= Network Traffic Accounting and Monitoring Software
+
+.if !defined(WITHOUT_MYSQL)
+LIB_DEPENDS= mysqlclient.10:${PORTSDIR}/databases/mysql323-client
+.endif
+
+MAN8= netams.8
+MANCOMPRESSED= no
+
+WRKSRC= ${WRKDIR}/netams
+
+DEFINE= -DFREEBSD
+LIB= -pthread -lpcap -lutil
+
+.if !defined(WITHOUT_MYSQL)
+DEFINE+= -DUSE_MYSQL
+LIB+= -l mysqlclient -L${LOCALBASE}/lib/mysql
+.endif
+.if defined(LOG_DROP)
+DEFINE+= -DLOG_DROP
+.endif
+.if defined(MAX_QUOTA)
+DEFINE+= -DMAX_QUOTA=${MAX_QUOTA}
+.else
+DEFINE+= -DMAX_QUOTA=32
+.endif
+
+SCRIPTS_ENV='DEFINE=${DEFINE}' 'LIB=${LIB}'
+
+.include <bsd.port.pre.mk>
+.if ${OSVERSION} >= 500000
+.endif
+
+do-install:
+ @ ${INSTALL_PROGRAM} ${WRKSRC}/src/netams ${PREFIX}/libexec/netams
+ @ ${INSTALL_PROGRAM} ${WRKSRC}/src/netamsctl ${PREFIX}/bin/netamsctl
+ @ ${INSTALL_DATA} ${WRKSRC}/addon/netams.cfg ${PREFIX}/etc/netams.conf.sample
+ @ ${INSTALL_SCRIPT} ${FILESDIR}/netams.sh ${PREFIX}/etc/rc.d/netams.sh.sample
+ @ ${INSTALL_MAN} ${WRKSRC}/doc/netams.8 ${PREFIX}/man/man8
+ @ ${MKDIR} ${EXAMPLESDIR}/cgi-bin
+ @ ${INSTALL_DATA} ${WRKSRC}/addon/.netamsctl.rc ${EXAMPLESDIR}/
+.for example in netams-nat-network.cfg netams-netflow.cfg netams.cfg netams-simple.cfg
+ @ ${INSTALL_DATA} ${WRKSRC}/doc/${example} ${EXAMPLESDIR}/
+.endfor
+.for cgi in logo.gif netams_api.pl netams_graph.cgi weblogin.tem lucon.ttf netams_example.cgi weblogin.cgi
+ @ ${INSTALL_DATA} ${WRKSRC}/cgi-bin/${cgi} ${EXAMPLESDIR}/cgi-bin/
+.endfor
+.if !defined(NOPORTDOCS)
+ @ ${MKDIR} ${DOCSDIR}
+.for doc in documentation-en.html diagram-1.gif net-1-1a.gif net-1-2a.gif net-1-3a.gif logo.gif
+ @ ${INSTALL_DATA} ${WRKSRC}/doc/${doc} ${DOCSDIR}/
+.endfor
+.endif
+
+post-install:
+ @${SED} 's|%%PREFIX%%|${PREFIX}|g' ${PKGDIR}/pkg-message|${SED} 's|%%EXAMPLESDIR%%|${EXAMPLESDIR}|g'
+
+.include <bsd.port.post.mk>
diff --git a/net-mgmt/netams/distinfo b/net-mgmt/netams/distinfo
new file mode 100644
index 000000000000..033432fd8a8c
--- /dev/null
+++ b/net-mgmt/netams/distinfo
@@ -0,0 +1 @@
+MD5 (netams-3.1.1376.tar.gz) = cf8e0f63a9c0a406500ed7a6c1fa2c53
diff --git a/net-mgmt/netams/files/netams.sh b/net-mgmt/netams/files/netams.sh
new file mode 100644
index 000000000000..1df303d575ff
--- /dev/null
+++ b/net-mgmt/netams/files/netams.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+case "$1" in
+
+start)
+ sleep 3;
+ /bin/mkdir -p /var/run/netams
+ if [ -x /usr/local/libexec/netams ]; then
+ if [ -f /usr/local/etc/netams.conf ]; then
+ /usr/local/libexec/netams -lf /usr/local/etc/netams.conf >/dev/null && echo -n ' NetAMS'
+ fi
+ fi
+ ;;
+
+stop)
+ killall netams
+ rmdir /var/run/netams
+ ;;
+*)
+ echo "$0 start | stop"
+ ;;
+
+esac
+
+
+
diff --git a/net-mgmt/netams/files/patch-Makefile b/net-mgmt/netams/files/patch-Makefile
new file mode 100644
index 000000000000..99461f5957e3
--- /dev/null
+++ b/net-mgmt/netams/files/patch-Makefile
@@ -0,0 +1,20 @@
+--- Makefile.orig Sat Apr 5 00:17:21 2003
++++ Makefile Sat Apr 5 00:17:52 2003
+@@ -3,7 +3,7 @@
+ #*** (c) 1998-2001 Anton Vinokurov, anton@inorg.chem.msu.ru
+ #***
+ #*************************************************************************
+-LIB = -pthread -lutil -lpcap -lmysqlclient -L/usr/local/lib/mysql
++LIB = -pthread -lutil -lpcap -lmysqlclient -L${LOCALBASE}/lib/mysql
+ DEFINE += -DFREEBSD -DFREEBSD_VER=4 -DUSE_MYSQL
+ ##########################################################################
+ # for Linux, uncomment this
+@@ -40,7 +40,7 @@
+
+ CC = g++
+ FLAGS = -g -pthread -Wall
+-INCLUDE=/usr/local/include
++INCLUDE=${LOCALBASE}/include
+ OBJ = $(SRC:.c=.o)
+ CFLAGS = $(FLAGS) -I$(INCLUDE) $(DEFINE) -Wall
+
diff --git a/net-mgmt/netams/files/patch-addon::netams-startup.sh b/net-mgmt/netams/files/patch-addon::netams-startup.sh
new file mode 100644
index 000000000000..e6e9e99a7e63
--- /dev/null
+++ b/net-mgmt/netams/files/patch-addon::netams-startup.sh
@@ -0,0 +1,22 @@
+*** addon/netams-startup.sh.orig Sun Dec 15 14:42:13 2002
+--- addon/netams-startup.sh Mon Dec 16 17:07:08 2002
+***************
+5c5
+< debug=1
+---
+> debug=0
+7,8c7,8
+< configfile=/home/anton/netams/netams.cfg
+< appfile=/home/anton/netams/netams
+---
+> configfile=/usr/local/etc/netams.conf
+> appfile=/usr/local/libexec/netams
+10c10
+< path=/tmp
+---
+> path=/var/log
+87c87
+<
+---
+> sleep 3;
+
diff --git a/net-mgmt/netams/pkg-descr b/net-mgmt/netams/pkg-descr
new file mode 100644
index 000000000000..0c3ccce4d17e
--- /dev/null
+++ b/net-mgmt/netams/pkg-descr
@@ -0,0 +1,9 @@
+NeTAMS is a Network Traffic Accounting and Monitoring Software.
+It runs as a daemon under FreeBSD and Linux operating systems.
+Collects an IP traffic information flowing via your PC/UNIX or Cisco router,
+filters it, aggregates, stores onto HASH/SQL database,
+and makes SMTP/HTML reports to site administrator.
+Anoter features are flexible policy targets, firewalling, access control,
+quotas, scheduler and much much more.
+
+WWW: http://www.netams.com/
diff --git a/net-mgmt/netams/pkg-message b/net-mgmt/netams/pkg-message
new file mode 100644
index 000000000000..145c670c4467
--- /dev/null
+++ b/net-mgmt/netams/pkg-message
@@ -0,0 +1,15 @@
+--------------------------------------------------------------------------
+
+The NetAMS package has been successfully installed.
+
+To use the programm, make a copy of %%PREFIX%%/etc/rc.d/netams.sh.sample under
+%%PREFIX%%/etc/rc.d/netams.sh and do: chmod +x %%PREFIX%%/etc/rc.d/netams.sh.
+Check %%EXAMPLESDIR%% for examples.
+
+A sample configuration file has been installed to %%PREFIX%%/etc as
+"netams.conf.sample". This may be renamed to "netams.conf" and edited.
+
+In order to use the netamsctl programs, a user must copy
+%%EXAMPLESDIR%%/.netamsctl.rc to home directory and edit.
+
+--------------------------------------------------------------------------
diff --git a/net-mgmt/netams/pkg-plist b/net-mgmt/netams/pkg-plist
new file mode 100644
index 000000000000..877b0878b65e
--- /dev/null
+++ b/net-mgmt/netams/pkg-plist
@@ -0,0 +1,27 @@
+@unexec if cmp -s %D/etc/netams.conf.sample %D/etc/netams.conf; then rm -f %D/etc/netams.conf; fi
+etc/netams.conf.sample
+etc/rc.d/netams.sh.sample
+libexec/netams
+bin/netamsctl
+%%PORTDOCS%%share/doc/netams/documentation-en.html
+%%PORTDOCS%%share/doc/netams/diagram-1.gif
+%%PORTDOCS%%share/doc/netams/logo.gif
+%%PORTDOCS%%share/doc/netams/net-1-1a.gif
+%%PORTDOCS%%share/doc/netams/net-1-2a.gif
+%%PORTDOCS%%share/doc/netams/net-1-3a.gif
+share/examples/netams/netams-nat-network.cfg
+share/examples/netams/netams-netflow.cfg
+share/examples/netams/netams-simple.cfg
+share/examples/netams/netams.cfg
+share/examples/netams/.netamsctl.rc
+share/examples/netams/cgi-bin/logo.gif
+share/examples/netams/cgi-bin/lucon.ttf
+share/examples/netams/cgi-bin/netams_api.pl
+share/examples/netams/cgi-bin/netams_example.cgi
+share/examples/netams/cgi-bin/netams_graph.cgi
+share/examples/netams/cgi-bin/weblogin.cgi
+share/examples/netams/cgi-bin/weblogin.tem
+%%PORTDOCS%%@dirrm share/doc/netams
+@dirrm share/examples/netams/cgi-bin
+@dirrm share/examples/netams
+
diff --git a/net-mgmt/netams/scripts/configure b/net-mgmt/netams/scripts/configure
new file mode 100644
index 000000000000..b7e5ae9402d0
--- /dev/null
+++ b/net-mgmt/netams/scripts/configure
@@ -0,0 +1,26 @@
+#! ${SH}
+#
+# $FreeBSD$
+
+PATH_TO_CONFIG="${PREFIX}/etc/natams.conf"
+PATH_TO_LOG="/var/log/netams.log"
+FLAGS="-g"
+
+cd ${WRKSRC}
+ rm -f Makefile.new
+ cp Makefile Makefile.orig
+ grep -v "^LIB" Makefile > Makefile.new || exit 1
+ grep -v "^DEFINE" Makefile.new > Makefile || exit 1
+ grep -v "^PATH_TO_CONFIG" Makefile > Makefile.new || exit 1
+ grep -v "^PATH_TO_LOG" Makefile.new > Makefile || exit 1
+ grep -v "^FLAGS" Makefile > Makefile.new || exit 1
+ grep -v "^CFLAGS" Makefile.new > Makefile || exit 1
+ echo "PATH_TO_CONFIG=${PATH_TO_CONFIG}" > Makefile.new || exit 1
+ echo "PATH_TO_LOG=${PATH_TO_LOG}" >> Makefile.new || exit 1
+ echo "LIB=${LIB}" >> Makefile.new || exit 1
+ echo "DEFINE=${DEFINE}" >> Makefile.new || exit 1
+ echo "FLAGS=${FLAGS}" >> Makefile.new || exit 1
+ echo 'CFLAGS = $(FLAGS) -I$(INCLUDE) $(DEFINE)' >> Makefile.new || exit 1
+ cat Makefile >> Makefile.new || exit 1
+ mv -f Makefile.new Makefile || exit 1
+