ntop stable port information

Package: ntop
Version: 3.3
Revision: 3
Maintainer: None
Depends: <<
gdbm3-shlibs,
libpcap-shlibs (>= 0.9.8-1),
libpcre1-shlibs,
librrd4-shlibs (>= 1.3.8-1),
net-snmp-unified25-shlibs
<<
BuildDepends: <<
autoconf2.6,
automake1.11,
fink (>= 0.28),
fink-package-precedence,
gdbm3,
libelf,
libpcap (>= 0.9.8-1),
libpcre1,
libtool2,
net-snmp-unified25-dev,
net-snmp-unified (>= 5.6.1-1),
pkgconfig (>= 0.23),
rrdtool-dev (>= 1.3.8-1),
system-openssl-dev
<<
Source: mirror:debian:pool/main/n/%n/%n_%v.orig.tar.gz
Source-MD5: a0e52a85587c8a5519d822d04862dab4
SourceDirectory: %n-%v
PatchFile: %n.patch
PatchFile-MD5: 7f0c9633d5bfb28af40a72d9db898f2c
PatchScript: <<
sed "s,@PREFIX@,%p,g" < %{PatchFile} | patch -p1
perl -pi -e 's/-shared/-module -avoid-version/' plugins/Makefile.am
perl -pi -e 's/-release \@PACKAGE_VERSION\@//' plugins/Makefile.am
<<
SetCPPFLAGS: -I%p/lib/system-openssl/include
SetLDFLAGS: -L%p/lib/system-openssl/lib
ConfigureParams: --mandir=%p/share/man --enable-dependency-tracking --disable-static --with-ssl --with-tcpwrap --enable-i18n --with-localedir=%p/share/locale
CompileScript: <<
rm -f libtool.m4.in ltmain.sh aclocal.m4 acinclude.m4.in
cp acinclude.m4.ntop acinclude.m4
autoreconf -fi
./configure %c
make
fink-package-precedence .
<<
InstallScript: <<
make install DESTDIR=%d
<<
DocFiles: AUTHORS COPYING ChangeLog NEWS SUPPORT_NTOP.txt THANKS docs/1STRUN.txt docs/BUG_REPORT docs/FAQ* docs/HACKING docs/KNOWN_BUGS docs/README docs/TODO docs/database/README:README.database docs/database/README.mySQL:README.mySQL
Shlibs: <<
! %p/lib/libntop-3.3.dylib
! %p/lib/libntopreport-3.3.dylib
<<
DescPackaging: <<
Upstream website is confusing, just pull debian's source.

net-snmp's .la are in %N instead of %N15-dev.

net-snmp-config publishes flags related to perl but ntop
doesn't use or embed perl itself, so doesn't matter that they
are not portable among system-perl perlversions. But remove
/usr/local paths for safety (wish net-snmp already did that!).

Install the ASN datafiles.
<<
DescPort: <<
Fix upstream confusion about what a shared-library vs a
loadable module is for building plugins.

Avoid lots of non-portable darwin-specific hacks that aren't
needed on modern unix-standard OS X.

Leaving as -flat_namespace pending evidence that changing it
is good (libnetsnmp is flat).

Plugins cannot be -no-undefined because they need symbols from
main shared-libraries but don't link them or specify
-bundle_loader. Leaving alone until someone cares.

