ports/60184: [maintainer patch] net/ntop: misc fixes

Clement LAFORET sheepkiller at cultdeadsheep.org
Fri Dec 12 18:30:26 UTC 2003


>Number:         60184
>Category:       ports
>Synopsis:       [maintainer patch] net/ntop: misc fixes
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Dec 12 10:30:19 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Clement Laforet
>Release:        FreeBSD 5.2-CURRENT i386
>Organization:
cotds.org
>Environment:
System: FreeBSD lucifer.cultdeadsheep.org 5.2-CURRENT FreeBSD 5.2-CURRENT #0: Sun Dec 7 15:41:23 GMT 2003 root at lucifer.cultdeadsheep.org:/usr/obj/usr/src/sys/LUCIFER i386


	
>Description:
	- remove dependency with gdchart: use bundled one
	- remove interactive menu
	- fix dependency on gd1
	you have now correct graphs ;-)

	TODO: fix dependencies on glib2 when user selects XML dumps.
	removed files:
		scripts/configure.sh
		scripts

>How-To-Repeat:
	N/A.
>Fix:

	

--- ntop.diff begins here ---
Index: ntop/Makefile
===================================================================
RCS file: /SERVICES/cvs/FreeBSD/ports/net/ntop/Makefile,v
retrieving revision 1.32
diff -u -u -r1.32 Makefile
--- ntop/Makefile	11 Dec 2003 20:15:00 -0000	1.32
+++ ntop/Makefile	12 Dec 2003 18:21:43 -0000
@@ -7,7 +7,7 @@
 
 PORTNAME=	ntop
 PORTVERSION=	2.2
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	net
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
 MASTER_SITE_SUBDIR=	${PORTNAME}
@@ -16,12 +16,8 @@
 MAINTAINER=	sheepkiller at cultdeadsheep.org
 COMMENT=	Network monitoring tool with command line and web interfaces
 
-BUILD_DEPENDS=	${LOCALBASE}/lib/libgdc.a:${PORTSDIR}/graphics/gdchart
-LIB_DEPENDS=	gdbm:${PORTSDIR}/databases/gdbm
-
-.if !defined(BATCH) && !defined(PACKAGE_BUILDING)
-IS_INTERACTIVE=	yes
-.endif
+LIB_DEPENDS=	gd1.2:${PORTSDIR}/graphics/gd1 \
+		gdbm:${PORTSDIR}/databases/gdbm
 
 DBDIR?=		/var/db
 
@@ -33,28 +29,88 @@
 USE_LIBTOOL=	yes
 INSTALLS_SHLIB=	yes
 PLIST_SUB+=	DBDIR=${DBDIR}
-CONFIGURE_ENV=	LIBS="-lcrypto -L${LOCALBASE}/lib"
+CONFIGURE_ENV=	LIBS="-lcrypto -L${LOCALBASE}/lib ${LDFLAGS}"
 CONFIGURE_TARGET=	--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
 CONFIGURE_ARGS=	--localstatedir=${DBDIR} \
 		--with-ossl-root=${OPENSSLBASE} \
-		--with-gdchart-root=${LOCALBASE}
-SCRIPTS_ENV=	WRKDIRPREFIX="${WRKDIRPREFIX}" \
-		TOUCH="${TOUCH}" \
-		MKDIR="${MKDIR}" \
-		CAT="${CAT}" \
-		OPTIONS="${OPTIONS}" \
-		REALCURDIR="${.CURDIR}"
+		--with-gdbm-root=${LOCALBASE} \
+		--with-gdchart-lib=../gdchart0.94c \
+		--with-gdchart-include=../gdchart0.94c \
+		--with-gd-root=${LOCALBASE} \
+		--with-libpng-root=${LOCALBASE} \
+		--with-zlib-root=/usr
 
 MAN8=		ntop.8
 
-.include <bsd.port.pre.mk>
+##
+## Available knobs:
+##    WITH_LOCALE:        Enable locale (i18n) support.
+##    WITH_LSOF:          Add lsof as dependency.
+##    WITH_PCAP:          Enable libpcap support.
+##    WITH_PCAP_PORT:     Use libpcap from ports.
+##    WITH_RRD:           Enablerrdtool support.
+##    WITH_XMLDUMP:       Enable XML Dump support.
+##
+##    WITHOUT_GDBM:       Disable gdbm support.
+##    WITHOUT_TCPWRAPPER: Disable TCP wrapper support.
+##
 
