mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-13 07:34:50 +00:00
- Fix graphs by: use bundled gdchart and use gd1 instead of gd2
- Get rid of interactive menu - Rework build options - Fix optional XML dumping support PR: ports/60184 Submitted by: Clement Laforet <sheepkiller@cultdeadsheep.org> (maintainer)
This commit is contained in:
parent
4d56f646a3
commit
a44b9103bf
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=95683
@ -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 @@ EXTRACT_SUFX= .tgz
|
||||
MAINTAINER= sheepkiller@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,86 @@ USE_OPENSSL= yes
|
||||
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=${WRKSRC}/../gdchart0.94c \
|
||||
--with-gdchart-include=${WRKSRC}/../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_LSOF)
|
||||
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)
|
||||
LIB_DEPENDS+= 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 +124,4 @@ post-install:
|
||||
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>
|
||||
|
36
net/ntop/files/Makefile.gdchart
Normal file
36
net/ntop/files/Makefile.gdchart
Normal file
@ -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
|
@ -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
|
||||
|
||||
|
@ -1,110 +0,0 @@
|
||||
# ex:ts=4
|
||||
# $FreeBSD$
|
||||
|
||||
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
|
Loading…
Reference in New Issue
Block a user