"bool" is a defined type on darwin...#include the system
header rather than setting a local typedef (header is already
used via other #include spaghetti sometimes anyway)
<<
DescUsage: <<
This version includes its own webserver (defaults to running
on port 3000). Previous versions had a text interface
(curses). If you want a text-based tool similar to the old
ntop, try iftop.
<<
Description: Network usage information via web interface
License: GPL
Homepage: http://www.ntop.org/

ntop stable port .patch

diff -Nurd -x'*~' ntop-3.3.orig/Makefile.am ntop-3.3/Makefile.am
--- ntop-3.3.orig/Makefile.am 2007-06-09 17:15:11.000000000 -0400
+++ ntop-3.3/Makefile.am 2009-05-28 23:05:29.000000000 -0400
@@ -157,8 +157,8 @@
.PHONY: snapshot


-acinclude.m4: acinclude.m4.ntop libtool.m4.in
- @cat acinclude.m4.ntop libtool.m4.in >acinclude.m4
+acinclude.m4: acinclude.m4.ntop
+ @cat acinclude.m4.ntop >acinclude.m4

CLEANLIST = `ls -l $(DESTDIR)$(libdir)/*ntop*.so $(DESTDIR)$(libdir)/*Plugin*.so | \
grep -v $(VERSION) | \
@@ -266,7 +266,7 @@
fi; \
done

-install: install-recursive
+install: install-recursive install-data-as

@mkdir -p $(DESTDIR)/$(CFG_DBFILE_DIR)

@@ -360,7 +360,6 @@
done

install-data-local: ntop.txt ntop.html faq.html
- @$(top_srcdir)/mkinstalldirs $(DESTDIR)/$(libdir)/plugins;
@if ! test -d $(DESTDIR)/$(datadir)/ntop; then \
$(top_srcdir)/mkinstalldirs $(DESTDIR)/$(datadir)/ntop; \
touch $(DESTDIR)/$(datadir)/ntop/warnuser; \
diff -Nurd -x'*~' ntop-3.3.orig/configure.in ntop-3.3/configure.in
--- ntop-3.3.orig/configure.in 2007-06-09 17:30:00.000000000 -0400
+++ ntop-3.3/configure.in 2009-05-29 00:09:52.000000000 -0400
@@ -159,6 +159,7 @@

AC_PROG_CPP
AC_PROG_CC
+AM_PROG_CC_C_O
dnl> AC_PROG_CXX no c++ code (yet?)
AC_PROG_INSTALL
AC_PROG_LN_S
@@ -360,7 +361,6 @@
echo
echo "Checking C compiler program and features..."
echo
-AM_PROG_CC_STDC
if test ".${ac_cv_prog_cc_stdc}" = ".no"; then
echo
echo "*******************************************************************"
@@ -508,10 +508,6 @@
LOCALEDIR="/usr/lib/locale"
fi

-dnl> Add /usr/local/
-CFLAGS="${CFLAGS} -I/usr/local/include"
-CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
-LDFLAGS="${LDFLAGS} -L/usr/local/lib"



@@ -546,14 +542,7 @@
)

dnl> add pic flag in any case this makes sure all our code is relocatable
-case "${target}:${CC}" in
- *-*-darwin*:* )
- CFLAGS="$CFLAGS "`grep pic_flag= /usr/bin/glibtool | head -n1 | sed -e 's/.*pic_flag=//' -e 's/"//g'`
- ;;
- * )
- CFLAGS="$CFLAGS "`grep pic_flag= libtool | head -n1 | sed -e 's/.*pic_flag=//' -e 's/"//g'`
- ;;
-esac
+dnl nah, just let libtool Do The Right Thing

dnl> Presets for the make flags go here...
CFLAGS="${CFLAGS}"
@@ -1581,13 +1570,13 @@
AC_CHECK_TOOL(NETSNMP, net-snmp-config)
if test "x$ac_cv_prog_ac_ct_NETSNMP" = "xnet-snmp-config"; then
AC_DEFINE_UNQUOTED(HAVE_SNMP, 1, [SNMP is supported])
- SNMPLIBS="`net-snmp-config --libs`"
+ SNMPLIBS="`net-snmp-config --libs | sed 's/-L\/usr\/local\/lib//g'`"
SNMPLIBS="`echo ${SNMPLIBS}|sed -e s,'-R../lib',,g`"
echo "net-snmp libs: ${SNMPLIBS}"
LIBS="${LIBS} ${SNMPLIBS}"
dnl remove unecessary path
LIBS=`echo ${LIBS}|sed -e s,'-R../lib',,g`
- INCS="${INCS} `net-snmp-config --cflags`"
+ INCS="${INCS} `net-snmp-config --cflags | sed 's/-I\/usr\/local\/include//g'`"
else
AC_MSG_RESULT(NET-SNMP is not present: SNMP support is disabled)
fi
@@ -2088,7 +2077,7 @@
echo "#endif /* MEMORY_DEBUG */" >> version.c

case "${host}" in
- *darwin* )
+ *darwin_skip-this-hack* )
echo
echo "Copying patched versions of some configure-related files for Mac OS X"
cp packages/MacOSX/lt* .
diff -Nurd -x'*~' ntop-3.3.orig/configureextra/DARWIN ntop-3.3/configureextra/DARWIN
--- ntop-3.3.orig/configureextra/DARWIN 2005-03-24 07:09:07.000000000 -0500
+++ ntop-3.3/configureextra/DARWIN 2009-05-28 22:30:42.000000000 -0400
@@ -1,13 +1,5 @@
#!/bin/sh

echo " Setting Darwin (Mac OS X) specific flag values"
-CFLAGS="-no-cpp-precomp $CFLAGS"

-case "${target}" in
- *-*-darwin5.5* )
- DYN_FLAGS="-bundle -flat_namespace -undefined suppress $DYN_FLAGS"
- ;;
- *-*-darwin8* )
CPPFLAGS="${CPPFLAGS} -DTIGER"
- ;;
-esac
diff -Nurd -x'*~' ntop-3.3.orig/globals-defines.h ntop-3.3/globals-defines.h
--- ntop-3.3.orig/globals-defines.h 2007-05-17 11:30:08.000000000 -0400
+++ ntop-3.3/globals-defines.h 2009-05-29 00:12:49.000000000 -0400
@@ -2051,7 +2051,7 @@
* default file and directories
*/
#define DEFAULT_NTOP_PIDFILE "ntop.pid"
-#define DEFAULT_NTOP_PID_DIRECTORY "/var/run"
+#define DEFAULT_NTOP_PID_DIRECTORY "@PREFIX@/var/run"

/*
* default configuration parameters -- the comment gives the (short getopt) name
diff -Nurd -x'*~' ntop-3.3.orig/globals-structtypes.h ntop-3.3/globals-structtypes.h
--- ntop-3.3.orig/globals-structtypes.h 2007-05-29 16:46:55.000000000 -0400
+++ ntop-3.3/globals-structtypes.h 2009-06-02 12:29:04.000000000 -0400
@@ -100,7 +100,11 @@
typedef char int8_t;
#endif

+#ifdef __APPLE__
+#include
+#else
typedef unsigned char bool;
+#endif

#include "fcUtils.h"
#include "scsiUtils.h"
diff -Nurd -x'*~' ntop-3.3.orig/plugins/Makefile.am ntop-3.3/plugins/Makefile.am
--- ntop-3.3.orig/plugins/Makefile.am 2007-06-07 17:57:43.000000000 -0400
+++ ntop-3.3/plugins/Makefile.am 2009-05-28 21:16:26.000000000 -0400
@@ -42,16 +42,7 @@
#
# The meat for ntop
#
-noinst_PROGRAMS = \
- icmpPlugin.so \
- lastSeenPlugin.so \
- netflowPlugin.so \
- pdaPlugin.so \
- remotePlugin.so \
- rrdPlugin.so \
- sflowPlugin.so
-
-lib_LTLIBRARIES = \
+plugin_LTLIBRARIES = \
libicmpPlugin.la \
liblastSeenPlugin.la \
libnetflowPlugin.la \
@@ -89,117 +80,12 @@
libsflowPlugin_la_LDFLAGS = -shared -release @PACKAGE_VERSION@ @DYN_FLAGS@
libsflowPlugin_la_CFLAGS = $(AM_CFLAGS)

-#
-# Dependencies to allow ntop loading plugins on-place
-# by default ntop looks for plugins in the plugins/ subdirectory
-#
-
-
-.libs/libicmpPlugin.so@SO_VERSION_PATCH@:
- @if test -f libicmpPlugin_la-icmpPlugin.o; then \
- $(CC) @MAKE_SHARED_LIBRARY_PARM@ -o .libs/libicmpPlugin.so@SO_VERSION_PATCH@ libicmpPlugin_la-icmpPlugin.o; \
- else \
- $(CC) @MAKE_SHARED_LIBRARY_PARM@ -o .libs/libicmpPlugin.so@SO_VERSION_PATCH@ icmpPlugin.o; \
- fi
-
-icmpPlugin.so$(EXEEXT): .libs/libicmpPlugin.so@SO_VERSION_PATCH@
- @$(LN_S) .libs/libicmpPlugin.so icmpPlugin.so
-
-###############
-
-.libs/liblastSeenPlugin.so@SO_VERSION_PATCH@:
- @if test -f liblastSeenPlugin_la-lastSeenPlugin.o; then \
- $(CC) @MAKE_SHARED_LIBRARY_PARM@ -o .libs/liblastSeenPlugin.so@SO_VERSION_PATCH@ liblastSeenPlugin_la-lastSeenPlugin.o; \
- else \
- $(CC) @MAKE_SHARED_LIBRARY_PARM@ -o .libs/liblastSeenPlugin.so@SO_VERSION_PATCH@ lastSeenPlugin.o; \
- fi
-
-lastSeenPlugin.so$(EXEEXT): .libs/liblastSeenPlugin.so@SO_VERSION_PATCH@
- @$(LN_S) .libs/liblastSeenPlugin.so lastSeenPlugin.so
-
-###############
-
-.libs/libnetflowPlugin.so@SO_VERSION_PATCH@:
- @if test -f libnetflowPlugin_la-netflowPlugin.o; then \
- $(CC) @MAKE_SHARED_LIBRARY_PARM@ -o .libs/libnetflowPlugin.so@SO_VERSION_PATCH@ libnetflowPlugin_la-netflowPlugin.o; \
- else \
- $(CC) @MAKE_SHARED_LIBRARY_PARM@ -o .libs/libnetflowPlugin.so@SO_VERSION_PATCH@ netflowPlugin.o; \
- fi
-
-netflowPlugin.so$(EXEEXT): .libs/libnetflowPlugin.so@SO_VERSION_PATCH@
- @$(LN_S) .libs/libnetflowPlugin.so netflowPlugin.so
-
-###############
-
-.libs/libpdaPlugin.so@SO_VERSION_PATCH@:
- @if test -f libpdaPlugin_la-pdaPlugin.o; then \
- $(CC) @MAKE_SHARED_LIBRARY_PARM@ -o .libs/libpdaPlugin.so@SO_VERSION_PATCH@ libpdaPlugin_la-pdaPlugin.o; \
- else \
- $(CC) @MAKE_SHARED_LIBRARY_PARM@ -o .libs/libpdaPlugin.so@SO_VERSION_PATCH@ pdaPlugin.o; \
- fi
-
-pdaPlugin.so$(EXEEXT): .libs/libpdaPlugin.so@SO_VERSION_PATCH@
- @$(LN_S) .libs/libpdaPlugin.so pdaPlugin.so
-
-###############
-
-.libs/libremotePlugin.so@SO_VERSION_PATCH@:
- @if test -f libremotePlugin_la-remotePlugin.o; then \
- $(CC) @MAKE_SHARED_LIBRARY_PARM@ -o .libs/libremotePlugin.so@SO_VERSION_PATCH@ libremotePlugin_la-remotePlugin.o; \
- else \
- $(CC) @MAKE_SHARED_LIBRARY_PARM@ -o .libs/libremotePlugin.so@SO_VERSION_PATCH@ remotePlugin.o; \
- fi
-
-remotePlugin.so$(EXEEXT): .libs/libremotePlugin.so@SO_VERSION_PATCH@
- @$(LN_S) .libs/libremotePlugin.so remotePlugin.so
-
-###############
-
-.libs/librrdPlugin.so@SO_VERSION_PATCH@:
- @if test -f librrdPlugin_la-rrdPlugin.o; then \
- $(CC) @MAKE_SHARED_LIBRARY_PARM@ -o .libs/librrdPlugin.so@SO_VERSION_PATCH@ librrdPlugin_la-rrdPlugin.o; \
- else \
- $(CC) @MAKE_SHARED_LIBRARY_PARM@ -o .libs/librrdPlugin.so@SO_VERSION_PATCH@ rrdPlugin.o; \
- fi
-
-rrdPlugin.so$(EXEEXT): .libs/librrdPlugin.so@SO_VERSION_PATCH@
- @$(LN_S) .libs/librrdPlugin.so rrdPlugin.so
-
-###############
-
-.libs/libsflowPlugin.so@SO_VERSION_PATCH@:
- @if test -f libsflowPlugin_la-sflowPlugin.o; then \
- $(CC) @MAKE_SHARED_LIBRARY_PARM@ -o .libs/libsflowPlugin.so@SO_VERSION_PATCH@ libsflowPlugin_la-sflowPlugin.o; \
- else \
- $(CC) @MAKE_SHARED_LIBRARY_PARM@ -o .libs/libsflowPlugin.so@SO_VERSION_PATCH@ sflowPlugin.o; \
- fi

-sflowPlugin.so$(EXEEXT): .libs/libsflowPlugin.so@SO_VERSION_PATCH@
- @$(LN_S) .libs/libsflowPlugin.so sflowPlugin.so
-
-###############
-
-.libs/libxmldumpPlugin.so@SO_VERSION_PATCH@:
- @if test -f libxmldumpPlugin_la-xmldumpPlugin.o; then \
- $(CC) @MAKE_SHARED_LIBRARY_PARM@ -o .libs/libxmldumpPlugin.so@SO_VERSION_PATCH@ libxmldumpPlugin_la-xmldumpPlugin.o; \
- else \
- $(CC) @MAKE_SHARED_LIBRARY_PARM@ -o .libs/libxmldumpPlugin.so@SO_VERSION_PATCH@ xmldumpPlugin.o; \
- fi
-
-xmldumpPlugin.so$(EXEEXT): .libs/libxmldumpPlugin.so@SO_VERSION_PATCH@
- @$(LN_S) .libs/libxmldumpPlugin.so xmldumpPlugin.so
-
-###############
-
-install-data-local:
- @$(top_srcdir)/mkinstalldirs $(DESTDIR)$(plugindir);
- @for file in $(noinst_PROGRAMS); do \
- cp -p $$file $(DESTDIR)$(plugindir)/$$file; \
- done
-# remove installed libraries
- @for file in $(lib_LTLIBRARIES); do \
- rm -f $(DESTDIR)$(libdir)/$$file; \
- done
+# use -hook (runs after real install) instead of -local (runs before)
+install-data-hook:
+ $(top_srcdir)/mkinstalldirs $(DESTDIR)$(plugindir)
+# we dlopen(*), so nuke everything except the actual loadable .so files
+ rm -f $(DESTDIR)$(plugindir)/*.la

#
# Special stuff for xml auto-generation of code from the "doc":

ntop _unstable_ port .patch