-pre-fetch:
-	@${SETENV} ${SCRIPTS_ENV} ${SH} ${SCRIPTDIR}/configure.sh
+.if !defined(WITHOUT_TCPWRAPPER)
+CONFIGURE_ARGS+=	--with-tcpwrap
+.endif
 
-post-patch:
-	@${REINPLACE_CMD} -e "s,-lgdchart,-lgdc,g" \
-		-e "s,-lglib,-lglib12,g" ${WRKSRC}/configure
+.if defined(WITH_PCAP)
+.    if defined(WITH_PCAP_PORT)
+BUILD_DEPENDS+=		${LOCALBASE}/lib/libpcap.a:${PORTSDIR}/net/libpcap
+PCAP_ROOT=		${LOCALBASE}
+.    else
+PCAP_ROOT=		/usr
+.    endif
+CONFIGURE_ARGS+=	--with-pcap-root=${PCAP_ROOT}
+.endif
+
+.if defined(WITH_RRD)
+LIB_DEPENDS+=		rrd.0:${PORTSDIR}/net/rrdtool
+CONFIGURE_ARGS+=	--enable-rrd
+			--with-rrd-root=${LOCALBASE}
+.else
+CONFIGURE_ARGS+=	--without-rrd-root
+.endif
+
+.if defined(WITH_LOSF)
+RUN_DEPENDS+=		lsof:${PORTSDIR}/sysutils/lsof
+.endif
+
+.if defined(WITH_LOCALE)
+LIB_DEPENDS+=		intl.5:${PORTSDIR}/devel/gettext
+CONFIGURE_ARGS+=	--enable-i18n \
+			--with-localedir=${LOCALBASE}/share/locale
+.endif
+
+.if defined(WITH_XMLDUMP)
+USE_GNOME=		glib12
+LIB_DEPENDS+=		xml2.5:${PORTSDIR}/textproc/libxml2 \
+			gdome.8:${PORTSDIR}/textproc/gdome2
+CONFIGURE_ARGS+=	--enable-xmldump \
+			--with-xml2-lib=${LOCALBASE}/lib \
+			--with-xml2-include=${LOCALBASE}/include/libxml2/libxml \
+			--with-gdome-lib=${LOCALBASE}/lib \
+			--with-gdome-include=${LOCALBASE}/include/libgdome \
+			--with-glib-lib=${LOCALBASE}/lib \
+			--with-glib-include=${LOCALBASE}/include/glib12
+CONFIGURE_ENV+=		"CPPFLAGS=-I${LOCALBASE}/include/libxml2 "
+.endif
+
+pre-everything:: show-options
+
+show-options:
+	@${SED} -ne 's/^##//p' ${.CURDIR}/Makefile
+
+# This part is a little bit dirty, but configure script need gdchart linked against
+# libgd1.
+pre-configure:
+	@${CP} ${FILESDIR}/Makefile.gdchart ${WRKSRC}/../gdchart0.94c/Makefile
+	@(cd ${WRKSRC}/../gdchart0.94c ; ${SETENV} ${MAKE_ENV} ${MAKE})
 
 post-install:
 	@${MKDIR} ${DBDIR}/ntop
@@ -70,8 +126,4 @@
 post-clean:
 	@${RM} -f ${WRKDIRPREFIX}${.CURDIR}/Makefile.inc
 
