[94641] trunk/dports/net/ntop

ryandesign at macports.org ryandesign at macports.org
Mon Jun 25 15:02:48 PDT 2012


Revision: 94641
          https://trac.macports.org/changeset/94641
Author:   ryandesign at macports.org
Date:     2012-06-25 15:02:48 -0700 (Mon, 25 Jun 2012)
Log Message:
-----------
ntop:

 * update to 4.1.0
 * rewrite master_sites to avoid redirects
 * add automake, autoconf, libtool build dependencies so we're not using possibly obsolete OS versions
 * add python27 dependency and add env vars to use it
 * remove unnecessary configure cflags and args
 * rewrite startupitem to use startupitem.executable and no longer need ntop.sh wrapper
 * install sample config file and databases; don't register them to the port so they're not clobbered at port upgrades
 * patch autogen.sh to not require wget
 * patch autogen.sh to look for libtool.m4 in ${prefix} instead of /usr/local
 * patch configure to not look in /usr/local or hardcoded /opt/local
 * patch configure to find python
 * patch configure to fix syntax errors in removal of arch flags from python config output
 * patch configure to no longer use obsolete 2002-era Mac OS X versions of ltconfig and ltmain.sh; this fixes the port so it's UsingTheRightCompiler which addresses comment:ticket:28457:6
 * patch configure to use MacPorts libtool
 * remove patch-external-geoip.diff

See #31330

Modified Paths:
--------------
    trunk/dports/net/ntop/Portfile
    trunk/dports/net/ntop/files/patch-Makefile.am.diff

Added Paths:
-----------
    trunk/dports/net/ntop/files/patch-autogen.sh.diff
    trunk/dports/net/ntop/files/patch-configure.in.diff
    trunk/dports/net/ntop/files/patch-plugins-Makefile.am.diff

Removed Paths:
-------------
    trunk/dports/net/ntop/files/ntop.sh
    trunk/dports/net/ntop/files/patch-external-geoip.diff

Modified: trunk/dports/net/ntop/Portfile
===================================================================
--- trunk/dports/net/ntop/Portfile	2012-06-25 20:01:54 UTC (rev 94640)
+++ trunk/dports/net/ntop/Portfile	2012-06-25 22:02:48 UTC (rev 94641)
@@ -4,8 +4,7 @@
 PortSystem 1.0
 
 name			ntop
-version			3.3.10
-revision		5
+version			4.1.0
 categories		net
 maintainers		markd openmaintainer
 description		network traffic probe
@@ -14,64 +13,77 @@
 				usage, similar to what the popular top Unix command does.
 
 homepage		http://www.ntop.org/
-master_sites		sourceforge
-checksums		md5 6e2ffa90d5f935c8f03d88a5dd19a866
+master_sites		sourceforge:project/ntop/ntop/Stable/
 
-patchfiles		patch-external-geoip.diff \
-			patch-Makefile.am.diff
+checksums		rmd160  6f10e30e1b2870fc1ec327512e17cfbe0783faa4 \
+			sha256  c71e5563879ec1866296825e1705f30b5a67eb87c9abfbd7dc1c5baeed0384a4
 
 depends_build		port:gawk \
-			port:wget \
+			port:automake \
+			port:autoconf \
+			port:libtool \
 			port:rrdtool \
 			port:libevent
+
 depends_lib		port:libpcap \
 			port:gd2 \
 			port:libpng \
 			port:gdbm \
-			port:libgeoip
+			port:libgeoip \
+			port:python27
 
-configure.cflags-append	-I${prefix}/include
-configure.args		--mandir=${prefix}/share/man \
-			--with-localedir=${prefix}/share/locale \
-			--with-rrd-home=${prefix} \
+patchfiles		patch-Makefile.am.diff \
+			patch-autogen.sh.diff \
+			patch-configure.in.diff \
+			patch-plugins-Makefile.am.diff
+
+post-patch {
+	reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/autogen.sh
+}
+
+use_autoconf		yes
+autoconf.cmd		${worksrcpath}/autogen.sh
+autoconf.args		--noconfig
+
+configure.env		LOCALEDIR=${prefix}/share/locale \
+			PYTHON=${prefix}/bin/python2.7-config
+
+configure.args		--with-rrd-home=${prefix} \
 			--without-ssl
 
