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