-.if exists(${WRKDIRPREFIX}${.CURDIR}/Makefile.inc)
-.include "${WRKDIRPREFIX}${.CURDIR}/Makefile.inc"
-.endif
-
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
Index: ntop/files/Makefile.gdchart
===================================================================
RCS file: ntop/files/Makefile.gdchart
diff -N ntop/files/Makefile.gdchart
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ntop/files/Makefile.gdchart	12 Dec 2003 18:21:43 -0000
@@ -0,0 +1,36 @@
+GDC_INCL = .
+GD_INCL  = $(LOCALBASE)/include/gd
+GD_LIB   = $(LOCALBASE)/lib
+
+AR=ar
+RANLIB = ranlib
+
+all: libgdchart.a
+
+# --- compile the lib ---
+price_conv.o: price_conv.c
+	$(CC) $(CFLAGS) -c price_conv.c
+
+gdc.o: gdc.c gdc.h
+	$(CC) -I$(GD_INCL) -I$(GDC_INCL) $(CFLAGS) -c gdc.c
+
+gdc_pie.o: $(GDC_INCL)/gdc.h $(GDC_INCL)/gdcpie.h gdc_pie.c
+	$(CC) -I$(GD_INCL) -I$(GDC_INCL) $(CFLAGS) -c gdc_pie.c
+
+gdchart.o: $(GDC_INCL)/gdc.h $(GDC_INCL)/gdchart.h gdchart.c
+	$(CC) -I$(GD_INCL) -I$(GDC_INCL) $(CFLAGS) -c gdchart.c
+
+libgdchart.a: gdc.o gdc_pie.o gdchart.o price_conv.o
+	$(AR) rc libgdchart.a gdc.o gdc_pie.o gdchart.o price_conv.o
+	@if [ -x $(RANLIB) ] ; then \
+	  $(RANLIB) libgdchart.a; \
+	fi;
+
+install:
+
+# --- clean ---
+clean:
+	rm -f *.o gdc_samp1 gdc_samp2 gdc_pie_samp libgdchart.a
+	cd $(GD_LIB) ; $(MAKE) -f Makefile clean
+
+distclean: clean
Index: ntop/files/patch-configure
===================================================================
RCS file: /SERVICES/cvs/FreeBSD/ports/net/ntop/files/patch-configure,v
retrieving revision 1.1
diff -u -u -r1.1 patch-configure
--- ntop/files/patch-configure	5 Dec 2003 21:07:23 -0000	1.1
+++ ntop/files/patch-configure	12 Dec 2003 18:21:43 -0000
@@ -1,5 +1,29 @@
---- configure.orig	Sat Nov 22 13:54:32 2003
-+++ configure	Sat Nov 22 13:54:48 2003
+--- configure.orig	Mon Apr 14 18:41:50 2003
++++ configure	Fri Dec 12 19:11:08 2003
+@@ -8251,9 +8251,9 @@
+             esac
+         fi
+         if test ".gd" != "."; then
+-            rc=`(echo $LIBS | grep '\-lgd ' > /dev/null 2> /dev/null; echo $?)`
++            rc=`(echo $LIBS | grep '\-lgd1 ' > /dev/null 2> /dev/null; echo $?)`
+             if [ $rc -eq 1 ]; then
+-                LIBS="$LIBS -lgd"
++                LIBS="$LIBS -lgd1"
+             fi
+         fi
+     fi
+@@ -8512,9 +8512,9 @@
+             esac
+         fi
+         if test ".glib" != "."; then
+-            rc=`(echo $LIBS | grep '\-lglib ' > /dev/null 2> /dev/null; echo $?)`
++            rc=`(echo $LIBS | grep '\-lglib12 ' > /dev/null 2> /dev/null; echo $?)`
+             if [ $rc -eq 1 ]; then
+-                LIBS="$LIBS -lglib"
++                LIBS="$LIBS -lglib12"
+             fi
+         fi
+     fi
 @@ -14711,7 +14711,7 @@
  
  
@@ -9,3 +33,47 @@
  do
  as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
  if eval "test \"\${$as_ac_Header+set}\" = set"; then
