aboutsummaryrefslogtreecommitdiff
path: root/net/wireshark/Makefile
blob: e96f4e2d34d672368c6ef6238ddcfcf7b594afa5 (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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# Created by: Bill Fumerola <billf@chc-chimes.com>
# $FreeBSD$

PORTNAME?=	wireshark
PORTVERSION=	1.8.6
CATEGORIES=	net ipv6
MASTER_SITES=	http://www.wireshark.org/download/src/ \
		http://ftp.uni-kl.de/pub/wireshark/src/ \
		http://wireshark.askapache.com/download/src/all-versions/ \
		ftp://ftp.uni-kl.de/pub/wireshark/src/ \
		http://prdownloads.sourceforge.net/wireshark/ \
		http://ftp.yz.yamagata-u.ac.jp/pub/network/security/wireshark/src/ \
		ftp://ftp.yz.yamagata-u.ac.jp/pub/network/security/wireshark/src/ \
		http://wireshark.zing.org/download/src/

DISTNAME=	${DATADIR_NAME}-${PORTVERSION}
MAINTAINER=	marcus@FreeBSD.org
COMMENT?=	A powerful network analyzer/capture tool

DATADIR_NAME=	wireshark

USE_PERL5_BUILD=yes
USE_PYTHON_BUILD=yes
USE_GETTEXT=	yes
USE_ICONV=	yes
USE_BZIP2=	yes
USE_GMAKE=	yes
MAKE_JOBS_SAFE=	yes
WANT_GNOME=	yes
USE_OPENSSL=	yes
CONFIGURE_ENV=	LIBS="${WIRESHARK_LIBS}"
CONFIGURE_ARGS+=	--program-transform-name="" \
			--with-ssl=${OPENSSLBASE}
USE_LDCONFIG=	yes
DATADIR=	${PREFIX}/share/${DATADIR_NAME}
LDFLAGS+=	-L${LOCALBASE}/lib
CFLAGS+=	-funit-at-a-time

DESKTOP_ENTRIES=	"Wireshark" "Network Protocol Analyzer" \
			"${DATADIR}/hi48-app-wireshark.png" \
			"wireshark" "System;Monitor;GTK;" true

WIRESHARK_LIBS=

.for x in capinfos editcap mergecap rawshark text2pcap dftest randpkt
.if defined(LITE)
PLIST_SUB+=		${x:U}="@comment $x not installed"
CONFIGURE_ARGS+=	--enable-$x=no
.else
PLIST_SUB+=		${x:U}=bin/$x
MAN1+=			$x.1
.endif
.endfor

.if !defined(LITE)
OPTIONS_DEFINE=		RTP SNMP ADNS PCRE IPV6 GEOIP LUA CARES GSSAPI X11
OPTIONS_DEFAULT=	SNMP ADNS PCRE IPV6 GEOIP GSSAPI X11

RTP_DESC=		Enable support for playing back RTP streams
ADNS_DESC=		Enable asynchronous DNS lookup support
.endif

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MX11}
USE_XORG=		x11
.endif

.include <bsd.port.pre.mk>

.if ${PORT_OPTIONS:MX11}
MAN1+=		wireshark.1
PLIST_SUB+=	WIRESHARK=bin/wireshark
USE_GNOME+=	gtk20
WIRESHARK_LIBS+=${PTHREAD_LIBS}
.else
PLIST_SUB+=	WIRESHARK="@comment wireshark not built"
USE_GNOME+=	glib20
USES+=		pkgconfig
CONFIGURE_ARGS+=	--enable-wireshark=no \
			--disable-gtktest
.endif

GNU_CONFIGURE=	yes
LIBTOOLFILES=	configure wiretap/configure
PLIST_SUB+=	PORTVERSION=${PORTVERSION}

.if ${PORT_OPTIONS:MIPV6}
CONFIGURE_ARGS+=	--enable-ipv6=yes
.else
CONFIGURE_ARGS+=	--enable-ipv6=no
.endif