-use_autoconf		yes
 build.type		gnu
 
-# Create a startupitem to start/stop the server
-	startupitem.create    yes
-	startupitem.start    "${prefix}/share/${name}/ntop.sh"
-	startupitem.stop     "${prefix}/share/${name}/ntop.sh"
+startupitem.create	yes
+startupitem.executable	${prefix}/bin/ntop @${prefix}/etc/ntop/ntop.conf
 
-pre-configure {
-	system "cd ${worksrcpath} && ./autogen.sh --noconfig"
-}
+destroot.keepdirs ${destroot}${prefix}/var/ntop/rrd
 
 post-destroot	{
 	xinstall -m 755 -o nobody -d ${destroot}${prefix}/var/ntop \
 		${destroot}${prefix}/var/ntop/rrd
-	system "cd ${destroot}${prefix}/var/ntop && \
-		touch addressQueue.db dnsCache.db macPrefix.db \
-		ntop_pw.db prefsCache.db rrd/.turd"
-	system "chown -R nobody ${destroot}${prefix}/var/ntop"
 
 	xinstall -m 755 -d ${destroot}${prefix}/etc/ntop
 	xinstall -m 755 \
 		${worksrcpath}/packages/FreeBSD-ports/net/ntop/files/ntop.conf.sample \
-		${destroot}${prefix}/etc/ntop/ntop.conf
+		${destroot}${prefix}/etc/ntop
 	reinplace "s|%%DBDIR%%/ntop|${prefix}/var/ntop|g" \
-		${destroot}${prefix}/etc/ntop/ntop.conf            
+		${destroot}${prefix}/etc/ntop/ntop.conf.sample
 	reinplace "s|#--interface sis0|--interface en0|g" \
-		${destroot}${prefix}/etc/ntop/ntop.conf
+		${destroot}${prefix}/etc/ntop/ntop.conf.sample
+}
 
-    xinstall -m 755 ${filespath}/ntop.sh \
-        ${destroot}${prefix}/share/ntop/ntop.sh
-    reinplace "s|__PREFIX__|${prefix}|g" \
-        ${destroot}${prefix}/share/ntop/ntop.sh
+post-activate {
+	foreach f {addressQueue.db dnsCache.db macPrefix.db ntop_pw.db prefsCache.db} {
+		if {![file exists ${prefix}/var/ntop/${f}]} {
+			touch ${prefix}/var/ntop/${f}
+			file attributes ${prefix}/var/ntop/${f} -owner nobody
+		}
+	}
+	if {![file exists ${prefix}/etc/ntop/ntop.conf]} {
+		copy ${prefix}/etc/ntop/ntop.conf.sample ${prefix}/etc/ntop/ntop.conf
+	}
 }
 
-# ticket #27472; check if this is still a problem when updating to 4.1.x
 universal_variant		no
 
 livecheck.regex		/${name}-(\[0-9.\]+)${extract.suffix}

Deleted: trunk/dports/net/ntop/files/ntop.sh
===================================================================
--- trunk/dports/net/ntop/files/ntop.sh	2012-06-25 20:01:54 UTC (rev 94640)
+++ trunk/dports/net/ntop/files/ntop.sh	2012-06-25 22:02:48 UTC (rev 94641)
@@ -1,5 +0,0 @@
-#!/bin/sh
-echo ntop will start in 60s
-sleep 60
-__PREFIX__/bin/ntop @__PREFIX__/etc/ntop/ntop.conf -d
-

Modified: trunk/dports/net/ntop/files/patch-Makefile.am.diff
===================================================================
--- trunk/dports/net/ntop/files/patch-Makefile.am.diff	2012-06-25 20:01:54 UTC (rev 94640)
+++ trunk/dports/net/ntop/files/patch-Makefile.am.diff	2012-06-25 22:02:48 UTC (rev 94641)
@@ -1,6 +1,6 @@
---- Makefile.am.orig	2009-04-17 17:27:57.000000000 -0300
-+++ Makefile.am	2009-09-15 13:07:19.000000000 -0300
-@@ -76,9 +76,7 @@
+--- Makefile.am.orig	2011-03-03 07:44:59.000000000 -0600
++++ Makefile.am	2011-11-12 23:33:32.000000000 -0600
+@@ -67,9 +67,7 @@
  NTOPDATA = ntop-cert.pem \
             $(ETTER_PASSIVE) \
             oui.txt.gz \
