Update net/tcpdump to version 4.6.2
[dports.git] / net / tcpdump / Makefile
1 # Created by: Bruce M Simpson <bms@FreeBSD.org>
2 # $FreeBSD$
3
4 PORTNAME=       tcpdump
5 PORTVERSION=    4.6.2
6 CATEGORIES=     net ipv6
7 MASTER_SITES=   http://www.tcpdump.org/release/
8
9 MAINTAINER=     garga@FreeBSD.org
10 COMMENT=        Ubiquitous network traffic analysis tool
11
12 LICENSE=        BSD3CLAUSE
13
14 LIB_DEPENDS=    libpcap.so:${PORTSDIR}/net/libpcap
15
16 GNU_CONFIGURE=          yes
17 USES=           gmake
18
19 UNPRIV_USER?=   nobody
20 CHROOTDIR?=     /var/run/tcpdump
21
22 OPTIONS_DEFINE= CRYPTO IPV6 SMB SMI USER CHROOT
23 OPTIONS_DEFAULT=        CRYPTO IPV6 SMB SMI
24
25 CRYPTO_DESC=    Support IPSEC and TCPMD5
26 # This one is intentionally worded this way because the default
27 # description implies that tcpdump would not capture SMB, which
28 # is not true. It will just not print it if this option is off.
29 SMB_DESC=       Support printing SMB information
30 SMI_DESC=       Allow MIBs to be loaded on the fly
31 USER_DESC=      Drop privileges to nobody
32 CHROOT_DESC=    Chroot to /var/run/tcpdump (set CHROOTDIR to change)
33
34 .include <bsd.port.options.mk>
35
36 CONFIGURE_ARGS+=        --enable-pcap_setdirection --with-pcap_setdirection
37
38 # The --without-crypto flag needs to be explicitly specified. The
39 # configure script gets confused if you specify --with-crypto and
40 # thinks this means you *don't* want crypto.
41 #
42 .if ${PORT_OPTIONS:MCRYPTO}
43 USE_OPENSSL=    yes
44 .else
45 CONFIGURE_ARGS+=        --without-crypto
46 .endif
47
48 .if ${PORT_OPTIONS:MIPV6}
49 CONFIGURE_ARGS+=        --enable-ipv6
50 .endif
51
52 .if empty(PORT_OPTIONS:MSMB)
53 CONFIGURE_ARGS+=        --disable-smb
54 .endif
55
56 .if ${PORT_OPTIONS:MSMI}
57 LIB_DEPENDS+=           libsmi.so:${PORTSDIR}/net-mgmt/libsmi
58 .else
59 CONFIGURE_ARGS+=        --disable-smi
60 .endif
61
62 .if ${PORT_OPTIONS:MUSER}
63 CONFIGURE_ARGS+=        --with-user=${UNPRIV_USER}
64 .endif
65
66 .if ${PORT_OPTIONS:MCHROOT}
67 CONFIGURE_ARGS+=        --with-chroot=${CHROOTDIR}
68 .endif
69
70 .include <bsd.port.pre.mk>
71
72 PLIST_FILES=    sbin/tcpdump \
73                 man/man1/tcpdump.1.gz
74
75 post-configure:
76         @${REINPLACE_CMD} -e "s,\./\.\./${LIBPCAP_FORCE_VER}/libpcap\.a,${LOCALBASE}/lib/libpcap.so.1," ${WRKSRC}/Makefile
77
78 do-install:
79         ${INSTALL_PROGRAM} ${WRKSRC}/tcpdump ${STAGEDIR}/${PREFIX}/sbin
80         ${INSTALL_MAN} ${WRKSRC}/tcpdump.1 ${STAGEDIR}/${MAN1PREFIX}/man/man1
81
82 .include <bsd.port.post.mk>