diff options
author | leeym <leeym@FreeBSD.org> | 2003-06-20 04:13:20 +0800 |
---|---|---|
committer | leeym <leeym@FreeBSD.org> | 2003-06-20 04:13:20 +0800 |
commit | f1de0970c1a081f116bbcc2ce1ac62cab0c381fc (patch) | |
tree | 9eba6997fba59b9ff253743a4d4b852102990c4c /net/netams | |
parent | d2ac72719790c34e905efb91a2533f7f2a2c9391 (diff) | |
download | freebsd-ports-gnome-f1de0970c1a081f116bbcc2ce1ac62cab0c381fc.tar.gz freebsd-ports-gnome-f1de0970c1a081f116bbcc2ce1ac62cab0c381fc.tar.zst freebsd-ports-gnome-f1de0970c1a081f116bbcc2ce1ac62cab0c381fc.zip |
Update based on new version netams-3.1.1563
PR: 52608
Submitted by: "Yuriy N. Shkandybin" <jura@happychance.com>
Diffstat (limited to 'net/netams')
-rw-r--r-- | net/netams/Makefile | 54 | ||||
-rw-r--r-- | net/netams/distinfo | 2 | ||||
-rw-r--r-- | net/netams/files/patch-Makefile | 56 | ||||
-rw-r--r-- | net/netams/files/patch-addon::netams-startup.sh | 22 | ||||
-rw-r--r-- | net/netams/pkg-plist | 2 | ||||
-rw-r--r-- | net/netams/scripts/configure | 26 | ||||
-rw-r--r-- | net/netams/scripts/configure.netams | 161 |
7 files changed, 231 insertions, 92 deletions
diff --git a/net/netams/Makefile b/net/netams/Makefile index 0b20fbadd79d..652ff437e020 100644 --- a/net/netams/Makefile +++ b/net/netams/Makefile @@ -7,44 +7,42 @@ PORTNAME= netams PORTVERSION= 3.1 +PORTREVISION= 0 CATEGORIES= net -MASTER_SITES= http://www.netams.com/ -DISTNAME= netams-3.1.1376 +MASTER_SITES= http://www.netams.com/files/ +DISTNAME= ${PORTNAME}-${PORTVERSION}.1563 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 +USE_SUBMAKE= yes -WRKSRC= ${WRKDIR}/netams +MAN8= netams.8 +MANCOMPRESSED= no -DEFINE= -DFREEBSD -LIB= -pthread -lpcap -lutil +SCRIPTS_ENV= WRKDIRPREFIX="${WRKDIRPREFIX}" \ + PREFIX="${PREFIX}" \ + TOUCH="${TOUCH}" \ + MKDIR="${MKDIR}" \ + REALCURDIR="${.CURDIR}" \ + WITH_MYSQL="${WITH_MYSQL}" \ + WITH_MYSQL40="${WITH_MYSQL40}" \ + WITH_MYSQL41="${WITH_MYSQL41}" \ + WITH_PGSQL="${WITH_PGSQL}" \ + WITH_DEBUG="${WITH_DEBUG}" \ + LOG_DROP="${LOG_DROP}" -.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 +.include <bsd.port.pre.mk> -SCRIPTS_ENV='DEFINE=${DEFINE}' 'LIB=${LIB}' +pre-fetch: + @${SETENV} ${SCRIPTS_ENV} ${SH} ${SCRIPTDIR}/configure.netams -.include <bsd.port.pre.mk> -.if ${OSVERSION} >= 500000 +.if exists(${WRKDIRPREFIX}${.CURDIR}/Makefile.inc) +.include "${WRKDIRPREFIX}${.CURDIR}/Makefile.inc" .endif +MAKE_ENV+= DEFINE="${DEFINE}" FLAGS="${FLAGS}" LIB="${LIB}" + do-install: @ ${INSTALL_PROGRAM} ${WRKSRC}/src/netams ${PREFIX}/libexec/netams @ ${INSTALL_PROGRAM} ${WRKSRC}/src/netamsctl ${PREFIX}/bin/netamsctl @@ -56,7 +54,7 @@ do-install: .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 +.for cgi in logo.gif netams_api.pl netams_graph.cgi weblogin.tem netams_example.cgi weblogin.cgi @ ${INSTALL_DATA} ${WRKSRC}/cgi-bin/${cgi} ${EXAMPLESDIR}/cgi-bin/ .endfor .if !defined(NOPORTDOCS) @@ -68,5 +66,7 @@ do-install: post-install: @${SED} 's|%%PREFIX%%|${PREFIX}|g' ${PKGDIR}/pkg-message|${SED} 's|%%EXAMPLESDIR%%|${EXAMPLESDIR}|g' +post-clean: + @${RM} -f ${WRKDIRPREFIX}${.CURDIR}/Makefile.inc .include <bsd.port.post.mk> diff --git a/net/netams/distinfo b/net/netams/distinfo index 033432fd8a8c..cf626493f2ab 100644 --- a/net/netams/distinfo +++ b/net/netams/distinfo @@ -1 +1 @@ -MD5 (netams-3.1.1376.tar.gz) = cf8e0f63a9c0a406500ed7a6c1fa2c53 +MD5 (netams-3.1.1563.tar.gz) = 75c402d5a883efc577c0c9c760fbd627 diff --git a/net/netams/files/patch-Makefile b/net/netams/files/patch-Makefile index 99461f5957e3..73ca3202e10a 100644 --- a/net/netams/files/patch-Makefile +++ b/net/netams/files/patch-Makefile @@ -1,20 +1,48 @@ ---- 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 +--- Makefile Mon May 19 20:41:16 2003 ++++ Makefile.orig Fri May 23 12:27:25 2003 +@@ -11,14 +11,14 @@ ########################################################################## - # for Linux, uncomment this -@@ -40,7 +40,7 @@ + # for FreeBSD, uncomment this +-DEFINE = -DFREEBSD -D_THREAD_SAFE +-LIB = -pthread -lpcap ++DEFINE += -DFREEBSD -D_THREAD_SAFE ++LIB += -pthread -lpcap -lcrypt + # + # DB1 support + # DEFINE+= -DUSE_HASH + # + # MySQL storage support +-DEFINE += -DUSE_MYSQL +-LIB += -lmysqlclient -L/usr/local/lib/mysql ++# DEFINE += -DUSE_MYSQL ++# LIB += -lmysqlclient -L/usr/local/lib/mysql + # + # PostgreSQL storage support + # DEFINE += -DUSE_POSTGRES +@@ -45,14 +45,14 @@ + # DEFINE += -DIPTBL_PFSET + ########################################################################## + # Define here a PATH variables +-PATH_TO_CONFIG="/usr/local/etc/netams.cfg" ++PATH_TO_CONFIG="${PREFIX}/etc/netams.conf" + PATH_TO_LOG="/var/log/netams.log" + # + # Uncomment this if you want to log dropped packets + # DEFINE += -DLOG_DROP + # Uncomment this if you want to enable debug features +-DEFINE += -DDEBUG +-FLAGS += -g -Wall ++# DEFINE += -DDEBUG ++# FLAGS += -g -Wall + # Uncomment this if you want to enable profiler support + # LIB += -lm -pg + # FLAGS += -pg +@@ -74,7 +74,7 @@ CC = g++ - FLAGS = -g -pthread -Wall + FLAGS += -pthread -INCLUDE=/usr/local/include -+INCLUDE=${LOCALBASE}/include ++INCLUDE = ${LOCALBASE}/include OBJ = $(SRC:.c=.o) - CFLAGS = $(FLAGS) -I$(INCLUDE) $(DEFINE) -Wall + CFLAGS = $(FLAGS) -I$(INCLUDE) $(DEFINE) diff --git a/net/netams/files/patch-addon::netams-startup.sh b/net/netams/files/patch-addon::netams-startup.sh deleted file mode 100644 index e6e9e99a7e63..000000000000 --- a/net/netams/files/patch-addon::netams-startup.sh +++ /dev/null @@ -1,22 +0,0 @@ -*** 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/netams/pkg-plist b/net/netams/pkg-plist index 877b0878b65e..597e0366c84d 100644 --- a/net/netams/pkg-plist +++ b/net/netams/pkg-plist @@ -15,7 +15,6 @@ 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 @@ -24,4 +23,3 @@ 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/netams/scripts/configure b/net/netams/scripts/configure deleted file mode 100644 index b7e5ae9402d0..000000000000 --- a/net/netams/scripts/configure +++ /dev/null @@ -1,26 +0,0 @@ -#! ${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 - diff --git a/net/netams/scripts/configure.netams b/net/netams/scripts/configure.netams new file mode 100644 index 000000000000..d3013b9af407 --- /dev/null +++ b/net/netams/scripts/configure.netams @@ -0,0 +1,161 @@ +#!/bin/sh + +if [ -f ${WRKDIRPREFIX}${REALCURDIR}/Makefile.inc ]; then + exit +fi + +tempfile=`mktemp -t checklist` + +if [ "${BATCH}" ]; then + if [ "${WITH_MYSQL41}" ]; then + OPTIONS="${OPTIONS} \"MySQL41\"" + elif [ "${WITH_MYSQL40}" ]; then + OPTIONS="${OPTIONS} \"MySQL40\"" + elif [ "${WITH_MYSQL}" ]; then + OPTIONS="${OPTIONS} \"MySQL\"" + fi + if [ "${WITH_POSTGRES}" ]; then + OPTIONS="${OPTIONS} \"PgSQL\"" + fi + if [ "${WITH_HASH}" ]; then + OPTIONS="$OPTIONS} \"HASH\"" + fi + if [ "${WITH_OPT}" ]; then + OPTIONS="${OPTIONS} \"OPTIMIZED\"" + fi + if [ "${LOG_DROP}" ]; then + OPTIONS="$OPTIONS} \"LOG_DROP\"" + fi + +else + SET_MYSQL41="OFF" + SET_MYSQL40="OFF" + SET_MYSQL="OFF" + if [ "${WITH_MYSQL41}" -o -f ${PREFIX}/lib/mysql/libmysqlclient.so.14 ] ; then + SET_MYSQL41="ON" + elif [ "${WITH_MYSQL40}" -o -f ${PREFIX}/lib/mysql/libmysqlclient.so.12 ] ; then + SET_MYSQL40="ON" + elif [ "${WITH_MYSQL}" -o -f ${PREFIX}/lib/mysql/libmysqlclient.so ] ; then + SET_MYSQL="ON" + fi + SET_POSTGRES="OFF" + if [ "${WITH_POSTGRES}" -o -f ${PREFIX}/lib/pq.3 ] ; then + SET_POSTGRES="ON" + fi + SET_HASH="OFF" + if [ "${WITH_HASH}" ] ; then + SET_HASH="ON" + fi + SET_DEBUG="ON" + if [ "${WITH_DEBUG}" ] ; then + SET_DEBUG="ON" + fi + SET_OPT="OFF" + if [ "${WITH_OPT}" ] ; then + SET_OPT="ON" + fi + SET_LOG_DROP="OFF" + if [ "${LOG_DROP}" ] ; then + SET_LOG_DROP="ON" + fi + + /usr/bin/dialog --title "NetAMS options" --clear \ + --checklist "\n\ +Please select desired options:" -1 -1 8 \ +MySQL "MySQL 3.23 support" ${SET_MYSQL} \ +MySQL40 "MySQL 4.0 support" ${SET_MYSQL40} \ +MySQL41 "MySQL 4.1 support" ${SET_MYSQL41} \ +PgSQL "PostgreSQL support" ${SET_POSTGRES} \ +HASH "Unix HASH support" ${SET_HASH} \ +DEBUG "Debugging support" ${SET_DEBUG} \ +OPTIMIZED "Enable optimization" ${SET_OPT} \ +LOG_DROP "Log dropped packets" ${SET_LOG_DROP} \ +2> $tempfile + + retval=$? + + if [ -s $tempfile ]; then + set `cat $tempfile` + fi + rm -f $tempfile + + case $retval in + 0) if [ -z "$*" ]; then + echo "Nothing selected" + fi + ;; + 1) echo "Cancel pressed." + exit 1 + ;; + esac +fi + + +${MKDIR} ${WRKDIRPREFIX}${REALCURDIR} +exec > ${WRKDIRPREFIX}${REALCURDIR}/Makefile.inc + +echo "PREFIX= ${PREFIX}" + +while [ "$1" ]; do + case $1 in + \"MySQL41\") + if [ "${DEFMYSQL}" ]; then + echo "MySQL 3.23, 4.0 and 4.1 are mutually exclusive." > /dev/stderr + exit 1 + fi + echo "LIB_DEPENDS+= mysqlclient.14:\${PORTSDIR}/databases/mysql41-client" + DEFMYSQL=1 + ;; + \"MySQL40\") + if [ "${DEFMYSQL}" ]; then + echo "MySQL 3.23, 4.0 and 4.1 are mutually exclusive." > /dev/stderr + exit 1 + fi + echo "LIB_DEPENDS+= mysqlclient.12:\${PORTSDIR}/databases/mysql40-client" + DEFMYSQL=1 + ;; + \"MySQL\") + if [ "${DEFMYSQL}" ]; then + echo "MySQL 3.23, 4.0 and 4.1 are mutually exclusive." > /dev/stderr + exit 1 + fi + echo "LIB_DEPENDS+= mysqlclient.10:\${PORTSDIR}/databases/mysql323-client" + DEFMYSQL=1 + ;; + \"PgSQL\") + echo "LIB_DEPENDS+= pq.3:\${PORTSDIR}/databases/postgresql7" + echo "DEFINE+= -DUSE_POSTGRES" + echo "LIB += -lpq -L${LOCALBASE}/lib" + ;; + \"HASH\") + echo "DEFINE+= -DUSE_HASH" + ;; + \"DEBUG\") + if [ "${DEFOPT}" ]; then + echo "DEBUG and OPTIMIZED are mutually exclusive." > /dev/stderr + exit 1 + fi + echo "DEFINE += -DDEBUG" + echo "FLAGS += -g -Wall" + DEFDEBUG=1 + ;; + \"OPTIMIZED\") + if [ "${DEFDEBUG}" ]; then + echo "DEBUG and OPTIMIZED are mutually exclusive." > /dev/stderr + exit 1 + fi + echo "FLAGS += -O" + DEFOPT=1 + ;; + \"LOG_DROP\") + echo "DEFINE += -DLOG_DROP" + ;; + esac + shift +done + +if [ "${DEFMYSQL}" ]; then +echo "LIB += -lmysqlclient -L${LOCALBASE}/lib/mysql" +echo "DEFINE+= -DUSE_MYSQL" +else +fi |