50919819b63f55ce74ac1dc41fd8c3d139892c9e
[openwrt/openwrt.git] / package / network / utils / tcpdump / Makefile
1 #
2 # Copyright (C) 2007-2011 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=tcpdump
11 PKG_VERSION:=4.9.2
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://www.us.tcpdump.org/release/ \
16 http://www.tcpdump.org/release/
17 PKG_HASH:=798b3536a29832ce0cbb07fafb1ce5097c95e308a6f592d14052e1ef1505fe79
18
19 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
20 PKG_BUILD_PARALLEL:=1
21
22 PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
23 PKG_LICENSE:=BSD-3-Clause
24 PKG_CPE_ID:=cpe:/a:tcpdump:tcpdump
25
26 PKG_INSTALL:=1
27
28 include $(INCLUDE_DIR)/package.mk
29
30 define Package/tcpdump/default
31 SECTION:=net
32 CATEGORY:=Network
33 DEPENDS:=+libpcap
34 TITLE:=Network monitoring and data acquisition tool
35 URL:=http://www.tcpdump.org/
36 endef
37
38 define Package/tcpdump
39 $(Package/tcpdump/default)
40 VARIANT:=full
41 endef
42
43 define Package/tcpdump-mini
44 $(Package/tcpdump/default)
45 TITLE+= (minimal version)
46 VARIANT:=mini
47 endef
48
49 CONFIGURE_ARGS += \
50 --without-crypto
51
52 ifeq ($(CONFIG_IPV6),y)
53 CONFIGURE_ARGS += \
54 --enable-ipv6
55 endif
56
57 TARGET_CFLAGS += -ffunction-sections -fdata-sections
58 TARGET_LDFLAGS += -Wl,--gc-sections
59
60 CONFIGURE_VARS += \
61 BUILD_CC="$(TARGET_CC)" \
62 HOSTCC="$(HOSTCC)" \
63 td_cv_buggygetaddrinfo="no" \
64 ac_cv_linux_vers=$(LINUX_VERSION) \
65 ac_cv_header_rpc_rpcent_h=no \
66 ac_cv_lib_rpc_main=no \
67 ac_cv_path_PCAP_CONFIG=""
68
69 MAKE_FLAGS :=
70
71 ifeq ($(BUILD_VARIANT),mini)
72 TARGET_CFLAGS += -DTCPDUMP_MINI
73 CONFIGURE_ARGS += --disable-smb
74 MAKE_FLAGS += TCPDUMP_MINI=1
75 endif
76
77 MAKE_FLAGS += \
78 CCOPT="$(TARGET_CFLAGS)" INCLS="-I. $(TARGET_CPPFLAGS)"
79
80 define Package/tcpdump/install
81 $(INSTALL_DIR) $(1)/usr/sbin
82 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/tcpdump $(1)/usr/sbin/
83 endef
84
85 Package/tcpdump-mini/install = $(Package/tcpdump/install)
86
87 $(eval $(call BuildPackage,tcpdump))
88 $(eval $(call BuildPackage,tcpdump-mini))