+@@ -17879,7 +17879,7 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lgd  $LIBS"
++LIBS="-lgd1  $LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+ #line $LINENO "configure"
+ /* confdefs.h.  */
+@@ -17932,7 +17932,7 @@
+ #define HAVE_LIBGD 1
+ _ACEOF
+ 
+-  LIBS="-lgd $LIBS"
++  LIBS="-lgd1 $LIBS"
+ 
+ fi
+ 
+@@ -18648,13 +18648,13 @@
+ 
+ 
+ 
+-echo "$as_me:$LINENO: checking for g_date_julian in -lglib" >&5
+-echo $ECHO_N "checking for g_date_julian in -lglib... $ECHO_C" >&6
++echo "$as_me:$LINENO: checking for g_date_julian in -lglib12" >&5
++echo $ECHO_N "checking for g_date_julian in -lglib12... $ECHO_C" >&6
+ if test "${ac_cv_lib_glib_g_date_julian+set}" = set; then
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lglib  $LIBS"
++LIBS="-lglib12  $LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+ #line $LINENO "configure"
+ /* confdefs.h.  */
+@@ -18707,7 +18707,7 @@
+ #define HAVE_LIBGLIB 1
+ _ACEOF
+ 
+-  LIBS="-lglib $LIBS"
++  LIBS="-lglib12 $LIBS"
+ 
+ fi
+ 
Index: ntop/scripts/configure.sh
===================================================================
RCS file: ntop/scripts/configure.sh
diff -N ntop/scripts/configure.sh
--- ntop/scripts/configure.sh	25 Aug 2003 05:51:05 -0000	1.3
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,110 +0,0 @@
-# ex:ts=4
-# $FreeBSD: ports/net/ntop/scripts/configure.sh,v 1.3 2003/08/25 05:51:05 marcus Exp $
-
-if [ -f ${WRKDIRPREFIX}${REALCURDIR}/Makefile.inc ]; then
-	exit
-fi
-
-tempfile=`/usr/bin/mktemp -t checklist`
-
-if [ "${BATCH}" ]; then
-	if [ "${OPTIONS}" ]; then
-		set ${OPTIONS}
-	else
-		set \"tcpwrap\" \"pcap\" \"zlib\"
-	fi
-else
-	/usr/bin/dialog --title "ntop configuration options" --clear \
-		--checklist "\n\
-Please select desired options:" -1 -1 16 \
-tcpwrap		"TCP Wrapper support" ON \
-pcap		"libpcap support" ON \
-gdbm		"GNU gdbm support" OFF \
-zlib		"zlib support" ON \
-gd		"GD 1 support" OFF \
-rrd		"rrdtool support" OFF \
-locale		"locale (i18n) support" OFF \
-xmldump		"XML Dump support" OFF \
-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
-
-while [ "$1" ]; do
-	case $1 in
-		\"tcpwrap\")
-			echo "CONFIGURE_ARGS+=--with-tcpwrap"
-			;;
-
-		\"pcap\")
-			echo "CONFIGURE_ARGS+=--with-pcap-root=/usr"
-			;;
-
-		\"gdbm\")
-			echo "LIB_DEPENDS+=	gdbm.3:\${PORTSDIR}/databases/gdbm"
-			echo "CONFIGURE_ARGS+=--with-gdbm-root=\${LOCALBASE}"
-			;;
-
-		\"zlib\")
-			echo "CONFIGURE_ARGS+=--with-zlib-root=/usr"
-			;;
-
-		\"gd\")
-			echo "LIB_DEPENDS+=	gd.2:\${PORTSDIR}/graphics/gd"
-			echo "LIB_DEPENDS+=	png.5:\${PORTSDIR}/graphics/png"
-			echo "CONFIGURE_ARGS+=--with-gd-root=\${LOCALBASE}"
-			echo "CONFIGURE_ARGS+=--with-libpng-root=\${LOCALBASE}"
-			;;
-
-		\"rrd\")
-			echo "LIB_DEPENDS+=	rrd.0:\${PORTSDIR}/net/rrdtool"
-			echo "CONFIGURE_ARGS+=--with-rrd-root=\${LOCALBASE}"
-			;;
-
-		\"locale\")
-			echo "LIB_DEPENDS+=	intl.5:\${PORTSDIR}/devel/gettext"
-			echo "CONFIGURE_ARGS+=--with-localedir=\${LOCALBASE}/share/locale"
-			echo "CONFIGURE_ARGS+=--enable-i18n"
-			;;
-
-		\"xmldump\")
-			echo "USE_GNOME=	glib12"
-			echo "GLIB_PREFIX?=	`\${LOCALBASE}/bin/glib-config --prefix`"
-			echo "XML2_PREFIX?=	`\${LOCALBASE}/bin/xml2-config --prefix`"
-			echo "LIB_DEPENDS+=	xml2.5:\${PORTSDIR}/textproc/libxml2"
-			echo "LIB_DEPENDS+=	gdome.7:\${PORTSDIR}/textproc/gdome2"
-			echo "CONFIGURE_ARGS+=--enable-xmldump"
-			echo "CONFIGURE_ARGS+=--with-xml2-lib=\${XML2_PREFIX}/lib"
-			echo "CONFIGURE_ARGS+=--with-xml2-include=\${XML2_PREFIX}/include/libxml2/libxml"
-			echo "CONFIGURE_ARGS+=--with-gdome-lib=\${LOCALBASE}/lib"
-			echo "CONFIGURE_ARGS+=--with-gdome-include=\${LOCALBASE}/include/libgdome"
-			echo "CONFIGURE_ARGS+=--with-glib-lib=\${GLIB_PREFIX}/lib"
-			echo "CONFIGURE_ARGS+=--with-glib-include=\${GLIB_PREFIX}/include/glib12"
-			;;
-
-		*)
-			echo "Invalid option(s): $*" > /dev/stderr
-			rm -f ${WRKDIRPREFIX}${REALCURDIR}/Makefile.inc
-			exit 1
-			;;
-	esac
-	shift
-done
--- ntop.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list