aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/netams
diff options
context:
space:
mode:
authorPav Lucistnik <pav@FreeBSD.org>2006-06-14 12:08:24 +0000
committerPav Lucistnik <pav@FreeBSD.org>2006-06-14 12:08:24 +0000
commit96769ea325609aae5f815a73df461f8a54c66523 (patch)
treee46ddca5a73261e4d68c354d5d63d13f41e151ac /net-mgmt/netams
parent80f746313509300573ddf543f52b37c3b5c3922a (diff)
downloadports-96769ea325609aae5f815a73df461f8a54c66523.tar.gz
ports-96769ea325609aae5f815a73df461f8a54c66523.zip
Notes
Diffstat (limited to 'net-mgmt/netams')
-rw-r--r--net-mgmt/netams/Makefile32
-rw-r--r--net-mgmt/netams/distinfo6
-rw-r--r--net-mgmt/netams/files/netams.sh.in37
-rw-r--r--net-mgmt/netams/files/patch-src__common.c29
-rw-r--r--net-mgmt/netams/files/patch-src__ng_netams.c25
-rw-r--r--net-mgmt/netams/pkg-message4
-rw-r--r--net-mgmt/netams/pkg-plist9
7 files changed, 110 insertions, 32 deletions
diff --git a/net-mgmt/netams/Makefile b/net-mgmt/netams/Makefile
index 9c8872035bf7..18e3661c6142 100644
--- a/net-mgmt/netams/Makefile
+++ b/net-mgmt/netams/Makefile
@@ -6,7 +6,7 @@
#
PORTNAME= netams
-PORTVERSION= 3.3.2
+PORTVERSION= 3.3.5
CATEGORIES= net-mgmt
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} \
http://www.netams.com/files/
@@ -16,9 +16,10 @@ DISTNAME= ${PORTNAME}-${PORTVERSION}
MAINTAINER= jura@netams.com
COMMENT= Network Traffic Accounting and Monitoring Software
-NO_PACKAGE= "Depends on kernel"
+NO_PACKAGE= Depends on kernel
USE_SUBMAKE= yes
+USE_RC_SUBR= netams.sh
MANCOMPRESSED= no
SCRIPTS_ENV= WRKDIRPREFIX="${WRKDIRPREFIX}" \
@@ -30,11 +31,11 @@ SCRIPTS_ENV= WRKDIRPREFIX="${WRKDIRPREFIX}" \
ADMINCGI= .htaccess index.cgi policy.cgi showusercard.cgi user.cgi \
access.cgi login.cgi quota.cgi showusercard.tmpl view.cgi \
account.cgi netams.cgi radius.cgi subplan.cgi config.cgi \
- plan.cgi russian.res unit.cgi
+ plan.cgi russian.res unit.cgi cardtool.cgi
CGI= .htaccess config.cgi netams_api.pl russian.res \
netams_example.cgi usertool.cgi admintool.cgi login.cgi \
- netams_graph.cgi
-IMAGES= logo.gif logo-small.gif admintool-logo.gif showtable-logo.gif
+ netams_graph.cgi activate.cgi activate.tmpl
+IMAGES= logo.gif logo_sm.jpg admintool-logo.gif showtable-logo.gif
MAN8= netams.8 flowprobe.8 netamsctl.8
SYSDIR?= /sys
@@ -45,9 +46,9 @@ OPTIONS= DEBUG "Build with debug symbols" off \
.include <bsd.port.pre.mk>
-.if !exists(${SYSDIR})
-IGNORE= could not find the kernel sources in ${SYSDIR}. Please define SYSDIR
-.endif
+#.if !exists(${SYSDIR})
+#IGNORE= Could not find the kernel sources in ${SYSDIR}. Please define SYSDIR
+#.endif
post-patch:
@${REINPLACE_CMD} -E 's/^(CC).*/\1=$$(CXX)/; s|^(INCLUDE=).*|\1 ${LOCALBASE}/include|; s|^(CFLAGS).*=|\1+=|; /^FLAGS/d' \
@@ -70,20 +71,11 @@ post-patch:
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/src/netams ${PREFIX}/libexec/netams
${INSTALL_PROGRAM} ${WRKSRC}/src/flowprobe ${PREFIX}/sbin/flowprobe
- ${INSTALL_PROGRAM} ${WRKSRC}/src/ipfw2netflow \
- ${PREFIX}/sbin/ipfw2netflow
+ ${INSTALL_PROGRAM} ${WRKSRC}/src/ipfw2netflow ${PREFIX}/sbin/ipfw2netflow
${INSTALL_PROGRAM} ${WRKSRC}/src/netamsctl ${PREFIX}/bin/netamsctl
- ${INSTALL_DATA} ${WRKSRC}/addon/netams.cfg \
- ${PREFIX}/etc/netams.cfg.sample
-.if !exists(${PREFIX}/etc/netams.cfg)
- ${INSTALL_DATA} ${WRKSRC}/addon/netams.cfg \
- ${PREFIX}/etc/netams.cfg
-.endif
- ${INSTALL_SCRIPT} ${WRKSRC}/addon/netams-startup.sh \
- ${PREFIX}/etc/rc.d/netams-startup.sh.sample
+ ${INSTALL_DATA} ${WRKSRC}/addon/netams.cfg ${PREFIX}/etc/netams.cfg.sample
${MKDIR} ${DATADIR}/cgi-bin/admin ${DATADIR}/cgi-bin/images
- ${INSTALL_DATA} ${WRKSRC}/addon/ru-networks.txt \
- ${DATADIR}/ru-networks.txt.sample
+ ${INSTALL_DATA} ${WRKSRC}/addon/ru-networks.txt ${DATADIR}/ru-networks.txt.sample
${INSTALL_DATA} ${WRKSRC}/addon/.netamsctl.rc ${DATADIR}
.for f in ${IMAGES}
${INSTALL_DATA} ${WRKSRC}/cgi-bin/images/${f} ${DATADIR}/cgi-bin/images
diff --git a/net-mgmt/netams/distinfo b/net-mgmt/netams/distinfo
index 34b0aa481635..8801585ce8c3 100644
--- a/net-mgmt/netams/distinfo
+++ b/net-mgmt/netams/distinfo
@@ -1,3 +1,3 @@
-MD5 (netams-3.3.2.tar.gz) = 74ea7a851c644f3bee98674504d2a58d
-SHA256 (netams-3.3.2.tar.gz) = 8286816a9cb626f55908f55737b5e5eaf4b6beef910d6e931980b882a1d39a9e
-SIZE (netams-3.3.2.tar.gz) = 327600
+MD5 (netams-3.3.5.tar.gz) = 5b76510d2df6cf1e370efbdc1f0a71fd
+SHA256 (netams-3.3.5.tar.gz) = fedb4fd3463a87c5a70e2126b9c7d3fc5fe02bccb16977b241f0a38c4055b702
+SIZE (netams-3.3.5.tar.gz) = 338686
diff --git a/net-mgmt/netams/files/netams.sh.in b/net-mgmt/netams/files/netams.sh.in
new file mode 100644
index 000000000000..8b7ea67b0d47
--- /dev/null
+++ b/net-mgmt/netams/files/netams.sh.in
@@ -0,0 +1,37 @@
+#!/bin/sh
+# $FreeBSD$
+
+# PROVIDE: netams
+# REQUIRE: NETWORKING
+# KEYWORD: shutdown
+
+# Define these netams_* variables in one of these files:
+# /etc/rc.conf
+# /etc/rc.conf.local
+# /etc/rc.conf.d/netams
+#
+# netams_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable netams.
+# netams_config (str): Custom configuration file to be passed
+# to netams.
+#
+# DO NOT CHANGE THESE DEFAULT VALUES HERE
+#
+netams_enable=${netams_enable-"NO"}
+netams_config=${netams_config-"%%PREFIX%%/etc/netams.cfg"}
+
+netams_pidfile="/var/run/netams.pid"
+
+. %%RC_SUBR%%
+
+name="netams"
+rcvar=`set_rcvar`
+command="%%PREFIX%%/libexec/netams"
+
+load_rc_config $name
+
+pidfile="${netams_pidfile}"
+
+start_cmd="echo \"Starting ${name}.\"; ${command} -ldf ${netams_config} > /dev/null"
+
+run_rc_command "$1"
diff --git a/net-mgmt/netams/files/patch-src__common.c b/net-mgmt/netams/files/patch-src__common.c
new file mode 100644
index 000000000000..949a05891b1e
--- /dev/null
+++ b/net-mgmt/netams/files/patch-src__common.c
@@ -0,0 +1,29 @@
+--- ./src/common.c Fri Apr 21 10:25:11 2006
++++ ./src/common.c Wed Jun 14 13:15:26 2006
+@@ -179,11 +179,21 @@
+
+ if (flag_syslog) { bzero(str2log2, 256); bzero(str2log1, 256+64); }
+
+- va_start(ap, fmt);
+- if (flag_nodaemon && !flag_quiet) vfprintf(stdout, fmt, ap);
+- if (flag_log) vfprintf(LOGFILE, fmt, ap);
+- if (flag_syslog) vsnprintf(str2log2,256, fmt, ap);
+- va_end(ap);
++ if (flag_nodaemon && !flag_quiet) {
++ va_start(ap, fmt);
++ vfprintf(stdout, fmt, ap);
++ va_end(ap);
++ }
++ if (flag_log) {
++ va_start(ap, fmt);
++ vfprintf(LOGFILE, fmt, ap);
++ va_end(ap);
++ }
++ if (flag_syslog) {
++ va_start(ap, fmt);
++ vsnprintf(str2log2,256, fmt, ap);
++ va_end(ap);
++ }
+
+ if (flag_syslog) {
+ snprintf(str2log1,256+64,"%s:%u %s", where, id, str2log2);
diff --git a/net-mgmt/netams/files/patch-src__ng_netams.c b/net-mgmt/netams/files/patch-src__ng_netams.c
new file mode 100644
index 000000000000..455391392ef1
--- /dev/null
+++ b/net-mgmt/netams/files/patch-src__ng_netams.c
@@ -0,0 +1,25 @@
+--- ./src/ng_netams.c Fri Mar 4 04:38:52 2005
++++ ./src/ng_netams.c Wed Jun 14 11:54:21 2006
+@@ -438,7 +438,10 @@
+ } else
+ prev=e;
+ }
+- if (data->debug) printf("callout/%u%c active %u, checked %u, queued=%u, flushed %u\n", time_second, data->daemon_node?'+':'-', data->active_flows, t_active, f_queued, f_active);
++ if (data->debug)
++ printf("callout/%lu%c active %u, checked %u, queued=%u, flushed %u\n",
++ (u_long)time_second, data->daemon_node?'+':'-',
++ data->active_flows, t_active, f_queued, f_active);
+ mtx_unlock(&data->mtx_active);
+
+ if (data->daemon_node!=0 && time_second%10==0) { // time to send info to daemon
+@@ -446,7 +449,9 @@
+ msg->header.token=data->daemon_cookie;
+ ng_netams_set_info(msg, data);
+ NG_SEND_MSG_ID(error, data->node, msg, data->daemon_node, NG_NODE_ID(data->node));
+- if (data->debug) printf("info/%u: sent to daemon [%u] with error=%u\n", time_second, data->daemon_node, error);
++ if (data->debug)
++ printf("info/%lu: sent to daemon [%u] with error=%u\n",
++ (u_long)time_second, data->daemon_node, error);
+ if (error) { data->daemon_cookie=data->daemon_node=0; } // something went wrong, reset userspace destination to prevent further loss
+ }
+
diff --git a/net-mgmt/netams/pkg-message b/net-mgmt/netams/pkg-message
index 5bd6e7999833..31cb60263150 100644
--- a/net-mgmt/netams/pkg-message
+++ b/net-mgmt/netams/pkg-message
@@ -2,9 +2,6 @@
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 %%DATADIR%% and http://www.netams.com for examples.
A sample configuration file has been installed to %%PREFIX%%/etc as
@@ -17,7 +14,6 @@ By default, CGI scripts are NOT installed, as well as web server is NOT configur
You should do it yourself, and then copy entire %%DATADIR%%/cgi/ directory to appropriate place.
And PLEASE READ THE DOCUMENTATION FIRST!
-
http://www.netams.com
--------------------------------------------------------------------------
diff --git a/net-mgmt/netams/pkg-plist b/net-mgmt/netams/pkg-plist
index e297295413c9..7eca933d6c1e 100644
--- a/net-mgmt/netams/pkg-plist
+++ b/net-mgmt/netams/pkg-plist
@@ -1,8 +1,4 @@
-@comment $FreeBSD$
-@unexec if cmp -s %D/etc/netams.cfg %D/etc/netams.cfg.sample; then rm -f %D/etc/netams.cfg; fi
etc/netams.cfg.sample
-@exec [ -f %B/netams.cfg ] || cp %B/%f %B/netams.cfg
-etc/rc.d/netams-startup.sh.sample
libexec/netams
sbin/flowprobe
sbin/ipfw2netflow
@@ -16,9 +12,12 @@ bin/netamsctl
%%DATADIR%%/cgi-bin/netams_example.cgi
%%DATADIR%%/cgi-bin/usertool.cgi
%%DATADIR%%/cgi-bin/admintool.cgi
+%%DATADIR%%/cgi-bin/activate.cgi
+%%DATADIR%%/cgi-bin/activate.tmpl
%%DATADIR%%/cgi-bin/login.cgi
%%DATADIR%%/cgi-bin/netams_graph.cgi
%%DATADIR%%/cgi-bin/admin/.htaccess
+%%DATADIR%%/cgi-bin/admin/cardtool.cgi
%%DATADIR%%/cgi-bin/admin/index.cgi
%%DATADIR%%/cgi-bin/admin/policy.cgi
%%DATADIR%%/cgi-bin/admin/showusercard.cgi
@@ -37,8 +36,8 @@ bin/netamsctl
%%DATADIR%%/cgi-bin/admin/russian.res
%%DATADIR%%/cgi-bin/admin/unit.cgi
%%DATADIR%%/cgi-bin/images/admintool-logo.gif
-%%DATADIR%%/cgi-bin/images/logo-small.gif
%%DATADIR%%/cgi-bin/images/logo.gif
+%%DATADIR%%/cgi-bin/images/logo_sm.jpg
%%DATADIR%%/cgi-bin/images/showtable-logo.gif
@dirrm %%DATADIR%%/cgi-bin/images
@dirrm %%DATADIR%%/cgi-bin/admin