Import net/tcpdump version 4.3.0
[dports.git] / net / tcpdump / Makefile
1 # New ports collection makefile for:    tcpdump
2 # Date created:         10 December 2003
3 # Whom:                 Bruce M Simpson <bms@FreeBSD.org>
4 #
5 # $FreeBSD: ports/net/tcpdump/Makefile,v 1.33 2012/11/17 06:00:22 svnexp Exp $
6 #
7
8 PORTNAME=       tcpdump
9 PORTVERSION=    4.3.0
10 CATEGORIES=     net ipv6
11 MASTER_SITES=   http://www.tcpdump.org/release/
12
13 MAINTAINER=     wxs@FreeBSD.org
14 COMMENT=        Ubiquitous network traffic analysis tool
15
16 LIB_DEPENDS=    pcap:${PORTSDIR}/net/libpcap
17
18 GNU_CONFIGURE=          yes
19 USE_GMAKE=              yes
20 MAKE_JOBS_SAFE= yes
21
22 UNPRIV_USER?=   nobody
23 CHROOTDIR?=     /var/run/tcpdump
24
25 OPTIONS_DEFINE= CRYPTO IPV6 SMB SMI USER CHROOT
26 OPTIONS_DEFAULT=        CRYPTO IPV6 SMB SMI
27
28 CRYPTO_DESC=    Support IPSEC and TCPMD5
29 # This one is intentionally worded this way because the default
30 # description implies that tcpdump would not capture SMB, which
31 # is not true. It will just not print it if this option is off.
32 SMB_DESC=       Support printing SMB information
33 SMI_DESC=       Allow MIBs to be loaded on the fly
34 USER_DESC=      Drop privileges to nobody
35 CHROOT_DESC=    Chroot to /var/run/tcpdump (set CHROOTDIR to change)
36
37 .include <bsd.port.options.mk>
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+=           smi:${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 MAN1=           tcpdump.1
73 PLIST_FILES=    sbin/tcpdump
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 ${PREFIX}/sbin
80         ${INSTALL_MAN} ${WRKSRC}/tcpdump.1 ${MAN1PREFIX}/man/man1
81
82 .include <bsd.port.post.mk>