@@ -11,20 +11,12 @@
  
  NTOPHTML = html html/*.js html/*.html  html/*.gif html/*.jpg html/*.ico html/*.png \
             html/*.css html/*.dtd \
-@@ -270,8 +268,6 @@
- 
- install: install-recursive
- 
--	cd @GEO_DIR@; make install
--
- 	@mkdir -p $(DESTDIR)/$(CFG_DBFILE_DIR)
- 
- 	@echo ""
-@@ -341,7 +337,6 @@
+@@ -328,7 +326,7 @@
+ install-selinux-policy:
  	chcon -t textrel_shlib_t $(DESTDIR)$(libdir)/*ntop*.so
  
- install-data-local: ntop.txt ntop.html faq.html
--	@$(top_srcdir)/mkinstalldirs $(DESTDIR)/$(libdir)/plugins;
+-install-data-local: ntop.txt ntop.html faq.html dnetter
++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; \

Added: trunk/dports/net/ntop/files/patch-autogen.sh.diff
===================================================================
--- trunk/dports/net/ntop/files/patch-autogen.sh.diff	                        (rev 0)
+++ trunk/dports/net/ntop/files/patch-autogen.sh.diff	2012-06-25 22:02:48 UTC (rev 94641)
@@ -0,0 +1,31 @@
+--- autogen.sh.orig	2010-03-31 10:13:52.000000000 -0500
++++ autogen.sh	2011-09-11 00:47:04.000000000 -0500
+@@ -202,15 +202,6 @@
+   GNU_OR_DIE=0
+ }
+ 
+-WGET=`find_command 'wget*'`
+-($WGET --version) < /dev/null > /dev/null 2>&1 ||
+-{
+-  echo
+-  echo "You must have wget installed to compile $progname."
+-  echo "Download the appropriate package for your distribution, or get the"
+-  echo "source tarball from ftp://ftp.gnu.org/pub/gnu/wget"
+-  GNU_OR_DIE=0
+-}
+ 
+ if test "$GNU_OR_DIE" -eq 0; then
+   exit 1
+@@ -311,9 +302,9 @@
+ 
+ if [ ! -f libtool.m4.in ]; then
+   echo "    Finding libtool.m4.in"
+-  if [ -f /usr/local/share/aclocal/libtool.m4 ]; then
+-     echo "        .... found /usr/local/share/aclocal/libtool.m4"
+-     cp /usr/local/share/aclocal/libtool.m4 libtool.m4.in
++  if [ -f __PREFIX__/share/aclocal/libtool.m4 ]; then
++     echo "        .... found __PREFIX__/share/aclocal/libtool.m4"
++     cp __PREFIX__/share/aclocal/libtool.m4 libtool.m4.in
+   else
+      if [ -f /usr/share/aclocal/libtool.m4 ]; then
+       echo "        .... found /usr/share/aclocal/libtool.m4"

Added: trunk/dports/net/ntop/files/patch-configure.in.diff
===================================================================
--- trunk/dports/net/ntop/files/patch-configure.in.diff	                        (rev 0)
+++ trunk/dports/net/ntop/files/patch-configure.in.diff	2012-06-25 22:02:48 UTC (rev 94641)
@@ -0,0 +1,67 @@
+--- configure.in.orig	2011-08-15 03:34:28.000000000 -0500
++++ configure.in	2011-11-12 23:59:24.000000000 -0600
+@@ -469,10 +469,6 @@
+     LOCALEDIR="/usr/lib/locale"
+ fi
+ 
+-dnl> Add /usr/local/ /opt/local
+-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"
+ 
+ PWD=`pwd`
+ 
+@@ -1450,25 +1446,8 @@
+ dnl> PYTHON
+ dnl>
+   AC_CHECK_TOOL(PYTHON, python-config)
+-  PYTHON_CONFIG=""
++  PYTHON_CONFIG="$ac_cv_prog_ac_ct_PYTHON"
+ 
+-  if test "x$ac_cv_prog_ac_ct_PYTHON" != "xpython-config"; then   
+-       if test -f "/etc/debian_version"; then
+-       	   AC_MSG_RESULT(Please install python-dev and rerun configure)
+-	   exit 1
+-	else
+-	AC_MSG_RESULT(>>>> Unable to locate python-config: using workaround <<<<)
+-        dnl> Silly workaround for RedHat-like distro
+-        AC_CHECK_TOOL(PYTHON, python)
+-        if test "x$ac_cv_prog_ac_ct_PYTHON" = "xpython"; then
+-          PYTHON_CONFIG="./configureextra/python-config"
+-        else
+-          PYTHON_CONFIG="python-config"
+-        fi
+-     fi
+-  else
+-     PYTHON_CONFIG="python-config"
+-  fi
+ 
+   if test "x$PYTHON_CONFIG" != "x"; then
+     PYTHON_LIBS="`$PYTHON_CONFIG --libs`"
+@@ -1480,7 +1459,7 @@
+ 
+     dnl remove unecessary path
+     dnl line below workaround for OSX 10.6 (Snow Leopard)/10.7 (Lion)
+-    PYTHON_INCS=`$PYTHON_CONFIG --cflags | sed -e "s/-arch i386// | sed -e "s/-arch ppc// | sed -e "s/-arch x86_64//"`
++    PYTHON_INCS=`$PYTHON_CONFIG --cflags | sed -e "s/-arch i386//" | sed -e "s/-arch ppc//" | sed -e "s/-arch x86_64//"`
+     INCS="${INCS} ${PYTHON_INCS}"
+ 
+ OLD_CFLAGS=$CFLAGS
+@@ -1956,16 +1935,8 @@
+ echo "#endif /* MEMORY_DEBUG */" >> version.c
+ 
+ case "${host}" in
+-    *darwin* )
+-        echo
+-	echo "Copying patched versions of some configure-related files for Mac OS X"
+-        cp packages/MacOSX/lt* .
+-	rm -f libtool
+-	ln -s  /usr/bin/glibtool libtool
+-        echo
+-        ;;
+ 	*)
+-	LIBTOOL_PATH="/usr/bin/libtool"
++	LIBTOOL_PATH="${prefix}/bin/glibtool"
+ 	if test -x ${LIBTOOL_PATH}; then
+ 	   rm -f libtool
+ 	   ln -s ${LIBTOOL_PATH} libtool

