c026e636b02b1a810cd6f211f51e3210a0f53aa8
[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.0
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://www.tcpdump.org/release/ \
16 http://www.at.tcpdump.org/
17 PKG_HASH:=eae98121cbb1c9adbedd9a777bf2eae9fa1c1c676424a54740311c8abcee5a5e
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
25 PKG_INSTALL:=1
26
27 include $(INCLUDE_DIR)/package.mk
28
29 define Package/tcpdump/default
30 SECTION:=net
31 CATEGORY:=Network
32 DEPENDS:=+libpcap
33 TITLE:=Network monitoring and data acquisition tool
34 URL:=http://www.tcpdump.org/
35 endef
36
37 define Package/tcpdump
38 $(Package/tcpdump/default)
39 VARIANT:=full
40 endef
41
42 define Package/tcpdump-mini
43 $(Package/tcpdump/default)
44 TITLE+= (minimal version)
45 VARIANT:=mini
46 endef
47
48 CONFIGURE_ARGS += \
49 --without-crypto
50
51 ifeq ($(CONFIG_IPV6),y)
52 CONFIGURE_ARGS += \
53 --enable-ipv6
54 endif
55
56 TARGET_CFLAGS += -ffunction-sections -fdata-sections
57 TARGET_LDFLAGS += -Wl,--gc-sections
58
59 CONFIGURE_VARS += \
60 BUILD_CC="$(TARGET_CC)" \
61 HOSTCC="$(HOSTCC)" \
62 td_cv_buggygetaddrinfo="no" \
63 ac_cv_linux_vers=$(LINUX_VERSION) \
64 ac_cv_header_rpc_rpcent_h=no \
65 ac_cv_lib_rpc_main=no \
66 ac_cv_path_PCAP_CONFIG=""
67
68 MAKE_FLAGS :=
69
70 ifeq ($(BUILD_VARIANT),mini)
71 TARGET_CFLAGS += -DTCPDUMP_MINI
72 CONFIGURE_ARGS += --disable-smb
73 MAKE_FLAGS += TCPDUMP_MINI=1
74 endif
75
76 MAKE_FLAGS += \
77 CCOPT="$(TARGET_CFLAGS)" INCLS="-I. $(TARGET_CPPFLAGS)"
78
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))