summaryrefslogtreecommitdiffstats
path: root/net-mgmt/ettercap/Makefile
blob: 3a44bc7b8f9e343c781c28f479f3e67c71a143e7 (plain)
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
# New ports collection makefile for:   ettercap
# Date created:        19 February 2001
# Whom:                George Reid <greid@ukug.uk.freebsd.org>
#
# $FreeBSD$
#

PORTNAME=		ettercap
PORTVERSION=		0.7.3
DISTVERSIONPREFIX=	NG-
PORTREVISION=		3
PORTEPOCH=		1
CATEGORIES=		net-mgmt security
MASTER_SITES=		${MASTER_SITE_SOURCEFORGE_EXTENDED} \
			${MASTER_SITE_PACKETSTORM:S:%SUBDIR%:sniffers/ettercap:}
MASTER_SITE_SUBDIR=	${PORTNAME}

MAINTAINER=	mnag@FreeBSD.org
COMMENT=	A network sniffer/interceptor/injector/logger for switched LANs

BUILD_DEPENDS=	libnet*>=1.1.2,1:${PORTSDIR}/net/libnet

OPTIONS=	GTK	"Build with GTK2+ GUI"	on \
		ICONV	"Build with support for UTF-8"	on \
		PLUGINS	"Build with ettercap plugins"	on \
		SSL	"Build with support for SSH1 and SSL decryption"	on \
		PCRE	"Build with PCRE regexps in filters"	on

WANT_GNOME=	yes
USE_AUTOTOOLS=	libltdl:15
GNU_CONFIGURE=	yes
USE_REINPLACE=	yes

MAN5=		etter.conf.5
MAN8=		ettercap.8 ettercap_curses.8 etterfilter.8 etterlog.8
DOCS=		AUTHORS CHANGELOG README README.BINARIES README.BUGS \
		README.CVS README.PLATFORMS THANKS TODO TODO.TESTING \
		doc/capture doc/decoders doc/dissectors doc/threads

.include <bsd.port.pre.mk>

CFLAGS+=		${PTHREAD_CFLAGS}
CPPFLAGS+=		-I${LOCALBASE}/include
LDFLAGS+=		-L${LOCALBASE}/lib
CONFIGURE_ENV+=		CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"
CONFIGURE_ARGS+=	--enable-plugins --with-libnet=${LOCALBASE}
CONFIGURE_TARGET=	--build=${ARCH}-portbld-freebsd${OSREL}

.if ${OSVERSION} < 502111
BUILD_DEPENDS+=		${LOCALBASE}/lib/libpcap.a:${PORTSDIR}/net/libpcap
CONFIGURE_ARGS+=	--with-libpcap=${LOCALBASE}
.endif

.if !defined(WITHOUT_GTK)
USE_GNOME=		glib20 atk pango gtk20
PKGNAMESUFFIX+=		-gtk2
CONFIGURE_ARGS+=	--enable-gtk
.else
CONFIGURE_ARGS+=	--disable-gtk
.endif

.if !defined(WITHOUT_ICONV)
USE_ICONV=		yes
CONFIGURE_ARGS+=	--with-iconv=${LOCALBASE}
.endif

.if !defined(WITHOUT_PCRE)
LIB_DEPENDS+=		pcre.0:${PORTSDIR}/devel/pcre
CONFIGURE_ARGS+=	--with-libpcre=${LOCALBASE}
.else
CONFIGURE_ARGS+=	--without-libpcre
.endif

.if !defined(WITHOUT_PLUGINS)
MAN8+=			ettercap_plugins.8
DOCS+=			doc/plugins
CONFIGURE_ARGS+=	--enable-plugins
PLIST_SUB+=		PLUGINS=""
.else
CONFIGURE_ARGS+=	--disable-plugins
PLIST_SUB+=		PLUGINS="@comment "
.endif

.if !defined(WITHOUT_SSL)
.include "${PORTSDIR}/Mk/bsd.openssl.mk"
CONFIGURE_ARGS+=	--with-openssl=${OPENSSLBASE}
.else
CONFIGURE_ARGS+=	--without-openssl
.endif

post-patch:
	@${REINPLACE_CMD} -e 's|%%PTHREAD_LIBS%%|${PTHREAD_LIBS}|g' \
		${WRKSRC}/configure
	@${REINPLACE_CMD} -E -e 's|(^pkgdatadir.+=).+|\1 ${DATADIR}|' \
		${WRKSRC}/share/Makefile.in

post-install:
	@${INSTALL_DATA} ${WRKSRC}/share/etter.conf \
		${PREFIX}/etc/etter.conf.sample
.	if !exists(${PREFIX}/etc/etter.conf)
		@${INSTALL_DATA} ${WRKSRC}/share/etter.conf ${PREFIX}/etc/etter.conf
.	endif
.	if !defined(NOPORTDOCS)
		@${MKDIR} ${DOCSDIR}
.		for i in ${DOCS}
			@${INSTALL_DATA} ${WRKSRC}/$i ${DOCSDIR}
.		endfor
.	endif

.include <bsd.port.post.mk>
OpenPOWER on IntegriCloud