Ticket #31330: ntop-4.1.0.diff

File ntop-4.1.0.diff, 10.8 KB (added by ryandesign (Ryan Carsten Schmidt), 12 years ago)
  • files/patch-autogen.sh.diff

     
     1--- autogen.sh.orig     2010-03-31 10:13:52.000000000 -0500
     2+++ autogen.sh  2011-09-11 00:47:04.000000000 -0500
     3@@ -202,15 +202,6 @@
     4   GNU_OR_DIE=0
     5 }
     6 
     7-WGET=`find_command 'wget*'`
     8-($WGET --version) < /dev/null > /dev/null 2>&1 ||
     9-{
     10-  echo
     11-  echo "You must have wget installed to compile $progname."
     12-  echo "Download the appropriate package for your distribution, or get the"
     13-  echo "source tarball from ftp://ftp.gnu.org/pub/gnu/wget"
     14-  GNU_OR_DIE=0
     15-}
     16 
     17 if test "$GNU_OR_DIE" -eq 0; then
     18   exit 1
     19@@ -311,9 +302,9 @@
     20 
     21 if [ ! -f libtool.m4.in ]; then
     22   echo "    Finding libtool.m4.in"
     23-  if [ -f /usr/local/share/aclocal/libtool.m4 ]; then
     24-     echo "        .... found /usr/local/share/aclocal/libtool.m4"
     25-     cp /usr/local/share/aclocal/libtool.m4 libtool.m4.in
     26+  if [ -f __PREFIX__/share/aclocal/libtool.m4 ]; then
     27+     echo "        .... found __PREFIX__/share/aclocal/libtool.m4"
     28+     cp __PREFIX__/share/aclocal/libtool.m4 libtool.m4.in
     29   else
     30      if [ -f /usr/share/aclocal/libtool.m4 ]; then
     31       echo "        .... found /usr/share/aclocal/libtool.m4"
  • files/patch-external-geoip.diff

     
    1 --- configure.in.orig   2009-08-05 19:30:31.141160363 +0530
    2 +++ configure.in        2009-08-05 19:34:11.076160092 +0530
    3 @@ -1962,40 +1962,23 @@
    4      }'`
    5  fi
    6  
    7 -dnl> GeoIP (http://www.maxmind.com/)
    8 -if test -f "GeoIP.tar.gz"; then
    9 -   echo "GeoIP already present on this machine"
    10 -else
    11 -   wget http://www.maxmind.com/download/geoip/api/c/GeoIP.tar.gz
    12 -fi
    13 -tar xvfz GeoIP.tar.gz
    14 -GEO_DIR=`find $PWD -type d -name "GeoIP-*"`
    15 -cd $GEO_DIR; ./configure --prefix=${prefix}; make; cd ..
    16 -# OSX Fix
    17 -GEO_DYLIB="$GEO_DIR/libGeoIP/.libs/libGeoIP.dylib"
    18 -if test -f $GEO_DYLIB; then
    19 -   ln -s $GEO_DYLIB .
    20 -fi
    21 -
    22 -if test -f "GeoLiteCity.dat"; then
    23 -   echo "GeoLiteCity.dat already present"
    24 -else
    25 -   wget http://www.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
    26 -   gunzip GeoLiteCity.dat.gz
    27 -fi
    28 -
    29 -if test -f "GeoIPASNum.dat"; then
    30 -   echo "GeoIPASNum.dat already present"
    31 -else
    32 -   wget http://www.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz
    33 -   gunzip GeoIPASNum.dat.gz
    34 +#
    35 +#GeoIP
    36 +#
    37 +AC_CHECK_HEADERS(
    38 +    [GeoIP.h],
    39 +    [geoip_header="yes"],
    40 +    [AC_MSG_FAILURE([GeoIP header file is missing])]
    41 +)
    42 +if test "$geoip_header" = "yes"; then
    43 +    AC_CHECK_LIB(GeoIP, GeoIP_open,
    44 +        [geoip_libs="yes"],
    45 +       [AC_MSG_FAILURE([GeoIP library is missing])]
    46 +    )
    47 +fi
    48 +if test "$geoip_libs" = "yes"; then
    49 +    LDFLAGS="${LDFLAGS} -lGeoIP"
    50  fi
    51 -
    52 -
    53 -GEO_DIR=`find $PWD -type d -name "GeoIP-*"`
    54 -GEO_IP="$GEO_DIR/libGeoIP/"
    55 -CFLAGS="$CFLAGS -I$GEO_IP"
    56 -LDFLAGS="-L$GEO_IP.libs/ -lGeoIP $LDFLAGS"
    57  
    58  dnl> NTOPCONFIGDEBUG_SETTINGS([precet])
    59  
  • files/ntop.sh

     
    1 #!/bin/sh
    2 echo ntop will start in 60s
    3 sleep 60
    4 __PREFIX__/bin/ntop @__PREFIX__/etc/ntop/ntop.conf -d
    5 
  • files/patch-configure.in.diff

     
     1--- configure.in.orig   2011-08-15 03:34:28.000000000 -0500
     2+++ configure.in        2011-11-12 23:59:24.000000000 -0600
     3@@ -469,10 +469,6 @@
     4     LOCALEDIR="/usr/lib/locale"
     5 fi
     6 
     7-dnl> Add /usr/local/ /opt/local
     8-CFLAGS="${CFLAGS} -I/usr/local/include -I/opt/local/include"
     9-CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/opt/local/include"
     10-LDFLAGS="${LDFLAGS} -L/usr/local/lib -L/opt/local/lib"
     11 
     12 PWD=`pwd`
     13 
     14@@ -1450,25 +1446,8 @@
     15 dnl> PYTHON
     16 dnl>
     17   AC_CHECK_TOOL(PYTHON, python-config)
     18-  PYTHON_CONFIG=""
     19+  PYTHON_CONFIG="$ac_cv_prog_ac_ct_PYTHON"
     20 
     21-  if test "x$ac_cv_prog_ac_ct_PYTHON" != "xpython-config"; then   
     22-       if test -f "/etc/debian_version"; then
     23-                  AC_MSG_RESULT(Please install python-dev and rerun configure)
     24-          exit 1
     25-       else
     26-       AC_MSG_RESULT(>>>> Unable to locate python-config: using workaround <<<<)
     27-        dnl> Silly workaround for RedHat-like distro
     28-        AC_CHECK_TOOL(PYTHON, python)
     29-        if test "x$ac_cv_prog_ac_ct_PYTHON" = "xpython"; then
     30-          PYTHON_CONFIG="./configureextra/python-config"
     31-        else
     32-          PYTHON_CONFIG="python-config"
     33-        fi
     34-     fi
     35-  else
     36-     PYTHON_CONFIG="python-config"
     37-  fi
     38 
     39   if test "x$PYTHON_CONFIG" != "x"; then
     40     PYTHON_LIBS="`$PYTHON_CONFIG --libs`"
     41@@ -1480,7 +1459,7 @@
     42 
     43     dnl remove unecessary path
     44     dnl line below workaround for OSX 10.6 (Snow Leopard)/10.7 (Lion)
     45-    PYTHON_INCS=`$PYTHON_CONFIG --cflags | sed -e "s/-arch i386// | sed -e "s/-arch ppc// | sed -e "s/-arch x86_64//"`
     46+    PYTHON_INCS=`$PYTHON_CONFIG --cflags | sed -e "s/-arch i386//" | sed -e "s/-arch ppc//" | sed -e "s/-arch x86_64//"`
     47     INCS="${INCS} ${PYTHON_INCS}"
     48 
     49 OLD_CFLAGS=$CFLAGS
     50@@ -1956,16 +1935,8 @@
     51 echo "#endif /* MEMORY_DEBUG */" >> version.c
     52 
     53 case "${host}" in
     54-    *darwin* )
     55-        echo
     56-       echo "Copying patched versions of some configure-related files for Mac OS X"
     57-        cp packages/MacOSX/lt* .
     58-       rm -f libtool
     59-       ln -s  /usr/bin/glibtool libtool
     60-        echo
     61-        ;;
     62        *)
     63-       LIBTOOL_PATH="/usr/bin/libtool"
     64+       LIBTOOL_PATH="${prefix}/bin/glibtool"
     65        if test -x ${LIBTOOL_PATH}; then
     66           rm -f libtool
     67           ln -s ${LIBTOOL_PATH} libtool
  • files/patch-Makefile.am.diff

     
    1 --- Makefile.am.orig    2009-04-17 17:27:57.000000000 -0300
    2 +++ Makefile.am 2009-09-15 13:07:19.000000000 -0300
    3 @@ -76,9 +76,7 @@
     1--- Makefile.am.orig    2011-03-03 07:44:59.000000000 -0600
     2+++ Makefile.am 2011-11-12 23:33:32.000000000 -0600
     3@@ -67,9 +67,7 @@
    44 NTOPDATA = ntop-cert.pem \
    55            $(ETTER_PASSIVE) \
    66            oui.txt.gz \
     
    1111 
    1212 NTOPHTML = html html/*.js html/*.html  html/*.gif html/*.jpg html/*.ico html/*.png \
    1313            html/*.css html/*.dtd \
    14 @@ -270,8 +268,6 @@
    15  
    16  install: install-recursive
    17  
    18 -       cd @GEO_DIR@; make install
    19 -
    20         @mkdir -p $(DESTDIR)/$(CFG_DBFILE_DIR)
    21  
    22         @echo ""
    23 @@ -341,7 +337,6 @@
     14@@ -328,7 +326,7 @@
     15 install-selinux-policy:
    2416        chcon -t textrel_shlib_t $(DESTDIR)$(libdir)/*ntop*.so
    2517 
    26  install-data-local: ntop.txt ntop.html faq.html
    27 -       @$(top_srcdir)/mkinstalldirs $(DESTDIR)/$(libdir)/plugins;
     18-install-data-local: ntop.txt ntop.html faq.html dnetter
     19+install-data-local: ntop.txt ntop.html faq.html
     20        @$(top_srcdir)/mkinstalldirs $(DESTDIR)/$(libdir)/plugins;
    2821        @if ! test -d $(DESTDIR)/$(datadir)/ntop; then \
    2922          $(top_srcdir)/mkinstalldirs $(DESTDIR)/$(datadir)/ntop; \
    30           touch $(DESTDIR)/$(datadir)/ntop/warnuser; \
  • Portfile

     
    44PortSystem 1.0
    55
    66name                    ntop
    7 version                 3.3.10
    8 revision                5
     7version                 4.1.0
    98categories              net
    109maintainers             markd openmaintainer
    1110description             network traffic probe
     
    1413                                usage, similar to what the popular top Unix command does.
    1514
    1615homepage                http://www.ntop.org/
    17 master_sites            sourceforge
    18 checksums               md5 6e2ffa90d5f935c8f03d88a5dd19a866
     16master_sites            sourceforge:project/ntop/ntop/Stable/
    1917
    20 patchfiles              patch-external-geoip.diff \
    21                         patch-Makefile.am.diff
     18checksums               rmd160  6f10e30e1b2870fc1ec327512e17cfbe0783faa4 \
     19                        sha256  c71e5563879ec1866296825e1705f30b5a67eb87c9abfbd7dc1c5baeed0384a4
    2220
    2321depends_build           port:gawk \
    24                         port:wget \
     22                        port:automake \
     23                        port:autoconf \
     24                        port:libtool \
    2525                        port:rrdtool \
    2626                        port:libevent
     27
    2728depends_lib             port:libpcap \
    2829                        port:gd2 \
    2930                        port:libpng \
    3031                        port:gdbm \
    31                         port:libgeoip
     32                        port:libgeoip \
     33                        port:python27
    3234
    33 configure.cflags-append -I${prefix}/include
    34 configure.args          --mandir=${prefix}/share/man \
    35                         --with-localedir=${prefix}/share/locale \
    36                         --with-rrd-home=${prefix} \
     35patchfiles              patch-Makefile.am.diff \
     36                        patch-autogen.sh.diff \
     37                        patch-configure.in.diff
     38#patch-external-geoip.diff
     39
     40post-patch {
     41        reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/autogen.sh
     42}
     43
     44use_autoconf            yes
     45autoconf.cmd            ${worksrcpath}/autogen.sh
     46autoconf.args           --noconfig
     47
     48configure.env           LOCALEDIR=${prefix}/share/locale \
     49                        PYTHON=${prefix}/bin/python2.7-config
     50
     51configure.args          --with-rrd-home=${prefix} \
    3752                        --without-ssl
    3853
    39 use_autoconf            yes
    4054build.type              gnu
    4155
    42 # Create a startupitem to start/stop the server
    43         startupitem.create    yes
    44         startupitem.start    "${prefix}/share/${name}/ntop.sh"
    45         startupitem.stop     "${prefix}/share/${name}/ntop.sh"
     56startupitem.create      yes
     57startupitem.executable  ${prefix}/bin/ntop @${prefix}/etc/ntop/ntop.conf
    4658
    47 pre-configure {
    48         system "cd ${worksrcpath} && ./autogen.sh --noconfig"
    49 }
     59destroot.keepdirs ${destroot}${prefix}/var/ntop/rrd
    5060
    5161post-destroot   {
    5262        xinstall -m 755 -o nobody -d ${destroot}${prefix}/var/ntop \
    5363                ${destroot}${prefix}/var/ntop/rrd
    54         system "cd ${destroot}${prefix}/var/ntop && \
    55                 touch addressQueue.db dnsCache.db macPrefix.db \
    56                 ntop_pw.db prefsCache.db rrd/.turd"
    57         system "chown -R nobody ${destroot}${prefix}/var/ntop"
    5864
    5965        xinstall -m 755 -d ${destroot}${prefix}/etc/ntop
    6066        xinstall -m 755 \
    6167                ${worksrcpath}/packages/FreeBSD-ports/net/ntop/files/ntop.conf.sample \
    62                 ${destroot}${prefix}/etc/ntop/ntop.conf
     68                ${destroot}${prefix}/etc/ntop
    6369        reinplace "s|%%DBDIR%%/ntop|${prefix}/var/ntop|g" \
    64                 ${destroot}${prefix}/etc/ntop/ntop.conf           
     70                ${destroot}${prefix}/etc/ntop/ntop.conf.sample
    6571        reinplace "s|#--interface sis0|--interface en0|g" \
    66                 ${destroot}${prefix}/etc/ntop/ntop.conf
     72                ${destroot}${prefix}/etc/ntop/ntop.conf.sample
     73}
    6774
    68     xinstall -m 755 ${filespath}/ntop.sh \
    69         ${destroot}${prefix}/share/ntop/ntop.sh
    70     reinplace "s|__PREFIX__|${prefix}|g" \
    71         ${destroot}${prefix}/share/ntop/ntop.sh
     75post-activate {
     76        foreach f {addressQueue.db dnsCache.db macPrefix.db ntop_pw.db prefsCache.db} {
     77                if {![file exists ${prefix}/var/ntop/${f}]} {
     78                        touch ${prefix}/var/ntop/${f}
     79                        file attributes ${prefix}/var/ntop/${f} -owner nobody
     80                }
     81        }
     82        if {![file exists ${prefix}/etc/ntop/ntop.conf]} {
     83                copy ${prefix}/etc/ntop/ntop.conf.sample ${prefix}/etc/ntop/ntop.conf
     84        }
    7285}
    7386
    74 # ticket #27472; check if this is still a problem when updating to 4.1.x
    75 universal_variant               no
    76 
    7787livecheck.regex         /${name}-(\[0-9.\]+)${extract.suffix}