Deleted: trunk/dports/net/ntop/files/patch-external-geoip.diff
===================================================================
--- trunk/dports/net/ntop/files/patch-external-geoip.diff	2012-06-25 20:01:54 UTC (rev 94640)
+++ trunk/dports/net/ntop/files/patch-external-geoip.diff	2012-06-25 22:02:48 UTC (rev 94641)
@@ -1,59 +0,0 @@
---- configure.in.orig	2009-08-05 19:30:31.141160363 +0530
-+++ configure.in	2009-08-05 19:34:11.076160092 +0530
-@@ -1962,40 +1962,23 @@
-     }'`
- fi
- 
--dnl> GeoIP (http://www.maxmind.com/)
--if test -f "GeoIP.tar.gz"; then
--   echo "GeoIP already present on this machine"
--else
--   wget http://www.maxmind.com/download/geoip/api/c/GeoIP.tar.gz
--fi
--tar xvfz GeoIP.tar.gz
--GEO_DIR=`find $PWD -type d -name "GeoIP-*"`
--cd $GEO_DIR; ./configure --prefix=${prefix}; make; cd ..
--# OSX Fix
--GEO_DYLIB="$GEO_DIR/libGeoIP/.libs/libGeoIP.dylib"
--if test -f $GEO_DYLIB; then
--   ln -s $GEO_DYLIB .
--fi
--
--if test -f "GeoLiteCity.dat"; then
--   echo "GeoLiteCity.dat already present"
--else
--   wget http://www.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
--   gunzip GeoLiteCity.dat.gz
--fi
--
--if test -f "GeoIPASNum.dat"; then
--   echo "GeoIPASNum.dat already present"
--else
--   wget http://www.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz
--   gunzip GeoIPASNum.dat.gz
-+#
-+#GeoIP
-+#
-+AC_CHECK_HEADERS(
-+    [GeoIP.h],
-+    [geoip_header="yes"],
-+    [AC_MSG_FAILURE([GeoIP header file is missing])]
-+)
-+if test "$geoip_header" = "yes"; then
-+    AC_CHECK_LIB(GeoIP, GeoIP_open,
-+        [geoip_libs="yes"],
-+	[AC_MSG_FAILURE([GeoIP library is missing])]
-+    )
-+fi
-+if test "$geoip_libs" = "yes"; then
-+    LDFLAGS="${LDFLAGS} -lGeoIP"
- fi
--
--
--GEO_DIR=`find $PWD -type d -name "GeoIP-*"`
--GEO_IP="$GEO_DIR/libGeoIP/"
--CFLAGS="$CFLAGS -I$GEO_IP"
--LDFLAGS="-L$GEO_IP.libs/ -lGeoIP $LDFLAGS"
- 
- dnl> NTOPCONFIGDEBUG_SETTINGS([precet])
- 

Added: trunk/dports/net/ntop/files/patch-plugins-Makefile.am.diff
===================================================================
--- trunk/dports/net/ntop/files/patch-plugins-Makefile.am.diff	                        (rev 0)
+++ trunk/dports/net/ntop/files/patch-plugins-Makefile.am.diff	2012-06-25 22:02:48 UTC (rev 94641)
@@ -0,0 +1,32 @@
+--- plugins/Makefile.am.orig	2010-01-01 10:53:43.000000000 -0600
++++ plugins/Makefile.am	2011-11-13 00:47:52.000000000 -0600
+@@ -57,24 +57,24 @@
+                   libsflowPlugin.la
+ 
+ libicmpPlugin_la_SOURCES = icmpPlugin.c
+-libicmpPlugin_la_LDFLAGS = -shared -release @PACKAGE_VERSION@ @DYN_FLAGS@
++libicmpPlugin_la_LDFLAGS = $(AM_LDFLAGS) -shared -release @PACKAGE_VERSION@ @DYN_FLAGS@
+ libicmpPlugin_la_CFLAGS = $(AM_CFLAGS)
+ 
+ libnetflowPlugin_la_SOURCES = netflowPlugin.c
+-libnetflowPlugin_la_LDFLAGS = -shared -release @PACKAGE_VERSION@ @DYN_FLAGS@
++libnetflowPlugin_la_LDFLAGS = $(AM_LDFLAGS) -shared -release @PACKAGE_VERSION@ @DYN_FLAGS@
+ libnetflowPlugin_la_CFLAGS = $(AM_CFLAGS)
+ 
+ libcpacketPlugin_la_SOURCES = cpacketPlugin.c
+-libcpacketPlugin_la_LDFLAGS = -shared -release @PACKAGE_VERSION@ @DYN_FLAGS@
++libcpacketPlugin_la_LDFLAGS = $(AM_LDFLAGS) -shared -release @PACKAGE_VERSION@ @DYN_FLAGS@
+ libcpacketPlugin_la_CFLAGS = $(AM_CFLAGS)
+ 
+ librrdPlugin_la_SOURCES = rrdPlugin.c
+-librrdPlugin_la_LDFLAGS = -shared -release @PACKAGE_VERSION@ @DYN_FLAGS@
++librrdPlugin_la_LDFLAGS = $(AM_LDFLAGS) -shared -release @PACKAGE_VERSION@ @DYN_FLAGS@
+ librrdPlugin_la_LIBADD = ${RRD_LIB}
+ librrdPlugin_la_CFLAGS = $(AM_CFLAGS)
+ 
+ libsflowPlugin_la_SOURCES = sflowPlugin.c
+-libsflowPlugin_la_LDFLAGS = -shared -release @PACKAGE_VERSION@ @DYN_FLAGS@
++libsflowPlugin_la_LDFLAGS = $(AM_LDFLAGS) -shared -release @PACKAGE_VERSION@ @DYN_FLAGS@
+ libsflowPlugin_la_CFLAGS = $(AM_CFLAGS)
+ 
+ #
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120625/b45e4dc8/attachment.html>


More information about the macports-changes mailing list