aboutsummaryrefslogtreecommitdiff
path: root/net/ntop/Makefile
blob: cf00c0b0cae983976f5766dbb5f0d5f6c2304678 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# New ports collection makefile for:   ntop
# Date created:        10 August 1998
# Whom:                Bill Fumerola <billf@chc-chimes.com>
#
# $FreeBSD$
#

PORTNAME=	ntop
PORTVERSION=	2.2
PORTREVISION=	2
CATEGORIES=	net
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR=	${PORTNAME}
EXTRACT_SUFX=	.tgz

MAINTAINER=	clement@FreeBSD.org
COMMENT=	Network monitoring tool with command line and web interfaces

LIB_DEPENDS=	gd1.2:${PORTSDIR}/graphics/gd1 \
		gdbm:${PORTSDIR}/databases/gdbm

DBDIR?=		/var/db

WRKSRC=		${WRKDIR}/${DISTNAME}/${PORTNAME}
USE_GETOPT_LONG=yes
USE_GMAKE=	yes
USE_REINPLACE=	yes
USE_OPENSSL=	yes
USE_LIBTOOL=	yes
INSTALLS_SHLIB=	yes
PLIST_SUB+=	DBDIR=${DBDIR}
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-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

##
## 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.
##

.if !defined(WITHOUT_TCPWRAPPER)
CONFIGURE_ARGS+=	--with-tcpwrap
.endif

.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-old
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
	@${MKDIR} ${PREFIX}/etc/rc.d
	@${SED} -e "s#%%PREFIX%%#${PREFIX}#g" \
		-e "s#%%LOGDIR%%#${LOGDIR}#g" ${FILESDIR}/ntop.sh > \
		${WRKDIR}/ntop.sh
	@${INSTALL_DATA} ${WRKDIR}/ntop.sh ${PREFIX}/etc/rc.d
.if !defined(BATCH)
	@${SED} "s,%%LOCALBASE%%,${LOCALBASE},g" < ${PKGMESSAGE}
.endif

post-clean:
	@${RM} -f ${WRKDIRPREFIX}${.CURDIR}/Makefile.inc

.include <bsd.port.mk>