# XXX - untested
.if ${PORT_OPTIONS:MTHREADS}
CONFIGURE_ARGS+=	--enable-threads
.endif

.if ${PORT_OPTIONS:MPCRE} && !defined(LITE)
LIB_DEPENDS+=	pcre:${PORTSDIR}/devel/pcre
CONFIGURE_ARGS+=	--with-pcre=${LOCALBASE}/lib
.else
CONFIGURE_ARGS+=	--with-pcre=no
.endif

.if ${PORT_OPTIONS:MLUA} && !defined(LITE)
USE_LUA=	5.1
CONFIGURE_ARGS+=--with-lua=${LUA_PREFIX}
PLIST_SUB+=	LUA=""
.else
CONFIGURE_ARGS+=--without-lua
PLIST_SUB+=	LUA="@comment "
.endif

.if ${PORT_OPTIONS:MRTP} && !defined(LITE)
LIB_DEPENDS+=	portaudio:${PORTSDIR}/audio/portaudio
CONFIGURE_ARGS+=--with-portaudio=${LOCALBASE}
WIRESHARK_LIBS+=${PTHREAD_LIBS}
.else
CONFIGURE_ARGS+=--without-portaudio
.endif

.if ${PORT_OPTIONS:MSNMP} && !defined(LITE)
LIB_DEPENDS+=		smi:${PORTSDIR}/net-mgmt/libsmi
CONFIGURE_ARGS+=	--with-libsmi=${LOCALBASE}
.else
CONFIGURE_ARGS+=	--with-libsmi=no
.endif

.if ${PORT_OPTIONS:MADNS}) && !defined(LITE)
LIB_DEPENDS+=	adns:${PORTSDIR}/dns/adns
CONFIGURE_ARGS+=	--with-adns=${LOCALBASE}/lib
.else
CONFIGURE_ARGS+=	--with-adns=no
.endif

.if ${PORT_OPTIONS:MCARES} && !defined(LITE)
LIB_DEPENDS+=		cares:${PORTSDIR}/dns/c-ares
CONFIGURE_ARGS+=	--with-c-ares=${LOCALBASE}/lib
.else
CONFIGURE_ARGS+=	--with-c-ares=no
.endif

.if ${PORT_OPTIONS:MGEOIP} && !defined(LITE)
LIB_DEPENDS+=	GeoIP:${PORTSDIR}/net/GeoIP
CONFIGURE_ARGS+=	--with-geoip=${LOCALBASE}/lib
.else
CONFIGURE_ARGS+=	--with-geoip=no
.endif

.if ${PORT_OPTIONS:MGNUTLS}
LIB_DEPENDS+=	gnutls:${PORTSDIR}/security/gnutls \
		gcrypt:${PORTSDIR}/security/libgcrypt
CONFIGURE_ARGS+=--with-libgcrypt-prefix=${LOCALBASE} \
		--with-gnutls=yes
.else
CONFIGURE_ARGS+=--with-gnutls=no
.endif

.if ${PORT_OPTIONS:MGCRYPT}
LIB_DEPENDS+=	gcrypt:${PORTSDIR}/security/libgcrypt
CONFIGURE_ARGS+=--with-libgcrypt-prefix=${LOCALBASE}
.endif

.if ! ${PORT_OPTIONS:MGSSAPI}
CONFIGURE_ARGS+=--with-krb5=no
.endif

MAN1+=	dumpcap.1 tshark.1
MAN4+=	wireshark-filter.4

post-patch:
	@${REINPLACE_CMD} -e 's|%%LUA_INCDIR%%|${LUA_INCDIR}|g ; \
	    	s|-Wl,--as-needed|| ; \
	    	s|%%LUA_LIBDIR%%|${LUA_LIBDIR}|g' \
		${WRKSRC}/configure

post-install:
	${INSTALL_DATA} ${WRKSRC}/image/hi48-app-wireshark.png ${DATADIR}

.include <bsd.port.post.mk>