aboutsummaryrefslogtreecommitdiff
path: root/net/ntopng/files
diff options
context:
space:
mode:
authorSunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org>2013-12-02 08:00:56 +0000
committerSunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org>2013-12-02 08:00:56 +0000
commit5034f925da1b45e57d55c7d218fc160d1441dffc (patch)
treecca2befcb2f534da1ebd714a8c551b4bc95ff038 /net/ntopng/files
parentb01d9e3fe09a1ca91435040654393a8993d65548 (diff)
downloadports-5034f925da1b45e57d55c7d218fc160d1441dffc.tar.gz
ports-5034f925da1b45e57d55c7d218fc160d1441dffc.zip
- Add ntopng 1.1
ntopng is a new generation flexible and feature-rich tool for monitoring and troubleshooting local area networks. It provides command line and web interfaces, the latter via an embedded web server. ntop is based on libpcap. WWW: http://www.ntop.org/products/ntop/ PR: ports/184197 Submitted by: Muhammad Moinur Rahman <5u623l20@gmail.com>
Notes
Notes: svn path=/head/; revision=335455
Diffstat (limited to 'net/ntopng/files')
-rw-r--r--net/ntopng/files/ntopng.in35
-rw-r--r--net/ntopng/files/patch-Makefile.in118
-rw-r--r--net/ntopng/files/patch-Ntop.cpp20
-rw-r--r--net/ntopng/files/patch-configure40
-rw-r--r--net/ntopng/files/patch-credis.c12
5 files changed, 225 insertions, 0 deletions
diff --git a/net/ntopng/files/ntopng.in b/net/ntopng/files/ntopng.in
new file mode 100644
index 000000000000..453daa5cdfed
--- /dev/null
+++ b/net/ntopng/files/ntopng.in
@@ -0,0 +1,35 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: ntopng
+# REQUIRE: DAEMON
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf to enable ntop:
+#
+# ntopng_enable (bool): Set it to "YES" to enable ntop
+# Default is "NO".
+# ntopng_flags (flags): Set extra flags to ntop
+# Default is "-d --use-syslog=daemon". see ntop(8).
+#
+
+. /etc/rc.subr
+
+name=ntopng
+rcvar=ntopng_enable
+pid_path=/var/run/${name}.pid
+httpdocs_path=%%DATADIR%%/httpdocs
+scripts_path=%%DATADIR%%/scripts
+callbacks_path=%%DATADIR%%/scripts/callbacks
+user_path=%%PREFIX%%/etc/ntopng-users.conf
+
+load_rc_config $name
+
+: ${ntopng_enable="NO"}
+: ${ntopng_flags="-e -G ${pid_path}"}
+
+command=%%PREFIX%%/bin/ntopng
+command_args="-e -G $pid_path -1 $httpdocs_path -2 $scripts_path -3 $callbacks_path
+
+run_rc_command "$1"
diff --git a/net/ntopng/files/patch-Makefile.in b/net/ntopng/files/patch-Makefile.in
new file mode 100644
index 000000000000..7a7bbd537fdb
--- /dev/null
+++ b/net/ntopng/files/patch-Makefile.in
@@ -0,0 +1,118 @@
+--- Makefile.in.orig 2013-11-04 06:15:16.000000000 +0600
++++ Makefile.in 2013-11-18 21:50:52.000000000 +0600
+@@ -1,5 +1,4 @@
+-SHELL=/bin/bash
+-OS := $(shell uname -s)
++OS=FreeBSD
+ ######
+ CREDIS_HOME=third-party/credis-0.2.3
+ CREDIS=$(CREDIS_HOME)/credis.o
+@@ -13,9 +12,7 @@
+ MONGOOSE_HOME=./third-party/mongoose
+ MONGOOSE_INC=-I$(MONGOOSE_HOME)
+ ######
+-LUAJIT_HOME=./third-party/LuaJIT-2.0.2
+-LUAJIT_INC=-I$(LUAJIT_HOME)/src
+-LUAJIT_LIB=$(LUAJIT_HOME)/src/libluajit.a
++%%LUAJIT_LIB%%
+ ######
+ LIBRRDTOOL_HOME=third-party/rrdtool-1.4.7
+ LIBRRDTOOL_INC=-I$(LIBRRDTOOL_HOME)/src/
+@@ -29,14 +26,14 @@
+ ######
+ ZEROMQ_HOME=./third-party/zeromq-3.2.3
+ ZEROMQ_INC=-I$(ZEROMQ_HOME)/include
+-ZEROMQ_LIB=$(ZEROMQ_HOME)/src/.libs/libzmq.a
++%%ZEROMQ_LIB%%
+ ######
+ EWH_HOME=third-party/EWAHBoolArray
+ EWH_INC=$(EWH_HOME)/headers
+ ######
+ TARGET = ntopng
+-LIBS = @LDFLAGS@ $(NDPI_LIB) $(LIBPCAP) $(LUAJIT_LIB) $(LIBRRDTOOL_LIB) $(ZEROMQ_LIB) $(JSON_LIB) -lxml2 @SQLITE_LIB@ @LINK_OPTS@ @LIBGNUTLS@ @GEOIP_LIB@ @Z_LIB@ -lm -ldl -lpthread
+-CPPFLAGS = -g @CFLAGS@ $(CREDIS_INC) $(MONGOOSE_INC) -I$(JSON_INC) $(NDPI_INC) $(LUAJIT_INC) $(LIBRRDTOOL_INC) $(ZEROMQ_INC) @CPPFLAGS@ -I$(HTTPCLIENT_INC) -I$(EWH_INC) # -D_GLIBCXX_DEBUG
++LIBS = @LDFLAGS@ $(NDPI_LIB) $(LIBPCAP) $(LUAJIT_LIB) $(ZEROMQ_LIB) $(LIBRRDTOOL_LIB) $(JSON_LIB) -lxml2 @SQLITE_LIB@ @LINK_OPTS@ @LIBGNUTLS@ @GEOIP_LIB@ @Z_LIB@ -lm -lpthread
++CPPFLAGS = -g @CFLAGS@ $(CREDIS_INC) $(MONGOOSE_INC) -I$(JSON_INC) $(NDPI_INC) $(LIBRRDTOOL_INC) @CPPFLAGS@ -I$(HTTPCLIENT_INC) -I$(EWH_INC) # -D_GLIBCXX_DEBUG
+ ######
+ # ntopng-1.0_1234.x86_64.rpm
+ PLATFORM = `uname -p`
+@@ -53,22 +50,22 @@
+
+ .PHONY: default all clean
+
+-default: $(NDPI_LIB) $(LUAJIT_LIB) $(LIBRRDTOOL_LIB) $(ZEROMQ_LIB) $(JSON_LIB) $(TARGET)
++default: $(NDPI_LIB) $(TARGET)
+ all: default
+
+ OBJECTS = $(patsubst %.cpp, %.o, $(wildcard *.cpp)) $(CREDIS)
+ HEADERS = $(wildcard *.h)
+
+ %.o: %.c $(HEADERS) Makefile
+- g++ $(CPPFLAGS) -c $< -o $@
++ %%G++%% $(CPPFLAGS) -c $< -o $@
+
+ %.o: %.cpp $(HEADERS) Makefile
+- g++ $(CPPFLAGS) -c $< -o $@
++ %%G++%% $(CPPFLAGS) -c $< -o $@
+
+ .PRECIOUS: $(TARGET) $(OBJECTS)
+
+-$(TARGET): $(OBJECTS) $(LIBRRDTOOL) Makefile
+- g++ $(OBJECTS) -Wall $(LIBS) -o $@
++$(TARGET): $(OBJECTS) Makefile
++ %%G++%% $(OBJECTS) -Wall $(LIBS) -o $@
+
+ $(NDPI_LIB): nDPI
+ cd nDPI; ./configure; @GMAKE@
+@@ -76,18 +73,6 @@
+ nDPI:
+ svn co https://svn.ntop.org/svn/ntop/trunk/nDPI/
+
+-$(LUAJIT_LIB):
+- cd $(LUAJIT_HOME); @GMAKE@
+-
+-$(ZEROMQ_LIB):
+- cd $(ZEROMQ_HOME); ./configure --without-documentation; @GMAKE@
+-
+-$(LIBRRDTOOL_LIB):
+- cd $(LIBRRDTOOL_HOME); ./configure --disable-rrd_graph --disable-libdbi --disable-libwrap --disable-rrdcgi --disable-libtool-lock --disable-nls --disable-rpath --disable-perl --disable-ruby --disable-lua --disable-tcl --disable-python --disable-dependency-tracking; cd src; @GMAKE@ librrd_th.la
+-
+-$(JSON_LIB):
+- cd $(JSON_HOME); ./autogen.sh; ./configure; make
+-
+ clean:
+ -rm -f *.o *~ svn-commit.* #config.h
+ -rm -f $(TARGET)
+@@ -156,21 +141,14 @@
+ -rm -rf ntopng-data-@PACKAGE_VERSION@ ntopng-data_@PACKAGE_VERSION@_@SVN_RELEASE@.tgz
+
+
+-install: ntopng geoip
+- @echo "While we provide you an install make target, we encourage you"
+- @echo "to create a package and install that"
+- @echo "rpm - do 'make build-rpm'"
+- @echo "deb - do 'cd packages/ubuntu;./configure;make"
+- mkdir -p /usr/local/share/ntopng /usr/local/man/man8 /usr/local/bin
+- cp ntopng /usr/local/bin
+- cp ./ntopng.8 /usr/local/man/man8
+- cp -r ./httpdocs /usr/local/share/ntopng
+- cp -r ./scripts /usr/local/share/ntopng
+- find /usr/local/share/ntopng -name "*~" | xargs /bin/rm -f
+- find /usr/local/share/ntopng -name ".svn" | xargs /bin/rm -rf
+-
+-Makefile: @SVN_WC_DB@
+- @echo ""
+- @echo "Re-running configure as the SVN release has changed"
+- @echo ""
+- ./configure
++install:
++ /bin/mkdir -p %%STAGEDIR%%%%DATADIR%%
++ /bin/mkdir -p %%STAGEDIR%%%%DATADIR%%/httpdocs
++ /bin/mkdir -p %%STAGEDIR%%%%DATADIR%%/httpdocs/geoip
++ /bin/mkdir -p %%STAGEDIR%%%%DATADIR%%/scripts
++ cd %%WRKSRC%% && %%INSTALL_PROGRAM%% %%PORTNAME%% %%STAGEDIR%%%%PREFIX%%/bin/
++ cd %%WRKSRC%% && %%INSTALL_MAN%% ntopng.8 %%STAGEDIR%%%%PREFIX%%/man/man8
++ cd %%WRKDIR%% && %%INSTALL_DATA%% GeoIPASNum.dat %%STAGEDIR%%%%DATADIR%%/httpdocs/geoip/
++ cd %%WRKDIR%% && %%INSTALL_DATA%% GeoIPASNumv6.dat %%STAGEDIR%%%%DATADIR%%/httpdocs/geoip/
++ cd %%WRKDIR%% && %%INSTALL_DATA%% GeoLiteCity.dat %%STAGEDIR%%%%DATADIR%%/httpdocs/geoip/
++ cd %%WRKDIR%% && %%INSTALL_DATA%% GeoLiteCityv6.dat %%STAGEDIR%%%%DATADIR%%/httpdocs/geoip/
diff --git a/net/ntopng/files/patch-Ntop.cpp b/net/ntopng/files/patch-Ntop.cpp
new file mode 100644
index 000000000000..8511c6d32274
--- /dev/null
+++ b/net/ntopng/files/patch-Ntop.cpp
@@ -0,0 +1,20 @@
+--- Ntop.cpp.orig 2013-11-18 16:49:30.000000000 +0600
++++ Ntop.cpp 2013-11-18 16:50:51.000000000 +0600
+@@ -89,12 +89,12 @@
+ void Ntop::initTimezone() {
+ /*
+ Setup timezone differences
+-
+- We call it all the time as daylight can change
+- during the night and thus we need to have it "fresh"
+ */
+- tzset();
+- time_offset = timezone - (daylight * 3600);
++ time_t curtime;
++ struct tm *loctime;
++ curtime = time (NULL);
++ loctime = localtime (&curtime);
++ time_offset = loctime->tm_gmtoff;
+ }
+
+ /* ******************************************* */
diff --git a/net/ntopng/files/patch-configure b/net/ntopng/files/patch-configure
new file mode 100644
index 000000000000..3841dc597310
--- /dev/null
+++ b/net/ntopng/files/patch-configure
@@ -0,0 +1,40 @@
+--- configure.orig 2013-11-18 11:08:04.000000000 +0600
++++ configure 2013-11-18 11:09:19.000000000 +0600
+@@ -620,7 +620,6 @@
+
+ ac_subst_vars='LTLIBOBJS
+ LIBOBJS
+-SVN_WC_DB
+ SVN_DATE
+ GMAKE
+ SQLITE_LIB
+@@ -2953,15 +2952,15 @@
+ NTOPNG_VERS=`cat ./configure.in | head -1 | grep '_INIT' | cut -d " " -f 2|cut -d ')' -f 1`
+ CFLAGS="${CFLAGS} -I/usr/local/include -I/opt/local/include"
+ CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/opt/local/include"
+-LDFLAGS="${LDFLAGS} -L/usr/local/lib -L/opt/local/lib"
++LDFLAGS="${LDFLAGS}-L/usr/local/lib -L/opt/local/lib"
+
+-SVN_RELEASE=`svn info . | grep "^Revision"|cut -d " " -f 2`
++SVN_RELEASE="6939"
+
+ cat >>confdefs.h <<_ACEOF
+ #define NTOPNG_SVN_RELEASE "r${SVN_RELEASE}"
+ _ACEOF
+
+-SVN_DATE=`svn info . | grep "^Last Changed Date"|cut -d " " -f 4-`
++SVN_DATE="2013-11-05 03:54:00 +0600 (Tue, 05 Nov 2013)"
+
+ cat >>confdefs.h <<_ACEOF
+ #define NTOPNG_SVN_DATE "${SVN_DATE}"
+@@ -2969,10 +2968,6 @@
+
+ PACKAGE_VERSION="${NTOPNG_VERS}_${SVN_RELEASE}"
+
+-if test -f ".svn/wc.db"; then
+- SVN_WC_DB=".svn/wc.db"
+-fi
+-
+ MACHINE=`uname -m`
+ SYSTEM=`uname -s`
+
diff --git a/net/ntopng/files/patch-credis.c b/net/ntopng/files/patch-credis.c
new file mode 100644
index 000000000000..f44050273935
--- /dev/null
+++ b/net/ntopng/files/patch-credis.c
@@ -0,0 +1,12 @@
+--- third-party/credis-0.2.3/credis.c.orig 2013-11-18 21:41:06.000000000 +0600
++++ third-party/credis-0.2.3/credis.c 2013-11-18 21:41:54.000000000 +0600
+@@ -39,6 +39,9 @@
+ #include <winsock2.h>
+ #include "ntop_win32.h"
+ #else
++#ifdef __FreeBSD__
++#include <sys/types.h>
++#endif
+ #include <arpa/inet.h>
+ #include <errno.h>
+ #include <fcntl.h>